Skip to content

Commit 1e65455

Browse files
committed
Merge branch 'dev' into ms/#53-upgrate-to-scala3
# Conflicts: # CHANGELOG.md
2 parents d0b6350 + 9c80601 commit 1e65455

33 files changed

+2327
-5879
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5858
- Replace `WecModel` with its new implementation [#1154](https://github.com/ie3-institute/simona/issues/1154)
5959
- Replace `StorageModel` with its new implementation [#1153](https://github.com/ie3-institute/simona/issues/1153)
6060
- Use ValidationUtils for ThermalGrids [#1117](https://github.com/ie3-institute/simona/issues/1117)
61+
- Replace `EvcsModel` with its new implementation [#1151](https://github.com/ie3-institute/simona/issues/1151)
6162

6263
### Changed
6364
- Adapted to changed data source in PSDM [#435](https://github.com/ie3-institute/simona/issues/435)
@@ -147,6 +148,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
147148
- Based `PvModel` calculations on irradiance (power per area) instead of irradiation (energy per area) [#1212](https://github.com/ie3-institute/simona/issues/1212)
148149
- Updated to changes of PSDM release v6.0.0 [#1107](https://github.com/ie3-institute/simona/issues/1107)
149150
- Refactor external simulation setup [#1136](https://github.com/ie3-institute/simona/issues/1136)
151+
- Use new tick retrieval methods from PSDM [#920](https://github.com/ie3-institute/simona/issues/920)
150152
- Upgrated `scala2` to `scala3` [#53](https://github.com/ie3-institute/simona/issues/53)
151153

152154
### Fixed
@@ -201,6 +203,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
201203
- Fix handling of states in `ParticipantModelShell` [#1228](https://github.com/ie3-institute/simona/issues/1228)
202204
- Fix input data handling in `ParticipantModel` [#1237](https://github.com/ie3-institute/simona/issues/1237)
203205
- Show full stacktrace of failing tests with `gradle test` [#1245](https://github.com/ie3-institute/simona/issues/1245)
206+
- Fix copernicus url in readthedocs [#1248](https://github.com/ie3-institute/simona/issues/1248)
204207

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

docs/readthedocs/howto/weatherDataHowToCopernicusERA5.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# How To use Copernicus ERA5 weather data in SIMONA
44

5-
To use weather data from the past within SIMONA we recommend to use the dataset [ERA5 hourly data on single levels from 1940 to present](https://cds-beta.climate.copernicus.eu/datasets/reanalysis-era5-single-levels?tab=download) of [Copernicus Climate Data Store](https://cds-beta.climate.copernicus.eu/).
5+
To use weather data from the past within SIMONA we recommend to use the dataset [ERA5 hourly data on single levels from 1940 to present](https://cds.climate.copernicus.eu/datasets/reanalysis-era5-single-levels?tab=download) of [Copernicus Climate Data Store](https://cds.climate.copernicus.eu/).
66

77
The following data parameter should be used
88

src/main/scala/edu/ie3/simona/agent/grid/GridAgentController.scala

Lines changed: 5 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ import edu.ie3.datamodel.models.input.system._
1212
import edu.ie3.simona.actor.SimonaActorNaming._
1313
import edu.ie3.simona.agent.EnvironmentRefs
1414
import edu.ie3.simona.agent.em.EmAgent
15-
import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService.{
16-
ActorExtEvDataService,
17-
ActorWeatherService,
18-
}
19-
import edu.ie3.simona.agent.participant.evcs.EvcsAgent
15+
import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService.ActorWeatherService
2016
import edu.ie3.simona.agent.participant.hp.HpAgent
2117
import edu.ie3.simona.agent.participant.statedata.ParticipantStateData.ParticipantInitializeStateData
2218
import edu.ie3.simona.agent.participant2.ParticipantAgentInit.{
@@ -405,22 +401,15 @@ class GridAgentController(
405401
maybeControllingEm,
406402
)
407403
case input: EvcsInput =>
408-
buildEvcs(
404+
buildParticipant(
409405
input,
410406
participantConfigUtil.getOrDefault[EvcsRuntimeConfig](
411407
input.getUuid
412408
),
413-
environmentRefs.primaryServiceProxy,
414-
environmentRefs.evDataService.getOrElse(
415-
throw new GridAgentInitializationException(
416-
"EvMovementsService required for setting up evcs."
417-
)
418-
),
419-
simulationStartDate,
420-
simulationEndDate,
421-
resolution,
422-
requestVoltageDeviationThreshold,
423409
outputConfigUtil.getOrDefault(NotifierIdentifier.Evcs),
410+
participantRefs,
411+
simParams,
412+
environmentRefs.scheduler,
424413
maybeControllingEm,
425414
)
426415
case hpInput: HpInput =>
@@ -494,74 +483,6 @@ class GridAgentController(
494483
participant
495484
}
496485

497-
/** Creates an Evcs agent and determines the needed additional information for
498-
* later initialization of the agent.
499-
*
500-
* @param evcsInput
501-
* Evcs input model to derive information from
502-
* @param modelConfiguration
503-
* User-provided configuration for this specific load model
504-
* @param primaryServiceProxy
505-
* Reference to the primary data service proxy
506-
* @param evMovementsService
507-
* Reference to the ev movements service actor
508-
* @param simulationStartDate
509-
* The simulation time at which the simulation starts
510-
* @param simulationEndDate
511-
* The simulation time at which the simulation ends
512-
* @param resolution
513-
* Frequency of power flow calculations
514-
* @param requestVoltageDeviationThreshold
515-
* Maximum deviation in p.u. of request voltages to be considered equal
516-
* @param outputConfig
517-
* Configuration of the output behavior
518-
* @param maybeControllingEm
519-
* The parent EmAgent, if applicable
520-
* @return
521-
* The [[EvcsAgent]] 's [[ActorRef]]
522-
*/
523-
private def buildEvcs(
524-
evcsInput: EvcsInput,
525-
modelConfiguration: EvcsRuntimeConfig,
526-
primaryServiceProxy: ClassicRef,
527-
evMovementsService: ClassicRef,
528-
simulationStartDate: ZonedDateTime,
529-
simulationEndDate: ZonedDateTime,
530-
resolution: Long,
531-
requestVoltageDeviationThreshold: Double,
532-
outputConfig: NotifierConfig,
533-
maybeControllingEm: Option[ActorRef[FlexResponse]],
534-
): ActorRef[ParticipantAgent.Request] = {
535-
val participant = gridAgentContext.toClassic
536-
.simonaActorOf(
537-
EvcsAgent.props(
538-
environmentRefs.scheduler.toClassic,
539-
ParticipantInitializeStateData(
540-
evcsInput,
541-
modelConfiguration,
542-
primaryServiceProxy,
543-
Iterable(
544-
ActorExtEvDataService(
545-
evMovementsService
546-
)
547-
),
548-
simulationStartDate,
549-
simulationEndDate,
550-
resolution,
551-
requestVoltageDeviationThreshold,
552-
outputConfig,
553-
maybeControllingEm,
554-
),
555-
listener.map(_.toClassic),
556-
),
557-
evcsInput.getId,
558-
)
559-
.toTyped
560-
introduceAgentToEnvironment(participant)
561-
562-
participant
563-
}
564-
565486
/** Builds an [[HpAgent]] from given input
566487
*
567488
* @param hpInput

src/main/scala/edu/ie3/simona/agent/participant/ServiceRegistration.scala

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
package edu.ie3.simona.agent.participant
88

99
import org.apache.pekko.actor.ActorRef
10-
import edu.ie3.datamodel.models.input.system.{EvcsInput, SystemParticipantInput}
10+
import edu.ie3.datamodel.models.input.system.SystemParticipantInput
1111
import edu.ie3.simona.agent.participant.data.Data.PrimaryData.PrimaryDataWithComplexPower
1212
import edu.ie3.simona.agent.participant.data.Data.SecondaryData
1313
import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService
1414
import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService.{
15-
ActorExtEvDataService,
1615
ActorPriceService,
1716
ActorWeatherService,
1817
}
@@ -24,7 +23,6 @@ import edu.ie3.simona.model.participant.{
2423
ModelState,
2524
SystemParticipant,
2625
}
27-
import edu.ie3.simona.ontology.messages.services.EvMessage.RegisterForEvDataMessage
2826
import edu.ie3.simona.ontology.messages.services.WeatherMessage.RegisterForWeatherMessage
2927

3028
trait ServiceRegistration[
@@ -89,9 +87,6 @@ trait ServiceRegistration[
8987
case ActorWeatherService(serviceRef) =>
9088
registerForWeather(serviceRef, participantRef, inputModel)
9189
Some(serviceRef)
92-
case ActorExtEvDataService(serviceRef) =>
93-
registerForEvData(serviceRef, inputModel)
94-
Some(serviceRef)
9590
}
9691

9792
/** Register for the weather service
@@ -125,27 +120,4 @@ trait ServiceRegistration[
125120
serviceRef ! RegisterForWeatherMessage(participantRef, lat, lon)
126121
}
127122

128-
/** Register for the EV movement service
129-
*
130-
* @param serviceRef
131-
* Actor reference of the EV movements service
132-
* @param inputModel
133-
* Input model of the simulation mode
134-
* @return
135-
*/
136-
private def registerForEvData(
137-
serviceRef: ActorRef,
138-
inputModel: I,
139-
): Unit = {
140-
inputModel match {
141-
case evcsInput: EvcsInput =>
142-
serviceRef ! RegisterForEvDataMessage(evcsInput.getUuid)
143-
case _ =>
144-
throw new ServiceRegistrationException(
145-
s"Cannot register for EV movements information at node ${inputModel.getNode.getId} " +
146-
s"(${inputModel.getNode.getUuid}) of type ${inputModel.getClass.getName}, because only Evcs can register for this."
147-
)
148-
}
149-
}
150-
151123
}

src/main/scala/edu/ie3/simona/agent/participant/evcs/EvcsAgent.scala

Lines changed: 0 additions & 185 deletions
This file was deleted.

0 commit comments

Comments
 (0)