Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
72560d3
Incrementing dev version to 0.12.0
sebastian-peter Oct 23, 2025
afd83ba
Merge pull request #364 from ie3-institute/sp/#0-merge-back
sebastian-peter Oct 23, 2025
d1907c5
Bump org.sonarqube from 7.0.0.6105 to 7.0.1.6134
dependabot[bot] Oct 27, 2025
71eef01
Merge pull request #365 from ie3-institute/dependabot/gradle/dev/org.…
github-actions[bot] Oct 27, 2025
9c2df60
Fixed issues related to em data
staudtMarius Oct 28, 2025
aac91bf
Some small adaption in flex options.
staudtMarius Oct 28, 2025
69ac9c2
Adding some utility methods.
staudtMarius Oct 28, 2025
c54c172
Including reviewer's comments.
staudtMarius Oct 29, 2025
6cda87a
Including reviewer's comments.
staudtMarius Oct 29, 2025
4af46d9
Merge branch 'ms/#366-fix-issues-related-to-em-data' into ms/#368-add…
staudtMarius Oct 29, 2025
8ba9c0a
Including reviewer's comments.
staudtMarius Oct 29, 2025
cd22541
Merge pull request #367 from ie3-institute/ms/#366-fix-issues-related…
sebastian-peter Oct 30, 2025
6f432fa
Merge branch 'dev' into ms/#368-adding-utility-methods
sebastian-peter Oct 30, 2025
257bfea
Merge pull request #370 from ie3-institute/ms/#368-adding-utility-met…
staudtMarius Oct 30, 2025
c27604a
Extending flex option handling in `ExtInputContainer`.
staudtMarius Oct 31, 2025
90214c9
Increasing test coverage.
staudtMarius Oct 31, 2025
3add106
Small adaptions.
staudtMarius Nov 3, 2025
ffe891c
Small adaptions.
staudtMarius Nov 3, 2025
2eecd76
Merge pull request #372 from ie3-institute/ms/#371-extend-FlexOption-…
sebastian-peter Nov 4, 2025
7d02d4a
Fixed bugs in `ExtEntityMapping`
staudtMarius Nov 4, 2025
1c74826
Adding test for fix in `ExtEntityMapping`.
staudtMarius Nov 5, 2025
32457ac
Merge pull request #374 from ie3-institute/ms/#373-fix-bugs-in-ExtEnt…
sebastian-peter Nov 5, 2025
bdcc837
Bump org.scala-lang:scala3-library_3 from 3.7.3 to 3.7.4
dependabot[bot] Nov 10, 2025
645f082
Merge pull request #375 from ie3-institute/dependabot/gradle/dev/org.…
github-actions[bot] Nov 10, 2025
ab36598
Bump com.github.spotbugs from 6.4.4 to 6.4.5
dependabot[bot] Nov 12, 2025
7ec4349
Merge pull request #376 from ie3-institute/dependabot/gradle/dev/com.…
github-actions[bot] Nov 12, 2025
cc760a3
Update EvModel.java
kkarthik11 Nov 13, 2025
ad46618
Resolves #259
Nov 14, 2025
1a388c2
Update CHANGELOG.md
kkarthik11 Nov 14, 2025
a1b5452
Merge pull request #377 from ie3-institute/kk/#259-cosPhi-from-EvInpu…
danielfeismann Nov 17, 2025
03879ce
Fixed changelog entry #366
danielfeismann Nov 17, 2025
686c332
fix order
danielfeismann Nov 17, 2025
6058617
Enhancing input data container with has data methods.
staudtMarius Nov 17, 2025
df2e117
Add CHANGELOG entry.
staudtMarius Nov 17, 2025
fb1dd84
Merge pull request #379 from ie3-institute/df/#378-fix-changelog
staudtMarius Nov 17, 2025
ab9cf93
Merge branch 'dev' into ms/#382-ehancing-data-container-with-utils
staudtMarius Nov 17, 2025
78c5f13
Fix considered data in `ExtEntityMapping.getAssets()`
staudtMarius Nov 17, 2025
20c7b16
update gradle to 9.2
danielfeismann Nov 17, 2025
52d756a
Include reviewer's comments.
staudtMarius Nov 17, 2025
d70dda7
Merge pull request #383 from ie3-institute/ms/#382-ehancing-data-cont…
danielfeismann Nov 17, 2025
6969146
Merge branch 'dev' into ms/#384-Fix-considered-data-in-ExtEntityMappi…
staudtMarius Nov 17, 2025
4e4f5f7
Include reviewer's comments.
staudtMarius Nov 17, 2025
156f7ef
Merge branch 'dev' into df/#381-gradle-9-2
staudtMarius Nov 17, 2025
5a85ea2
Merge pull request #388 from ie3-institute/df/#381-gradle-9-2
staudtMarius Nov 17, 2025
a04e79d
Merge branch 'dev' into ms/#384-Fix-considered-data-in-ExtEntityMappi…
staudtMarius Nov 17, 2025
a106418
update to gradle 9.2.1
danielfeismann Nov 17, 2025
9641df7
rollback version.properties
danielfeismann Nov 17, 2025
6efa6a2
Merge pull request #385 from ie3-institute/ms/#384-Fix-considered-dat…
danielfeismann Nov 17, 2025
01fe670
Merge branch 'dev' into df/#389-gradle-9-2-1
danielfeismann Nov 17, 2025
0128604
Merge pull request #390 from ie3-institute/df/#389-gradle-9-2-1
staudtMarius Nov 18, 2025
6fd54f6
Bump com.diffplug.spotless from 8.0.0 to 8.1.0 (#393)
dependabot[bot] Nov 19, 2025
054b665
Bump pekkoVersion from 1.2.1 to 1.3.0 (#394)
dependabot[bot] Nov 20, 2025
b915b7b
Release 0.12.0
danielfeismann Nov 20, 2025
14b4510
Merge branch 'dev' into rel/df/#380-release-0-12
danielfeismann Nov 20, 2025
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
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased/Snapshot]

### Added

### Changed

### Fixed

## [0.12.0] - 2025-11-20

### Added
- Adding some utility methods [#368](https://github.com/ie3-institute/simonaAPI/issues/368)
- Extending flex option handling in `ExtInputContainer` [#371](https://github.com/ie3-institute/simonaAPI/issues/371)
- Enhancing `ExtInputContainer` with `hasData` methods [#382](https://github.com/ie3-institute/simonaAPI/issues/382)

### Changed
- Changes to sent and received em data [#2366](https://github.com/ie3-institute/simonaAPI/issues/366)
- Changed the PRated in the EvModel to SRated and added cosphi to the model [#259](https://github.com/ie3-institute/simonaAPI/issues/259)
- Update `Gradle` to 9.2.0 [#381](https://github.com/ie3-institute/simonaAPI/issues/381)
- Update `Gradle` to 9.2.1 [#389](https://github.com/ie3-institute/simonaAPI/issues/389)

### Fixed
- Issues related to em data [#366](https://github.com/ie3-institute/simonaAPI/issues/366)
- `Fixed bugs in `ExtEntityMapping` [#373](https://github.com/ie3-institute/simonaAPI/issues/373)
- Fixed changelog entry #366 [#378](https://github.com/ie3-institute/simonaAPI/issues/366)
- Fix considered data in `ExtEntityMapping.getAssets()` [#384](https://github.com/ie3-institute/simonaAPI/issues/384)

## [0.11.0] - 2025-10-23

### Added
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
plugins {
id 'groovy' // groovy support
id 'java' // java support
id 'com.diffplug.spotless' version '8.0.0'//code format
id 'com.diffplug.spotless' version '8.1.0'//code format
id 'pmd' // code check, working on source code
id 'com.github.spotbugs' version '6.4.4' // code check, working on byte code
id "org.sonarqube" version "7.0.0.6105" // sonarqube
id 'com.github.spotbugs' version '6.4.5' // code check, working on byte code
id "org.sonarqube" version "7.0.1.6134" // 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 @@ -18,8 +18,8 @@ ext {

// required for pekko
scalaVersion = '3'
scalaBinaryVersion = '3.7.3'
pekkoVersion = "1.2.1"
scalaBinaryVersion = '3.7.4'
pekkoVersion = "1.3.0"
}

group = 'com.github.ie3-institute'
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-9.0.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 1 addition & 4 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

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

CLASSPATH="\\\"\\\""


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

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

Expand Down Expand Up @@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"

Expand Down
3 changes: 1 addition & 2 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@ goto fail
:execute
@rem Setup the command line

set CLASSPATH=


@rem Execute Gradle
"%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" %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public int size() {
return receiverTriggerDeque.size();
}

/** Method for clearing this queue. */
public void clear() {
receiverTriggerDeque.clear();
}

/**
* Method for adding an {@link ExtDataContainer} to the queue.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import edu.ie3.simona.api.exceptions.UnexpectedResponseMessageException;
import edu.ie3.simona.api.ontology.DataMessageFromExt;
import edu.ie3.simona.api.ontology.DataResponseMessageToExt;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;

/**
Expand Down Expand Up @@ -38,6 +40,13 @@ public final R receiveAny() throws InterruptedException {
return receiveTriggerQueue.take();
}

/** Returns all received responses. */
public final List<R> receiveAll() {
List<R> result = new ArrayList<>(receiveTriggerQueue.size());
receiveTriggerQueue.drainTo(result);
return result;
}

@Override
@SuppressWarnings("unchecked")
public final <T extends R> T receiveWithType(Class<T> expectedMessageClass)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import edu.ie3.simona.api.data.model.em.*;
import edu.ie3.simona.api.ontology.em.*;
import java.util.*;
import org.slf4j.Logger;

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

/**
* Tries to send em data to SIMONA. A message is sent, if at least one map is not empty.
* Tries to send em data to SIMONA. A message is sent, if the map is not empty.
*
* @param tick current tick
* @param flexRequests receiver to flex option request
* @param flexOptions receiver to flex options
* @param setPoints receiver to set point
* @param maybeNextTick option for the next tick in the simulation
* @param emData a map: receiver to em data
* @param log logger for logging warnings
* @return true, if data was sent
*/
public boolean sendEmData(
long tick,
Map<UUID, FlexOptionRequest> flexRequests,
Map<UUID, List<FlexOptions>> flexOptions,
Map<UUID, EmSetPoint> setPoints,
Optional<Long> maybeNextTick) {
public boolean sendEmData(long tick, Map<UUID, ? extends EmData> emData, Logger log) {
// send message only if at least one value is present
if (!flexRequests.isEmpty() || !flexOptions.isEmpty() || !setPoints.isEmpty()) {
sendExtMsg(new ProvideEmData(tick, flexRequests, flexOptions, setPoints, maybeNextTick));
if (!emData.isEmpty()) {
sendExtMsg(ProvideEmData.create(tick, emData, log));
return true;
}
return false;
}

/**
* Tries to send flex option requests to SIMONA. A message is sent, if at least one entity is
* given.
* Tries to send em data to SIMONA. A message is sent, if at least one map is not empty.
*
* @param tick current tick
* @param entities for which flex options should be requested
* @param disaggregated if disaggregated flex option should be returned
* @param flexRequests receiver to flex option request
* @param flexOptions receiver to flex options
* @param setPoints receiver to set point that should be sent to SIMONA
* @return true, if data was sent
*/
public boolean sendFlexRequest(long tick, Collection<UUID> entities, boolean disaggregated) {
public boolean sendEmData(
long tick,
Map<UUID, FlexOptionRequest> flexRequests,
Map<UUID, List<FlexOptions>> flexOptions,
Map<UUID, EmSetPoint> setPoints) {
// send message only if at least one value is present
if (!entities.isEmpty()) {
sendExtMsg(new RequestEmFlexResults(tick, new ArrayList<>(entities), disaggregated));
if (!flexRequests.isEmpty() || !flexOptions.isEmpty() || !setPoints.isEmpty()) {
sendExtMsg(new ProvideEmData(tick, flexRequests, flexOptions, setPoints));
return true;
}
return false;
Expand All @@ -79,33 +77,13 @@ public boolean sendFlexRequest(long tick, Collection<UUID> entities, boolean dis
*
* @param tick current tick
* @param emCommunicationMessages that should be sent
* @param maybeNextTick an option for the next tick
* @return true, if data was sent
*/
public boolean sendCommunicationMessage(
long tick,
List<EmCommunicationMessage<?>> emCommunicationMessages,
Optional<Long> maybeNextTick) {
long tick, List<EmCommunicationMessage<?>> emCommunicationMessages) {
// send message only if at least one value is present
if (!emCommunicationMessages.isEmpty()) {
sendExtMsg(new EmCommunicationMessages(tick, emCommunicationMessages, maybeNextTick));
return true;
}
return false;
}

/**
* Tries to send the em set points to SIMONA.
*
* @param tick current tick
* @param setPoints receiver to set point, that should be sent to SIMONA
* @param maybeNextTick option for the next tick in the simulation
* @return true, if data was sent
*/
public boolean sendSetPoints(
long tick, Map<UUID, EmSetPoint> setPoints, Optional<Long> maybeNextTick) {
if (!setPoints.isEmpty()) {
sendExtMsg(new ProvideEmSetPointData(tick, setPoints, maybeNextTick));
sendExtMsg(new EmCommunicationMessages(tick, emCommunicationMessages));
return true;
}
return false;
Expand All @@ -115,13 +93,18 @@ public boolean sendSetPoints(
* Method to request em flexibility options from SIMONA.
*
* @param tick for which set points are requested
* @param emEntities for which set points are requested
* @return an {@link FlexOptionsResponse} message
* @param entities for which set points are requested
* @return a map: uuid to list of flex options
* @throws InterruptedException - on interruptions
*/
public Map<UUID, ExtendedFlexOptionsResult> requestEmFlexResults(
long tick, List<UUID> emEntities, boolean disaggregated) throws InterruptedException {
sendExtMsg(new RequestEmFlexResults(tick, emEntities, disaggregated));
public Map<UUID, List<FlexOptions>> requestEmFlexResults(
long tick, List<UUID> entities, boolean disaggregated) throws InterruptedException {
// create requests
Map<UUID, FlexOptionRequest> requests = new HashMap<>();
entities.forEach(
emEntity -> requests.put(emEntity, new FlexOptionRequest(emEntity, disaggregated)));

sendExtMsg(new ProvideEmData(tick, requests, Collections.emptyMap(), Collections.emptyMap()));
return receiveWithType(FlexOptionsResponse.class).receiverToFlexOptions();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @param <T> type of response messages to ext
*/
public sealed interface ExtOutputDataConnection<T extends DataResponseMessageToExt>
permits BiDirectional, ExtResultListener {
extends ExtDataConnection permits BiDirectional, ExtResultListener {

/** Queues message from SIMONA that should be handled by the external simulation. */
void queueExtResponseMsg(T msg) throws InterruptedException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@

import edu.ie3.datamodel.models.value.PValue;
import edu.ie3.datamodel.models.value.Value;
import edu.ie3.simona.api.data.model.em.EmCommunicationMessage;
import edu.ie3.simona.api.data.model.em.EmSetPoint;
import edu.ie3.simona.api.data.model.em.FlexOptionRequest;
import edu.ie3.simona.api.data.model.em.FlexOptions;
import edu.ie3.simona.api.data.model.em.*;
import java.util.*;

/** Contains all inputs for SIMONA for a certain tick */
Expand All @@ -27,7 +24,7 @@ public final class ExtInputContainer implements ExtDataContainer {
/** Map uuid to primary input value for SIMONA. */
private final Map<UUID, Value> primaryData = new HashMap<>();

// mapping for em data
// mappings for em data
/** Map uuid to flex option requests. */
private final Map<UUID, FlexOptionRequest> flexRequests = new HashMap<>();

Expand Down Expand Up @@ -61,7 +58,8 @@ public boolean isEmpty() {
return primaryData.isEmpty()
&& flexRequests.isEmpty()
&& flexOptions.isEmpty()
&& setPoints.isEmpty();
&& setPoints.isEmpty()
&& emMessages.isEmpty();
}

/** Returns the tick the data is provided for. */
Expand All @@ -74,6 +72,19 @@ public Optional<Long> getMaybeNextTick() {
return maybeNextTick;
}

/** Returns {@code true} if this container holds primary data. */
public boolean hasPrimaryData() {
return !primaryData.isEmpty();
}

/** Returns {@code true} if this container holds em data. */
public boolean hasEmData() {
return !flexRequests.isEmpty()
|| !flexOptions.isEmpty()
|| !setPoints.isEmpty()
|| !emMessages.isEmpty();
}

// add data

/**
Expand All @@ -100,8 +111,34 @@ public void addRequest(UUID receiver) {
flexRequests.put(receiver, new FlexOptionRequest(receiver, false));
}

public void addRequest(UUID receiver, FlexOptionRequest request) {
flexRequests.put(receiver, request);
/**
* Method for adding a flex option request.
*
* @param request to be added
*/
public void addRequest(FlexOptionRequest request) {
flexRequests.put(request.receiver(), request);
}

/**
* Method for adding flex options to a given receiver.
*
* @param multiFlexOptions that will be added to this container
*/
public void addFlexOptions(MultiFlexOptions multiFlexOptions) {
flexOptions
.computeIfAbsent(multiFlexOptions.receiver(), k -> new ArrayList<>())
.addAll(multiFlexOptions.disaggregated().values());
}

/**
* Method for adding flex options to a given receiver.
*
* @param receiver that will receive the flex options
* @param flexOption that will be added
*/
public void addFlexOptions(UUID receiver, FlexOptions flexOption) {
flexOptions.computeIfAbsent(receiver, k -> new ArrayList<>()).add(flexOption);
}

/**
Expand Down Expand Up @@ -201,4 +238,24 @@ public String flexOptionsString() {
public String setPointsString() {
return setPoints.toString();
}

@Override
public String toString() {
return "ExtInputContainer{"
+ "tick="
+ tick
+ ", maybeNextTick="
+ maybeNextTick
+ ", primaryData="
+ primaryData
+ ", flexRequests="
+ flexRequests
+ ", flexOptions="
+ flexOptions
+ ", setPoints="
+ setPoints
+ ", emMessages="
+ emMessages
+ '}';
}
}
Loading