Skip to content

Commit cf4672b

Browse files
authored
Merge branch 'dev' into mh/#1192-parameter-cleanup-ArgsParser
2 parents bb50898 + c50ec9a commit cf4672b

40 files changed

+1311
-688
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
144144
- Typo and format of `ThermalGrid` and `ThermalHouse` ScalaDocs [#1196](https://github.com/ie3-institute/simona/issues/1196)
145145
- Refactor `EmRuntimeConfig` [#1181](https://github.com/ie3-institute/simona/issues/1181)
146146
- Based `PvModel` calculations on irradiance (power per area) instead of irradiation (energy per area) [#1212](https://github.com/ie3-institute/simona/issues/1212)
147+
- Updated to changes of PSDM release v6.0.0 [#1107](https://github.com/ie3-institute/simona/issues/1107)
148+
- Refactor external simulation setup [#1136](https://github.com/ie3-institute/simona/issues/1136)
147149

148150
### Fixed
149151
- Fix rendering of references in documentation [#505](https://github.com/ie3-institute/simona/issues/505)
@@ -196,6 +198,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
196198
- Fix test timeouts for all tests [#1222](https://github.com/ie3-institute/simona/issues/1222)
197199
- Fix handling of states in `ParticipantModelShell` [#1228](https://github.com/ie3-institute/simona/issues/1228)
198200
- Fix input data handling in `ParticipantModel` [#1237](https://github.com/ie3-institute/simona/issues/1237)
201+
- Show full stacktrace of failing tests with `gradle test` [#1245](https://github.com/ie3-institute/simona/issues/1245)
199202

200203
### Removed
201204
- Removed `SimonaListerner` and related code [#1205](https://github.com/ie3-institute/simona/issues/1205)

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ dependencies {
7272
/* Exclude our own nested dependencies */
7373
exclude group: 'com.github.ie3-institute'
7474
}
75-
implementation('com.github.ie3-institute:PowerSystemDataModel:5.1.0') {
75+
implementation('com.github.ie3-institute:PowerSystemDataModel:6.0.0') {
7676
exclude group: 'org.apache.logging.log4j'
7777
exclude group: 'org.slf4j'
7878
/* Exclude our own nested dependencies */
@@ -104,7 +104,7 @@ dependencies {
104104
testRuntimeOnly "org.scalatestplus:junit-5-11_${scalaVersion}:3.2.19.0"
105105

106106
// mocking framework
107-
testImplementation 'org.mockito:mockito-core:5.15.2'
107+
testImplementation 'org.mockito:mockito-core:5.16.0'
108108
testImplementation "org.scalatestplus:mockito-3-4_${scalaVersion}:3.2.10.0"
109109

110110
// pekko

docs/readthedocs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Sphinx==8.2.1
1+
Sphinx==8.2.3
22
sphinx-rtd-theme==3.0.2
33
sphinxcontrib-plantuml==0.30
44
myst-parser==4.0.1

docs/readthedocs/usersguide.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,12 @@ Within the ``rawOutputData`` folder you can find the raw simulation results. For
152152
## Setting up and running an external simulation
153153

154154
SIMONA is capable of running an external sub-simulation by integration within the same time system (ticks) as SIMONA.
155-
The information flow between SIMONA and the external simulation is partitioned into a control stream (see ``edu.ie3.simona.api.ExtSimAdapter``) and a number of optional data streams.
156-
Currently, only a data stream transporting electric vehicle movement information is implemented (see ``edu.ie3.simona.service.ev.ExtEvDataService``).
155+
The information flow between SIMONA and the external simulation is partitioned into a control stream (see ``edu.ie3.simona.api.ExtSimAdapter``) and a number of optional data connections.
156+
Currently, available data connections are:
157+
- electric vehicle movement information (see ``edu.ie3.simona.service.ev.ExtEvDataService``)
158+
- energy management data (see ``edu.ie3.simona.service.em.ExtEmDataService``)
159+
- primary data (see ``edu.ie3.simona.service.primary.ExtPrimaryDataService``)
160+
- result data (see ``edu.ie3.simona.service.results.ExtResultDataProvider``)
157161

158162
An external simulation has to depend on [SimonaAPI](https://github.com/ie3-institute/simonaAPI) and make use of some of its interfaces (see below).
159163
In order to run an external simulation, several requirements have to be fulfilled and a bunch of preparation steps have to be followed.
@@ -168,23 +172,24 @@ In order to run an external simulation, several requirements have to be fulfille
168172

169173
- The external simulation should be implemented in its own project (repository).
170174
- The project should include the *shadowJar* gradle plugin (``id "com.github.johnrengelman.shadow" version "x.y.z"``).
171-
- A class (called *main class* here) needs to extend ``edu.ie3.simona.api.schedule.ExtSimulation`` and thus implement the two methods ``Optional<Long> initialize()`` and ``Optional<Long> doActivity(long tick)``. The method ``initialize`` is called when the external simulation needs to be initialized whereas the method ``doActivity`` is called when time step ``tick`` is triggered. ``initialize`` and ``doActivity`` can return a subsequent new tick that the sub simulation should be activated with next.
172-
- For each data stream, a sub-interface of ``edu.ie3.simona.api.data.ExtDataSimulation`` needs to be implemented, such as ``edu.ie3.simona.api.data.ev.ExtEvSimulation``, and all methods of the interface have to be implemented. The *main class* could be the implementing class here.
173-
- In order for SIMONA to use the external simulation, a class that extends ``edu.ie3.simona.api.ExtLinkInterface`` has to reside inside the project. The class has to implement the corresponding methods by returning the control stream and data stream implementations (could all be the same *main class*).
175+
- A class (called *main class* here) needs to extend ``edu.ie3.simona.api.schedule.ExtSimulation`` and thus implement the three methods ``Set<ExtDataConnection> getDataConnections()``, ``Optional<Long> initialize()`` and ``Optional<Long> doActivity(long tick)``. The method ``getDataConnections`` is called to return all data connection between the external simulation and SIMONA, ``initialize`` is called when the external simulation needs to be initialized whereas the method ``doActivity`` is called when time step ``tick`` is triggered. ``initialize`` and ``doActivity`` can return a subsequent new tick that the sub simulation should be activated with next.
176+
- For each data, that should be exchanged with SIMONA, a data connection (see ``edu.ie3.simona.api.data.ExtDataConnection``) needs to be created, such as ``edu.ie3.simona.api.data.ev.ExtEvDataConnection``. All data connections should be returned by the implementation of ``edu.ie3.simona.api.schedule.ExtSimulation``.
177+
- In order for SIMONA to use the external simulation, a class that extends ``edu.ie3.simona.api.ExtLinkInterface`` has to reside inside the project. The class has to implement the corresponding methods. One method is used to set up the external simulation with the provided ``edu.ie3.simona.api.simulation.ExtSimAdapterData``. The second method is called after the setup and returns the external simulation.
174178
- When loading the external simulations, SIMONA is looking for the corresponding service files of the class ``edu.ie3.simona.api.ExtLinkInterface``. Therefor every external simulation needs the following service file: ``src/main/resources/META-INF/services/edu.ie3.simona.api.ExtLinkInterface``. The service file needs to contain the relative path to the class that extends ``edu.ie3.simona.api.ExtLinkInterface``.
175179
- A <em>very simple</em> example for an external simulation can be found [here](https://github.com/ie3-institute/ExtSimSample)
176180

177181
**SIMONA**
178182

179-
- For EV simulation: The EVCS that are used by the external simulation have to be loaded by SIMONA from the according input data. EVCS are identified by their UUIDs.
183+
- The grid with all system participants that are either used in or receive data from external simulations have to be loaded by SIMONA.
184+
- The external data connections uses the UUIDs of the assets and participants to provide data or send results.
180185

181186

182187
### Preparation
183188

184189
These steps have to be performed each time updates to the external simulation need to be deployed.
185190

186191
- Execute ``gradlew shadowJar`` inside the external simulation project.
187-
- Copy the resulting *jar* (usually placed inside ``<external project>/build/libs``) to ``./input/ext_sim/``.
192+
- Copy the resulting *jar* (usually placed inside ``<external project>/build/libs``) into the external simulation folder. This folder is set via the given config.
188193

189194
Now, when a simulation with SIMONA is started (see {ref}`usersguide:running a standalone simulation`), the external simulation is triggered at each tick that it requested.
190195

gradle/scripts/tests.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ test {
33
includeEngines 'scalatest'
44
testLogging {
55
events("skipped", "failed")
6+
exceptionFormat("full")
67
}
78
}
89
}

0 commit comments

Comments
 (0)