Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.6.0 #222

Merged
merged 105 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
fa7263f
Temp
jo-bao Mar 16, 2024
47b0559
Merge branch 'dev' into jb/#167-enhanceinit
jo-bao Mar 16, 2024
b73a590
Merge branch 'dev' into jb/#167-enhanceinit
jo-bao Mar 19, 2024
f323f65
data support
jo-bao Mar 19, 2024
88f7107
fine tuning
jo-bao Mar 19, 2024
646191c
Merge branch 'dev' into jb/#167-enhanceinit
jo-bao Mar 26, 2024
f3ac57d
phase in extsim
jo-bao Mar 27, 2024
7480efc
Merge branch 'dev' into jb/#167-enhanceinit
jo-bao Apr 8, 2024
0814e92
opsim coupling
jo-bao Apr 9, 2024
208b7b9
Merge branch 'dev' into jb/#167-enhanceinit
jo-bao Apr 9, 2024
6657433
temp
jo-bao May 16, 2024
a7f1ca2
simple em ext simulation
jo-bao May 20, 2024
a86c5ff
temp
May 21, 2024
1bb71ad
ext address as argument
jo-bao May 24, 2024
01354cc
mapping in runtime
Jun 3, 2024
754ebc5
temp
Jun 4, 2024
6f6b097
removed dataSimulation
jo-bao Jun 5, 2024
ca6fad9
modified setup
Jun 7, 2024
49e3468
docs
jo-bao Jun 11, 2024
7d05625
Merge remote-tracking branch 'origin/dev' into jb/#167-enhanceinit
Jul 4, 2024
77dbda6
Merge remote-tracking branch 'origin/dev' into jb/#167-enhanceinit
Jul 12, 2024
72d1f12
ext simulation with storage
Jul 23, 2024
6d98e9b
fixing tests
Jul 24, 2024
ebfeda0
improve docs
Jul 24, 2024
cf22d84
fixing pmd?
Jul 24, 2024
2207a45
fixing pmd?
Jul 24, 2024
aee53bb
em data test
Jul 24, 2024
f5d2c32
new tests
Jul 24, 2024
d54be62
temp csv
Jul 24, 2024
c44fce7
spotless
Jul 24, 2024
f81ca16
columnScheme get
Jul 24, 2024
92a6a7e
update build.gradle
Jul 24, 2024
62cc742
Merge branch 'dev' into jb/#167-enhanceinit
jo-bao Jul 24, 2024
7e5d65c
Downgrading current version
sebastian-peter Aug 9, 2024
5e4b335
Merge branch 'refs/heads/main' into dev
sebastian-peter Aug 9, 2024
db75949
Upgrade working version
sebastian-peter Aug 9, 2024
5107955
Merge remote-tracking branch 'origin/dev' into jb/#167-enhanceinit
Aug 30, 2024
92c9b6a
Bump com.github.spotbugs from 6.0.20 to 6.0.21 (#196)
dependabot[bot] Aug 30, 2024
e9edd45
provide next tick
Sep 10, 2024
74db236
fixing messages
Sep 12, 2024
9ae3c83
Merge remote-tracking branch 'origin/dev' into jb/#167-enhanceinit
Sep 12, 2024
b5d050a
fix tests
Sep 12, 2024
8968852
spotless
Sep 12, 2024
41cd02c
fix javadoc
Sep 12, 2024
376c057
fix codacy
Sep 12, 2024
aac5970
Bump pekkoVersion from 1.0.3 to 1.1.1 (#199)
dependabot[bot] Sep 16, 2024
9d9e306
Bump com.github.spotbugs from 6.0.21 to 6.0.22 (#198)
dependabot[bot] Sep 16, 2024
eae57ff
improve doc
Sep 18, 2024
668616c
Merge remote-tracking branch 'origin/dev' into jb/#167-enhanceinit
Sep 18, 2024
6a903dd
code quality
Sep 21, 2024
3e47116
changelog and spotless
Sep 21, 2024
b5f316e
codacy
Sep 21, 2024
3454047
Bump com.github.spotbugs from 6.0.22 to 6.0.23 (#201)
dependabot[bot] Sep 25, 2024
7fea266
Bump com.fasterxml.jackson.core:jackson-databind from 2.17.2 to 2.18.…
dependabot[bot] Sep 27, 2024
494e951
Bump org.scala-lang:scala-library from 2.13.14 to 2.13.15 (#200)
dependabot[bot] Sep 27, 2024
a5aa82e
Bump com.github.spotbugs from 6.0.23 to 6.0.24 (#203)
dependabot[bot] Oct 8, 2024
ae70000
Bump pekkoVersion from 1.1.1 to 1.1.2 (#204)
dependabot[bot] Oct 9, 2024
cc8819d
Bump com.github.spotbugs from 6.0.24 to 6.0.25 (#205)
dependabot[bot] Oct 15, 2024
f011e99
Merge branch 'dev' into jb/#167-enhanceinit
jo-bao Oct 23, 2024
62c938b
deleted ExtDataSimulation implementations
jo-bao Oct 23, 2024
930c647
changes after review
jo-bao Oct 23, 2024
f4e8b42
Merge remote-tracking branch 'origin/jb/#167-enhanceinit' into jb/#16…
jo-bao Oct 23, 2024
c013284
changes after review
Oct 24, 2024
f4c6001
changes after review
Oct 24, 2024
6146585
implement DataServiceTestData
Oct 24, 2024
7caf708
Bump com.fasterxml.jackson.core:jackson-databind from 2.18.0 to 2.18.…
dependabot[bot] Oct 29, 2024
edf0b38
Bump com.github.spotbugs from 6.0.25 to 6.0.26 (#207)
dependabot[bot] Nov 4, 2024
cfba344
Merge branch 'dev' into jb/#167-enhanceinit
staudtMarius Nov 7, 2024
b14b26f
Renaming power fields in `EvModel`.
staudtMarius Nov 14, 2024
e2dcded
Merge pull request #209 from ie3-institute/ms/#208-consider-only-acti…
sebastian-peter Nov 14, 2024
2220540
Merge remote-tracking branch 'origin/dev' into jb/#167-enhanceinit
Nov 15, 2024
5a66653
changes after review MS
Nov 15, 2024
06e2205
changes after review
Nov 15, 2024
d33bf8a
change dataconversion
Nov 19, 2024
ad85c9b
Bump org.sonarqube from 5.1.0.4882 to 6.0.0.5145 (#211)
dependabot[bot] Nov 20, 2024
c2961f2
Bump tech.units:indriya from 2.2 to 2.2.1 (#212)
dependabot[bot] Nov 21, 2024
1bf59cf
improve doc
Nov 21, 2024
485d9ba
Merge branch 'dev' into jb/#167-enhanceinit
staudtMarius Nov 21, 2024
b262929
improve doc
Nov 21, 2024
31bd7cc
clean code
Nov 21, 2024
dfa26fb
improve doc
Nov 21, 2024
a6b99ba
fix logger
Nov 21, 2024
2a3b45b
fix sonarqube
Nov 21, 2024
b67cf22
update logging
Nov 27, 2024
cc0e634
update logging
Nov 27, 2024
0e66758
update logging
Nov 27, 2024
e72cfd0
Bump org.sonarqube from 6.0.0.5145 to 6.0.1.5171 (#214)
dependabot[bot] Nov 28, 2024
094bcaf
Bump com.fasterxml.jackson.core:jackson-databind from 2.18.1 to 2.18.…
dependabot[bot] Nov 28, 2024
44c4b81
Merge remote-tracking branch 'origin/dev' into jb/#167-enhanceinit
Nov 28, 2024
4fe25eb
fix sonarqube
Nov 28, 2024
48e5d3d
fix sonarqube
Nov 28, 2024
ea9c05c
fix sonarqube
Nov 28, 2024
59facfe
Merge pull request #168 from ie3-institute/jb/#167-enhanceinit
jo-bao Nov 28, 2024
52bf491
Bump org.apache.logging.log4j:log4j-bom from 2.24.1 to 2.24.2 (#215)
dependabot[bot] Nov 29, 2024
2aecc32
ExtResultContainer returns resultmap
Nov 29, 2024
bb03511
Enhancing external data connections
staudtMarius Nov 29, 2024
e1dea08
Merge pull request #218 from ie3-institute/jb/#217-resultmap
staudtMarius Nov 29, 2024
22c7767
Merge branch 'dev' into ms/#219-enhance-external-data-connections
staudtMarius Nov 29, 2024
ffa48d0
Fix code quality.
staudtMarius Nov 29, 2024
1f84440
Implementing reviewers requests.
staudtMarius Nov 29, 2024
0454ec1
Merge pull request #220 from ie3-institute/ms/#219-enhance-external-d…
staudtMarius Nov 29, 2024
034cab4
Adapting changelog for release
sebastian-peter Dec 2, 2024
d6ffc2c
Upgrading gradle to 8.11.1
sebastian-peter Dec 2, 2024
b411dc9
Removing unnecessary dependency
sebastian-peter Dec 2, 2024
6ee4e5e
spotless
sebastian-peter Dec 2, 2024
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
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased/Snapshot]

## [0.6.0] - 2024-12-02

### Added
- Enable initialization of external data simulation [#167](https://github.com/ie3-institute/simonaAPI/issues/167)
- `ExtResultContainer` returns result map [#217](https://github.com/ie3-institute/simonaAPI/issues/217)

### Changed
- Renaming power fields in `EvModel` [#208](https://github.com/ie3-institute/simonaAPI/issues/208)
- Enhancing external data connections [#219](https://github.com/ie3-institute/simonaAPI/issues/219)

## [0.5.0] - 2024-08-09

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

[Unreleased/Snapshot]: https://github.com/ie3-institute/simonaapi/compare/0.5.0...HEAD
[Unreleased/Snapshot]: https://github.com/ie3-institute/simonaapi/compare/0.6.0...HEAD
[0.6.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/0.5.0...0.6.0
[0.5.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/0.4.0...0.5.0
[0.4.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/0.3.0...0.4.0
[0.3.0]: https://github.com/ie3-institute/powersystemdatamodel/compare/0.2.0...0.3.0
Expand Down
22 changes: 14 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ plugins {
id 'java' // java support
id 'com.diffplug.spotless' version '6.25.0'//code format
id 'pmd' // code check, working on source code
id 'com.github.spotbugs' version '6.0.20' // code check, working on byte code
id "org.sonarqube" version "5.1.0.4882" // sonarqube
id 'com.github.spotbugs' version '6.0.26' // code check, working on byte code
id "org.sonarqube" version "6.0.1.5171" // sonarqube
id 'signing'
id 'maven-publish' // publish to a maven repo (local or mvn central, has to be defined)
id 'jacoco' // java code coverage plugin
Expand All @@ -17,8 +17,8 @@ ext {

// required for pekko
scalaVersion = "2.13"
scalaBinaryVersion = "2.13.14"
pekkoVersion = "1.0.3"
scalaBinaryVersion = "2.13.15"
pekkoVersion = "1.1.2"
}

group = 'com.github.ie3-institute'
Expand Down Expand Up @@ -46,33 +46,39 @@ repositories {

dependencies{

implementation 'tech.units:indriya:2.2' // quantities
implementation 'tech.units:indriya:2.2.1' // quantities

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

//PSDM
//PSU
implementation('com.github.ie3-institute:PowerSystemUtils:2.2.1') {
exclude group: 'org.apache.logging.log4j'
exclude group: 'org.slf4j'
/* Exclude our own nested dependencies */
exclude group: 'com.github.ie3-institute'
}

//PSDM
implementation('com.github.ie3-institute:PowerSystemDataModel:5.1.0') {
exclude group: 'org.apache.logging.log4j'
exclude group: 'org.slf4j'
/* Exclude our own nested dependencies */
exclude group: 'com.github.ie3-institute'
}

// logging
implementation platform('org.apache.logging.log4j:log4j-bom:2.24.2')
implementation 'org.apache.logging.log4j:log4j-api' // log4j
implementation 'org.apache.logging.log4j:log4j-core' // log4j
implementation 'org.apache.logging.log4j:log4j-slf4j-impl' // log4j -> slf4j

// pekko
implementation "org.apache.pekko:pekko-actor_${scalaVersion}:${pekkoVersion}"
testImplementation "org.apache.pekko:pekko-testkit_${scalaVersion}:${pekkoVersion}" // pekko testkit

// TESTING
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'

implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.17.2'
}

task printVersion {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

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

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

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

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

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

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
21 changes: 13 additions & 8 deletions src/main/java/edu/ie3/simona/api/ExtLinkInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,25 @@

package edu.ie3.simona.api;

import edu.ie3.simona.api.data.ExtDataSimulation;
import edu.ie3.simona.api.exceptions.NoExtSimulationException;
import edu.ie3.simona.api.simulation.ExtSimAdapterData;
import edu.ie3.simona.api.simulation.ExtSimulation;
import java.util.List;

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

List<ExtDataSimulation> getExtDataSimulations();
/**
* Method to set up an external simulation. Everything that needs to be set up before the external
* simulation can be retrieved should be done here.
*
* @param data used for setting up the external simulation
*/
void setup(ExtSimAdapterData data);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* © 2024. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/

package edu.ie3.simona.api.data;

import java.util.concurrent.LinkedBlockingQueue;

/** Data queue to allow data flow between SimonaAPI and an external simulation */
public class DataQueueExtSimulationExtSimulator<V extends ExtDataContainer> {
private final LinkedBlockingQueue<V> receiverTriggerQueue = new LinkedBlockingQueue<>();

public void queueData(V data) throws InterruptedException {
this.receiverTriggerQueue.put(data);
}

public V takeData() throws InterruptedException {
return this.receiverTriggerQueue.take();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@

package edu.ie3.simona.api.data;

public interface ExtData {}
/** Interface that defines a data connection between SIMONA and an external simulation. */
public interface ExtDataConnection {}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
* Research group Distribution grid planning and operation
*/

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

public class ConvertionException extends Exception {

public ConvertionException(final String message) {
super(message);
}
}
/** Interface for data that are exchanged between an external simulation and SimonaAPI */
public interface ExtDataContainer {}
16 changes: 0 additions & 16 deletions src/main/java/edu/ie3/simona/api/data/ExtDataSimulation.java

This file was deleted.

21 changes: 21 additions & 0 deletions src/main/java/edu/ie3/simona/api/data/ExtInputDataConnection.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* © 2024. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/

package edu.ie3.simona.api.data;

import org.apache.pekko.actor.ActorRef;

public interface ExtInputDataConnection extends ExtDataConnection {

/**
* Sets the actor refs for data and control flow.
*
* @param dataService actor ref to the adapter of the data service for schedule activation
* messages
* @param extSimAdapter actor ref to the extSimAdapter
*/
void setActorRefs(ActorRef dataService, ActorRef extSimAdapter);
}
69 changes: 69 additions & 0 deletions src/main/java/edu/ie3/simona/api/data/ExtInputDataContainer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* © 2024. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/

package edu.ie3.simona.api.data;

import edu.ie3.datamodel.models.value.Value;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;

/** Contains all inputs for SIMONA for a certain tick */
public class ExtInputDataContainer implements ExtDataContainer {

/** The tick, the input data is meant for */
private final long tick;

/** Map external id to an input value for SIMONA */
private final Map<String, Value> dataMap;

/** The next tick, when data will be provided, if available */
private final Optional<Long> maybeNextTick;

/**
* Container class for input data for SIMONA which can be read by SimonaAPI
*
* @param tick The tick, the input data is meant for
* @param dataMap data to be provided to SIMONA
* @param nextTick tick, when the next data will be provided
*/
public ExtInputDataContainer(long tick, Map<String, Value> dataMap, long nextTick) {
this.tick = tick;
this.dataMap = dataMap;
this.maybeNextTick = Optional.of(nextTick);
}

public ExtInputDataContainer(long tick, Map<String, Value> dataMap) {
this.tick = tick;
this.dataMap = dataMap;
this.maybeNextTick = Optional.empty();
}

public ExtInputDataContainer(long tick) {
this(tick, new HashMap<>());
}

public ExtInputDataContainer(long tick, long nextTick) {
this(tick, new HashMap<>(), nextTick);
}

public long getTick() {
return tick;
}

public Map<String, Value> getSimonaInputMap() {
return dataMap;
}

public Optional<Long> getMaybeNextTick() {
return maybeNextTick;
}

/** Adds a value to the input map */
public void addValue(String id, Value value) {
dataMap.put(id, value);
}
}
27 changes: 27 additions & 0 deletions src/main/java/edu/ie3/simona/api/data/ExtOutputDataConnection.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* © 2024. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/

package edu.ie3.simona.api.data;

import org.apache.pekko.actor.ActorRef;

/**
* Interface for a connection between SIMONA and an external simulation with data flow from SIMONA
* to external
*/
public interface ExtOutputDataConnection extends ExtDataConnection {

/**
* Sets the actor refs for data and control flow
*
* @param extResultDataService actor ref to the adapter of the data service for data messages
* @param dataServiceActivation actor ref to the adapter of the data service for schedule
* activation messages
* @param extSimAdapter actor ref to the extSimAdapter
*/
void setActorRefs(
ActorRef extResultDataService, ActorRef dataServiceActivation, ActorRef extSimAdapter);
}
Loading