Skip to content

Commit 4ebc7a9

Browse files
Merge pull request #222 from ie3-institute/rel/sp/#221-release-0.6
Release 0.6.0
2 parents e58e134 + 6ee4e5e commit 4ebc7a9

File tree

56 files changed

+1764
-546
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1764
-546
lines changed

CHANGELOG.md

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

77
## [Unreleased/Snapshot]
88

9+
## [0.6.0] - 2024-12-02
10+
11+
### Added
12+
- Enable initialization of external data simulation [#167](https://github.com/ie3-institute/simonaAPI/issues/167)
13+
- `ExtResultContainer` returns result map [#217](https://github.com/ie3-institute/simonaAPI/issues/217)
14+
15+
### Changed
16+
- Renaming power fields in `EvModel` [#208](https://github.com/ie3-institute/simonaAPI/issues/208)
17+
- Enhancing external data connections [#219](https://github.com/ie3-institute/simonaAPI/issues/219)
18+
919
## [0.5.0] - 2024-08-09
1020

1121
### Added
@@ -37,7 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3747
- Renamed messages to ease understanding [#62](https://github.com/ie3-institute/simonaAPI/issues/62)
3848
- Separating departures and arrivals in message protocol, properly handling exceptions [#77](https://github.com/ie3-institute/simonaAPI/issues/77)
3949

40-
[Unreleased/Snapshot]: https://github.com/ie3-institute/simonaapi/compare/0.5.0...HEAD
50+
[Unreleased/Snapshot]: https://github.com/ie3-institute/simonaapi/compare/0.6.0...HEAD
51+
[0.6.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/0.5.0...0.6.0
4152
[0.5.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/0.4.0...0.5.0
4253
[0.4.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/0.3.0...0.4.0
4354
[0.3.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/0.2.0...0.3.0

build.gradle

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ plugins {
33
id 'java' // java support
44
id 'com.diffplug.spotless' version '6.25.0'//code format
55
id 'pmd' // code check, working on source code
6-
id 'com.github.spotbugs' version '6.0.20' // code check, working on byte code
7-
id "org.sonarqube" version "5.1.0.4882" // sonarqube
6+
id 'com.github.spotbugs' version '6.0.26' // code check, working on byte code
7+
id "org.sonarqube" version "6.0.1.5171" // 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
@@ -17,8 +17,8 @@ ext {
1717

1818
// required for pekko
1919
scalaVersion = "2.13"
20-
scalaBinaryVersion = "2.13.14"
21-
pekkoVersion = "1.0.3"
20+
scalaBinaryVersion = "2.13.15"
21+
pekkoVersion = "1.1.2"
2222
}
2323

2424
group = 'com.github.ie3-institute'
@@ -46,33 +46,39 @@ repositories {
4646

4747
dependencies{
4848

49-
implementation 'tech.units:indriya:2.2' // quantities
49+
implementation 'tech.units:indriya:2.2.1' // quantities
5050

5151
// scala (needed for pekko)
5252
implementation "org.scala-lang:scala-library:${scalaBinaryVersion}"
5353

54-
//PSDM
54+
//PSU
5555
implementation('com.github.ie3-institute:PowerSystemUtils:2.2.1') {
5656
exclude group: 'org.apache.logging.log4j'
5757
exclude group: 'org.slf4j'
5858
/* Exclude our own nested dependencies */
5959
exclude group: 'com.github.ie3-institute'
6060
}
61+
62+
//PSDM
6163
implementation('com.github.ie3-institute:PowerSystemDataModel:5.1.0') {
6264
exclude group: 'org.apache.logging.log4j'
6365
exclude group: 'org.slf4j'
6466
/* Exclude our own nested dependencies */
6567
exclude group: 'com.github.ie3-institute'
6668
}
6769

70+
// logging
71+
implementation platform('org.apache.logging.log4j:log4j-bom:2.24.2')
72+
implementation 'org.apache.logging.log4j:log4j-api' // log4j
73+
implementation 'org.apache.logging.log4j:log4j-core' // log4j
74+
implementation 'org.apache.logging.log4j:log4j-slf4j-impl' // log4j -> slf4j
75+
6876
// pekko
6977
implementation "org.apache.pekko:pekko-actor_${scalaVersion}:${pekkoVersion}"
7078
testImplementation "org.apache.pekko:pekko-testkit_${scalaVersion}:${pekkoVersion}" // pekko testkit
7179

7280
// TESTING
7381
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
74-
75-
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.17.2'
7682
}
7783

7884
task printVersion {

gradle/wrapper/gradle-wrapper.jar

-19.7 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-8.9-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

gradlew.bat

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
4345
%JAVA_EXE% -version >NUL 2>&1
4446
if %ERRORLEVEL% equ 0 goto execute
4547

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
48+
echo. 1>&2
49+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50+
echo. 1>&2
51+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52+
echo location of your Java installation. 1>&2
5153

5254
goto fail
5355

@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5759

5860
if exist "%JAVA_EXE%" goto execute
5961

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
62+
echo. 1>&2
63+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64+
echo. 1>&2
65+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66+
echo location of your Java installation. 1>&2
6567

6668
goto fail
6769

src/main/java/edu/ie3/simona/api/ExtLinkInterface.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,25 @@
66

77
package edu.ie3.simona.api;
88

9-
import edu.ie3.simona.api.data.ExtDataSimulation;
9+
import edu.ie3.simona.api.exceptions.NoExtSimulationException;
10+
import edu.ie3.simona.api.simulation.ExtSimAdapterData;
1011
import edu.ie3.simona.api.simulation.ExtSimulation;
11-
import java.util.List;
1212

1313
/**
1414
* Every external simulation has to provide a class {@code edu.ie3.simona.api.ExtLink} which
1515
* implements this interface.
16-
*
17-
* <p>{@link #getExtSimulation()} and {@link #getExtDataSimulations()} can return references to the
18-
* same object, if that object implements both {@link ExtSimulation} and one or more variants of
19-
* {@link ExtDataSimulation}.
2016
*/
2117
public interface ExtLinkInterface {
22-
ExtSimulation getExtSimulation();
18+
/** Returns the external simulation. */
19+
default ExtSimulation getExtSimulation() {
20+
throw new NoExtSimulationException(this.getClass());
21+
}
2322

24-
List<ExtDataSimulation> getExtDataSimulations();
23+
/**
24+
* Method to set up an external simulation. Everything that needs to be set up before the external
25+
* simulation can be retrieved should be done here.
26+
*
27+
* @param data used for setting up the external simulation
28+
*/
29+
void setup(ExtSimAdapterData data);
2530
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* © 2024. TU Dortmund University,
3+
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
4+
* Research group Distribution grid planning and operation
5+
*/
6+
7+
package edu.ie3.simona.api.data;
8+
9+
import java.util.concurrent.LinkedBlockingQueue;
10+
11+
/** Data queue to allow data flow between SimonaAPI and an external simulation */
12+
public class DataQueueExtSimulationExtSimulator<V extends ExtDataContainer> {
13+
private final LinkedBlockingQueue<V> receiverTriggerQueue = new LinkedBlockingQueue<>();
14+
15+
public void queueData(V data) throws InterruptedException {
16+
this.receiverTriggerQueue.put(data);
17+
}
18+
19+
public V takeData() throws InterruptedException {
20+
return this.receiverTriggerQueue.take();
21+
}
22+
}

src/main/java/edu/ie3/simona/api/data/ExtData.java renamed to src/main/java/edu/ie3/simona/api/data/ExtDataConnection.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66

77
package edu.ie3.simona.api.data;
88

9-
public interface ExtData {}
9+
/** Interface that defines a data connection between SIMONA and an external simulation. */
10+
public interface ExtDataConnection {}

src/main/java/edu/ie3/simona/api/exceptions/ConvertionException.java renamed to src/main/java/edu/ie3/simona/api/data/ExtDataContainer.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
* Research group Distribution grid planning and operation
55
*/
66

7-
package edu.ie3.simona.api.exceptions;
7+
package edu.ie3.simona.api.data;
88

9-
public class ConvertionException extends Exception {
10-
11-
public ConvertionException(final String message) {
12-
super(message);
13-
}
14-
}
9+
/** Interface for data that are exchanged between an external simulation and SimonaAPI */
10+
public interface ExtDataContainer {}

0 commit comments

Comments
 (0)