Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ dependencies{
}

//PSDM
implementation('com.github.ie3-institute:PowerSystemDataModel:5.1.0') {
implementation('com.github.ie3-institute:PowerSystemDataModel:6.0.0') {
exclude group: 'org.apache.logging.log4j'
exclude group: 'org.slf4j'
/* Exclude our own nested dependencies */
Expand Down
14 changes: 6 additions & 8 deletions gradle/scripts/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@ spotless {
licenseHeader "#!groovy\n\n" + ie3LicHead, "////////////////////////////////"
// the Groovy Eclipse formatter extends the Java Eclipse formatter,
// so it formats Java files by default (unless `excludeJava` is used).
// FIXME rolled back greclipse version https://github.com/diffplug/spotless/issues/1860
greclipse('4.27')
indentWithSpaces 2
greclipse()
leadingTabsToSpaces 2
}

groovyGradle {
// same as groovy, but for .gradle (defaults to '*.gradle')
target '*.gradle', 'gradle/scripts/*.gradle'
// FIXME rolled back greclipse version https://github.com/diffplug/spotless/issues/1860
greclipse('4.27')
indentWithSpaces 2
greclipse()
leadingTabsToSpaces 2
}

//sets a license header, removes unused imports and formats conforming to the scala fmt formatter
Expand All @@ -43,15 +41,15 @@ spotless {
format 'misc', {
target '**/.gitignore', 'configs/**'
trimTrailingWhitespace()
indentWithTabs()
leadingSpacesToTabs()
endWithNewline()
}

/* Formats markdown files, just like the other misc files, but without trimming trailing white spaces (nested
* enumerations) */
format 'md', {
target '**/*.md'
indentWithSpaces 2
leadingTabsToSpaces 2
endWithNewline()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import static edu.ie3.util.quantities.PowerSystemUnits.PU;

import edu.ie3.datamodel.models.result.ModelResultEntity;
import edu.ie3.datamodel.models.result.NodeResult;
import edu.ie3.datamodel.models.result.ResultEntity;
import edu.ie3.datamodel.models.result.connector.LineResult;
import edu.ie3.datamodel.models.result.system.SystemParticipantResult;
import edu.ie3.simona.api.data.ExtDataContainer;
Expand All @@ -32,7 +32,7 @@ public class ExtResultContainer implements ExtDataContainer {
* Map external id to result from SIMONA ATTENTION: The time stamp of the result entities is not
* necessarily corresponding to the tick
*/
private final Map<String, ModelResultEntity> simonaResultsMap;
private final Map<String, ResultEntity> simonaResultsMap;

/**
* Container class for result data from SIMONA
Expand All @@ -42,17 +42,17 @@ public class ExtResultContainer implements ExtDataContainer {
* @param nextTick tick the external simulation can expect the next results
*/
public ExtResultContainer(
long tick, Map<String, ModelResultEntity> simonaResultsMap, Optional<Long> nextTick) {
long tick, Map<String, ResultEntity> simonaResultsMap, Optional<Long> nextTick) {
this.tick = tick;
this.simonaResultsMap = simonaResultsMap;
this.maybeNextTick = nextTick;
}

public ExtResultContainer(long tick, Map<String, ModelResultEntity> simonaResultsMap) {
public ExtResultContainer(long tick, Map<String, ResultEntity> simonaResultsMap) {
this(tick, simonaResultsMap, Optional.empty());
}

public Map<String, ModelResultEntity> getResults() {
public Map<String, ResultEntity> getResults() {
return simonaResultsMap;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

package edu.ie3.simona.api.data.results;

import edu.ie3.datamodel.models.result.ModelResultEntity;
import edu.ie3.datamodel.models.result.NodeResult;
import edu.ie3.datamodel.models.result.ResultEntity;
import edu.ie3.datamodel.models.result.system.SystemParticipantResult;
import edu.ie3.simona.api.data.ExtOutputDataConnection;
import edu.ie3.simona.api.data.ontology.ScheduleDataServiceMessage;
Expand Down Expand Up @@ -74,20 +74,20 @@ public List<UUID> getParticipantResultDataAssets() {
}

/** Method that an external simulation can request results from SIMONA as a list. */
private List<ModelResultEntity> requestResultList(long tick) throws InterruptedException {
private List<ResultEntity> requestResultList(long tick) throws InterruptedException {
sendExtMsg(new RequestResultEntities(tick));
return receiveWithType(ProvideResultEntities.class).results();
}

/**
* Method that an external simulation can request results from SIMONA as a map string to object.
*/
public Map<String, ModelResultEntity> requestResults(long tick) throws InterruptedException {
public Map<String, ResultEntity> requestResults(long tick) throws InterruptedException {
return createResultMap(requestResultList(tick));
}

protected Map<String, ModelResultEntity> createResultMap(List<ModelResultEntity> results) {
Map<String, ModelResultEntity> resultMap = new HashMap<>();
protected Map<String, ResultEntity> createResultMap(List<ResultEntity> results) {
Map<String, ResultEntity> resultMap = new HashMap<>();
results.forEach(
result -> {
if (result instanceof NodeResult nodeResult) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

package edu.ie3.simona.api.data.results.ontology;

import edu.ie3.datamodel.models.result.ModelResultEntity;
import edu.ie3.datamodel.models.result.ResultEntity;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/** Provides a list of results from SIMONA to an external simulation. */
public record ProvideResultEntities(List<ModelResultEntity> results)
public record ProvideResultEntities(List<ResultEntity> results)
implements ResultDataResponseMessageToExt {
public ProvideResultEntities(Map<UUID, ModelResultEntity> resultMap) {
public ProvideResultEntities(Map<UUID, ResultEntity> resultMap) {
this(resultMap.values().stream().toList());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

package edu.ie3.simona.api.simulation;

import edu.ie3.datamodel.models.result.ModelResultEntity;
import edu.ie3.datamodel.models.result.ResultEntity;
import edu.ie3.datamodel.models.value.Value;
import edu.ie3.simona.api.data.DataQueueExtSimulationExtSimulator;
import edu.ie3.simona.api.data.ExtInputDataContainer;
Expand Down Expand Up @@ -169,7 +169,7 @@ protected void sendDataToExt(
ExtResultDataConnection connection, long tick, Optional<Long> maybeNextTick, Logger log)
throws InterruptedException {
log.debug("Request results from SIMONA!");
Map<String, ModelResultEntity> resultsToBeSend = connection.requestResults(tick);
Map<String, ResultEntity> resultsToBeSend = connection.requestResults(tick);
log.debug("Received results from SIMONA!");
dataQueueSimonaApiToExtCoSimulator.queueData(
new ExtResultContainer(tick, resultsToBeSend, maybeNextTick));
Expand Down