-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Release 0.6.0
- Loading branch information
Showing
56 changed files
with
1,764 additions
and
546 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/edu/ie3/simona/api/data/DataQueueExtSimulationExtSimulator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
src/main/java/edu/ie3/simona/api/data/ExtDataSimulation.java
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
src/main/java/edu/ie3/simona/api/data/ExtInputDataConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
69
src/main/java/edu/ie3/simona/api/data/ExtInputDataContainer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
27
src/main/java/edu/ie3/simona/api/data/ExtOutputDataConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
Oops, something went wrong.