Skip to content

Commit d9c9efd

Browse files
authored
Merge pull request #396 from ie3-institute/rel/df/#380-release-0-12
Release 0.12.0
2 parents 8904d57 + db48f8c commit d9c9efd

34 files changed

+523
-475
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased/Snapshot]
88

9+
### Added
10+
11+
### Changed
12+
13+
### Fixed
14+
15+
## [0.12.0] - 2025-11-20
16+
17+
### Added
18+
- Adding some utility methods [#368](https://github.com/ie3-institute/simonaAPI/issues/368)
19+
- Extending flex option handling in `ExtInputContainer` [#371](https://github.com/ie3-institute/simonaAPI/issues/371)
20+
- Enhancing `ExtInputContainer` with `hasData` methods [#382](https://github.com/ie3-institute/simonaAPI/issues/382)
21+
22+
### Changed
23+
- Changes to sent and received em data [#2366](https://github.com/ie3-institute/simonaAPI/issues/366)
24+
- Changed the PRated in the EvModel to SRated and added cosphi to the model [#259](https://github.com/ie3-institute/simonaAPI/issues/259)
25+
- Update `Gradle` to 9.2.0 [#381](https://github.com/ie3-institute/simonaAPI/issues/381)
26+
- Update `Gradle` to 9.2.1 [#389](https://github.com/ie3-institute/simonaAPI/issues/389)
27+
28+
### Fixed
29+
- Issues related to em data [#366](https://github.com/ie3-institute/simonaAPI/issues/366)
30+
- Fixed bugs in `ExtEntityMapping` [#373](https://github.com/ie3-institute/simonaAPI/issues/373)
31+
- Fixed changelog entry #366 [#378](https://github.com/ie3-institute/simonaAPI/issues/366)
32+
- Fix considered data in `ExtEntityMapping.getAssets()` [#384](https://github.com/ie3-institute/simonaAPI/issues/384)
33+
934
## [0.11.0] - 2025-10-23
1035

1136
### Added

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
plugins {
22
id 'groovy' // groovy support
33
id 'java' // java support
4-
id 'com.diffplug.spotless' version '8.0.0'//code format
4+
id 'com.diffplug.spotless' version '8.1.0'//code format
55
id 'pmd' // code check, working on source code
6-
id 'com.github.spotbugs' version '6.4.4' // code check, working on byte code
7-
id "org.sonarqube" version "7.0.0.6105" // sonarqube
6+
id 'com.github.spotbugs' version '6.4.5' // code check, working on byte code
7+
id "org.sonarqube" version "7.0.1.6134" // sonarqube
88
id 'signing'
99
id 'maven-publish' // publish to a maven repo (local or mvn central, has to be defined)
1010
id 'jacoco' // java code coverage plugin
@@ -18,8 +18,8 @@ ext {
1818

1919
// required for pekko
2020
scalaVersion = '3'
21-
scalaBinaryVersion = '3.7.3'
22-
pekkoVersion = "1.2.1"
21+
scalaBinaryVersion = '3.7.4'
22+
pekkoVersion = "1.3.0"
2323
}
2424

2525
group = 'com.github.ie3-institute'

gradle/wrapper/gradle-wrapper.jar

1.83 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright © 2015-2021 the original authors.
4+
# Copyright © 2015 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -114,7 +114,6 @@ case "$( uname )" in #(
114114
NONSTOP* ) nonstop=true ;;
115115
esac
116116

117-
CLASSPATH="\\\"\\\""
118117

119118

120119
# Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@ fi
172171
# For Cygwin or MSYS, switch paths to Windows format before running java
173172
if "$cygwin" || "$msys" ; then
174173
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
175-
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
176174

177175
JAVACMD=$( cygpath --unix "$JAVACMD" )
178176

@@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
212210

213211
set -- \
214212
"-Dorg.gradle.appname=$APP_BASE_NAME" \
215-
-classpath "$CLASSPATH" \
216213
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217214
"$@"
218215

gradlew.bat

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@ goto fail
7070
:execute
7171
@rem Setup the command line
7272

73-
set CLASSPATH=
7473

7574

7675
@rem Execute Gradle
77-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
76+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7877

7978
:end
8079
@rem End local scope for the variables with windows NT shell

src/main/java/edu/ie3/simona/api/data/ExtDataContainerQueue.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ public int size() {
2121
return receiverTriggerDeque.size();
2222
}
2323

24+
/** Method for clearing this queue. */
25+
public void clear() {
26+
receiverTriggerDeque.clear();
27+
}
28+
2429
/**
2530
* Method for adding an {@link ExtDataContainer} to the queue.
2631
*

src/main/java/edu/ie3/simona/api/data/connection/BiDirectional.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import edu.ie3.simona.api.exceptions.UnexpectedResponseMessageException;
1010
import edu.ie3.simona.api.ontology.DataMessageFromExt;
1111
import edu.ie3.simona.api.ontology.DataResponseMessageToExt;
12+
import java.util.ArrayList;
13+
import java.util.List;
1214
import java.util.concurrent.LinkedBlockingQueue;
1315

1416
/**
@@ -38,6 +40,13 @@ public final R receiveAny() throws InterruptedException {
3840
return receiveTriggerQueue.take();
3941
}
4042

43+
/** Returns all received responses. */
44+
public final List<R> receiveAll() {
45+
List<R> result = new ArrayList<>(receiveTriggerQueue.size());
46+
receiveTriggerQueue.drainTo(result);
47+
return result;
48+
}
49+
4150
@Override
4251
@SuppressWarnings("unchecked")
4352
public final <T extends R> T receiveWithType(Class<T> expectedMessageClass)

src/main/java/edu/ie3/simona/api/data/connection/ExtEmDataConnection.java

Lines changed: 30 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import edu.ie3.simona.api.data.model.em.*;
1010
import edu.ie3.simona.api.ontology.em.*;
1111
import java.util.*;
12+
import org.slf4j.Logger;
1213

1314
/** Enables data connection of em data between SIMONA and SimonaAPI */
1415
public final class ExtEmDataConnection
@@ -32,42 +33,39 @@ public List<UUID> getControlledEms() {
3233
}
3334

3435
/**
35-
* Tries to send em data to SIMONA. A message is sent, if at least one map is not empty.
36+
* Tries to send em data to SIMONA. A message is sent, if the map is not empty.
3637
*
3738
* @param tick current tick
38-
* @param flexRequests receiver to flex option request
39-
* @param flexOptions receiver to flex options
40-
* @param setPoints receiver to set point
41-
* @param maybeNextTick option for the next tick in the simulation
39+
* @param emData a map: receiver to em data
40+
* @param log logger for logging warnings
4241
* @return true, if data was sent
4342
*/
44-
public boolean sendEmData(
45-
long tick,
46-
Map<UUID, FlexOptionRequest> flexRequests,
47-
Map<UUID, List<FlexOptions>> flexOptions,
48-
Map<UUID, EmSetPoint> setPoints,
49-
Optional<Long> maybeNextTick) {
43+
public boolean sendEmData(long tick, Map<UUID, ? extends EmData> emData, Logger log) {
5044
// send message only if at least one value is present
51-
if (!flexRequests.isEmpty() || !flexOptions.isEmpty() || !setPoints.isEmpty()) {
52-
sendExtMsg(new ProvideEmData(tick, flexRequests, flexOptions, setPoints, maybeNextTick));
45+
if (!emData.isEmpty()) {
46+
sendExtMsg(ProvideEmData.create(tick, emData, log));
5347
return true;
5448
}
5549
return false;
5650
}
5751

5852
/**
59-
* Tries to send flex option requests to SIMONA. A message is sent, if at least one entity is
60-
* given.
53+
* Tries to send em data to SIMONA. A message is sent, if at least one map is not empty.
6154
*
6255
* @param tick current tick
63-
* @param entities for which flex options should be requested
64-
* @param disaggregated if disaggregated flex option should be returned
56+
* @param flexRequests receiver to flex option request
57+
* @param flexOptions receiver to flex options
58+
* @param setPoints receiver to set point that should be sent to SIMONA
6559
* @return true, if data was sent
6660
*/
67-
public boolean sendFlexRequest(long tick, Collection<UUID> entities, boolean disaggregated) {
61+
public boolean sendEmData(
62+
long tick,
63+
Map<UUID, FlexOptionRequest> flexRequests,
64+
Map<UUID, List<FlexOptions>> flexOptions,
65+
Map<UUID, EmSetPoint> setPoints) {
6866
// send message only if at least one value is present
69-
if (!entities.isEmpty()) {
70-
sendExtMsg(new RequestEmFlexResults(tick, new ArrayList<>(entities), disaggregated));
67+
if (!flexRequests.isEmpty() || !flexOptions.isEmpty() || !setPoints.isEmpty()) {
68+
sendExtMsg(new ProvideEmData(tick, flexRequests, flexOptions, setPoints));
7169
return true;
7270
}
7371
return false;
@@ -79,33 +77,13 @@ public boolean sendFlexRequest(long tick, Collection<UUID> entities, boolean dis
7977
*
8078
* @param tick current tick
8179
* @param emCommunicationMessages that should be sent
82-
* @param maybeNextTick an option for the next tick
8380
* @return true, if data was sent
8481
*/
8582
public boolean sendCommunicationMessage(
86-
long tick,
87-
List<EmCommunicationMessage<?>> emCommunicationMessages,
88-
Optional<Long> maybeNextTick) {
83+
long tick, List<EmCommunicationMessage<?>> emCommunicationMessages) {
8984
// send message only if at least one value is present
9085
if (!emCommunicationMessages.isEmpty()) {
91-
sendExtMsg(new EmCommunicationMessages(tick, emCommunicationMessages, maybeNextTick));
92-
return true;
93-
}
94-
return false;
95-
}
96-
97-
/**
98-
* Tries to send the em set points to SIMONA.
99-
*
100-
* @param tick current tick
101-
* @param setPoints receiver to set point, that should be sent to SIMONA
102-
* @param maybeNextTick option for the next tick in the simulation
103-
* @return true, if data was sent
104-
*/
105-
public boolean sendSetPoints(
106-
long tick, Map<UUID, EmSetPoint> setPoints, Optional<Long> maybeNextTick) {
107-
if (!setPoints.isEmpty()) {
108-
sendExtMsg(new ProvideEmSetPointData(tick, setPoints, maybeNextTick));
86+
sendExtMsg(new EmCommunicationMessages(tick, emCommunicationMessages));
10987
return true;
11088
}
11189
return false;
@@ -115,13 +93,18 @@ public boolean sendSetPoints(
11593
* Method to request em flexibility options from SIMONA.
11694
*
11795
* @param tick for which set points are requested
118-
* @param emEntities for which set points are requested
119-
* @return an {@link FlexOptionsResponse} message
96+
* @param entities for which set points are requested
97+
* @return a map: uuid to list of flex options
12098
* @throws InterruptedException - on interruptions
12199
*/
122-
public Map<UUID, ExtendedFlexOptionsResult> requestEmFlexResults(
123-
long tick, List<UUID> emEntities, boolean disaggregated) throws InterruptedException {
124-
sendExtMsg(new RequestEmFlexResults(tick, emEntities, disaggregated));
100+
public Map<UUID, List<FlexOptions>> requestEmFlexResults(
101+
long tick, List<UUID> entities, boolean disaggregated) throws InterruptedException {
102+
// create requests
103+
Map<UUID, FlexOptionRequest> requests = new HashMap<>();
104+
entities.forEach(
105+
emEntity -> requests.put(emEntity, new FlexOptionRequest(emEntity, disaggregated)));
106+
107+
sendExtMsg(new ProvideEmData(tick, requests, Collections.emptyMap(), Collections.emptyMap()));
125108
return receiveWithType(FlexOptionsResponse.class).receiverToFlexOptions();
126109
}
127110

src/main/java/edu/ie3/simona/api/data/connection/ExtOutputDataConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @param <T> type of response messages to ext
1616
*/
1717
public sealed interface ExtOutputDataConnection<T extends DataResponseMessageToExt>
18-
permits BiDirectional, ExtResultListener {
18+
extends ExtDataConnection permits BiDirectional, ExtResultListener {
1919

2020
/** Queues message from SIMONA that should be handled by the external simulation. */
2121
void queueExtResponseMsg(T msg) throws InterruptedException;

0 commit comments

Comments
 (0)