From 3ff9363bfb56ca0b315ecb95c341b168fa9b19ad Mon Sep 17 00:00:00 2001 From: Sebastian Peter Date: Thu, 8 Feb 2024 16:39:53 +0100 Subject: [PATCH 1/2] Setting config for trailing commas --- .scalafmt.conf | 4 ++++ gradle/scripts/spotless.gradle | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index e69de29bb2..b9ff87f158 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -0,0 +1,4 @@ +version = 3.7.3 +runner.dialect = scala213 + +rewrite.trailingCommas.style = multiple diff --git a/gradle/scripts/spotless.gradle b/gradle/scripts/spotless.gradle index 525b407e68..104ff70c86 100644 --- a/gradle/scripts/spotless.gradle +++ b/gradle/scripts/spotless.gradle @@ -34,7 +34,7 @@ spotless { //sets a license header, removes unused imports and formats conforming to the scala fmt formatter scala { - scalafmt() + scalafmt().configFile(".scalafmt.conf") licenseHeader ie3LicHead, "package.*\\n" } From c3f3f5a49ab7beb132b0058f3f8dc4a72a68ec1d Mon Sep 17 00:00:00 2001 From: Sebastian Peter Date: Thu, 8 Feb 2024 16:40:21 +0100 Subject: [PATCH 2/2] Applying trailing commas --- .../edu/ie3/simona/actor/ActorUtil.scala | 2 +- .../ie3/simona/agent/EnvironmentRefs.scala | 2 +- .../edu/ie3/simona/agent/SimonaAgent.scala | 2 +- .../edu/ie3/simona/agent/ValueStore.scala | 8 +- .../ie3/simona/agent/grid/DBFSAlgorithm.scala | 180 +- .../edu/ie3/simona/agent/grid/GridAgent.scala | 36 +- .../agent/grid/GridAgentController.scala | 80 +- .../ie3/simona/agent/grid/GridAgentData.scala | 58 +- .../simona/agent/grid/GridEnvironment.scala | 2 +- .../agent/grid/GridResultsSupport.scala | 86 +- .../simona/agent/grid/PowerFlowParams.scala | 2 +- .../simona/agent/grid/PowerFlowSupport.scala | 72 +- .../agent/grid/ReceivedValuesStore.scala | 22 +- .../simona/agent/grid/SweepValueStore.scala | 4 +- .../agent/participant/ParticipantAgent.scala | 140 +- .../ParticipantAgentFundamentals.scala | 278 +-- .../participant/ServiceRegistration.scala | 16 +- .../simona/agent/participant/data/Data.scala | 18 +- .../agent/participant/evcs/EvcsAgent.scala | 32 +- .../evcs/EvcsAgentFundamentals.scala | 134 +- .../fixedfeedin/FixedFeedInAgent.scala | 10 +- .../FixedFeedInAgentFundamentals.scala | 68 +- .../simona/agent/participant/hp/HpAgent.scala | 12 +- .../participant/hp/HpAgentFundamentals.scala | 76 +- .../agent/participant/load/LoadAgent.scala | 32 +- .../load/LoadAgentFundamentals.scala | 114 +- .../simona/agent/participant/pv/PvAgent.scala | 14 +- .../participant/pv/PvAgentFundamentals.scala | 68 +- .../participant/statedata/BaseStateData.scala | 22 +- .../statedata/DataCollectionStateData.scala | 2 +- .../statedata/InitializeStateData.scala | 2 +- .../statedata/ParticipantStateData.scala | 36 +- .../agent/participant/wec/WecAgent.scala | 12 +- .../wec/WecAgentFundamentals.scala | 70 +- .../ie3/simona/agent/state/AgentState.scala | 2 +- .../edu/ie3/simona/api/ExtSimAdapter.scala | 14 +- .../edu/ie3/simona/config/ArgsParser.scala | 6 +- .../ie3/simona/config/ConfigFailFast.scala | 38 +- .../ie3/simona/config/RefSystemParser.scala | 4 +- .../edu/ie3/simona/config/SimonaConfig.scala | 622 +++--- .../edu/ie3/simona/config/VoltLvlParser.scala | 10 +- .../edu/ie3/simona/event/ResultEvent.scala | 6 +- .../edu/ie3/simona/event/RuntimeEvent.scala | 2 +- .../event/listener/ResultEventListener.scala | 42 +- .../event/listener/RuntimeEventListener.scala | 14 +- .../listener/SimonaListenerWithFilter.scala | 2 +- .../listener/Transformer3wResultSupport.scala | 18 +- .../event/notifier/NotifierConfig.scala | 2 +- .../exceptions/WeatherServiceException.scala | 8 +- .../ie3/simona/io/grid/CsvGridSource.scala | 6 +- .../edu/ie3/simona/io/grid/GridProvider.scala | 10 +- .../io/result/ResultEntityCsvSink.scala | 6 +- .../io/result/ResultEntityInfluxDbSink.scala | 2 +- .../io/result/ResultEntityKafkaSink.scala | 18 +- .../ie3/simona/io/result/ResultSinkType.scala | 8 +- .../simona/io/result/plain/PlainResult.scala | 2 +- .../simona/io/result/plain/PlainWriter.scala | 4 +- .../io/runtime/RuntimeEventKafkaSink.scala | 16 +- .../io/runtime/RuntimeEventLogSink.scala | 2 +- .../io/runtime/RuntimeEventQueueSink.scala | 2 +- .../simona/io/runtime/RuntimeEventSink.scala | 2 +- .../logging/SimonaFSMActorLogging.scala | 2 +- .../ie3/simona/logging/SimonaLogging.scala | 12 +- .../logback/LogbackConfiguration.scala | 4 +- .../scala/edu/ie3/simona/main/RunSimona.scala | 2 +- .../ie3/simona/main/RunSimonaStandalone.scala | 4 +- .../ie3/simona/model/SystemComponent.scala | 6 +- .../edu/ie3/simona/model/em/EmTools.scala | 6 +- .../edu/ie3/simona/model/grid/GridModel.scala | 62 +- .../edu/ie3/simona/model/grid/LineModel.scala | 24 +- .../edu/ie3/simona/model/grid/NodeModel.scala | 10 +- .../model/grid/PiEquivalentCircuit.scala | 2 +- .../edu/ie3/simona/model/grid/RefSystem.scala | 14 +- .../ie3/simona/model/grid/SwitchModel.scala | 10 +- .../model/grid/Transformer3wModel.scala | 56 +- .../grid/Transformer3wPowerFlowCase.scala | 2 +- .../simona/model/grid/TransformerModel.scala | 30 +- .../model/grid/TransformerTapping.scala | 2 +- .../model/grid/TransformerTappingModel.scala | 8 +- .../ApparentPowerAndHeatParticipant.scala | 6 +- .../ApparentPowerParticipant.scala | 2 +- .../simona/model/participant/BMModel.scala | 20 +- .../simona/model/participant/ChpModel.scala | 34 +- .../model/participant/FixedFeedInModel.scala | 20 +- .../participant/FlexChangeIndicator.scala | 2 +- .../simona/model/participant/HpModel.scala | 50 +- .../simona/model/participant/PvModel.scala | 58 +- .../model/participant/SystemParticipant.scala | 30 +- .../simona/model/participant/WecModel.scala | 28 +- .../model/participant/control/QControl.scala | 16 +- .../participant/evcs/EvModelWrapper.scala | 4 +- .../model/participant/evcs/EvcsModel.scala | 118 +- .../uncontrolled/ConstantPowerCharging.scala | 4 +- .../uncontrolled/MaximumPowerCharging.scala | 4 +- .../participant/load/FixedLoadModel.scala | 12 +- .../model/participant/load/LoadModel.scala | 16 +- .../participant/load/LoadReference.scala | 2 +- .../load/profile/LoadProfileKey.scala | 12 +- .../load/profile/LoadProfileStore.scala | 6 +- .../load/profile/ProfileLoadModel.scala | 14 +- .../load/random/RandomLoadModel.scala | 18 +- .../load/random/RandomLoadParamStore.scala | 12 +- .../simona/model/system/Characteristic.scala | 6 +- .../thermal/CylindricalThermalStorage.scala | 26 +- .../model/thermal/RandomStorageState.scala | 2 +- .../simona/model/thermal/ThermalGrid.scala | 82 +- .../simona/model/thermal/ThermalHouse.scala | 62 +- .../simona/model/thermal/ThermalSink.scala | 2 +- .../simona/model/thermal/ThermalStorage.scala | 6 +- .../ontology/messages/PowerMessage.scala | 10 +- .../ontology/messages/SchedulerMessage.scala | 4 +- .../ontology/messages/VoltageMessage.scala | 6 +- .../messages/flex/FlexibilityMessage.scala | 8 +- .../flex/MinMaxFlexibilityMessage.scala | 6 +- .../messages/services/EvMessage.scala | 8 +- .../services/PrimaryDataMessage.scala | 2 +- .../messages/services/ServiceMessage.scala | 4 +- .../messages/services/WeatherMessage.scala | 8 +- .../simona/scheduler/RuntimeNotifier.scala | 14 +- .../ie3/simona/scheduler/ScheduleLock.scala | 22 +- .../edu/ie3/simona/scheduler/Scheduler.scala | 30 +- .../ie3/simona/scheduler/TimeAdvancer.scala | 28 +- .../edu/ie3/simona/scheduler/core/Core.scala | 2 +- .../scheduler/core/PhaseSwitchCore.scala | 14 +- .../scheduler/core/RegularSchedulerCore.scala | 10 +- .../ie3/simona/service/SimonaService.scala | 18 +- .../simona/service/ev/ExtEvDataService.scala | 42 +- .../service/primary/PrimaryServiceProxy.scala | 94 +- .../primary/PrimaryServiceWorker.scala | 58 +- .../service/weather/SampleWeatherSource.scala | 14 +- .../service/weather/WeatherService.scala | 48 +- .../service/weather/WeatherSource.scala | 56 +- .../weather/WeatherSourceWrapper.scala | 62 +- .../scala/edu/ie3/simona/sim/SimonaSim.scala | 26 +- .../simona/sim/setup/ExtSimSetupData.scala | 2 +- .../ie3/simona/sim/setup/SetupHelper.scala | 26 +- .../ie3/simona/sim/setup/SimonaSetup.scala | 14 +- .../sim/setup/SimonaStandaloneSetup.scala | 74 +- .../edu/ie3/simona/util/CollectionUtils.scala | 4 +- .../edu/ie3/simona/util/ConfigUtil.scala | 58 +- .../ie3/simona/util/EntityMapperUtil.scala | 4 +- .../edu/ie3/simona/util/ReceiveDataMap.scala | 10 +- .../ie3/simona/util/ResultFileHierarchy.scala | 20 +- .../scala/edu/ie3/simona/util/TickUtil.scala | 2 +- .../edu/ie3/util/scala/ReflectionTools.scala | 2 +- .../immutable/PrioritySwitchBiSet.scala | 14 +- .../mutable/PriorityMultiBiSet.scala | 12 +- .../util/scala/io/GraphicDataCleaner.scala | 4 +- .../util/scala/io/ScalaReflectionSerde.scala | 6 +- .../util/scala/quantities/EnergyDensity.scala | 2 +- .../util/scala/quantities/EnergyPrice.scala | 2 +- .../util/scala/quantities/QuantityUtil.scala | 16 +- .../util/scala/quantities/ReactivePower.scala | 2 +- .../scala/quantities/ScalaNumberSystem.scala | 2 +- .../quantities/SpecificHeatCapacity.scala | 6 +- .../scala/quantities/ThermalConductance.scala | 4 +- .../edu/ie3/simona/agent/ValueStoreSpec.scala | 8 +- .../agent/grid/DBFSAlgorithmCenGridSpec.scala | 116 +- .../DBFSAlgorithmFailedPowerFlowSpec.scala | 42 +- .../grid/DBFSAlgorithmParticipantSpec.scala | 54 +- .../agent/grid/DBFSAlgorithmSupGridSpec.scala | 36 +- .../agent/grid/DBFSMockGridAgents.scala | 18 +- .../agent/grid/GridAgentDataHelperSpec.scala | 22 +- .../agent/grid/GridAgentSetup2WSpec.scala | 20 +- .../agent/grid/GridAgentSetup3WSpec.scala | 22 +- .../agent/grid/GridResultsSupportSpec.scala | 104 +- .../agent/grid/PowerFlowSupportSpec.scala | 72 +- .../agent/grid/ReceivedValuesStoreSpec.scala | 26 +- .../EvcsAgentModelCalculationSpec.scala | 258 +-- ...FixedFeedInAgentModelCalculationSpec.scala | 58 +- .../HpAgentModelCalculationSpec.scala | 138 +- .../LoadAgentFixedModelCalculationSpec.scala | 58 +- ...LoadAgentProfileModelCalculationSpec.scala | 52 +- .../ParticipantAgent2ListenerSpec.scala | 44 +- .../ParticipantAgentExternalSourceSpec.scala | 146 +- .../ParticipantAgentFundamentalsSpec.scala | 150 +- .../participant/ParticipantAgentMock.scala | 98 +- .../PvAgentModelCalculationSpec.scala | 132 +- .../agent/participant/RichValueSpec.scala | 42 +- .../WecAgentModelCalculationSpec.scala | 150 +- .../ie3/simona/api/ExtSimAdapterSpec.scala | 12 +- .../simona/config/ConfigFailFastSpec.scala | 70 +- .../simona/config/RefSystemParserSpec.scala | 40 +- .../edu/ie3/simona/deploy/DeploySpec.scala | 2 +- .../edu/ie3/simona/event/NotifierSpec.scala | 6 +- .../ie3/simona/event/SimonaListenerSpec.scala | 8 +- .../listener/ResultEventListenerSpec.scala | 62 +- .../RuntimeEventListenerKafkaSpec.scala | 18 +- .../listener/RuntimeEventListenerSpec.scala | 28 +- .../ThreeWindingResultHandlingSpec.scala | 16 +- .../listener/ThreeWindingResultTestData.scala | 8 +- .../integration/RunSimonaStandaloneIT.scala | 14 +- .../io/file/ResultFileHierarchySpec.scala | 8 +- .../io/result/ResultEntityCsvSinkSpec.scala | 16 +- .../io/result/ResultEntityKafkaSpec.scala | 26 +- .../simona/io/result/ResultSinkTypeSpec.scala | 22 +- .../io/result/plain/PlainWriterSpec.scala | 6 +- .../model/assets/control/QControlSpec.scala | 20 +- .../edu/ie3/simona/model/grid/GridSpec.scala | 40 +- .../edu/ie3/simona/model/grid/LineSpec.scala | 8 +- .../model/grid/NodeInputModelSpec.scala | 4 +- .../simona/model/grid/SwitchModelSpec.scala | 4 +- .../model/grid/SystemComponentSpec.scala | 4 +- .../model/grid/Transformer3wModelSpec.scala | 64 +- .../model/grid/TransformerModelSpec.scala | 40 +- .../ApparentPowerAndHeatSpec.scala | 20 +- .../participant/FixedFeedInModelSpec.scala | 6 +- .../model/participant/HpModelSpec.scala | 60 +- .../model/participant/HpModelTestData.scala | 30 +- .../participant/evcs/EvcsModelSpec.scala | 142 +- .../ConstantPowerChargingSpec.scala | 26 +- .../MaximumPowerChargingSpec.scala | 26 +- .../load/LoadModelScalingSpec.scala | 64 +- .../participant/load/LoadModelSpec.scala | 20 +- .../load/LoadProfileStoreSpec.scala | 18 +- .../load/ProfileLoadModelSpec.scala | 24 +- .../load/RandomLoadModelSpec.scala | 18 +- .../load/RandomLoadParamStoreSpec.scala | 28 +- .../load/TypeDayParametersSpec.scala | 6 +- .../model/thermal/ThermalGridSpec.scala | 4 +- .../model/thermal/ThermalGridTestData.scala | 2 +- .../ThermalGridWithHouseAndStorageSpec.scala | 90 +- .../ThermalGridWithHouseOnlySpec.scala | 42 +- .../ThermalGridWithStorageOnlySpec.scala | 40 +- .../model/thermal/ThermalHouseTestData.scala | 4 +- .../thermal/ThermalStorageTestData.scala | 6 +- .../flex/MinMaxFlexibilityMessageTest.scala | 8 +- .../scheduler/PhaseSwitchSchedulerSpec.scala | 26 +- .../ie3/simona/scheduler/ScheduleLockIT.scala | 22 +- .../simona/scheduler/ScheduleLockSpec.scala | 4 +- .../ie3/simona/scheduler/SchedulerSpec.scala | 40 +- .../simona/scheduler/TimeAdvancerSpec.scala | 24 +- .../service/ev/ExtEvDataServiceSpec.scala | 56 +- .../primary/PrimaryServiceProxySpec.scala | 124 +- .../primary/PrimaryServiceProxySqlIT.scala | 24 +- .../primary/PrimaryServiceWorkerSpec.scala | 50 +- .../primary/PrimaryServiceWorkerSqlIT.scala | 32 +- .../weather/SampleWeatherSourceSpec.scala | 10 +- .../service/weather/WeatherServiceSpec.scala | 34 +- .../service/weather/WeatherSourceSpec.scala | 88 +- .../weather/WeatherSourceWrapperSpec.scala | 72 +- .../ie3/simona/sim/SimonaSimFailSpec.scala | 28 +- .../simona/sim/setup/SetupHelperSpec.scala | 18 +- .../simona/sim/setup/SimonaSetupSpec.scala | 16 +- .../edu/ie3/simona/test/KafkaSpecLike.scala | 4 +- .../simona/test/common/DefaultTestData.scala | 6 +- .../ie3/simona/test/common/EvTestData.scala | 4 +- .../test/common/SilentTestEventListener.scala | 2 +- .../test/common/ThreeWindingTestData.scala | 20 +- .../CylindricalStorageInputTestData.scala | 4 +- .../test/common/input/EvcsInputTestData.scala | 4 +- .../common/input/FixedFeedInputTestData.scala | 2 +- .../test/common/input/GridInputTestData.scala | 14 +- .../test/common/input/LineInputTestData.scala | 30 +- .../test/common/input/LoadInputTestData.scala | 2 +- .../test/common/input/NodeInputTestData.scala | 12 +- .../test/common/input/PvInputTestData.scala | 2 +- .../common/input/SwitchInputTestData.scala | 6 +- .../common/input/TimeSeriesTestData.scala | 6 +- .../common/input/Transformer3wTestData.scala | 76 +- .../input/TransformerInputTestData.scala | 18 +- .../test/common/input/WecInputTestData.scala | 2 +- .../common/input/WecTypeInputTestData.scala | 2 +- .../test/common/model/grid/BasicGrid.scala | 10 +- .../model/grid/BasicGridWithSwitches.scala | 42 +- .../test/common/model/grid/DbfsTestGrid.scala | 74 +- .../grid/DbfsTestGridWithParticipants.scala | 24 +- .../model/grid/FiveLinesWithNodes.scala | 46 +- .../common/model/grid/SubGridGateMokka.scala | 10 +- .../test/common/model/grid/TapTestData.scala | 88 +- .../model/grid/TransformerTestData.scala | 1858 ++++++++--------- .../model/grid/TransformerTestGrid.scala | 32 +- .../common/model/participant/HpTestData.scala | 14 +- .../model/participant/LoadTestData.scala | 2 +- .../common/result/PowerFlowResultData.scala | 12 +- .../test/matchers/QuantityMatchers.scala | 18 +- .../test/matchers/QuantityMatchersSpec.scala | 4 +- .../test/matchers/SquantsMatchers.scala | 2 +- .../edu/ie3/simona/util/ActorUtils.scala | 4 +- .../ie3/simona/util/CollectionUtilsSpec.scala | 6 +- .../edu/ie3/simona/util/ConfigUtilSpec.scala | 118 +- .../edu/ie3/simona/util/TestGridFactory.scala | 20 +- .../ie3/util/quantities/IrradianceSpec.scala | 2 +- .../ie3/util/quantities/IrradiationSpec.scala | 2 +- .../util/quantities/QuantityUtilSpec.scala | 26 +- .../quantities/SpecificHeatCapacitySpec.scala | 4 +- .../quantities/ThermalConductanceSpec.scala | 4 +- 287 files changed, 5396 insertions(+), 5396 deletions(-) diff --git a/src/main/scala/edu/ie3/simona/actor/ActorUtil.scala b/src/main/scala/edu/ie3/simona/actor/ActorUtil.scala index 6f59446915..bfe44d97ad 100644 --- a/src/main/scala/edu/ie3/simona/actor/ActorUtil.scala +++ b/src/main/scala/edu/ie3/simona/actor/ActorUtil.scala @@ -12,7 +12,7 @@ import org.apache.pekko.actor.typed.scaladsl.{ActorContext, Behaviors} object ActorUtil { def stopOnError[M]( ctx: ActorContext[M], - msg: String + msg: String, ): Behavior[M] = { ctx.log.error(s"$msg. Stopping.") Behaviors.stopped diff --git a/src/main/scala/edu/ie3/simona/agent/EnvironmentRefs.scala b/src/main/scala/edu/ie3/simona/agent/EnvironmentRefs.scala index af7b168e41..2179b90202 100644 --- a/src/main/scala/edu/ie3/simona/agent/EnvironmentRefs.scala +++ b/src/main/scala/edu/ie3/simona/agent/EnvironmentRefs.scala @@ -27,5 +27,5 @@ final case class EnvironmentRefs( runtimeEventListener: ActorRef, primaryServiceProxy: ActorRef, weather: ActorRef, - evDataService: Option[ActorRef] + evDataService: Option[ActorRef], ) diff --git a/src/main/scala/edu/ie3/simona/agent/SimonaAgent.scala b/src/main/scala/edu/ie3/simona/agent/SimonaAgent.scala index cfdd3372c3..ff916942fd 100644 --- a/src/main/scala/edu/ie3/simona/agent/SimonaAgent.scala +++ b/src/main/scala/edu/ie3/simona/agent/SimonaAgent.scala @@ -37,7 +37,7 @@ trait SimonaAgent[D] case Event(Status.Failure(ex), _) => log.error( ex, - "Received a failure status message with following exception." + "Received a failure status message with following exception.", ) self ! PoisonPill stay() diff --git a/src/main/scala/edu/ie3/simona/agent/ValueStore.scala b/src/main/scala/edu/ie3/simona/agent/ValueStore.scala index 38fea13e80..a21f7d0f58 100644 --- a/src/main/scala/edu/ie3/simona/agent/ValueStore.scala +++ b/src/main/scala/edu/ie3/simona/agent/ValueStore.scala @@ -22,7 +22,7 @@ import scala.collection.SortedMap */ final case class ValueStore[+D]( maxTickSpan: Long, - private val store: SortedMap[Long, D] = SortedMap.empty[Long, D] + private val store: SortedMap[Long, D] = SortedMap.empty[Long, D], ) { /** Determine the lastly known data tick, if available. Includes the given @@ -105,11 +105,11 @@ object ValueStore { */ def forVoltage( maxTickSpan: Long, - initialPerUnit: Dimensionless + initialPerUnit: Dimensionless, ): ValueStore[Dimensionless] = new ValueStore( maxTickSpan, - SortedMap(SimonaConstants.FIRST_TICK_IN_SIMULATION -> initialPerUnit) + SortedMap(SimonaConstants.FIRST_TICK_IN_SIMULATION -> initialPerUnit), ) /** Create a value store for result values. A result value store requires a @@ -144,7 +144,7 @@ object ValueStore { def updateValueStore[D]( valueStore: ValueStore[D], tick: Long, - newEntry: D + newEntry: D, ): ValueStore[D] = { val updatedStore = valueStore.store ++ SortedMap(tick -> newEntry) diff --git a/src/main/scala/edu/ie3/simona/agent/grid/DBFSAlgorithm.scala b/src/main/scala/edu/ie3/simona/agent/grid/DBFSAlgorithm.scala index 309fb1b7ef..1cab5c0589 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/DBFSAlgorithm.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/DBFSAlgorithm.scala @@ -22,7 +22,7 @@ import edu.ie3.powerflow.model.enums.NodeType import edu.ie3.simona.agent.grid.GridAgent._ import edu.ie3.simona.agent.grid.GridAgentData.{ GridAgentBaseData, - PowerFlowDoneData + PowerFlowDoneData, } import edu.ie3.simona.agent.grid.ReceivedValues._ import edu.ie3.simona.agent.state.AgentState @@ -30,7 +30,7 @@ import edu.ie3.simona.agent.state.AgentState.Idle import edu.ie3.simona.agent.state.GridAgentState.{ CheckPowerDifferences, HandlePowerFlowCalculations, - SimulateGrid + SimulateGrid, } import edu.ie3.simona.event.RuntimeEvent.PowerFlowFailed import edu.ie3.simona.exceptions.agent.DBFSAlgorithmException @@ -41,7 +41,7 @@ import edu.ie3.simona.ontology.messages.SchedulerMessage.Completion import edu.ie3.simona.ontology.messages.VoltageMessage.ProvideSlackVoltageMessage.ExchangeVoltage import edu.ie3.simona.ontology.messages.VoltageMessage.{ ProvideSlackVoltageMessage, - RequestSlackVoltageMessage + RequestSlackVoltageMessage, } import edu.ie3.simona.util.TickUtil.TickLong import edu.ie3.util.scala.quantities.Megavars @@ -69,7 +69,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { // we start with a forward-sweep by requesting the data from our child assets and grids (if any) case Event( Activation(currentTick), - gridAgentBaseData: GridAgentBaseData + gridAgentBaseData: GridAgentBaseData, ) => log.debug("Start sweep number: {}", gridAgentBaseData.currentSweepNo) // hold tick and trigger for the whole time the dbfs is executed or @@ -85,7 +85,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { .get(gridAgentBaseData.currentSweepNo), gridAgentBaseData.gridEnv.nodeToAssetAgents, gridAgentBaseData.gridEnv.gridModel.mainRefSystem, - gridAgentBaseData.powerFlowParams.sweepTimeout + gridAgentBaseData.powerFlowParams.sweepTimeout, ) // 2. inferior grids p/q values @@ -93,7 +93,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { gridAgentBaseData.currentSweepNo, gridAgentBaseData.gridEnv.subgridGateToActorRef, gridAgentBaseData.inferiorGridGates, - gridAgentBaseData.powerFlowParams.sweepTimeout + gridAgentBaseData.powerFlowParams.sweepTimeout, ) // 3. superior grids slack voltage @@ -101,7 +101,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { gridAgentBaseData.currentSweepNo, gridAgentBaseData.gridEnv.subgridGateToActorRef, gridAgentBaseData.superiorGridGates, - gridAgentBaseData.powerFlowParams.sweepTimeout + gridAgentBaseData.powerFlowParams.sweepTimeout, ) stay() @@ -109,7 +109,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { // if we receive power values as response on our request, we process them here case Event( receivedValues: ReceivedValues, - gridAgentBaseData: GridAgentBaseData + gridAgentBaseData: GridAgentBaseData, ) => // we just received either all provided slack voltage values or all provided power values val updatedGridAgentBaseData: GridAgentBaseData = receivedValues match { @@ -137,31 +137,31 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { if (allValuesReceived) "Got answers for all my requests for Slack Voltages and Power Values." else - "Still waiting for answers my requests for Slack Voltages and Power Values." + "Still waiting for answers my requests for Slack Voltages and Power Values.", ) if (gridAgentBaseData.isSuperior) { goToCheckPowerDifferencesOrStay( allValuesReceived, - updatedGridAgentBaseData + updatedGridAgentBaseData, ) } else { goToPowerFlowCalculationOrStay( allValuesReceived, - updatedGridAgentBaseData + updatedGridAgentBaseData, ) } // if we receive a request for slack voltages from our inferior grids we want to answer it case Event( RequestSlackVoltageMessage(currentSweepNo, nodeUuids), - gridAgentBaseData: GridAgentBaseData + gridAgentBaseData: GridAgentBaseData, ) => log.debug( s"Received Slack Voltages request from {} for nodes {} and sweepNo: {}", sender(), nodeUuids, - gridAgentBaseData.currentSweepNo + gridAgentBaseData.currentSweepNo, ) nodeUuids.map { nodeUuid => @@ -177,7 +177,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { log.debug( "Unable to find slack voltage for nodes '{}' in sweep '{}'. Try to get voltage of previous sweep.", nodeUuids, - currentSweepNo + currentSweepNo, ) gridAgentBaseData.sweepValueStores .get(currentSweepNo - 1) @@ -191,7 +191,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { gridAgentBaseData.gridEnv.gridModel.mainRefSystem ( mainRefSystem.vInSi(slackVoltageInPu.real), - mainRefSystem.vInSi(slackVoltageInPu.imag) + mainRefSystem.vInSi(slackVoltageInPu.imag), ) case None => throw new DBFSAlgorithmException( @@ -205,7 +205,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { "Unable to get slack voltage for node '{}' in sweeps '{}' and '{}'. Returning target voltage.", nodeUuid, currentSweepNo, - currentSweepNo - 1 + currentSweepNo - 1, ) val refSystem = @@ -224,7 +224,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { ( vSlack, - refSystem.vInSi(0d) + refSystem.vInSi(0d), ) } match { case (slackE, slackF) => @@ -233,7 +233,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { s"$slackE, $slackF", sender(), nodeUuid, - gridAgentBaseData.currentSweepNo + gridAgentBaseData.currentSweepNo, ) ExchangeVoltage(nodeUuid, slackE, slackF) @@ -242,7 +242,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { case exchangeVoltages => stay() replying ProvideSlackVoltageMessage( currentSweepNo, - exchangeVoltages + exchangeVoltages, ) } @@ -251,12 +251,12 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { // / or trigger a new run for the next sweepNo case Event( RequestGridPowerMessage(requestSweepNo, _), - gridAgentBaseData: GridAgentBaseData + gridAgentBaseData: GridAgentBaseData, ) => if (gridAgentBaseData.currentSweepNo == requestSweepNo) { log.debug( s"Received request for grid power values for sweepNo {} before my first power flow calc. Stashing away.", - requestSweepNo + requestSweepNo, ) stash() stay() @@ -264,7 +264,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { log.debug( s"Received request for grid power values for a NEW sweep (request: {}, my: {})", requestSweepNo, - gridAgentBaseData.currentSweepNo + gridAgentBaseData.currentSweepNo, ) self ! PrepareNextSweepTrigger(currentTick) @@ -278,8 +278,8 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { powerFlowDoneData @ PowerFlowDoneData( gridAgentBaseData, powerFlowResult, - pendingRequestAnswers - ) + pendingRequestAnswers, + ), ) => /* Determine the subgrid number of the grid agent, that has sent the request */ val firstRequestedNodeUuid = requestedNodeUuids.headOption.getOrElse( @@ -319,13 +319,13 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { // (Inferior grid is a feed in facility to superior grid, which is negative then). Analogously for load case. ( refSystem.pInSi(pInPu) * (-1), - refSystem.qInSi(qInPu) * (-1) + refSystem.qInSi(qInPu) * (-1), ) case _ => /* TODO: As long as there are no multiple slack nodes, provide "real" power only for the slack node */ ( Megawatts(0d), - Megavars(0d) + Megavars(0d), ) } .getOrElse { @@ -338,7 +338,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { ProvideGridPowerMessage.ExchangePower( nodeUuid, p, - q + q, ) } @@ -355,7 +355,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { gridAgentBaseData.storeSweepDataAndClearReceiveMaps( validNewtonRaphsonPFResult, gridAgentBaseData.superiorGridNodeUuids, - gridAgentBaseData.inferiorGridGates + gridAgentBaseData.inferiorGridGates, ) } else { powerFlowDoneData.copy(pendingRequestAnswers = @@ -385,14 +385,14 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { // based on the just carried out power flow case Event( PrepareNextSweepTrigger(_), - gridAgentBaseData: GridAgentBaseData + gridAgentBaseData: GridAgentBaseData, ) => // request the updated slack voltages from the superior grid askSuperiorGridsForSlackVoltages( gridAgentBaseData.currentSweepNo, gridAgentBaseData.gridEnv.subgridGateToActorRef, gridAgentBaseData.superiorGridGates, - gridAgentBaseData.powerFlowParams.sweepTimeout + gridAgentBaseData.powerFlowParams.sweepTimeout, ) log.debug(s"Going to {}", HandlePowerFlowCalculations) @@ -403,7 +403,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { // b) cleanup of receiveMaps and sweepStore case Event( FinishGridSimulationTrigger(currentTick), - gridAgentBaseData: GridAgentBaseData + gridAgentBaseData: GridAgentBaseData, ) => // inform my child grids about the end of this grid simulation gridAgentBaseData.inferiorGridGates @@ -426,7 +426,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { log.debug("Calculate results and sending the results to the listener ...") createAndSendPowerFlowResults( gridAgentBaseData, - currentTick.toDateTime(simStartTime) + currentTick.toDateTime(simStartTime), ) // do my cleanup stuff @@ -436,7 +436,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { val cleanedGridAgentBaseData = GridAgentBaseData.clean( gridAgentBaseData, gridAgentBaseData.superiorGridNodeUuids, - gridAgentBaseData.inferiorGridGates + gridAgentBaseData.inferiorGridGates, ) // / release tick for the whole simulation (StartGridSimulationTrigger) @@ -445,7 +445,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { // / inform scheduler that we are done with the whole simulation and request new trigger for next time step environmentRefs.scheduler ! Completion( self.toTyped, - Some(currentTick + resolution) + Some(currentTick + resolution), ) // return to Idle @@ -462,11 +462,11 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { // main method for power flow calculations case Event( DoPowerFlowTrigger(currentTick, _), - gridAgentBaseData: GridAgentBaseData + gridAgentBaseData: GridAgentBaseData, ) => log.debug( "Received the following power values to the corresponding nodes: {}", - gridAgentBaseData.receivedValueStore.nodeToReceivedPower + gridAgentBaseData.receivedValueStore.nodeToReceivedPower, ) val gridModel = gridAgentBaseData.gridEnv.gridModel @@ -477,14 +477,14 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { gridModel.gridComponents.transformers3w, gridModel.nodeUuidToIndexMap, gridAgentBaseData.receivedValueStore, - gridModel.mainRefSystem + gridModel.mainRefSystem, ) newtonRaphsonPF( gridModel, gridAgentBaseData.powerFlowParams.maxIterations, operatingPoint, - slackNodeVoltages + slackNodeVoltages, )(gridAgentBaseData.powerFlowParams.epsilon) match { // if res is valid, ask our assets (if any) for updated power values based on the newly determined nodal voltages case validPowerFlowResult: ValidNewtonRaphsonPFResult => @@ -492,8 +492,8 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { "{}", composeValidNewtonRaphsonPFResultVoltagesDebugString( validPowerFlowResult, - gridModel - ) + gridModel, + ), ) val powerFlowDoneData = @@ -503,7 +503,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { SweepValueStore( validPowerFlowResult, gridModel.gridComponents.nodes, - gridModel.nodeUuidToIndexMap + gridModel.nodeUuidToIndexMap, ) ) askForAssetPowers( @@ -511,14 +511,14 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { sweepValueStoreOpt, gridAgentBaseData.gridEnv.nodeToAssetAgents, gridModel.mainRefSystem, - gridAgentBaseData.powerFlowParams.sweepTimeout + gridAgentBaseData.powerFlowParams.sweepTimeout, ) match { case None => // when we don't have assets we can skip another request for different asset behaviour due to changed // voltage values and go back to SimulateGrid directly log.debug( s"No generation or load assets in the grid. Going back to {}.", - SimulateGrid + SimulateGrid, ) unstashAll() // we can answer the stashed grid power requests now goto(SimulateGrid) using powerFlowDoneData @@ -541,7 +541,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { // of assets based on updated nodal voltages case Event( receivedPowerValues: ReceivedPowerValues, - powerFlowDoneData: PowerFlowDoneData + powerFlowDoneData: PowerFlowDoneData, ) => val gridAgentBaseData = powerFlowDoneData.gridAgentBaseData @@ -562,7 +562,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { case receivedPowers: ReceivedPowerValues => gridAgentBaseData.updateWithReceivedPowerValues( receivedPowers, - replace = true + replace = true, ) case unknownValuesReceived => throw new DBFSAlgorithmException( @@ -580,19 +580,19 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { if (readyForPowerFlow) "Got answers for all my requests for Slack Voltages and Power Values." else - "Still waiting for answers my requests for Slack Voltages and Power Values." + "Still waiting for answers my requests for Slack Voltages and Power Values.", ) goToPowerFlowCalculationOrStay( readyForPowerFlow, - updatedGridAgentBaseData + updatedGridAgentBaseData, ) } else { // no changes from assets, we want to go back to SimulateGrid and report the LF results to our parent grids if any requests log.debug( s"Assets have not changed their exchanged power or no voltage dependent behaviour. Going back to {}.", - SimulateGrid + SimulateGrid, ) unstashAll() // we can answer the stashed grid power requests now goto(SimulateGrid) using powerFlowDoneData @@ -604,7 +604,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { // updated power values for our power flow calculations case Event( receivedSlackValues: ReceivedSlackVoltageValues, - gridAgentBaseData: GridAgentBaseData + gridAgentBaseData: GridAgentBaseData, ) => log.debug( "Received Slack values for new forward sweep with same power but updated voltage values" @@ -616,7 +616,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { gridAgentBaseData.currentSweepNo - 1, throw new DBFSAlgorithmException( s"$actorName Unable to get results from previous sweep ${gridAgentBaseData.currentSweepNo - 1}!" - ) + ), ) val (operatingPoint, slackNodeVoltages) = @@ -625,29 +625,29 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { previousSweepData.sweepData, gridModel.gridComponents.transformers, gridModel.gridComponents.transformers3w, - gridModel.mainRefSystem + gridModel.mainRefSystem, ) newtonRaphsonPF( gridModel, gridAgentBaseData.powerFlowParams.maxIterations, operatingPoint, - slackNodeVoltages + slackNodeVoltages, )(gridAgentBaseData.powerFlowParams.epsilon) match { case validPowerFlowResult: ValidNewtonRaphsonPFResult => log.debug( "{}", composeValidNewtonRaphsonPFResultVoltagesDebugString( validPowerFlowResult, - gridModel - ) + gridModel, + ), ) // update the data val sweepValueStore = SweepValueStore( validPowerFlowResult, gridModel.gridComponents.nodes, - gridModel.nodeUuidToIndexMap + gridModel.nodeUuidToIndexMap, ) val updatedSweepValueStore = gridAgentBaseData.sweepValueStores + (gridAgentBaseData.currentSweepNo -> sweepValueStore) @@ -662,7 +662,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { Some(sweepValueStore), gridAgentBaseData.gridEnv.nodeToAssetAgents, gridModel.mainRefSystem, - gridAgentBaseData.powerFlowParams.sweepTimeout + gridAgentBaseData.powerFlowParams.sweepTimeout, ) // 2. inferior grids p/q values @@ -671,7 +671,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { gridAgentBaseData.currentSweepNo, gridAgentBaseData.gridEnv.subgridGateToActorRef, gridAgentBaseData.inferiorGridGates, - gridAgentBaseData.powerFlowParams.sweepTimeout + gridAgentBaseData.powerFlowParams.sweepTimeout, ) // when we don't have inferior grids and no assets both methods return None and we can skip doing another power @@ -704,7 +704,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { val powerFlowDoneData = PowerFlowDoneData( gridAgentBaseData, - failedNewtonRaphsonPFResult + failedNewtonRaphsonPFResult, ) log.warning( "Power flow with updated slack voltage did finally not converge!" @@ -719,7 +719,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { // by a superior grid arrives) case Event( _: RequestGridPowerMessage, - _: GridAgentBaseData + _: GridAgentBaseData, ) => log.debug("Received Request for Grid Power too early. Stashing away") stash() @@ -730,7 +730,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { // with its power flow calculation in this state as the request by a superior grid arrives) case Event( _: RequestGridPowerMessage, - _: PowerFlowDoneData + _: PowerFlowDoneData, ) => log.debug("Received Request for Grid Power too early. Stashing away") stash() @@ -743,7 +743,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { case Event( CheckPowerDifferencesTrigger(currentTick), - gridAgentBaseData: GridAgentBaseData + gridAgentBaseData: GridAgentBaseData, ) => log.debug("Starting the power differences check ...") val currentSweepNo = gridAgentBaseData.currentSweepNo @@ -759,7 +759,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { gridModel.nodeUuidToIndexMap, gridAgentBaseData.receivedValueStore, gridModel.mainRefSystem, - targetVoltageFromReceivedData = false + targetVoltageFromReceivedData = false, ) /* Regarding the power flow result of this grid, there are two cases. If this is the "highest" grid in a @@ -777,15 +777,15 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { gridModel, gridAgentBaseData.powerFlowParams.maxIterations, operationPoint, - slackNodeVoltages + slackNodeVoltages, )(gridAgentBaseData.powerFlowParams.epsilon) match { case validPowerFlowResult: ValidNewtonRaphsonPFResult => log.debug( "{}", composeValidNewtonRaphsonPFResultVoltagesDebugString( validPowerFlowResult, - gridModel - ) + gridModel, + ), ) validPowerFlowResult case result: PowerFlowResult.FailedPowerFlowResult => @@ -798,7 +798,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { .storeSweepDataAndClearReceiveMaps( validResult, gridAgentBaseData.superiorGridNodeUuids, - gridAgentBaseData.inferiorGridGates + gridAgentBaseData.inferiorGridGates, ) .copy(currentSweepNo = currentSweepNo + 1) @@ -808,7 +808,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { log.debug("Sweep value store is empty. Starting a second sweep ...") goToSimulateGridForNextSweepWith( updatedGridAgentBaseData, - currentTick + currentTick, ) } else { log.debug("Sweep value store is not empty. Check for deviation ...") @@ -821,7 +821,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { currentSweepNo - 1, throw new DBFSAlgorithmException( s"No data for previous sweep with no ${currentSweepNo - 1} available!" - ) + ), ) .sweepData .map(_.stateData.power) @@ -834,7 +834,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { currentSweepNo, throw new DBFSAlgorithmException( s"No data for current sweep with no $currentSweepNo available!" - ) + ), ) .sweepData .map(_.stateData.power) @@ -852,18 +852,18 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { case Some(deviation) => // next sweep log.debug( "Deviation between the last two sweeps: {}", - deviation + deviation, ) goToSimulateGridForNextSweepWith( updatedGridAgentBaseData, - currentTick + currentTick, ) case None => // we're done log.debug("We found a result! :-)") log.debug( "Final deviation: {}", - (previousSweepNodePower - currentSweepNodePower).toScalaVector + (previousSweepNodePower - currentSweepNodePower).toScalaVector, ) // go back to SimulateGrid and trigger a finish @@ -876,7 +876,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { log.warning( "Power flow for high voltage branch of three winding transformer failed after {} iterations. Cause: {}", failedResult.iteration, - failedResult.cause + failedResult.cause, ) self ! FinishGridSimulationTrigger(currentTick) handlePowerFlowFailure(gridAgentBaseData) @@ -904,7 +904,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { */ private def goToPowerFlowCalculationOrStay( allReceived: Boolean, - gridAgentBaseData: GridAgentBaseData + gridAgentBaseData: GridAgentBaseData, ): FSM.State[AgentState, GridAgentData] = { if (allReceived) { @@ -922,7 +922,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { unstashAll() // we want to answer the requests from our parent stay() using PowerFlowDoneData( gridAgentBaseData, - FailedNewtonRaphsonPFResult(-1, CalculationFailed) + FailedNewtonRaphsonPFResult(-1, CalculationFailed), ) } else { self ! DoPowerFlowTrigger(currentTick, gridAgentBaseData.currentSweepNo) @@ -964,7 +964,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { */ private def goToCheckPowerDifferencesOrStay( allReceived: Boolean, - gridAgentBaseData: GridAgentBaseData + gridAgentBaseData: GridAgentBaseData, ): FSM.State[AgentState, GridAgentData] = { if (allReceived) { log.debug("All power values of child assets + inferior grids received.") @@ -1022,13 +1022,13 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { */ private def goToSimulateGridForNextSweepWith( gridAgentBaseData: GridAgentBaseData, - currentTick: Long + currentTick: Long, ): FSM.State[AgentState, GridAgentData] = { releaseTick() environmentRefs.scheduler ! Completion( self.toTyped, - Some(currentTick) + Some(currentTick), ) goto(SimulateGrid) using gridAgentBaseData @@ -1060,7 +1060,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { sweepValueStore: Option[SweepValueStore], nodeToAssetAgents: Map[UUID, Set[ActorRef]], refSystem: RefSystem, - askTimeout: Duration + askTimeout: Duration, ): Option[Future[ReceivedPowerValues]] = { implicit val timeout: PekkoTimeout = PekkoTimeout.create(askTimeout) @@ -1090,19 +1090,19 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { ) ( refSystem.vInPu(eInSi), - refSystem.vInPu(fInSi) + refSystem.vInPu(fInSi), ) case None => ( Each(1d), - Each(0d) + Each(0d), ) } (assetAgent ? RequestAssetPowerMessage( currentTick, eInPu, - fInPU + fInPU, )).map { case providedPowerValuesMessage: AssetPowerChangedMessage => (assetAgent, providedPowerValuesMessage) @@ -1137,12 +1137,12 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { currentSweepNo: Int, subGridGateToActorRef: Map[SubGridGate, ActorRef], inferiorGridGates: Seq[SubGridGate], - askTimeout: Duration + askTimeout: Duration, ): Option[Future[ReceivedPowerValues]] = { implicit val timeout: PekkoTimeout = PekkoTimeout.create(askTimeout) log.debug( s"asking inferior grids for power values: {}", - inferiorGridGates + inferiorGridGates, ) Option.when(inferiorGridGates.nonEmpty) { Future @@ -1163,7 +1163,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { .map { case (inferiorGridAgentRef, inferiorGridGateNodes) => (inferiorGridAgentRef ? RequestGridPowerMessage( currentSweepNo, - inferiorGridGateNodes.distinct + inferiorGridGateNodes.distinct, )).map { case provideGridPowerMessage: ProvideGridPowerMessage => (inferiorGridAgentRef, provideGridPowerMessage) @@ -1196,12 +1196,12 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { currentSweepNo: Int, subGridGateToActorRef: Map[SubGridGate, ActorRef], superiorGridGates: Vector[SubGridGate], - askTimeout: Duration + askTimeout: Duration, ): Option[Future[ReceivedSlackVoltageValues]] = { implicit val timeout: PekkoTimeout = PekkoTimeout.create(askTimeout) log.debug( s"asking superior grids for slack voltage values: {}", - superiorGridGates + superiorGridGates, ) Option.when(superiorGridGates.nonEmpty) { @@ -1212,7 +1212,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { .map { case (superiorGridAgent, gridGates) => (superiorGridAgent ? RequestSlackVoltageMessage( currentSweepNo, - gridGates.map(_.superiorNode.getUuid) + gridGates.map(_.superiorNode.getUuid), )).map { case providedSlackValues: ProvideSlackVoltageMessage => (superiorGridAgent, providedSlackValues) } @@ -1238,14 +1238,14 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { */ def createAndSendPowerFlowResults( gridAgentBaseData: GridAgentBaseData, - currentTimestamp: ZonedDateTime + currentTimestamp: ZonedDateTime, ): Unit = { gridAgentBaseData.sweepValueStores.lastOption.foreach { case (_, valueStore) => notifyListener( this.createResultModels( gridAgentBaseData.gridEnv.gridModel, - valueStore + valueStore, )( currentTimestamp ) diff --git a/src/main/scala/edu/ie3/simona/agent/grid/GridAgent.scala b/src/main/scala/edu/ie3/simona/agent/grid/GridAgent.scala index b8677f607a..8ea4b12f5d 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/GridAgent.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/GridAgent.scala @@ -10,7 +10,7 @@ import edu.ie3.simona.agent.grid.GridAgent.Create import edu.ie3.simona.agent.grid.GridAgentData.{ GridAgentBaseData, GridAgentInitData, - GridAgentUninitializedData + GridAgentUninitializedData, } import edu.ie3.simona.agent.state.AgentState.{Idle, Uninitialized} import edu.ie3.simona.agent.state.GridAgentState.{Initializing, SimulateGrid} @@ -21,7 +21,7 @@ import edu.ie3.simona.model.grid.GridModel import edu.ie3.simona.ontology.messages.PowerMessage.RequestGridPowerMessage import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.{Activation, StopMessage} import edu.ie3.simona.scheduler.ScheduleLock.ScheduleKey @@ -39,13 +39,13 @@ object GridAgent { def props( environmentRefs: EnvironmentRefs, simonaConfig: SimonaConfig, - listener: Iterable[ActorRef] + listener: Iterable[ActorRef], ): Props = Props( new GridAgent( environmentRefs, simonaConfig, - listener + listener, ) ) @@ -56,7 +56,7 @@ object GridAgent { */ final case class Create( gridAgentInitData: GridAgentInitData, - unlockKey: ScheduleKey + unlockKey: ScheduleKey, ) /** Trigger used inside of [[edu.ie3.simona.agent.grid.DBFSAlgorithm]] to @@ -98,7 +98,7 @@ object GridAgent { class GridAgent( val environmentRefs: EnvironmentRefs, simonaConfig: SimonaConfig, - val listener: Iterable[ActorRef] + val listener: Iterable[ActorRef], ) extends SimonaAgent[GridAgentData] with DBFSAlgorithm with Stash { @@ -122,7 +122,7 @@ class GridAgent( simonaConfig.simona.output.participant, resolution, listener, - log + log, ) override def postStop(): Unit = { @@ -140,12 +140,12 @@ class GridAgent( when(Uninitialized) { case Event( Create(gridAgentInitData, unlockKey), - _ + _, ) => environmentRefs.scheduler ! ScheduleActivation( self.toTyped, INIT_SIM_TICK, - Some(unlockKey) + Some(unlockKey), ) goto(Initializing) using gridAgentInitData @@ -154,7 +154,7 @@ class GridAgent( when(Initializing) { case Event( Activation(INIT_SIM_TICK), - gridAgentInitData: GridAgentInitData + gridAgentInitData: GridAgentInitData, ) => // fail fast sanity checks failFast(gridAgentInitData) @@ -162,13 +162,13 @@ class GridAgent( log.debug( s"Inferior Subnets: {}; Inferior Subnet Nodes: {}", gridAgentInitData.inferiorGridIds, - gridAgentInitData.inferiorGridNodeUuids + gridAgentInitData.inferiorGridNodeUuids, ) log.debug( s"Superior Subnets: {}; Superior Subnet Nodes: {}", gridAgentInitData.superiorGridIds, - gridAgentInitData.superiorGridNodeUuids + gridAgentInitData.superiorGridNodeUuids, ) log.debug("Received InitializeTrigger.") @@ -189,7 +189,7 @@ class GridAgent( .toZonedDateTime(simonaConfig.simona.time.startDateTime), TimeUtil.withDefaults.toZonedDateTime( simonaConfig.simona.time.endDateTime - ) + ), ) /* Reassure, that there are also calculation models for the given uuids */ @@ -220,17 +220,17 @@ class GridAgent( simonaConfig.simona.powerflow.newtonraphson.epsilon.toVector.sorted, simonaConfig.simona.powerflow.newtonraphson.iterations, simonaConfig.simona.powerflow.sweepTimeout, - simonaConfig.simona.powerflow.stopOnFailure + simonaConfig.simona.powerflow.stopOnFailure, ), log, - actorName + actorName, ) log.debug("Je suis initialized") environmentRefs.scheduler ! Completion( self.toTyped, - Some(resolution) + Some(resolution), ) goto(Idle) using gridAgentBaseData @@ -246,13 +246,13 @@ class GridAgent( case Event( Activation(tick), - gridAgentBaseData: GridAgentBaseData + gridAgentBaseData: GridAgentBaseData, ) => unstashAll() environmentRefs.scheduler ! Completion( self.toTyped, - Some(tick) + Some(tick), ) goto(SimulateGrid) using gridAgentBaseData diff --git a/src/main/scala/edu/ie3/simona/agent/grid/GridAgentController.scala b/src/main/scala/edu/ie3/simona/agent/grid/GridAgentController.scala index 236f398d82..895afb7cc1 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/GridAgentController.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/GridAgentController.scala @@ -16,7 +16,7 @@ import edu.ie3.simona.actor.SimonaActorNaming._ import edu.ie3.simona.agent.EnvironmentRefs import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService.{ ActorEvMovementsService, - ActorWeatherService + ActorWeatherService, } import edu.ie3.simona.agent.participant.evcs.EvcsAgent import edu.ie3.simona.agent.participant.fixedfeedin.FixedFeedInAgent @@ -70,11 +70,11 @@ class GridAgentController( outputConfig: SimonaConfig.Simona.Output.Participant, resolution: Long, listener: Iterable[ActorRef], - log: LoggingAdapter + log: LoggingAdapter, ) extends LazyLogging { def buildSystemParticipants( subGridContainer: SubGridContainer, - thermalIslandGridsByBusId: Map[UUID, ThermalGrid] + thermalIslandGridsByBusId: Map[UUID, ThermalGrid], ): Map[UUID, Set[ActorRef]] = { val systemParticipants = @@ -86,7 +86,7 @@ class GridAgentController( outputConfig, systemParticipants, thermalIslandGridsByBusId, - environmentRefs + environmentRefs, ) } @@ -105,7 +105,7 @@ class GridAgentController( */ private def filterSysParts( subGridContainer: SubGridContainer, - environmentRefs: EnvironmentRefs + environmentRefs: EnvironmentRefs, ) = { val (notProcessedElements, availableSysParts) = @@ -115,14 +115,14 @@ class GridAgentController( .foldLeft((Set.empty[String], Vector.empty[SystemParticipantInput])) { case ( (notProcessedElements, availableSystemParticipants), - curSysPart + curSysPart, ) => curSysPart match { case entity @ (_: BmInput | _: ChpInput | _: EvInput | _: StorageInput) => ( notProcessedElements + entity.getClass.getSimpleName, - availableSystemParticipants + availableSystemParticipants, ) // only include evcs if ev data service is present case evcsInput: EvcsInput @@ -169,7 +169,7 @@ class GridAgentController( outputConfig: SimonaConfig.Simona.Output.Participant, participants: Vector[SystemParticipantInput], thermalIslandGridsByBusId: Map[UUID, ThermalGrid], - environmentRefs: EnvironmentRefs + environmentRefs: EnvironmentRefs, ): Map[UUID, Set[ActorRef]] = { /* Prepare the config util for the participant models, which (possibly) utilizes as map to speed up the initialization * phase */ @@ -188,7 +188,7 @@ class GridAgentController( outputConfigUtil, participant, thermalIslandGridsByBusId, - environmentRefs + environmentRefs, ) introduceAgentToEnvironment(actorRef) // return uuid to actorRef @@ -204,7 +204,7 @@ class GridAgentController( outputConfigUtil: OutputConfigUtil, participantInputModel: SystemParticipantInput, thermalIslandGridsByBusId: Map[UUID, ThermalGrid], - environmentRefs: EnvironmentRefs + environmentRefs: EnvironmentRefs, ): ActorRef = participantInputModel match { case input: FixedFeedInInput => buildFixedFeedIn( @@ -217,7 +217,7 @@ class GridAgentController( simulationEndDate, resolution, requestVoltageDeviationThreshold, - outputConfigUtil.getOrDefault(NotifierIdentifier.FixedFeedIn) + outputConfigUtil.getOrDefault(NotifierIdentifier.FixedFeedIn), ) case input: LoadInput => buildLoad( @@ -230,7 +230,7 @@ class GridAgentController( simulationEndDate, resolution, requestVoltageDeviationThreshold, - outputConfigUtil.getOrDefault(NotifierIdentifier.Load) + outputConfigUtil.getOrDefault(NotifierIdentifier.Load), ) case input: PvInput => buildPv( @@ -244,7 +244,7 @@ class GridAgentController( simulationEndDate, resolution, requestVoltageDeviationThreshold, - outputConfigUtil.getOrDefault(NotifierIdentifier.PvPlant) + outputConfigUtil.getOrDefault(NotifierIdentifier.PvPlant), ) case input: WecInput => buildWec( @@ -258,7 +258,7 @@ class GridAgentController( simulationEndDate, resolution, requestVoltageDeviationThreshold, - outputConfigUtil.getOrDefault(NotifierIdentifier.Wec) + outputConfigUtil.getOrDefault(NotifierIdentifier.Wec), ) case input: EvcsInput => buildEvcs( @@ -276,7 +276,7 @@ class GridAgentController( simulationEndDate, resolution, requestVoltageDeviationThreshold, - outputConfigUtil.getOrDefault(NotifierIdentifier.Evcs) + outputConfigUtil.getOrDefault(NotifierIdentifier.Evcs), ) case hpInput: HpInput => thermalIslandGridsByBusId.get(hpInput.getThermalBus.getUuid) match { @@ -288,7 +288,7 @@ class GridAgentController( environmentRefs.primaryServiceProxy, environmentRefs.weather, requestVoltageDeviationThreshold, - outputConfigUtil.getOrDefault(NotifierIdentifier.Hp) + outputConfigUtil.getOrDefault(NotifierIdentifier.Hp), ) case None => throw new GridAgentInitializationException( @@ -335,7 +335,7 @@ class GridAgentController( simulationEndDate: ZonedDateTime, resolution: Long, requestVoltageDeviationThreshold: Double, - outputConfig: NotifierConfig + outputConfig: NotifierConfig, ): ActorRef = gridAgentContext.simonaActorOf( FixedFeedInAgent.props( @@ -349,11 +349,11 @@ class GridAgentController( simulationEndDate, resolution, requestVoltageDeviationThreshold, - outputConfig + outputConfig, ), - listener + listener, ), - fixedFeedInInput.getId + fixedFeedInInput.getId, ) /** Creates a load agent and determines the needed additional information for @@ -386,7 +386,7 @@ class GridAgentController( simulationEndDate: ZonedDateTime, resolution: Long, requestVoltageDeviationThreshold: Double, - outputConfig: NotifierConfig + outputConfig: NotifierConfig, ): ActorRef = gridAgentContext.simonaActorOf( LoadAgent.props( @@ -400,11 +400,11 @@ class GridAgentController( simulationEndDate, resolution, requestVoltageDeviationThreshold, - outputConfig + outputConfig, ), - listener + listener, ), - loadInput.getId + loadInput.getId, ) /** Creates a pv agent and determines the needed additional information for @@ -440,7 +440,7 @@ class GridAgentController( simulationEndDate: ZonedDateTime, resolution: Long, requestVoltageDeviationThreshold: Double, - outputConfig: NotifierConfig + outputConfig: NotifierConfig, ): ActorRef = gridAgentContext.simonaActorOf( PvAgent.props( @@ -454,11 +454,11 @@ class GridAgentController( simulationEndDate, resolution, requestVoltageDeviationThreshold, - outputConfig + outputConfig, ), - listener + listener, ), - pvInput.getId + pvInput.getId, ) /** Creates an Evcs agent and determines the needed additional information for @@ -494,7 +494,7 @@ class GridAgentController( simulationEndDate: ZonedDateTime, resolution: Long, requestVoltageDeviationThreshold: Double, - outputConfig: NotifierConfig + outputConfig: NotifierConfig, ): ActorRef = gridAgentContext.simonaActorOf( EvcsAgent.props( @@ -512,9 +512,9 @@ class GridAgentController( simulationEndDate, resolution, requestVoltageDeviationThreshold, - outputConfig + outputConfig, ), - listener + listener, ) ) @@ -543,7 +543,7 @@ class GridAgentController( primaryServiceProxy: ActorRef, weatherService: ActorRef, requestVoltageDeviationThreshold: Double, - outputConfig: NotifierConfig + outputConfig: NotifierConfig, ): ActorRef = gridAgentContext.simonaActorOf( HpAgent.props( @@ -558,11 +558,11 @@ class GridAgentController( simulationEndDate, resolution, requestVoltageDeviationThreshold, - outputConfig + outputConfig, ), - listener + listener, ), - hpInput.getId + hpInput.getId, ) /** Creates a pv agent and determines the needed additional information for @@ -598,7 +598,7 @@ class GridAgentController( simulationEndDate: ZonedDateTime, resolution: Long, requestVoltageDeviationThreshold: Double, - outputConfig: NotifierConfig + outputConfig: NotifierConfig, ): ActorRef = gridAgentContext.simonaActorOf( WecAgent.props( @@ -612,11 +612,11 @@ class GridAgentController( simulationEndDate, resolution, requestVoltageDeviationThreshold, - outputConfig + outputConfig, ), - listener + listener, ), - wecInput.getId + wecInput.getId, ) /** Introduces the given agent to scheduler @@ -630,7 +630,7 @@ class GridAgentController( gridAgentContext.watch(actorRef) environmentRefs.scheduler ! ScheduleActivation( actorRef.toTyped, - INIT_SIM_TICK + INIT_SIM_TICK, ) } diff --git a/src/main/scala/edu/ie3/simona/agent/grid/GridAgentData.scala b/src/main/scala/edu/ie3/simona/agent/grid/GridAgentData.scala index 038d72cbc5..03ec0fd641 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/GridAgentData.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/GridAgentData.scala @@ -14,7 +14,7 @@ import edu.ie3.powerflow.model.PowerFlowResult import edu.ie3.powerflow.model.PowerFlowResult.SuccessFullPowerFlowResult.ValidNewtonRaphsonPFResult import edu.ie3.simona.agent.grid.ReceivedValues.{ ReceivedPowerValues, - ReceivedSlackVoltageValues + ReceivedSlackVoltageValues, } import edu.ie3.simona.agent.grid.ReceivedValuesStore.NodeToReceivedPower import edu.ie3.simona.model.grid.{GridModel, RefSystem} @@ -22,7 +22,7 @@ import edu.ie3.simona.ontology.messages.PowerMessage.{ FailedPowerFlow, PowerResponseMessage, ProvideGridPowerMessage, - ProvidePowerMessage + ProvidePowerMessage, } import java.util.UUID @@ -55,7 +55,7 @@ object GridAgentData { subGridContainer: SubGridContainer, thermalIslandGrids: Seq[ThermalGrid], subGridGateToActorRef: Map[SubGridGate, ActorRef], - refSystem: RefSystem + refSystem: RefSystem, ) extends GridAgentData with GridAgentDataHelper { override protected val subgridGates: Vector[SubGridGate] = @@ -76,13 +76,13 @@ object GridAgentData { final case class PowerFlowDoneData private ( gridAgentBaseData: GridAgentBaseData, powerFlowResult: PowerFlowResult, - pendingRequestAnswers: Set[Int] + pendingRequestAnswers: Set[Int], ) extends GridAgentData object PowerFlowDoneData { def apply( gridAgentBaseData: GridAgentBaseData, - powerFlowResult: PowerFlowResult + powerFlowResult: PowerFlowResult, ): PowerFlowDoneData = { /* Determine the subgrid numbers of all superior grids */ val superiorSubGrids = gridAgentBaseData.gridEnv.subgridGateToActorRef @@ -107,14 +107,14 @@ object GridAgentData { inferiorGridGates: Vector[SubGridGate], powerFlowParams: PowerFlowParams, log: LoggingAdapter, - actorName: String + actorName: String, ): GridAgentBaseData = { val currentSweepNo = 0 // initialization is assumed to be always @ sweep 0 val sweepValueStores: Map[Int, SweepValueStore] = Map .empty[ Int, - SweepValueStore + SweepValueStore, ] // initialization is assumed to be always with no sweep data val inferiorGridGateToActorRef = subgridGateToActorRef.filter { case (gate, _) => inferiorGridGates.contains(gate) @@ -126,11 +126,11 @@ object GridAgentData { ReceivedValuesStore.empty( nodeToAssetAgents, inferiorGridGateToActorRef, - superiorGridNodeUuids + superiorGridNodeUuids, ), sweepValueStores, log, - actorName + actorName, ) } @@ -152,7 +152,7 @@ object GridAgentData { def clean( gridAgentBaseData: GridAgentBaseData, superiorGridNodeUuids: Vector[UUID], - inferiorGridGates: Vector[SubGridGate] + inferiorGridGates: Vector[SubGridGate], ): GridAgentBaseData = { gridAgentBaseData.copy( @@ -161,10 +161,10 @@ object GridAgentData { gridAgentBaseData.gridEnv.subgridGateToActorRef.filter { case (gate, _) => inferiorGridGates.contains(gate) }, - superiorGridNodeUuids + superiorGridNodeUuids, ), currentSweepNo = 0, - sweepValueStores = Map.empty[Int, SweepValueStore] + sweepValueStores = Map.empty[Int, SweepValueStore], ) } @@ -195,7 +195,7 @@ object GridAgentData { receivedValueStore: ReceivedValuesStore, sweepValueStores: Map[Int, SweepValueStore], log: LoggingAdapter, - actorName: String + actorName: String, ) extends GridAgentData with GridAgentDataHelper { @@ -217,11 +217,11 @@ object GridAgentData { .forall(_.isDefined) log.debug( "slackMap: {}", - receivedValueStore.nodeToReceivedSlackVoltage + receivedValueStore.nodeToReceivedSlackVoltage, ) log.debug( "powerMap: {}", - receivedValueStore.nodeToReceivedPower + receivedValueStore.nodeToReceivedPower, ) assetAndGridPowerValuesReady & slackVoltageValuesReady } @@ -239,7 +239,7 @@ object GridAgentData { */ def updateWithReceivedPowerValues( receivedPowerValues: ReceivedPowerValues, - replace: Boolean = false + replace: Boolean = false, ): GridAgentBaseData = { val updatedNodeToReceivedPowersMap = receivedPowerValues.values.foldLeft( receivedValueStore.nodeToReceivedPower @@ -248,8 +248,8 @@ object GridAgentData { nodeToReceivedPowerValuesMapWithAddedPowerResponse, ( senderRef, - provideGridPowerMessage: ProvideGridPowerMessage - ) + provideGridPowerMessage: ProvideGridPowerMessage, + ), ) => /* Go over all includes messages and add them. */ provideGridPowerMessage.nodalResidualPower.foldLeft( @@ -257,25 +257,25 @@ object GridAgentData { ) { case ( nodeToReceivedPowerValuesMapWithAddedExchangedPower, - exchangedPower + exchangedPower, ) => updateNodalReceivedPower( exchangedPower, nodeToReceivedPowerValuesMapWithAddedExchangedPower, senderRef, - replace + replace, ) } case ( nodeToReceivedPowerValuesMapWithAddedPowerResponse, - (senderRef, powerResponseMessage) + (senderRef, powerResponseMessage), ) => // some other singular power response message updateNodalReceivedPower( powerResponseMessage, nodeToReceivedPowerValuesMapWithAddedPowerResponse, senderRef, - replace + replace, ) } this.copy( @@ -302,7 +302,7 @@ object GridAgentData { powerResponse: PowerResponseMessage, nodeToReceived: NodeToReceivedPower, senderRef: ActorRef, - replace: Boolean + replace: Boolean, ): NodeToReceivedPower = { // extract the nodeUuid that corresponds to the sender's actorRef and check if we expect a message from the sender val nodeUuid = powerResponse match { @@ -334,7 +334,7 @@ object GridAgentData { nodeUuid, throw new RuntimeException( s"NodeId $nodeUuid is not part of nodeToReceivedPowerValuesMap!" - ) + ), ) + // add or update entry in map of node entries (senderRef -> Some(powerResponse)) @@ -360,7 +360,7 @@ object GridAgentData { private def getNodeUuidForSender( nodeToReceivedPower: NodeToReceivedPower, senderRef: ActorRef, - replace: Boolean + replace: Boolean, ): Option[UUID] = nodeToReceivedPower .find { case (_, receivedPowerMessages) => @@ -431,13 +431,13 @@ object GridAgentData { def storeSweepDataAndClearReceiveMaps( validPowerFlowResult: ValidNewtonRaphsonPFResult, superiorGridNodeUuids: Vector[UUID], - inferiorGridGates: Vector[SubGridGate] + inferiorGridGates: Vector[SubGridGate], ): GridAgentBaseData = { val sweepValueStore = SweepValueStore( validPowerFlowResult, gridEnv.gridModel.gridComponents.nodes, - gridEnv.gridModel.nodeUuidToIndexMap + gridEnv.gridModel.nodeUuidToIndexMap, ) val updatedSweepValueStore = sweepValueStores + (currentSweepNo -> sweepValueStore) @@ -449,8 +449,8 @@ object GridAgentData { gridEnv.subgridGateToActorRef.filter { case (gate, _) => inferiorGridGates.contains(gate) }, - superiorGridNodeUuids - ) + superiorGridNodeUuids, + ), ) } } diff --git a/src/main/scala/edu/ie3/simona/agent/grid/GridEnvironment.scala b/src/main/scala/edu/ie3/simona/agent/grid/GridEnvironment.scala index 39dadc489f..622cf4f614 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/GridEnvironment.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/GridEnvironment.scala @@ -26,5 +26,5 @@ import edu.ie3.simona.model.grid.GridModel final case class GridEnvironment( gridModel: GridModel, subgridGateToActorRef: Map[SubGridGate, ActorRef], - nodeToAssetAgents: Map[UUID, Set[ActorRef]] + nodeToAssetAgents: Map[UUID, Set[ActorRef]], ) diff --git a/src/main/scala/edu/ie3/simona/agent/grid/GridResultsSupport.scala b/src/main/scala/edu/ie3/simona/agent/grid/GridResultsSupport.scala index ecd073b1cf..1118041f93 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/GridResultsSupport.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/GridResultsSupport.scala @@ -14,7 +14,7 @@ import edu.ie3.datamodel.models.result.connector.{ LineResult, SwitchResult, Transformer2WResult, - Transformer3WResult + Transformer3WResult, } import edu.ie3.powerflow.model.NodeData.StateData import edu.ie3.simona.agent.grid.GridResultsSupport.PartialTransformer3wResult @@ -24,7 +24,7 @@ import edu.ie3.simona.model.grid.Transformer3wModel.yij import edu.ie3.simona.model.grid.Transformer3wPowerFlowCase.{ PowerFlowCaseA, PowerFlowCaseB, - PowerFlowCaseC + PowerFlowCaseC, } import edu.ie3.simona.model.grid._ import edu.ie3.util.quantities.PowerSystemUnits @@ -60,7 +60,7 @@ private[grid] trait GridResultsSupport { */ def createResultModels( grid: GridModel, - sweepValueStore: SweepValueStore + sweepValueStore: SweepValueStore, )(implicit timestamp: ZonedDateTime): PowerFlowResultEvent = { // no sanity check for duplicated uuid result data as we expect valid data at this point implicit val sweepValueStoreData: Map[UUID, SweepValueStoreData] = @@ -90,7 +90,7 @@ private[grid] trait GridResultsSupport { grid.gridComponents.switches.map(calcSwitchResult(_, timestamp)), buildLineResults(grid.gridComponents.lines), buildTransformer2wResults(grid.gridComponents.transformers), - buildTransformer3wResults(grid.gridComponents.transformers3w) + buildTransformer3wResults(grid.gridComponents.transformers3w), ) } @@ -111,7 +111,7 @@ private[grid] trait GridResultsSupport { private def buildLineResults(lines: Set[LineModel])(implicit sweepValueStoreData: Map[UUID, SweepValueStoreData], iNominal: squants.ElectricCurrent, - timestamp: ZonedDateTime + timestamp: ZonedDateTime, ): Set[LineResult] = { lines.flatMap(lineModel => { sweepValueStoreData @@ -124,7 +124,7 @@ private[grid] trait GridResultsSupport { nodeAStateData.stateData, nodeBStateData.stateData, iNominal, - timestamp + timestamp, ) ) case None => @@ -132,7 +132,7 @@ private[grid] trait GridResultsSupport { "Cannot find power flow result data for line {} with nodeA {} and nodeB {}", lineModel.uuid, lineModel.nodeAUuid, - lineModel.nodeBUuid + lineModel.nodeBUuid, ) None } @@ -158,7 +158,7 @@ private[grid] trait GridResultsSupport { implicit sweepValueStoreData: Map[UUID, SweepValueStoreData], iNominal: ElectricCurrent, - timestamp: ZonedDateTime + timestamp: ZonedDateTime, ): Set[Transformer2WResult] = { transformers.flatMap(trafo2w => { sweepValueStoreData @@ -171,7 +171,7 @@ private[grid] trait GridResultsSupport { hvNodeStateData.stateData, lvNodeStateData.stateData, iNominal, - timestamp + timestamp, ) ) case None => @@ -179,7 +179,7 @@ private[grid] trait GridResultsSupport { "Cannot find power flow result data for transformer2w {} with hvNode {} and lvNode {}", trafo2w.uuid, trafo2w.hvNodeUuid, - trafo2w.lvNodeUuid + trafo2w.lvNodeUuid, ) None } @@ -205,7 +205,7 @@ private[grid] trait GridResultsSupport { implicit sweepValueStoreData: Map[UUID, SweepValueStoreData], iNominal: ElectricCurrent, - timestamp: ZonedDateTime + timestamp: ZonedDateTime, ): Set[PartialTransformer3wResult] = transformers3w.flatMap { trafo3w => { (trafo3w.powerFlowCase match { @@ -229,7 +229,7 @@ private[grid] trait GridResultsSupport { upperNodeStateData.stateData, internalNodeStateData.stateData, iNominal, - timestamp + timestamp, ) ) case None => @@ -238,7 +238,7 @@ private[grid] trait GridResultsSupport { trafo3w.uuid, trafo3w.hvNodeUuid, trafo3w.mvNodeUuid, - trafo3w.lvNodeUuid + trafo3w.lvNodeUuid, ) None } @@ -257,7 +257,7 @@ private[grid] trait GridResultsSupport { */ protected def calcNodeResult( sweepValueStoreData: SweepValueStoreData, - timestamp: ZonedDateTime + timestamp: ZonedDateTime, ): NodeResult = { val nodeStateData = sweepValueStoreData.stateData @@ -268,7 +268,7 @@ private[grid] trait GridResultsSupport { timestamp, sweepValueStoreData.nodeUuid, Quantities.getQuantity(vMag, PowerSystemUnits.PU), - Quantities.getQuantity(vAng, PowerSystemUnits.DEGREE_GEOM) + Quantities.getQuantity(vAng, PowerSystemUnits.DEGREE_GEOM), ) } @@ -284,13 +284,13 @@ private[grid] trait GridResultsSupport { */ protected def calcSwitchResult( switchModel: SwitchModel, - timestamp: ZonedDateTime + timestamp: ZonedDateTime, ): SwitchResult = { /* can be adapted when https://github.com/ie3-institute/PowerSystemDataModel/issues/151 has been resolved */ new SwitchResult( timestamp, switchModel.uuid, - switchModel.isClosed + switchModel.isClosed, ) } @@ -315,17 +315,17 @@ private[grid] trait GridResultsSupport { nodeAStateData: StateData, nodeBStateData: StateData, iNominal: ElectricCurrent, - timestamp: ZonedDateTime + timestamp: ZonedDateTime, ): LineResult = { if (line.isInOperation) { val yij = new Complex( line.gij().value.doubleValue, - line.bij().value.doubleValue + line.bij().value.doubleValue, ) val y0 = new Complex( line.g0().value.doubleValue, - line.b0().value.doubleValue + line.b0().value.doubleValue, ) val (iAComplexPu, iBComplexPu) = @@ -340,7 +340,7 @@ private[grid] trait GridResultsSupport { Quantities.getQuantity(iAMag.toAmperes, Units.AMPERE), Quantities.getQuantity(iAAng.toDegrees, PowerSystemUnits.DEGREE_GEOM), Quantities.getQuantity(iBMag.toAmperes, Units.AMPERE), - Quantities.getQuantity(iBAng.toDegrees, PowerSystemUnits.DEGREE_GEOM) + Quantities.getQuantity(iBAng.toDegrees, PowerSystemUnits.DEGREE_GEOM), ) } else { new LineResult( @@ -349,7 +349,7 @@ private[grid] trait GridResultsSupport { QuantityUtil.zeroCompQuantity(Units.AMPERE), QuantityUtil.zeroCompQuantity(PowerSystemUnits.DEGREE_GEOM), QuantityUtil.zeroCompQuantity(Units.AMPERE), - QuantityUtil.zeroCompQuantity(PowerSystemUnits.DEGREE_GEOM) + QuantityUtil.zeroCompQuantity(PowerSystemUnits.DEGREE_GEOM), ) } } @@ -377,13 +377,13 @@ private[grid] trait GridResultsSupport { hvNodeStateData: StateData, lvNodeStateData: StateData, iNominal: ElectricCurrent, - timestamp: ZonedDateTime + timestamp: ZonedDateTime, ): Transformer2WResult = { if (trafo2w.isInOperation) { val (yab, yaa, ybb) = ( TransformerModel.yij(trafo2w), TransformerModel.y0(trafo2w, ConnectorPort.A), - TransformerModel.y0(trafo2w, ConnectorPort.B) + TransformerModel.y0(trafo2w, ConnectorPort.B), ) val voltRatioNominal = trafo2w.voltRatioNominal @@ -393,7 +393,7 @@ private[grid] trait GridResultsSupport { lvNodeStateData.voltage, yab, yaa, - Some(ybb) + Some(ybb), ) /* Transfer port current A to high voltage level */ @@ -408,7 +408,7 @@ private[grid] trait GridResultsSupport { Quantities.getQuantity(iAAng.toDegrees, PowerSystemUnits.DEGREE_GEOM), Quantities.getQuantity(iBMag.toAmperes, Units.AMPERE), Quantities.getQuantity(iBAng.toDegrees, PowerSystemUnits.DEGREE_GEOM), - trafo2w.currentTapPos + trafo2w.currentTapPos, ) } else { @@ -419,7 +419,7 @@ private[grid] trait GridResultsSupport { QuantityUtil.zeroCompQuantity(PowerSystemUnits.DEGREE_GEOM), QuantityUtil.zeroCompQuantity(Units.AMPERE), QuantityUtil.zeroCompQuantity(PowerSystemUnits.DEGREE_GEOM), - trafo2w.currentTapPos + trafo2w.currentTapPos, ) } } @@ -446,7 +446,7 @@ private[grid] trait GridResultsSupport { nodeStateData: StateData, internalNodeStateData: StateData, iNominal: ElectricCurrent, - timestamp: ZonedDateTime + timestamp: ZonedDateTime, ): PartialTransformer3wResult = { val (_, iComplexPu) = iIJComplexPu( internalNodeStateData.voltage, @@ -458,9 +458,9 @@ private[grid] trait GridResultsSupport { case PowerFlowCaseA => Transformer3wModel.Transformer3wPort.A case PowerFlowCaseB => Transformer3wModel.Transformer3wPort.B case PowerFlowCaseC => Transformer3wModel.Transformer3wPort.C - } + }, ), - None + None, ) val (iMag, iAng) = iMagAndAngle(iComplexPu, iNominal) @@ -472,21 +472,21 @@ private[grid] trait GridResultsSupport { trafo3w.uuid, iMag, iAng, - trafo3w.currentTapPos + trafo3w.currentTapPos, ) case Transformer3wPowerFlowCase.PowerFlowCaseB => PartialTransformer3wResult.PortB( timestamp, trafo3w.uuid, iMag, - iAng + iAng, ) case Transformer3wPowerFlowCase.PowerFlowCaseC => PartialTransformer3wResult.PortC( timestamp, trafo3w.uuid, iMag, - iAng + iAng, ) } } @@ -510,11 +510,11 @@ private[grid] trait GridResultsSupport { */ private def iMagAndAngle( iPu: Complex, - iNominal: ElectricCurrent + iNominal: ElectricCurrent, ): (ElectricCurrent, Angle) = ( Amperes(iNominal.toAmperes * iPu.abs), - complexToAngle(iPu) + complexToAngle(iPu), ) /** Calculate the angle of the complex value given. The angle has the proper @@ -535,7 +535,7 @@ private[grid] trait GridResultsSupport { Angle can be 90 or 270 degrees, depending on sign of the imaginary part */ angleOffsetCorrection( Degrees(90d), - imag + imag, ) case Complex(real, imag) => /* Both real and imaginary parts are != 0. This means that the angle @@ -547,7 +547,7 @@ private[grid] trait GridResultsSupport { val baseAngle = atan(imag / real).toDegrees angleOffsetCorrection( Degrees(baseAngle), - real + real, ) } @@ -556,7 +556,7 @@ private[grid] trait GridResultsSupport { */ private def angleOffsetCorrection( angle: Angle, - dir: Double + dir: Double, ): Angle = if (dir < 0) angle + Degrees(180d) @@ -588,11 +588,11 @@ private[grid] trait GridResultsSupport { ujPu: Complex, yij: Complex, y0i: Complex, - y0j: Option[Complex] = None + y0j: Option[Complex] = None, ): (Complex, Complex) = { ( (uiPu - ujPu) * yij + (uiPu * y0i), - (ujPu - uiPu) * yij + (ujPu * y0j.getOrElse(y0i)) + (ujPu - uiPu) * yij + (ujPu * y0j.getOrElse(y0i)), ) } @@ -630,7 +630,7 @@ object GridResultsSupport { override val input: UUID, override val currentMagnitude: ElectricCurrent, override val currentAngle: Angle, - tapPos: Int + tapPos: Int, ) extends PartialTransformer3wResult /** Partial result for the port at the medium voltage side @@ -648,7 +648,7 @@ object GridResultsSupport { override val time: ZonedDateTime, override val input: UUID, override val currentMagnitude: ElectricCurrent, - override val currentAngle: Angle + override val currentAngle: Angle, ) extends PartialTransformer3wResult /** Partial result for the port at the low voltage side @@ -666,7 +666,7 @@ object GridResultsSupport { override val time: ZonedDateTime, override val input: UUID, override val currentMagnitude: ElectricCurrent, - override val currentAngle: Angle + override val currentAngle: Angle, ) extends PartialTransformer3wResult } } diff --git a/src/main/scala/edu/ie3/simona/agent/grid/PowerFlowParams.scala b/src/main/scala/edu/ie3/simona/agent/grid/PowerFlowParams.scala index 8e5284cb15..0235cb56de 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/PowerFlowParams.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/PowerFlowParams.scala @@ -30,5 +30,5 @@ final case class PowerFlowParams( epsilon: Vector[Double], maxIterations: Int, sweepTimeout: Duration, - stopOnFailure: Boolean + stopOnFailure: Boolean, ) diff --git a/src/main/scala/edu/ie3/simona/agent/grid/PowerFlowSupport.scala b/src/main/scala/edu/ie3/simona/agent/grid/PowerFlowSupport.scala index afc26f47c1..f06ab993c7 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/PowerFlowSupport.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/PowerFlowSupport.scala @@ -71,7 +71,7 @@ trait PowerFlowSupport { receivedValuesStore: ReceivedValuesStore, gridMainRefSystem: RefSystem, targetVoltageFromReceivedData: Boolean = true, - ignoreTargetVoltage: Boolean = false + ignoreTargetVoltage: Boolean = false, ): (Array[PresetData], WithForcedStartVoltages) = { val (operatingPoints, stateData) = nodes.map { nodeModel => // note: currently we only support pq nodes as we not distinguish between pq/pv nodes - @@ -83,7 +83,7 @@ trait PowerFlowSupport { nodeModel.uuid, throw new RuntimeException( s"Received data for node ${nodeModel.id} [${nodeModel.uuid}] which is not in my nodeUuidToIndexMap!" - ) + ), ) val apparentPower: Complex = @@ -107,18 +107,18 @@ trait PowerFlowSupport { .foldLeft( ( Kilowatts(0d), - Kilovars(0d) + Kilovars(0d), ) ) { case ((pSum, qSum), powerMessage) => ( pSum + powerMessage.p, - qSum + powerMessage.q + qSum + powerMessage.q, ) } new Complex( gridMainRefSystem.pInPu(p).value.doubleValue, - gridMainRefSystem.qInPu(q).value.doubleValue + gridMainRefSystem.qInPu(q).value.doubleValue, ) case None => new Complex(0, 0) } @@ -142,7 +142,7 @@ trait PowerFlowSupport { nodeModel.uuid, transformers2w, transformers3w, - gridMainRefSystem + gridMainRefSystem, ) } else { // Either the received data shall not be considered or the node is not a slack node @@ -157,7 +157,7 @@ trait PowerFlowSupport { nodeIdx, NodeType.SL, targetVoltage, - apparentPower + apparentPower, ) ) @@ -166,9 +166,9 @@ trait PowerFlowSupport { nodeIdx, nodeType, apparentPower, - targetVoltage.abs + targetVoltage.abs, ), - optStateData + optStateData, ) }.unzip @@ -195,7 +195,7 @@ trait PowerFlowSupport { ( combineOperatingPoint(adaptedOperatingPoint.toArray), - WithForcedStartVoltages(Array(slackNodeData)) + WithForcedStartVoltages(Array(slackNodeData)), ) } @@ -226,7 +226,7 @@ trait PowerFlowSupport { sweepDataValues: Vector[SweepValueStore.SweepValueStoreData], transformers2w: Set[TransformerModel], transformers3w: Set[Transformer3wModel], - gridMainRefSystem: RefSystem + gridMainRefSystem: RefSystem, ): (Array[PresetData], WithForcedStartVoltages) = sweepDataValues.map { sweepValueStoreData => val nodeStateData = sweepValueStoreData.stateData @@ -247,7 +247,7 @@ trait PowerFlowSupport { sweepValueStoreData.nodeUuid, transformers2w, transformers3w, - gridMainRefSystem + gridMainRefSystem, ) } else Complex.one @@ -258,22 +258,22 @@ trait PowerFlowSupport { nodeStateData.index, nodeStateData.nodeType, nodeStateData.power, - targetVoltage.abs + targetVoltage.abs, ), Option.when(nodeStateData.nodeType == NodeType.SL)( StateData( nodeStateData.index, nodeStateData.nodeType, targetVoltage, - nodeStateData.power + nodeStateData.power, ) - ) + ), ) }.unzip match { case (operatingPoint, stateData) => ( combineOperatingPoint(operatingPoint.toArray), - WithForcedStartVoltages(stateData.flatten.toArray) + WithForcedStartVoltages(stateData.flatten.toArray), ) } @@ -318,15 +318,15 @@ trait PowerFlowSupport { private def combinePresetData(a: PresetData, b: PresetData): PresetData = { require( a.index == b.index, - "Preset Data should only be combined when they map to the same index." + "Preset Data should only be combined when they map to the same index.", ) require( a.nodeType == b.nodeType, - "Preset Data combination is only supported for the same node types for now." + "Preset Data combination is only supported for the same node types for now.", ) require( math.abs(a.targetVoltage - b.targetVoltage) < 1e-6, - "Nodes to be combined have to be located in the same voltage level." + "Nodes to be combined have to be located in the same voltage level.", ) val index = a.index @@ -337,7 +337,7 @@ trait PowerFlowSupport { def combineOptionals( a: Option[Double], b: Option[Double], - f: (Double, Double) => Double + f: (Double, Double) => Double, ): Option[Double] = (a, b) match { case (Some(a), Some(b)) => Some(f(a, b)) case (Some(a), None) => Some(a) @@ -362,7 +362,7 @@ trait PowerFlowSupport { activePowerMin, activePowerMax, reactivePowerMin, - reactivePowerMax + reactivePowerMax, ) } @@ -378,7 +378,7 @@ trait PowerFlowSupport { */ protected def composeValidNewtonRaphsonPFResultVoltagesDebugString( validResult: ValidNewtonRaphsonPFResult, - gridModel: GridModel + gridModel: GridModel, ): String = { val debugString = new mutable.StringBuilder("Power flow result: ") validResult.nodeData.foreach(nodeStateData => { @@ -431,23 +431,23 @@ trait PowerFlowSupport { nodeUuid: UUID, transformers2w: Set[TransformerModel], transformers3w: Set[Transformer3wModel], - gridRefSystem: RefSystem + gridRefSystem: RefSystem, ): Complex = { (( transformers2w.find(_.hvNodeUuid == nodeUuid), - transformers3w.find(_.nodeInternalUuid == nodeUuid) + transformers3w.find(_.nodeInternalUuid == nodeUuid), ) match { case (Some(transformer2w), None) => transferToVoltageLevel( receivedSlackVoltage.e, receivedSlackVoltage.f, - transformer2w + transformer2w, ) case (None, Some(transformer3w)) => transferToVoltageLevel( receivedSlackVoltage.e, receivedSlackVoltage.f, - transformer3w + transformer3w, ) case (Some(transformer2w), Some(transformer3w)) => throw new RuntimeException( @@ -480,7 +480,7 @@ trait PowerFlowSupport { private def transferToVoltageLevel( e: ElectricPotential, f: ElectricPotential, - transformerModel: TransformerModel + transformerModel: TransformerModel, ): (ElectricPotential, ElectricPotential) = { val voltRatio = transformerModel.voltRatioNominal (e.divide(voltRatio.toDouble), f.divide(voltRatio.toDouble)) @@ -501,7 +501,7 @@ trait PowerFlowSupport { private def transferToVoltageLevel( e: ElectricPotential, f: ElectricPotential, - transformerModel: Transformer3wModel + transformerModel: Transformer3wModel, ): (ElectricPotential, ElectricPotential) = { val voltRatio = Transformer3wModel.voltRatio(transformerModel) (e.divide(voltRatio.toDouble), f.divide(voltRatio.toDouble)) @@ -521,10 +521,10 @@ trait PowerFlowSupport { private def toPu( e: ElectricPotential, f: ElectricPotential, - gridRefSystem: RefSystem + gridRefSystem: RefSystem, ): (squants.Dimensionless, squants.Dimensionless) = ( gridRefSystem.vInPu(e), - gridRefSystem.vInPu(f) + gridRefSystem.vInPu(f), ) /** Build a [[Complex]] from both parts of the voltage @@ -560,14 +560,14 @@ trait PowerFlowSupport { gridModel: GridModel, maxIterations: Int, operatingPoint: Array[PresetData], - slackVoltages: WithForcedStartVoltages + slackVoltages: WithForcedStartVoltages, )(epsilons: Vector[Double]): PowerFlowResult = { epsilons.headOption match { case Some(epsilon) => val admittanceMatrix = GridModel.composeAdmittanceMatrix( gridModel.nodeUuidToIndexMap, - gridModel.gridComponents + gridModel.gridComponents, ) // / execute @@ -577,7 +577,7 @@ trait PowerFlowSupport { Try { powerFlow.calculate( operatingPoint, - Some(slackVoltages) + Some(slackVoltages), ) }.map { case _: PowerFlowResult.FailedPowerFlowResult if epsilons.size > 1 => @@ -586,13 +586,13 @@ trait PowerFlowSupport { log.debug( "NR power flow with ɛ = {} failed. Relaxing to {}.", epsilon, - epsilonsLeft.headOption.getOrElse("") + epsilonsLeft.headOption.getOrElse(""), ) newtonRaphsonPF( gridModel, maxIterations, operatingPoint, - slackVoltages + slackVoltages, )( epsilonsLeft ) @@ -603,7 +603,7 @@ trait PowerFlowSupport { case Failure(exception) => throw new DBFSAlgorithmException( s"Power flow calculation in subgrid ${gridModel.subnetNo} failed.", - exception + exception, ) } case None => diff --git a/src/main/scala/edu/ie3/simona/agent/grid/ReceivedValuesStore.scala b/src/main/scala/edu/ie3/simona/agent/grid/ReceivedValuesStore.scala index 4c083629f3..e74f0f82df 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/ReceivedValuesStore.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/ReceivedValuesStore.scala @@ -10,11 +10,11 @@ import org.apache.pekko.actor.ActorRef import edu.ie3.datamodel.graph.SubGridGate import edu.ie3.simona.agent.grid.ReceivedValuesStore.{ NodeToReceivedPower, - NodeToReceivedSlackVoltage + NodeToReceivedSlackVoltage, } import edu.ie3.simona.ontology.messages.PowerMessage.{ PowerResponseMessage, - ProvidePowerMessage + ProvidePowerMessage, } import edu.ie3.simona.ontology.messages.VoltageMessage.ProvideSlackVoltageMessage.ExchangeVoltage @@ -41,7 +41,7 @@ import java.util.UUID */ final case class ReceivedValuesStore private ( nodeToReceivedPower: NodeToReceivedPower, - nodeToReceivedSlackVoltage: NodeToReceivedSlackVoltage + nodeToReceivedSlackVoltage: NodeToReceivedSlackVoltage, ) object ReceivedValuesStore { @@ -70,13 +70,13 @@ object ReceivedValuesStore { def empty( nodeToAssetAgents: Map[UUID, Set[ActorRef]], inferiorSubGridGateToActorRef: Map[SubGridGate, ActorRef], - superiorGridNodeUuids: Vector[UUID] + superiorGridNodeUuids: Vector[UUID], ): ReceivedValuesStore = { val (nodeToReceivedPower, nodeToReceivedSlackVoltage) = buildEmptyReceiveMaps( nodeToAssetAgents, inferiorSubGridGateToActorRef, - superiorGridNodeUuids + superiorGridNodeUuids, ) ReceivedValuesStore(nodeToReceivedPower, nodeToReceivedSlackVoltage) } @@ -95,7 +95,7 @@ object ReceivedValuesStore { */ private def buildEmptyNodeToReceivedPowerMap( nodeToAssetAgents: Map[UUID, Set[ActorRef]], - inferiorSubGridGateToActorRef: Map[SubGridGate, ActorRef] + inferiorSubGridGateToActorRef: Map[SubGridGate, ActorRef], ): NodeToReceivedPower = { /* Collect everything, that I expect from my asset agents */ val assetsToReceivedPower: NodeToReceivedPower = nodeToAssetAgents.collect { @@ -111,14 +111,14 @@ object ReceivedValuesStore { .foldLeft(assetsToReceivedPower) { case ( subordinateToReceivedPower, - couplingNodeUuid -> inferiorSubGridRef + couplingNodeUuid -> inferiorSubGridRef, ) => /* Check, if there is already something expected for the given coupling node * and add reference to the subordinate grid agent */ val actorRefToMessage = subordinateToReceivedPower .getOrElse( couplingNodeUuid, - Map.empty[ActorRef, Option[ProvidePowerMessage]] + Map.empty[ActorRef, Option[ProvidePowerMessage]], ) + (inferiorSubGridRef -> None) /* Update the existing map */ @@ -158,14 +158,14 @@ object ReceivedValuesStore { private def buildEmptyReceiveMaps( nodeToAssetAgents: Map[UUID, Set[ActorRef]], inferiorSubGridGateToActorRef: Map[SubGridGate, ActorRef], - superiorGridNodeUuids: Vector[UUID] + superiorGridNodeUuids: Vector[UUID], ): (NodeToReceivedPower, NodeToReceivedSlackVoltage) = { ( buildEmptyNodeToReceivedPowerMap( nodeToAssetAgents, - inferiorSubGridGateToActorRef + inferiorSubGridGateToActorRef, ), - buildEmptyNodeToReceivedSlackVoltageValuesMap(superiorGridNodeUuids) + buildEmptyNodeToReceivedSlackVoltageValuesMap(superiorGridNodeUuids), ) } diff --git a/src/main/scala/edu/ie3/simona/agent/grid/SweepValueStore.scala b/src/main/scala/edu/ie3/simona/agent/grid/SweepValueStore.scala index dfe459fc72..ddc46a1ba3 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/SweepValueStore.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/SweepValueStore.scala @@ -36,7 +36,7 @@ case object SweepValueStore { */ final case class SweepValueStoreData private ( nodeUuid: UUID, - stateData: StateData + stateData: StateData, ) /** Creates an empty [[SweepValueStore]] from on a valid power flow result @@ -55,7 +55,7 @@ case object SweepValueStore { def apply( validResult: ValidNewtonRaphsonPFResult, nodes: Seq[NodeModel], - nodeUuidToIndexMap: Map[UUID, Int] + nodeUuidToIndexMap: Map[UUID, Int], ): SweepValueStore = { val sweepDataValues = nodes.foldLeft(Vector.empty[SweepValueStoreData])( (valueStoreDataElements, node) => { diff --git a/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgent.scala b/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgent.scala index 20902cedd6..3eae4e4a55 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgent.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgent.scala @@ -11,7 +11,7 @@ import edu.ie3.simona.agent.{SimonaAgent, ValueStore} import edu.ie3.simona.agent.grid.GridAgent.FinishGridSimulationTrigger import edu.ie3.simona.agent.participant.ParticipantAgent.{ StartCalculationTrigger, - getAndCheckNodalVoltage + getAndCheckNodalVoltage, } import edu.ie3.simona.agent.participant.data.Data import edu.ie3.simona.agent.participant.data.Data.PrimaryData.PrimaryDataWithApparentPower @@ -19,19 +19,19 @@ import edu.ie3.simona.agent.participant.data.Data.{PrimaryData, SecondaryData} import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService import edu.ie3.simona.agent.participant.statedata.BaseStateData.{ FromOutsideBaseStateData, - ParticipantModelBaseStateData + ParticipantModelBaseStateData, } import edu.ie3.simona.agent.participant.statedata.ParticipantStateData._ import edu.ie3.simona.agent.participant.statedata.{ BaseStateData, DataCollectionStateData, - ParticipantStateData + ParticipantStateData, } import edu.ie3.simona.agent.state.AgentState import edu.ie3.simona.agent.state.AgentState.{Idle, Uninitialized} import edu.ie3.simona.agent.state.ParticipantAgentState.{ Calculate, - HandleInformation + HandleInformation, } import edu.ie3.simona.config.SimonaConfig import edu.ie3.simona.event.notifier.NotifierConfig @@ -41,13 +41,13 @@ import edu.ie3.simona.model.participant.{ CalcRelevantData, FlexChangeIndicator, ModelState, - SystemParticipant + SystemParticipant, } import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage.{ FlexResponse, IssueFlexControl, - RequestFlexOptions + RequestFlexOptions, } import edu.ie3.simona.ontology.messages.PowerMessage.RequestAssetPowerMessage import edu.ie3.simona.ontology.messages.SchedulerMessage.ScheduleActivation @@ -55,7 +55,7 @@ import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResp import edu.ie3.simona.ontology.messages.services.ServiceMessage.{ PrimaryServiceRegistrationMessage, ProvisionMessage, - RegistrationResponseMessage + RegistrationResponseMessage, } import edu.ie3.simona.util.SimonaConstants.INIT_SIM_TICK import edu.ie3.util.scala.quantities.ReactivePower @@ -96,10 +96,10 @@ abstract class ParticipantAgent[ D <: ParticipantStateData[PD], I <: SystemParticipantInput, MC <: SimonaConfig.BaseRuntimeConfig, - M <: SystemParticipant[CD, PD, MS] + M <: SystemParticipant[CD, PD, MS], ]( scheduler: ActorRef, - initStateData: ParticipantInitializeStateData[I, MC, PD] + initStateData: ParticipantInitializeStateData[I, MC, PD], )(implicit val tag: ClassTag[MS]) extends SimonaAgent[ParticipantStateData[PD]] { @@ -113,7 +113,7 @@ abstract class ParticipantAgent[ Long, ParticipantModelBaseStateData[PD, CD, MS, M], MS, - squants.Dimensionless + squants.Dimensionless, ) => PD // general agent states @@ -124,7 +124,7 @@ abstract class ParticipantAgent[ /* Initialize the agent */ case Event( Activation(INIT_SIM_TICK), - _: ParticipantUninitializedStateData[PD] + _: ParticipantUninitializedStateData[PD], ) => /* Ask the primary service proxy for data. If some is available, it will delegate the request to a worker and * that will confirm, otherwise, a failed registration is announced. */ @@ -141,14 +141,14 @@ abstract class ParticipantAgent[ initStateData.resolution, initStateData.requestVoltageDeviationThreshold, initStateData.outputConfig, - initStateData.maybeEmAgent + initStateData.maybeEmAgent, ) } when(Idle) { case Event( Activation(tick), - modelBaseStateData: ParticipantModelBaseStateData[PD, CD, MS, M] + modelBaseStateData: ParticipantModelBaseStateData[PD, CD, MS, M], ) if modelBaseStateData.services.isEmpty => /* An activity start trigger is sent and no data is awaited (neither secondary nor primary). Therefore go straight * ahead to calculations */ @@ -167,35 +167,35 @@ abstract class ParticipantAgent[ modelBaseStateData.requestValueStore, modelBaseStateData.voltageValueStore, additionalActivationTicks, - modelBaseStateData.foreseenDataTicks + modelBaseStateData.foreseenDataTicks, ) case Event( Activation(currentTick), - modelBaseStateData: ParticipantModelBaseStateData[PD, CD, MS, M] + modelBaseStateData: ParticipantModelBaseStateData[PD, CD, MS, M], ) => /* An activation is sent, but I'm not sure yet, if secondary data will arrive. Figure out, if someone * is about to deliver new data and either go to HandleInformation, check and possibly wait for data provision * messages or directly go to Calculate and utilize what is already there */ handleActivationAndGoToHandleInformation( currentTick, - modelBaseStateData + modelBaseStateData, ) case Event( Activation(currentTick), - fromOutsideBaseStateData: FromOutsideBaseStateData[M, PD] + fromOutsideBaseStateData: FromOutsideBaseStateData[M, PD], ) => /* An activation is sent, but I'm still expecting primary data. Go to HandleInformation and wait for * a data provision message */ handleActivationAndGoToHandleInformation( currentTick, - fromOutsideBaseStateData + fromOutsideBaseStateData, ) case Event( msg: ProvisionMessage[Data], - baseStateData: BaseStateData[PD] + baseStateData: BaseStateData[PD], ) => /* Somebody has sent new primary or secondary data. Collect, what is expected for this tick. Go over to data * handling */ @@ -203,7 +203,7 @@ abstract class ParticipantAgent[ case Event( RequestAssetPowerMessage(requestTick, eInPu, fInPu), - baseStateData: BaseStateData[PD] + baseStateData: BaseStateData[PD], ) => /* Determine the reply and stay in this state (or stash the message if the request cannot yet be answered) */ answerPowerRequestAndStayWithUpdatedStateData( @@ -211,19 +211,19 @@ abstract class ParticipantAgent[ requestTick, eInPu, fInPu, - alternativeResult + alternativeResult, ) case Event( FinishGridSimulationTrigger(tick), - baseStateData: BaseStateData[PD] + baseStateData: BaseStateData[PD], ) => // clean up agent result value store finalizeTickAfterPF(baseStateData, tick) case Event( RequestFlexOptions(tick), - baseStateData: ParticipantModelBaseStateData[PD, CD, MS, M] + baseStateData: ParticipantModelBaseStateData[PD, CD, MS, M], ) => val expectedSenders = baseStateData.foreseenDataTicks .collect { @@ -238,7 +238,7 @@ abstract class ParticipantAgent[ val nextStateData = DataCollectionStateData( baseStateData, expectedSenders, - yetTriggered = true + yetTriggered = true, ) /* Do await provision messages in HandleInformation */ @@ -252,7 +252,7 @@ abstract class ParticipantAgent[ case Event( flexCtrl: IssueFlexControl, - baseStateData: ParticipantModelBaseStateData[PD, CD, MS, M] + baseStateData: ParticipantModelBaseStateData[PD, CD, MS, M], ) => handleFlexCtrl(baseStateData, flexCtrl, scheduler) } @@ -270,8 +270,8 @@ abstract class ParticipantAgent[ resolution, requestVoltageDeviationThreshold, outputConfig, - _ - ) + _, + ), ) => log.debug("Will replay primary data") initializeParticipantForPrimaryDataReplay( @@ -283,7 +283,7 @@ abstract class ParticipantAgent[ requestVoltageDeviationThreshold, outputConfig, serviceRef -> maybeNextDataTick, - scheduler + scheduler, ) /* Receive registration refuse from primary data service -> Set up actor for model calculation */ @@ -298,8 +298,8 @@ abstract class ParticipantAgent[ resolution, requestVoltageDeviationThreshold, outputConfig, - maybeEmAgent - ) + maybeEmAgent, + ), ) => log.debug("Will perform model calculations") initializeParticipantForModelCalculation( @@ -312,19 +312,19 @@ abstract class ParticipantAgent[ requestVoltageDeviationThreshold, outputConfig, scheduler, - maybeEmAgent + maybeEmAgent, ) /* Receiving the registration replies from services and collect their next data ticks */ case Event( msg: RegistrationResponseMessage, - stateData: CollectRegistrationConfirmMessages[PD] + stateData: CollectRegistrationConfirmMessages[PD], ) => handleRegistrationResponse(scheduler, msg, stateData) case Event( Activation(currentTick), - stateData: DataCollectionStateData[PD] + stateData: DataCollectionStateData[PD], ) => /* The actor received an activation. Check, if there is everything at its place. If so, change state * accordingly, otherwise stay here and wait for the messages */ @@ -333,18 +333,18 @@ abstract class ParticipantAgent[ stateData, isYetTriggered = true, currentTick, - scheduler + scheduler, )(stateData.baseStateData.outputConfig) case Event( RequestFlexOptions(tick), - stateData: DataCollectionStateData[PD] + stateData: DataCollectionStateData[PD], ) => checkForExpectedDataAndChangeState( stateData, isYetTriggered = true, tick, - scheduler + scheduler, )(stateData.baseStateData.outputConfig) case Event( @@ -352,8 +352,8 @@ abstract class ParticipantAgent[ stateData @ DataCollectionStateData( baseStateData: BaseStateData[PD], data, - isYetTriggered - ) + isYetTriggered, + ), ) => /* We yet have received at least one data provision message. Handle all messages, that follow up for this tick, by * adding the received data to the collection state data and checking, if everything is at its place */ @@ -371,7 +371,7 @@ abstract class ParticipantAgent[ scheduler ! ScheduleActivation( self.toTyped, msg.tick, - msg.unlockKey + msg.unlockKey, ) /* Depending on if a next data tick can be foreseen, either update the entry in the base state data or remove @@ -384,18 +384,18 @@ abstract class ParticipantAgent[ baseStateData.requestValueStore, baseStateData.voltageValueStore, baseStateData.additionalActivationTicks, - foreSeenDataTicks + foreSeenDataTicks, ) val updatedStateData: DataCollectionStateData[PD] = stateData .copy( baseStateData = updatedBaseStateData, - data = updatedData + data = updatedData, ) checkForExpectedDataAndChangeState( updatedStateData, isYetTriggered, msg.tick, - scheduler + scheduler, )(updatedBaseStateData.outputConfig) } else throw new IllegalStateException( @@ -404,7 +404,7 @@ abstract class ParticipantAgent[ case Event( RequestAssetPowerMessage(currentTick, _, _), - DataCollectionStateData(_, data, yetTriggered) + DataCollectionStateData(_, data, yetTriggered), ) => if (log.isDebugEnabled) { val awaitedSenders = data.filter(_._2.isEmpty).keys @@ -418,7 +418,7 @@ abstract class ParticipantAgent[ s"$currentTick from ${sender()}", awaitedSenders, yetReceivedSenders, - if (yetTriggered) "" else "NOT" + if (yetTriggered) "" else "NOT", ) } stash() @@ -428,7 +428,7 @@ abstract class ParticipantAgent[ when(Calculate) { case Event( StartCalculationTrigger(currentTick), - modelBaseStateData: ParticipantModelBaseStateData[PD, CD, MS, M] + modelBaseStateData: ParticipantModelBaseStateData[PD, CD, MS, M], ) => /* Model calculation without any secondary data needed */ val voltage = getAndCheckNodalVoltage(modelBaseStateData, currentTick) @@ -441,7 +441,7 @@ abstract class ParticipantAgent[ lastModelState, currentTick, scheduler, - voltage + voltage, ) case Event( @@ -449,15 +449,15 @@ abstract class ParticipantAgent[ DataCollectionStateData( participantStateData: ParticipantModelBaseStateData[PD, CD, MS, M], data, - _ - ) + _, + ), ) => val updatedReceivedSecondaryData = ValueStore.updateValueStore( participantStateData.receivedSecondaryDataStore, currentTick, data.map { case (actorRef, Some(data: SecondaryData)) => actorRef -> data - } + }, ) /* At least parts of the needed data has been received or it is an additional activation, that has been triggered. @@ -470,14 +470,14 @@ abstract class ParticipantAgent[ ), lastModelState, currentTick, - scheduler + scheduler, ) case Event(RequestAssetPowerMessage(currentTick, _, _), _) => log.debug( s"Got asset power request for tick {} from '{}'. Will answer it later.", currentTick, - sender() + sender(), ) stash() stay() @@ -528,7 +528,7 @@ abstract class ParticipantAgent[ requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, senderToMaybeTick: (ActorRef, Option[Long]), - scheduler: ActorRef + scheduler: ActorRef, ): FSM.State[AgentState, ParticipantStateData[PD]] /** Abstract definition of initialization method, implementation in @@ -566,7 +566,7 @@ abstract class ParticipantAgent[ requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, scheduler: ActorRef, - maybeEmAgent: Option[TypedActorRef[FlexResponse]] + maybeEmAgent: Option[TypedActorRef[FlexResponse]], ): FSM.State[AgentState, ParticipantStateData[PD]] /** Handles the responses from service providers, this actor has registered @@ -583,7 +583,7 @@ abstract class ParticipantAgent[ def handleRegistrationResponse( scheduler: ActorRef, registrationResponse: RegistrationResponseMessage, - stateData: CollectRegistrationConfirmMessages[PD] + stateData: CollectRegistrationConfirmMessages[PD], ): FSM.State[AgentState, ParticipantStateData[PD]] /** Handle an [[Activation]] received in [[Idle]]. Prepare the foreseen @@ -599,7 +599,7 @@ abstract class ParticipantAgent[ */ private def handleActivationAndGoToHandleInformation( tick: Long, - baseStateData: BaseStateData[PD] + baseStateData: BaseStateData[PD], ): FSM.State[AgentState, ParticipantStateData[PD]] = { /* Hold tick, as we are about to changes states for a while */ holdTick(tick) @@ -617,7 +617,7 @@ abstract class ParticipantAgent[ val nextStateData = DataCollectionStateData( baseStateData, expectedSenders, - yetTriggered = true + yetTriggered = true, ) if (expectedSenders.nonEmpty || unforeseenPossible) { @@ -632,7 +632,7 @@ abstract class ParticipantAgent[ protected def getLastOrInitialStateData( baseStateData: ParticipantModelBaseStateData[PD, CD, MS, M], - tick: Long + tick: Long, ): MS = ConstantState match { case constantState: MS => @@ -662,7 +662,7 @@ abstract class ParticipantAgent[ def handleDataProvisionAndGoToHandleInformation( msg: ProvisionMessage[Data], baseStateData: BaseStateData[PD], - scheduler: ActorRef + scheduler: ActorRef, ): FSM.State[AgentState, ParticipantStateData[PD]] /** Checks, if all data is available and change state accordingly. Three cases @@ -692,7 +692,7 @@ abstract class ParticipantAgent[ stateData: DataCollectionStateData[PD], isYetTriggered: Boolean, tick: Long, - scheduler: ActorRef + scheduler: ActorRef, )(implicit outputConfig: NotifierConfig ): FSM.State[AgentState, ParticipantStateData[PD]] @@ -721,7 +721,7 @@ abstract class ParticipantAgent[ lastModelState: MS, currentTick: Long, scheduler: ActorRef, - nodalVoltage: Dimensionless + nodalVoltage: Dimensionless, ): FSM.State[AgentState, ParticipantStateData[PD]] /** Abstractly calculate the power output of the participant utilising @@ -751,7 +751,7 @@ abstract class ParticipantAgent[ baseStateData: ParticipantModelBaseStateData[PD, CD, MS, M], lastModelState: MS, currentTick: Long, - scheduler: ActorRef + scheduler: ActorRef, ): FSM.State[AgentState, ParticipantStateData[PD]] protected def createInitialState( @@ -760,23 +760,23 @@ abstract class ParticipantAgent[ protected def handleFlexRequest( baseStateData: ParticipantModelBaseStateData[PD, CD, MS, M], - tick: Long + tick: Long, ): ParticipantModelBaseStateData[PD, CD, MS, M] protected def calculateFlexOptions( baseStateData: ParticipantModelBaseStateData[PD, CD, MS, M], - tick: Long + tick: Long, ): ParticipantModelBaseStateData[PD, CD, MS, M] protected def createCalcRelevantData( baseStateData: ParticipantModelBaseStateData[PD, CD, MS, M], - tick: Long + tick: Long, ): CD protected def handleFlexCtrl( baseStateData: ParticipantModelBaseStateData[PD, CD, MS, M], flexCtrl: IssueFlexControl, - scheduler: ActorRef + scheduler: ActorRef, ): State /** Handle an active power change by flex control. @@ -798,7 +798,7 @@ abstract class ParticipantAgent[ baseStateData: ParticipantModelBaseStateData[PD, CD, MS, M], data: CD, lastState: MS, - setPower: squants.Power + setPower: squants.Power, ): (MS, PD, FlexChangeIndicator) /** Determining the reply to an @@ -833,7 +833,7 @@ abstract class ParticipantAgent[ requestTick: Long, eInPu: Dimensionless, fInPu: Dimensionless, - alternativeResult: PD + alternativeResult: PD, ): FSM.State[AgentState, ParticipantStateData[PD]] /** Abstract definition to notify result listeners from every participant @@ -848,7 +848,7 @@ abstract class ParticipantAgent[ baseStateData: BaseStateData[_], currentTick: Long, activePower: Power, - reactivePower: ReactivePower + reactivePower: ReactivePower, )(implicit outputConfig: NotifierConfig): Unit /** Abstract definition to clean up agent value stores after power flow @@ -864,7 +864,7 @@ abstract class ParticipantAgent[ */ def finalizeTickAfterPF( baseStateData: BaseStateData[PD], - currentTick: Long + currentTick: Long, ): FSM.State[AgentState, ParticipantStateData[PD]] } @@ -885,7 +885,7 @@ object ParticipantAgent { */ def getAndCheckNodalVoltage( baseStateData: BaseStateData[_ <: PrimaryData], - currentTick: Long + currentTick: Long, ): Dimensionless = { baseStateData.voltageValueStore.last(currentTick) match { case Some((_, voltage)) => voltage diff --git a/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentals.scala b/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentals.scala index ecb7dce11a..894c0e1c2e 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentals.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentals.scala @@ -11,7 +11,7 @@ import edu.ie3.datamodel.models.input.system.SystemParticipantInput import edu.ie3.datamodel.models.result.ResultEntity import edu.ie3.datamodel.models.result.system.{ FlexOptionsResult, - SystemParticipantResult + SystemParticipantResult, } import edu.ie3.datamodel.models.result.thermal.ThermalUnitResult import edu.ie3.simona.agent.ValueStore @@ -22,35 +22,35 @@ import edu.ie3.simona.agent.participant.data.Data.PrimaryData.{ ApparentPower, ApparentPowerAndHeat, EnrichableData, - PrimaryDataWithApparentPower + PrimaryDataWithApparentPower, } import edu.ie3.simona.agent.participant.data.Data.{PrimaryData, SecondaryData} import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService import edu.ie3.simona.agent.participant.statedata.BaseStateData.{ FromOutsideBaseStateData, - ParticipantModelBaseStateData + ParticipantModelBaseStateData, } import edu.ie3.simona.agent.participant.statedata.ParticipantStateData.{ CollectRegistrationConfirmMessages, - InputModelContainer + InputModelContainer, } import edu.ie3.simona.agent.participant.statedata.{ BaseStateData, DataCollectionStateData, - ParticipantStateData + ParticipantStateData, } import edu.ie3.simona.agent.state.AgentState import edu.ie3.simona.agent.state.AgentState.{Idle, Uninitialized} import edu.ie3.simona.agent.state.ParticipantAgentState.{ Calculate, - HandleInformation + HandleInformation, } import edu.ie3.simona.config.SimonaConfig import edu.ie3.simona.event.ResultEvent import edu.ie3.simona.event.ResultEvent.{ FlexOptionsResultEvent, ParticipantResultEvent, - ThermalResultEvent + ThermalResultEvent, } import edu.ie3.simona.event.notifier.NotifierConfig import edu.ie3.simona.exceptions.CriticalFailureException @@ -58,29 +58,29 @@ import edu.ie3.simona.exceptions.agent.{ ActorNotRegisteredException, AgentInitializationException, InconsistentStateException, - InvalidRequestException + InvalidRequestException, } import edu.ie3.simona.io.result.AccompaniedSimulationResult import edu.ie3.simona.model.em.EmTools import edu.ie3.simona.model.participant.{ CalcRelevantData, ModelState, - SystemParticipant + SystemParticipant, } import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.PowerMessage.{ AssetPowerChangedMessage, - AssetPowerUnchangedMessage + AssetPowerUnchangedMessage, } import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage._ import edu.ie3.simona.ontology.messages.flex.MinMaxFlexibilityMessage.ProvideMinMaxFlexOptions import edu.ie3.simona.ontology.messages.services.ServiceMessage.{ ProvisionMessage, - RegistrationResponseMessage + RegistrationResponseMessage, } import edu.ie3.simona.util.TickUtil._ import edu.ie3.util.quantities.PowerSystemUnits._ @@ -111,7 +111,7 @@ protected trait ParticipantAgentFundamentals[ D <: ParticipantStateData[PD], I <: SystemParticipantInput, MC <: SimonaConfig.BaseRuntimeConfig, - M <: SystemParticipant[CD, PD, MS] + M <: SystemParticipant[CD, PD, MS], ] extends ServiceRegistration[PD, CD, MS, D, I, MC, M] { this: ParticipantAgent[PD, CD, MS, D, I, MC, M] => protected val pdClassTag: ClassTag[PD] @@ -126,7 +126,7 @@ protected trait ParticipantAgentFundamentals[ requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, senderToMaybeTick: (ActorRef, Option[Long]), - scheduler: ActorRef + scheduler: ActorRef, ): FSM.State[AgentState, ParticipantStateData[PD]] = { val stateData = determineFromOutsideBaseStateData( inputModel, @@ -136,7 +136,7 @@ protected trait ParticipantAgentFundamentals[ resolution, requestVoltageDeviationThreshold, outputConfig, - senderToMaybeTick + senderToMaybeTick, ) /* Confirm final initialization */ @@ -178,13 +178,13 @@ protected trait ParticipantAgentFundamentals[ resolution: Long, requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, - senderToMaybeTick: (ActorRef, Option[Long]) + senderToMaybeTick: (ActorRef, Option[Long]), ): FromOutsideBaseStateData[M, PD] = { val model = buildModel( inputModel, modelConfig, simulationStartDate, - simulationEndDate + simulationEndDate, ) FromOutsideBaseStateData( model, @@ -203,10 +203,10 @@ protected trait ParticipantAgentFundamentals[ .to(PU) .getValue .doubleValue - ) + ), ), ValueStore.forResult[PD](resolution, 2), - ValueStore(resolution) + ValueStore(resolution), ) } @@ -226,7 +226,7 @@ protected trait ParticipantAgentFundamentals[ inputModel: InputModelContainer[I], modelConfig: MC, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): M /** Initializing the agent based on the uninitialized state and additional @@ -267,7 +267,7 @@ protected trait ParticipantAgentFundamentals[ requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, scheduler: ActorRef, - maybeEmAgent: Option[TypedActorRef[FlexResponse]] + maybeEmAgent: Option[TypedActorRef[FlexResponse]], ): FSM.State[AgentState, ParticipantStateData[PD]] = try { /* Register for services */ @@ -279,7 +279,7 @@ protected trait ParticipantAgentFundamentals[ emAgent ! RegisterParticipant( inputModel.electricalInputModel.getUuid, self.toTyped[FlexRequest], - inputModel.electricalInputModel + inputModel.electricalInputModel, ) } @@ -292,7 +292,7 @@ protected trait ParticipantAgentFundamentals[ resolution, requestVoltageDeviationThreshold, outputConfig, - maybeEmAgent + maybeEmAgent, ) /* If we do have registered with secondary data providers, wait for their responses. If not, the agent does not @@ -300,7 +300,7 @@ protected trait ParticipantAgentFundamentals[ if (awaitRegistrationResponsesFrom.nonEmpty) { goto(HandleInformation) using CollectRegistrationConfirmMessages( baseStateData, - awaitRegistrationResponsesFrom + awaitRegistrationResponsesFrom, ) } else { /* Determine the next activation tick, create a ScheduleTriggerMessage and remove the recently triggered tick */ @@ -313,7 +313,7 @@ protected trait ParticipantAgentFundamentals[ // flex is scheduled for tick 0, if no first tick available emAgent ! ScheduleFlexRequest( inputModel.electricalInputModel.getUuid, - newTick.getOrElse(0) + newTick.getOrElse(0), ) } @@ -321,7 +321,7 @@ protected trait ParticipantAgentFundamentals[ // scheduler, since we are activated by the EmAgent from now on scheduler ! Completion( self.toTyped, - newTick.filterNot(_ => baseStateData.isEmManaged) + newTick.filterNot(_ => baseStateData.isEmManaged), ) log.debug(s"Going to {}, using {}", Idle, nextBaseStateData) @@ -346,7 +346,7 @@ protected trait ParticipantAgentFundamentals[ resolution: Long, requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, - maybeEmAgent: Option[TypedActorRef[FlexResponse]] + maybeEmAgent: Option[TypedActorRef[FlexResponse]], ): ParticipantModelBaseStateData[PD, CD, MS, M] /** Determine all ticks between the operation start and end of the @@ -368,7 +368,7 @@ protected trait ParticipantAgentFundamentals[ simulationStartDate: ZonedDateTime, resolution: Long, operationStart: Long, - operationEnd: Long + operationEnd: Long, ): SortedSet[Long] = { /* The profile load model holds values in the specified resolution (e.g. for each full quarter hour (00:00, * 00:15, ...)). As the simulation might not start at an integer multiple of the resolution, we have to @@ -404,7 +404,7 @@ protected trait ParticipantAgentFundamentals[ */ def firstFullResolutionInSimulation( simulationStartDate: ZonedDateTime, - resolution: Long + resolution: Long, ): Long = { if (3600L % resolution != 0) throw new AgentInitializationException( @@ -430,12 +430,12 @@ protected trait ParticipantAgentFundamentals[ def handleRegistrationResponse( scheduler: ActorRef, registrationResponse: RegistrationResponseMessage, - stateData: CollectRegistrationConfirmMessages[PD] + stateData: CollectRegistrationConfirmMessages[PD], ): FSM.State[AgentState, ParticipantStateData[PD]] = registrationResponse match { case RegistrationResponseMessage.RegistrationSuccessfulMessage( serviceRef, - maybeNextTick + maybeNextTick, ) => val remainingResponses = stateData.pendingResponses.filter(_ != serviceRef) @@ -452,12 +452,12 @@ protected trait ParticipantAgentFundamentals[ stateData.baseStateData.requestValueStore, stateData.baseStateData.voltageValueStore, stateData.baseStateData.additionalActivationTicks, - foreseenDataTicks + foreseenDataTicks, ) goToIdleReplyCompletionAndScheduleTriggerForNextAction( complementedBaseStateData, - scheduler + scheduler, ) } else { val foreseenDataTicksFlattened = foreseenDataTicks.collect { @@ -467,7 +467,7 @@ protected trait ParticipantAgentFundamentals[ /* We not have yet received all responses. Wait here a bit for next messages. */ stay() using stateData.copy( pendingResponses = remainingResponses, - foreseenNextDataTicks = foreseenDataTicksFlattened + foreseenNextDataTicks = foreseenDataTicksFlattened, ) } case RegistrationResponseMessage.RegistrationFailedMessage(serviceRef) => @@ -493,7 +493,7 @@ protected trait ParticipantAgentFundamentals[ override def handleDataProvisionAndGoToHandleInformation( msg: ProvisionMessage[Data], baseStateData: BaseStateData[PD], - scheduler: ActorRef + scheduler: ActorRef, ): FSM.State[AgentState, ParticipantStateData[PD]] = { /* Figure out, who is going to send data in this tick */ val expectedSenders = baseStateData.foreseenDataTicks @@ -529,13 +529,13 @@ protected trait ParticipantAgentFundamentals[ emAgent ! ScheduleFlexRequest( modelStateData.model.getUuid, msg.tick, - msg.unlockKey + msg.unlockKey, ) case None => scheduler ! ScheduleActivation( self.toTyped, msg.tick, - msg.unlockKey + msg.unlockKey, ) } case _ => @@ -555,10 +555,10 @@ protected trait ParticipantAgentFundamentals[ baseStateData.requestValueStore, baseStateData.voltageValueStore, baseStateData.additionalActivationTicks, - foreseenDataTicks + foreseenDataTicks, ), expectedSenders, - yetTriggered = false + yetTriggered = false, ) goto(HandleInformation) using nextStateData } @@ -590,7 +590,7 @@ protected trait ParticipantAgentFundamentals[ stateData: DataCollectionStateData[PD], isYetTriggered: Boolean, tick: Long, - scheduler: ActorRef + scheduler: ActorRef, )(implicit outputConfig: NotifierConfig ): FSM.State[AgentState, ParticipantStateData[PD]] = { @@ -599,7 +599,7 @@ protected trait ParticipantAgentFundamentals[ stateData.baseStateData match { case fromOutsideBaseStateData: BaseStateData.FromOutsideBaseStateData[ M, - PD + PD, ] => /* Determine the way, the reactive power may be filled up */ val reactivePowerFunc = @@ -613,14 +613,14 @@ protected trait ParticipantAgentFundamentals[ announceSimulationResult( stateData.baseStateData, tick, - AccompaniedSimulationResult(mostRecentData) + AccompaniedSimulationResult(mostRecentData), ) val resultValueStore = fromOutsideBaseStateData.resultValueStore val updatedResultValueStore = ValueStore.updateValueStore( resultValueStore, tick, - mostRecentData + mostRecentData, ) val baseStateDataWithUpdatedResults = BaseStateData.updateBaseStateData( @@ -629,17 +629,17 @@ protected trait ParticipantAgentFundamentals[ stateData.baseStateData.requestValueStore, stateData.baseStateData.voltageValueStore, stateData.baseStateData.additionalActivationTicks, - stateData.baseStateData.foreseenDataTicks + stateData.baseStateData.foreseenDataTicks, ) goToIdleReplyCompletionAndScheduleTriggerForNextAction( baseStateDataWithUpdatedResults, - scheduler + scheduler, ) case Failure(exception) => log.error( "Was not able to extract received primary data correctly. Tear down the simulation. Failed with", - exception + exception, ) throw exception } @@ -648,14 +648,14 @@ protected trait ParticipantAgentFundamentals[ PD, CD, MS, - M + M, ] if modelStateData.isEmManaged => val updatedReceivedSecondaryData = ValueStore.updateValueStore( modelStateData.receivedSecondaryDataStore, tick, stateData.data.map { case (actorRef, Some(data: SecondaryData)) => actorRef -> data - } + }, ) // we don't go to calculate state, but return to idle directly @@ -663,7 +663,7 @@ protected trait ParticipantAgentFundamentals[ modelStateData.copy( receivedSecondaryDataStore = updatedReceivedSecondaryData ), - tick + tick, ) goto(Idle) using updatedStateData @@ -684,11 +684,11 @@ protected trait ParticipantAgentFundamentals[ override protected def handleFlexRequest( participantStateData: ParticipantModelBaseStateData[PD, CD, MS, M], - tick: Long + tick: Long, ): ParticipantModelBaseStateData[PD, CD, MS, M] = { val updatedBaseStateData = calculateFlexOptions( participantStateData, - tick + tick, ) val updatedFlexData = updatedBaseStateData.flexStateData.getOrElse( @@ -709,7 +709,7 @@ protected trait ParticipantAgentFundamentals[ override protected def calculateFlexOptions( baseStateData: ParticipantModelBaseStateData[PD, CD, MS, M], - tick: Long + tick: Long, ): ParticipantModelBaseStateData[PD, CD, MS, M] = { implicit val startDateTime: ZonedDateTime = baseStateData.startDate @@ -717,7 +717,7 @@ protected trait ParticipantAgentFundamentals[ val relevantData = createCalcRelevantData( baseStateData, - tick + tick, ) val lastState = getLastOrInitialStateData(baseStateData, tick) @@ -733,14 +733,14 @@ protected trait ParticipantAgentFundamentals[ modelUuid, referencePower, minPower, - maxPower + maxPower, ) => new FlexOptionsResult( tick.toDateTime, modelUuid, referencePower.toMegawatts.asMegaWatt, minPower.toMegawatts.asMegaWatt, - maxPower.toMegawatts.asMegaWatt + maxPower.toMegawatts.asMegaWatt, ) } @@ -757,7 +757,7 @@ protected trait ParticipantAgentFundamentals[ override protected def handleFlexCtrl( baseStateData: ParticipantModelBaseStateData[PD, CD, MS, M], flexCtrl: IssueFlexControl, - scheduler: ActorRef + scheduler: ActorRef, ): State = { /* Collect all needed information */ val flexStateData = baseStateData.flexStateData.getOrElse( @@ -767,7 +767,7 @@ protected trait ParticipantAgentFundamentals[ ) val relevantData = createCalcRelevantData( baseStateData, - flexCtrl.tick + flexCtrl.tick, ) val lastState = getLastOrInitialStateData(baseStateData, flexCtrl.tick) @@ -788,7 +788,7 @@ protected trait ParticipantAgentFundamentals[ baseStateData, relevantData, lastState, - setPointActivePower + setPointActivePower, ) // sanity check, simulation would hang if this matches @@ -807,7 +807,7 @@ protected trait ParticipantAgentFundamentals[ stateDataStore = ValueStore.updateValueStore( baseStateData.stateDataStore, flexCtrl.tick, - updatedState + updatedState, ) ) @@ -815,7 +815,7 @@ protected trait ParticipantAgentFundamentals[ val stateDataWithResults = handleCalculatedResult( updatedStateData, result, - flexCtrl.tick + flexCtrl.tick, ) // determine next tick @@ -833,7 +833,7 @@ protected trait ParticipantAgentFundamentals[ baseStateData.modelUuid, result.toApparentPower, flexChangeIndicator.changesAtNextActivation, - nextActivation + nextActivation, ) stay() using stateDataFinal @@ -854,21 +854,21 @@ protected trait ParticipantAgentFundamentals[ protected def handleCalculatedResult( baseStateData: ParticipantModelBaseStateData[PD, CD, MS, M], result: PD, - currentTick: Long + currentTick: Long, ): ParticipantModelBaseStateData[PD, CD, MS, M] = { // announce last result to listeners announceSimulationResult( baseStateData, currentTick, - AccompaniedSimulationResult(result) + AccompaniedSimulationResult(result), )(baseStateData.outputConfig) baseStateData.copy( resultValueStore = ValueStore.updateValueStore( baseStateData.resultValueStore, currentTick, - result + result, ) ) } @@ -893,7 +893,7 @@ protected trait ParticipantAgentFundamentals[ lastModelState: MS, currentTick: Long, scheduler: ActorRef, - nodalVoltage: squants.Dimensionless + nodalVoltage: squants.Dimensionless, ): FSM.State[AgentState, ParticipantStateData[PD]] = { val calcRelevantData = createCalcRelevantData(baseStateData, currentTick) @@ -904,34 +904,34 @@ protected trait ParticipantAgentFundamentals[ lastModelState, calcRelevantData, nodalVoltage, - baseStateData.model + baseStateData.model, ) val result = calculateModelPowerFunc( currentTick, baseStateData, updatedState, - nodalVoltage + nodalVoltage, ) val updatedResultValueStore = ValueStore.updateValueStore( baseStateData.resultValueStore, currentTick, - result + result, ) /* Inform the listeners about new result */ announceSimulationResult( baseStateData, currentTick, - AccompaniedSimulationResult(result) + AccompaniedSimulationResult(result), )(baseStateData.outputConfig) val updatedStateDataStore = ValueStore.updateValueStore( baseStateData.stateDataStore, currentTick, - updatedState + updatedState, ) /* In this case, without secondary data, the agent has been triggered by an ActivityStartTrigger by itself, @@ -939,12 +939,12 @@ protected trait ParticipantAgentFundamentals[ val baseStateDataWithUpdatedResultStore = baseStateData.copy( resultValueStore = updatedResultValueStore, - stateDataStore = updatedStateDataStore + stateDataStore = updatedStateDataStore, ) goToIdleReplyCompletionAndScheduleTriggerForNextAction( baseStateDataWithUpdatedResultStore, - scheduler + scheduler, ) } @@ -969,7 +969,7 @@ protected trait ParticipantAgentFundamentals[ modelState: MS, calcRelevantData: CD, nodalVoltage: squants.Dimensionless, - model: M + model: M, ): MS /** Determining the active to reactive power function to apply @@ -983,7 +983,7 @@ protected trait ParticipantAgentFundamentals[ */ def getReactivePowerFunction( tick: Long, - baseStateData: FromOutsideBaseStateData[M, PD] + baseStateData: FromOutsideBaseStateData[M, PD], ): Power => ReactivePower = if (baseStateData.fillUpReactivePowerWithModelFunc) { /* Use the model's active to reactive power function */ @@ -1015,7 +1015,7 @@ protected trait ParticipantAgentFundamentals[ */ def prepareData( data: Map[ActorRef, Option[_ <: Data]], - reactivePowerFunction: Power => ReactivePower + reactivePowerFunction: Power => ReactivePower, ): Try[PD] = data.headOption .flatMap { case (_, maybeData) => @@ -1073,7 +1073,7 @@ protected trait ParticipantAgentFundamentals[ */ def goToIdleReplyCompletionAndScheduleTriggerForNextAction( baseStateData: BaseStateData[PD], - scheduler: ActorRef + scheduler: ActorRef, ): FSM.State[AgentState, ParticipantStateData[PD]] = { /* Determine the very next tick, where activation is required */ val (maybeNextTick, updatedBaseStateData) = @@ -1088,7 +1088,7 @@ protected trait ParticipantAgentFundamentals[ maybeEmAgent.foreach { _ ! ScheduleFlexRequest( modelStateData.model.getUuid, - maybeNextTick.getOrElse(0) + maybeNextTick.getOrElse(0), ) } @@ -1102,7 +1102,7 @@ protected trait ParticipantAgentFundamentals[ // scheduler, since we are activated by the EmAgent from now on scheduler ! Completion( self.toTyped, - maybeNextTick.filterNot(_ => emManaged) + maybeNextTick.filterNot(_ => emManaged), ) unstashAll() goto(Idle) using updatedBaseStateData @@ -1157,7 +1157,7 @@ protected trait ParticipantAgentFundamentals[ /* There is only a data tick available */ ( Some(dataTick), - baseStateData + baseStateData, ) case (Some(additionalTick), Some(dataTick)) if dataTick < additionalTick => @@ -1165,7 +1165,7 @@ protected trait ParticipantAgentFundamentals[ * trigger. */ ( Some(dataTick), - baseStateData + baseStateData, ) case (Some(additionalTick), _) => /* The next activation is additional (either there is no foreseen data tick or it is after the additional tick. @@ -1178,12 +1178,12 @@ protected trait ParticipantAgentFundamentals[ baseStateData.requestValueStore, baseStateData.voltageValueStore, upcomingActivationTicks, - baseStateData.foreseenDataTicks + baseStateData.foreseenDataTicks, ) ( Some(additionalTick), - updatedBaseStateData + updatedBaseStateData, ) case (None, None) => /* We don't know nothing about either additional activation nor new incoming data */ @@ -1223,7 +1223,7 @@ protected trait ParticipantAgentFundamentals[ requestTick: Long, eInPu: Dimensionless, fInPu: Dimensionless, - alternativeResult: PD + alternativeResult: PD, ): FSM.State[AgentState, ParticipantStateData[PD]] = { /* Check, if there is any calculation foreseen for this tick. If so, wait with the response. */ val activationExpected = @@ -1235,7 +1235,7 @@ protected trait ParticipantAgentFundamentals[ s"Received power request from '{}' for tick '{}', but I'm still waiting for new results before " + s"this tick. Waiting with the response.", sender(), - requestTick + requestTick, ) stash() stay() using baseStateData @@ -1246,7 +1246,7 @@ protected trait ParticipantAgentFundamentals[ sqrt( pow(eInPu.toEach, 2) + pow( fInPu.toEach, - 2 + 2, ) ) ) @@ -1256,7 +1256,7 @@ protected trait ParticipantAgentFundamentals[ ValueStore.updateValueStore( baseStateData.voltageValueStore, requestTick, - nodalVoltage + nodalVoltage, ) /* Determine the most recent request */ val mostRecentRequest = @@ -1269,7 +1269,7 @@ protected trait ParticipantAgentFundamentals[ requestTick, updatedVoltageStore, nodalVoltage, - lastNodalVoltage + lastNodalVoltage, ).getOrElse { /* If a fast reply is not possible, determine it the old fashioned way */ determineReply( @@ -1278,7 +1278,7 @@ protected trait ParticipantAgentFundamentals[ mostRecentRequest, nodalVoltage, updatedVoltageStore, - alternativeResult + alternativeResult, ) } } @@ -1311,7 +1311,7 @@ protected trait ParticipantAgentFundamentals[ requestTick: Long, voltageValueStore: ValueStore[Dimensionless], nodalVoltage: Dimensionless, - lastNodalVoltage: Option[(Long, Dimensionless)] + lastNodalVoltage: Option[(Long, Dimensionless)], ): Option[FSM.State[AgentState, ParticipantStateData[PD]]] = { implicit val outputConfig: NotifierConfig = baseStateData.outputConfig @@ -1330,14 +1330,14 @@ protected trait ParticipantAgentFundamentals[ voltageValueStore = voltageValueStore ) replying AssetPowerUnchangedMessage( latestProvidedValues.p, - latestProvidedValues.q + latestProvidedValues.q, ) ) case modelBaseStateData: ParticipantModelBaseStateData[ PD, CD, MS, - M + M, ] => /* Check, if the last request has been made with the same nodal voltage. If not, recalculate the reactive * power. */ @@ -1353,7 +1353,7 @@ protected trait ParticipantAgentFundamentals[ Some( stay() using modelBaseStateData replying AssetPowerUnchangedMessage( latestProvidedValues.p, - latestProvidedValues.q + latestProvidedValues.q, ) ) } else { @@ -1398,7 +1398,7 @@ protected trait ParticipantAgentFundamentals[ mostRecentRequest: Option[(Long, PD)], nodalVoltage: Dimensionless, updatedVoltageValueStore: ValueStore[Dimensionless], - alternativeResult: PD + alternativeResult: PD, ): FSM.State[AgentState, ParticipantStateData[PD]] = { /* No fast reply possible --> Some calculations have to be made */ mostRecentRequest match { @@ -1414,7 +1414,7 @@ protected trait ParticipantAgentFundamentals[ PD, CD, MS, - M + M, ] => /* Active power is yet calculated, but reactive power needs update */ val nextReactivePower = modelBaseStateData.model @@ -1425,17 +1425,17 @@ protected trait ParticipantAgentFundamentals[ ValueStore.updateValueStore( baseStateData.requestValueStore, requestTick, - lastResult.withReactivePower(nextReactivePower) + lastResult.withReactivePower(nextReactivePower), ) val nextStateData = modelBaseStateData.copy( requestValueStore = updatedRequestValueStore, - voltageValueStore = updatedVoltageValueStore + voltageValueStore = updatedVoltageValueStore, ) stay() using nextStateData replying AssetPowerChangedMessage( lastResult.p, - nextReactivePower + nextReactivePower, ) case unexpectedStateData => throw new IllegalStateException( @@ -1450,7 +1450,7 @@ protected trait ParticipantAgentFundamentals[ getRelevantResultData( requestTick, baseStateData.resultValueStore, - baseStateData.requestValueStore + baseStateData.requestValueStore, ) match { case Some(relevantData) => /* There is at least one relevant simulation result apparent, which might also be the most recent one @@ -1461,7 +1461,7 @@ protected trait ParticipantAgentFundamentals[ requestTick, nodalVoltage, updatedVoltageValueStore, - alternativeResult + alternativeResult, ) case None => /* There is no simulation result at all. Reply with zero power */ @@ -1469,7 +1469,7 @@ protected trait ParticipantAgentFundamentals[ baseStateData, alternativeResult, requestTick, - updatedVoltageValueStore + updatedVoltageValueStore, ) } } @@ -1495,7 +1495,7 @@ protected trait ParticipantAgentFundamentals[ def getRelevantResultData( requestTick: Long, resultValueStore: ValueStore[PD], - requestValueStore: ValueStore[PD] + requestValueStore: ValueStore[PD], ): Option[RelevantResultValues[PD]] = { /* The actual tick window for averaging is the last request tick and this request tick (both including) */ val (averagingWindowStart, averagingWindowEnd) = @@ -1505,7 +1505,7 @@ protected trait ParticipantAgentFundamentals[ * averaging window and it's end (both including) are relevant for averaging the simulated primary data */ val firstRelevantTick = determineFirstRelevantTick( averagingWindowStart, - resultValueStore + resultValueStore, ) /* Let's see, if we got some simulation results between the first relevant simulation tick and this request's tick */ @@ -1518,7 +1518,7 @@ protected trait ParticipantAgentFundamentals[ RelevantResultValues( averagingWindowStart, averagingWindowEnd, - simulationResults + simulationResults, ) ) } else { @@ -1538,7 +1538,7 @@ protected trait ParticipantAgentFundamentals[ */ private def determineTickWindow( requestTick: Long, - requestValueStore: ValueStore[_] + requestValueStore: ValueStore[_], ): (Long, Long) = requestValueStore.lastKnownTick(requestTick - 1) match { case Some(lastRequestTick) => (lastRequestTick, requestTick) @@ -1559,7 +1559,7 @@ protected trait ParticipantAgentFundamentals[ */ private def determineFirstRelevantTick( lastRequestTick: Long, - resultValueStore: ValueStore[_] + resultValueStore: ValueStore[_], ): Long = resultValueStore.lastKnownTick(lastRequestTick) match { case Some(firstRelevantDataTick) => firstRelevantDataTick @@ -1592,7 +1592,7 @@ protected trait ParticipantAgentFundamentals[ requestTick: Long, nodalVoltage: Dimensionless, voltageValueStore: ValueStore[Dimensionless], - alternativeResult: PD + alternativeResult: PD, ): FSM.State[AgentState, ParticipantStateData[PD]] = { if (relevantResults.relevantData.nonEmpty) { averagePowerAndStay( @@ -1602,18 +1602,18 @@ protected trait ParticipantAgentFundamentals[ relevantResults.windowStart, relevantResults.windowEnd, nodalVoltage, - voltageValueStore + voltageValueStore, ) } else { log.debug( s"No relevant data apparent, stay and reply with alternative result {}.", - alternativeResult + alternativeResult, ) stayWithUpdatedRequestValueStore( baseData, alternativeResult, requestTick, - voltageValueStore + voltageValueStore, ) } } @@ -1648,20 +1648,20 @@ protected trait ParticipantAgentFundamentals[ windowStartTick: Long, windowEndTick: Long, nodalVoltage: Dimensionless, - voltageValueStore: ValueStore[Dimensionless] + voltageValueStore: ValueStore[Dimensionless], ): FSM.State[AgentState, ParticipantStateData[PD]] = { val averageResult = determineAverageResult( baseData, tickToResult, windowStartTick, windowEndTick, - nodalVoltage + nodalVoltage, ) stayWithUpdatedRequestValueStore( baseData, averageResult, requestTick, - voltageValueStore + voltageValueStore, ) } @@ -1687,7 +1687,7 @@ protected trait ParticipantAgentFundamentals[ tickToResult: Map[Long, PD], windowStartTick: Long, windowEndTick: Long, - nodalVoltage: Dimensionless + nodalVoltage: Dimensionless, ): PD = { /* Determine, how the single model would transfer the active into reactive power */ val activeToReactivePowerFunction = baseStateData match { @@ -1702,7 +1702,7 @@ protected trait ParticipantAgentFundamentals[ tickToResult, windowStartTick, windowEndTick, - activeToReactivePowerFunction + activeToReactivePowerFunction, ) } @@ -1725,7 +1725,7 @@ protected trait ParticipantAgentFundamentals[ windowEnd: Long, activeToReactivePowerFuncOpt: Option[ Power => ReactivePower - ] = None + ] = None, ): PD /** Updates the given base state data by inserting updated request value store @@ -1749,13 +1749,13 @@ protected trait ParticipantAgentFundamentals[ baseStateData: BaseStateData[PD], averageResult: PD, requestTick: Long, - voltageValueStore: ValueStore[Dimensionless] + voltageValueStore: ValueStore[Dimensionless], ): FSM.State[AgentState, ParticipantStateData[PD]] = { val updatedRequestValueStore = ValueStore.updateValueStore( baseStateData.requestValueStore, requestTick, - averageResult + averageResult, ) val nextStateData = BaseStateData.updateBaseStateData( baseStateData, @@ -1763,7 +1763,7 @@ protected trait ParticipantAgentFundamentals[ updatedRequestValueStore, voltageValueStore, baseStateData.additionalActivationTicks, - baseStateData.foreseenDataTicks + baseStateData.foreseenDataTicks, ) averageResult.toApparentPower match { @@ -1787,7 +1787,7 @@ protected trait ParticipantAgentFundamentals[ protected def announceSimulationResult( baseStateData: BaseStateData[PD], tick: Long, - result: AccompaniedSimulationResult[PD] + result: AccompaniedSimulationResult[PD], )(implicit outputConfig: NotifierConfig): Unit = if (outputConfig.simulationResultInfo) { notifyListener( @@ -1816,20 +1816,20 @@ protected trait ParticipantAgentFundamentals[ scheduler: ActorRef, baseStateData: BaseStateData[PD], result: AccompaniedSimulationResult[PD], - relevantData: CD + relevantData: CD, ): FSM.State[AgentState, ParticipantStateData[PD]] = { /* Update the value stores */ val updatedValueStore = ValueStore.updateValueStore( baseStateData.resultValueStore, currentTick, - result.primaryData + result.primaryData, ) /* Inform the listeners about new result */ announceSimulationResult( baseStateData, currentTick, - result + result, )(baseStateData.outputConfig) /* Update the base state data */ @@ -1847,7 +1847,7 @@ protected trait ParticipantAgentFundamentals[ goToIdleReplyCompletionAndScheduleTriggerForNextAction( baseStateDateWithUpdatedResults, - scheduler + scheduler, ) } @@ -1869,7 +1869,7 @@ protected trait ParticipantAgentFundamentals[ baseStateData: BaseStateData[_], tick: Long, activePower: Power, - reactivePower: ReactivePower + reactivePower: ReactivePower, )(implicit outputConfig: NotifierConfig): Unit = if (outputConfig.powerRequestReply) { log.warning( @@ -1889,7 +1889,7 @@ protected trait ParticipantAgentFundamentals[ */ override def finalizeTickAfterPF( baseStateData: BaseStateData[PD], - currentTick: Long + currentTick: Long, ): FSM.State[AgentState, ParticipantStateData[PD]] = { baseStateData.requestValueStore.last(currentTick).foreach { case (_, data) => @@ -1898,7 +1898,7 @@ protected trait ParticipantAgentFundamentals[ baseStateData, currentTick, data.p, - data.q + data.q, )(baseStateData.outputConfig) } goto(Idle) using baseStateData @@ -1918,7 +1918,7 @@ protected trait ParticipantAgentFundamentals[ def buildResultEvent( baseStateData: BaseStateData[PD], tick: Long, - result: PD + result: PD, ): ParticipantResultEvent = { val uuid = baseStateData.modelUuid val dateTime = tick.toDateTime(baseStateData.startDate) @@ -1962,7 +1962,7 @@ protected trait ParticipantAgentFundamentals[ protected def buildResult( uuid: UUID, dateTime: ZonedDateTime, - result: PD + result: PD, ): SystemParticipantResult /** Returns secondary service of type T or throws exception @@ -2012,7 +2012,7 @@ object ParticipantAgentFundamentals { final case class RelevantResultValues[+PD <: PrimaryData]( windowStart: Long, windowEnd: Long, - relevantData: Map[Long, PD] + relevantData: Map[Long, PD], ) /** Determine the average apparent power within the given tick window @@ -2035,21 +2035,21 @@ object ParticipantAgentFundamentals { activeToReactivePowerFuncOpt: Option[ Power => ReactivePower ] = None, - log: LoggingAdapter + log: LoggingAdapter, ): ApparentPower = { val p = QuantityUtil.average[Power, Energy]( tickToResults.map { case (tick, pd) => tick -> pd.p }, windowStart, - windowEnd + windowEnd, ) match { case Success(pSuccess) => pSuccess case Failure(exception) => log.warning( "Unable to determine average active power. Apply 0 instead. Cause:\n\t{}", - exception + exception, ) Megawatts(0d) } @@ -2065,14 +2065,14 @@ object ParticipantAgentFundamentals { } }, windowStart, - windowEnd + windowEnd, ) match { case Success(pSuccess) => Megavars(pSuccess.toMegawatts) case Failure(exception) => log.warning( "Unable to determine average reactive power. Apply 0 instead. Cause:\n\t{}", - exception + exception, ) Megavars(0d) } @@ -2100,14 +2100,14 @@ object ParticipantAgentFundamentals { activeToReactivePowerFuncOpt: Option[ Power => ReactivePower ] = None, - log: LoggingAdapter + log: LoggingAdapter, ): ApparentPowerAndHeat = { val tickToResultsApparentPower: Map[Long, ApparentPower] = tickToResults.map { case (tick, pd) => ( tick, - ApparentPower(Megawatts(pd.p.toMegawatts), Megavars(pd.q.toMegavars)) + ApparentPower(Megawatts(pd.p.toMegawatts), Megavars(pd.q.toMegavars)), ) } @@ -2116,7 +2116,7 @@ object ParticipantAgentFundamentals { windowStart, windowEnd, activeToReactivePowerFuncOpt, - log + log, ) val qDot = QuantityUtil.average[Power, Energy]( @@ -2124,13 +2124,13 @@ object ParticipantAgentFundamentals { tick -> Megawatts(pd.qDot.toMegawatts) }, windowStart, - windowEnd + windowEnd, ) match { case Success(qDotSuccess) => qDotSuccess case Failure(exception) => log.warning( "Unable to determine average thermal power. Apply 0 instead. Cause:\n\t{}", - exception + exception, ) Megawatts(0d) } diff --git a/src/main/scala/edu/ie3/simona/agent/participant/ServiceRegistration.scala b/src/main/scala/edu/ie3/simona/agent/participant/ServiceRegistration.scala index bca34cc95f..b8b2ef33ad 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/ServiceRegistration.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/ServiceRegistration.scala @@ -14,7 +14,7 @@ import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService.{ ActorEvMovementsService, ActorPriceService, - ActorWeatherService + ActorWeatherService, } import edu.ie3.simona.agent.participant.statedata.ParticipantStateData import edu.ie3.simona.config.SimonaConfig @@ -22,7 +22,7 @@ import edu.ie3.simona.exceptions.agent.ServiceRegistrationException import edu.ie3.simona.model.participant.{ CalcRelevantData, ModelState, - SystemParticipant + SystemParticipant, } import edu.ie3.simona.ontology.messages.services.EvMessage.RegisterForEvDataMessage import edu.ie3.simona.ontology.messages.services.WeatherMessage.RegisterForWeatherMessage @@ -34,7 +34,7 @@ trait ServiceRegistration[ D <: ParticipantStateData[PD], I <: SystemParticipantInput, MC <: SimonaConfig.BaseRuntimeConfig, - M <: SystemParticipant[CD, PD, MS] + M <: SystemParticipant[CD, PD, MS], ] { this: ParticipantAgent[PD, CD, MS, D, I, MC, M] => @@ -50,7 +50,7 @@ trait ServiceRegistration[ */ def registerForServices( inputModel: I, - services: Iterable[SecondaryDataService[_ <: SecondaryData]] + services: Iterable[SecondaryDataService[_ <: SecondaryData]], ): Iterable[ActorRef] = services.flatMap(service => registerForSecondaryService(service, inputModel) @@ -72,12 +72,12 @@ trait ServiceRegistration[ S <: SecondaryData ]( serviceDefinition: SecondaryDataService[S], - inputModel: I + inputModel: I, ): Option[ActorRef] = serviceDefinition match { case SecondaryDataService.ActorPriceService(_) => log.debug( s"Attempt to register for {}. This is currently not supported.", - ActorPriceService + ActorPriceService, ) None case ActorWeatherService(serviceRef) => @@ -98,7 +98,7 @@ trait ServiceRegistration[ */ private def registerForWeather( actorRef: ActorRef, - inputModel: I + inputModel: I, ): Unit = { /* If we are asked to register for weather, determine the proper geo position */ val geoPosition = inputModel.getNode.getGeoPosition @@ -126,7 +126,7 @@ trait ServiceRegistration[ */ private def registerForEvMovements( serviceRef: ActorRef, - inputModel: I + inputModel: I, ): Unit = { inputModel match { case evcsInput: EvcsInput => diff --git a/src/main/scala/edu/ie3/simona/agent/participant/data/Data.scala b/src/main/scala/edu/ie3/simona/agent/participant/data/Data.scala index 2bba0f0509..35748f755f 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/data/Data.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/data/Data.scala @@ -62,7 +62,7 @@ object Data { val ZERO_POWER: ApparentPower = ApparentPower( Megawatts(0d), - Megavars(0d) + Megavars(0d), ) /** Active power as participant simulation result @@ -76,7 +76,7 @@ object Data { override def toApparentPower: ApparentPower = ApparentPower( p, - Megavars(0d) + Megavars(0d), ) override def add(q: ReactivePower): ApparentPower = @@ -92,7 +92,7 @@ object Data { */ final case class ApparentPower( override val p: Power, - override val q: ReactivePower + override val q: ReactivePower, ) extends PrimaryDataWithApparentPower[ApparentPower] { override def toApparentPower: ApparentPower = this @@ -109,14 +109,14 @@ object Data { */ final case class ActivePowerAndHeat( override val p: Power, - override val qDot: Power + override val qDot: Power, ) extends PrimaryData with Heat with EnrichableData[ApparentPowerAndHeat] { override def toApparentPower: ApparentPower = ApparentPower( p, - Megavars(0d) + Megavars(0d), ) override def add(q: ReactivePower): ApparentPowerAndHeat = @@ -135,7 +135,7 @@ object Data { final case class ApparentPowerAndHeat( override val p: Power, override val q: ReactivePower, - override val qDot: Power + override val qDot: Power, ) extends PrimaryDataWithApparentPower[ApparentPowerAndHeat] with Heat { override def toApparentPower: ApparentPower = @@ -161,7 +161,7 @@ object Data { ), Kilowatts( qDot.to(PowerSystemUnits.KILOWATT).getValue.doubleValue - ) + ), ) ) case _ => @@ -181,7 +181,7 @@ object Data { ), Kilovars( q.to(PowerSystemUnits.KILOVAR).getValue.doubleValue - ) + ), ) ) case _ => @@ -201,7 +201,7 @@ object Data { ), Kilowatts( qDot.to(PowerSystemUnits.KILOWATT).getValue.doubleValue - ) + ), ) ) case _ => diff --git a/src/main/scala/edu/ie3/simona/agent/participant/evcs/EvcsAgent.scala b/src/main/scala/edu/ie3/simona/agent/participant/evcs/EvcsAgent.scala index 59516ff5ab..b2c428242d 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/evcs/EvcsAgent.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/evcs/EvcsAgent.scala @@ -9,7 +9,7 @@ package edu.ie3.simona.agent.participant.evcs import edu.ie3.datamodel.models.input.system.EvcsInput import edu.ie3.simona.agent.participant.data.Data.PrimaryData.{ ApparentPower, - ZERO_POWER + ZERO_POWER, } import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService.ActorEvMovementsService @@ -18,18 +18,18 @@ import edu.ie3.simona.agent.participant.statedata.ParticipantStateData import edu.ie3.simona.agent.participant.statedata.ParticipantStateData.ParticipantInitializeStateData import edu.ie3.simona.agent.participant.{ ParticipantAgent, - ParticipantAgentFundamentals + ParticipantAgentFundamentals, } import edu.ie3.simona.agent.state.AgentState.Idle import edu.ie3.simona.config.SimonaConfig.EvcsRuntimeConfig import edu.ie3.simona.model.participant.evcs.EvcsModel import edu.ie3.simona.model.participant.evcs.EvcsModel.{ EvcsRelevantData, - EvcsState + EvcsState, } import edu.ie3.simona.ontology.messages.services.EvMessage.{ DepartingEvsRequest, - EvFreeLotsRequest + EvFreeLotsRequest, } import edu.ie3.util.scala.quantities.ReactivePower import org.apache.pekko.actor.{ActorRef, Props} @@ -41,15 +41,15 @@ object EvcsAgent { initStateData: ParticipantInitializeStateData[ EvcsInput, EvcsRuntimeConfig, - ApparentPower + ApparentPower, ], - listener: Iterable[ActorRef] + listener: Iterable[ActorRef], ): Props = Props( new EvcsAgent( scheduler, initStateData, - listener + listener, ) ) @@ -63,9 +63,9 @@ class EvcsAgent( initStateData: ParticipantInitializeStateData[ EvcsInput, EvcsRuntimeConfig, - ApparentPower + ApparentPower, ], - override val listener: Iterable[ActorRef] + override val listener: Iterable[ActorRef], ) extends ParticipantAgent[ ApparentPower, EvcsRelevantData, @@ -73,7 +73,7 @@ class EvcsAgent( ParticipantStateData[ApparentPower], EvcsInput, EvcsRuntimeConfig, - EvcsModel + EvcsModel, ](scheduler, initStateData) with EvcsAgentFundamentals { override val alternativeResult: ApparentPower = ZERO_POWER @@ -85,8 +85,8 @@ class EvcsAgent( ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel - ] + EvcsModel, + ], ) => handleFreeLotsRequest(tick, modelBaseStateData) stay() @@ -97,8 +97,8 @@ class EvcsAgent( ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel - ] + EvcsModel, + ], ) => val updatedStateData = handleDepartingEvsRequest(tick, departingEvs, modelBaseStateData) @@ -124,13 +124,13 @@ class EvcsAgent( windowEnd: Long, activeToReactivePowerFuncOpt: Option[ Power => ReactivePower - ] + ], ): ApparentPower = ParticipantAgentFundamentals.averageApparentPower( tickToResults, windowStart, windowEnd, activeToReactivePowerFuncOpt, - log + log, ) } diff --git a/src/main/scala/edu/ie3/simona/agent/participant/evcs/EvcsAgentFundamentals.scala b/src/main/scala/edu/ie3/simona/agent/participant/evcs/EvcsAgentFundamentals.scala index d91295d5ba..9bf4dde900 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/evcs/EvcsAgentFundamentals.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/evcs/EvcsAgentFundamentals.scala @@ -9,7 +9,7 @@ package edu.ie3.simona.agent.participant.evcs import edu.ie3.datamodel.models.input.system.EvcsInput import edu.ie3.datamodel.models.result.system.{ EvcsResult, - SystemParticipantResult + SystemParticipantResult, } import edu.ie3.simona.agent.ValueStore import edu.ie3.simona.agent.participant.ParticipantAgent.getAndCheckNodalVoltage @@ -21,12 +21,12 @@ import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService.Acto import edu.ie3.simona.agent.participant.evcs.EvcsAgent.neededServices import edu.ie3.simona.agent.participant.statedata.BaseStateData.{ FlexControlledData, - ParticipantModelBaseStateData + ParticipantModelBaseStateData, } import edu.ie3.simona.agent.participant.statedata.ParticipantStateData.InputModelContainer import edu.ie3.simona.agent.participant.statedata.{ BaseStateData, - ParticipantStateData + ParticipantStateData, } import edu.ie3.simona.agent.state.AgentState import edu.ie3.simona.agent.state.AgentState.Idle @@ -36,18 +36,18 @@ import edu.ie3.simona.event.notifier.NotifierConfig import edu.ie3.simona.exceptions.agent.{ AgentInitializationException, InconsistentStateException, - InvalidRequestException + InvalidRequestException, } import edu.ie3.simona.model.participant.FlexChangeIndicator import edu.ie3.simona.model.participant.evcs.EvcsModel import edu.ie3.simona.model.participant.evcs.EvcsModel.{ EvcsRelevantData, - EvcsState + EvcsState, } import edu.ie3.simona.ontology.messages.PowerMessage.AssetPowerChangedMessage import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage.{ FlexRequest, - FlexResponse + FlexResponse, } import edu.ie3.simona.ontology.messages.services.EvMessage._ import edu.ie3.simona.util.SimonaConstants @@ -74,7 +74,7 @@ protected trait EvcsAgentFundamentals ParticipantStateData[ApparentPower], EvcsInput, EvcsRuntimeConfig, - EvcsModel + EvcsModel, ] { this: EvcsAgent => override protected val pdClassTag: ClassTag[ApparentPower] = @@ -113,12 +113,12 @@ protected trait EvcsAgentFundamentals resolution: Long, requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, - maybeEmAgent: Option[TypedActorRef[FlexResponse]] + maybeEmAgent: Option[TypedActorRef[FlexResponse]], ): ParticipantModelBaseStateData[ ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel + EvcsModel, ] = { /* Check for needed services */ if (!services.toSeq.map(_.getClass).containsSlice(neededServices)) @@ -132,14 +132,14 @@ protected trait EvcsAgentFundamentals inputModel, modelConfig, simulationStartDate, - simulationEndDate + simulationEndDate, ) ParticipantModelBaseStateData[ ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel + EvcsModel, ]( simulationStartDate, simulationEndDate, @@ -157,13 +157,13 @@ protected trait EvcsAgentFundamentals .to(PU) .getValue .doubleValue - ) + ), ), ValueStore(resolution), ValueStore(resolution), ValueStore(resolution), ValueStore(resolution), - maybeEmAgent.map(FlexControlledData(_, self.toTyped[FlexRequest])) + maybeEmAgent.map(FlexControlledData(_, self.toTyped[FlexRequest])), ) } @@ -171,14 +171,14 @@ protected trait EvcsAgentFundamentals inputModel: InputModelContainer[EvcsInput], modelConfig: EvcsRuntimeConfig, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): EvcsModel = EvcsModel( inputModel.electricalInputModel, modelConfig.scaling, simulationStartDate, simulationEndDate, modelConfig.chargingStrategy, - modelConfig.lowestEvSoc + modelConfig.lowestEvSoc, ) override protected def createInitialState( @@ -186,13 +186,13 @@ protected trait EvcsAgentFundamentals ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel + EvcsModel, ] ): EvcsState = EvcsState( Seq.empty, Map.empty, - SimonaConstants.FIRST_TICK_IN_SIMULATION + SimonaConstants.FIRST_TICK_IN_SIMULATION, ) override protected def createCalcRelevantData( @@ -200,9 +200,9 @@ protected trait EvcsAgentFundamentals ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel + EvcsModel, ], - tick: Long + tick: Long, ): EvcsRelevantData = { // always only take arrivals for the current tick // or empty sequence if none arrived @@ -239,18 +239,18 @@ protected trait EvcsAgentFundamentals ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel + EvcsModel, ], data: EvcsRelevantData, lastState: EvcsState, - setPower: squants.Power + setPower: squants.Power, ): (EvcsState, ApparentPower, FlexChangeIndicator) = { /* Calculate the power */ val voltage = getAndCheckNodalVoltage(baseStateData, tick) val reactivePower = baseStateData.model.calculateReactivePower( setPower, - voltage + voltage, ) val result = ApparentPower(setPower, reactivePower) @@ -270,10 +270,10 @@ protected trait EvcsAgentFundamentals ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel + EvcsModel, ], EvcsState, - Dimensionless + Dimensionless, ) => ApparentPower = (_, _, _, _) => throw new InvalidRequestException( @@ -306,11 +306,11 @@ protected trait EvcsAgentFundamentals ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel + EvcsModel, ], lastModelState: EvcsState, tick: Long, - scheduler: ActorRef + scheduler: ActorRef, ): FSM.State[AgentState, ParticipantStateData[ApparentPower]] = { /* extract EV data from secondary data, which should have been requested and received before */ baseStateData.receivedSecondaryDataStore @@ -322,7 +322,7 @@ protected trait EvcsAgentFundamentals handleArrivingEvsAndGoIdle( tick, scheduler, - baseStateData + baseStateData, ) } .getOrElse( @@ -347,8 +347,8 @@ protected trait EvcsAgentFundamentals ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel - ] + EvcsModel, + ], ): Unit = { val evServiceRef = getService[ActorEvMovementsService]( modelBaseStateData.services @@ -359,7 +359,7 @@ protected trait EvcsAgentFundamentals evServiceRef ! FreeLotsResponse( modelBaseStateData.model.uuid, - modelBaseStateData.model.chargingPoints - lastState.evs.size + modelBaseStateData.model.chargingPoints - lastState.evs.size, ) } @@ -381,13 +381,13 @@ protected trait EvcsAgentFundamentals ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel - ] + EvcsModel, + ], ): ParticipantModelBaseStateData[ ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel + EvcsModel, ] = { val evServiceRef = getService[ActorEvMovementsService]( baseStateData.services @@ -410,7 +410,7 @@ protected trait EvcsAgentFundamentals val updatedEvs = baseStateData.model.applySchedule( lastState, - tick + tick, ) val (departingEvs, stayingEvs) = updatedEvs.partition { ev => @@ -421,7 +421,7 @@ protected trait EvcsAgentFundamentals if (requestedDepartingEvs.nonEmpty) { evServiceRef ! DepartingEvsResponse( baseStateData.modelUuid, - departingEvs + departingEvs, ) } @@ -430,7 +430,7 @@ protected trait EvcsAgentFundamentals determineResultsAnnounceUpdateValueStore( lastState, tick, - baseStateData + baseStateData, ) val stayingSchedules = @@ -451,9 +451,9 @@ protected trait EvcsAgentFundamentals stateDataStore = ValueStore.updateValueStore( baseStateData.stateDataStore, tick, - newState + newState, ), - resultValueStore = updatedResultValueStore + resultValueStore = updatedResultValueStore, ) } @@ -478,8 +478,8 @@ protected trait EvcsAgentFundamentals ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel - ] + EvcsModel, + ], ): FSM.State[AgentState, ParticipantStateData[ApparentPower]] = { val relevantData = @@ -489,13 +489,13 @@ protected trait EvcsAgentFundamentals val currentEvs = modelBaseStateData.model.determineCurrentEvs( relevantData, - lastState + lastState, ) // if new EVs arrived, a new scheduling must be calculated. val newSchedule = modelBaseStateData.model.calculateNewScheduling( relevantData, - currentEvs + currentEvs, ) // create new current state @@ -504,7 +504,7 @@ protected trait EvcsAgentFundamentals val updatedStateDataStore = ValueStore.updateValueStore( modelBaseStateData.stateDataStore, tick, - newState + newState, ) /* Update the base state data with the updated result value store and relevant data store */ @@ -515,7 +515,7 @@ protected trait EvcsAgentFundamentals // We're only here if we're not flex-controlled, thus sending a Completion is always right goToIdleReplyCompletionAndScheduleTriggerForNextAction( updatedBaseStateData, - scheduler + scheduler, ) } @@ -545,7 +545,7 @@ protected trait EvcsAgentFundamentals mostRecentRequest: Option[(Long, ApparentPower)], nodalVoltage: squants.Dimensionless, updatedVoltageValueStore: ValueStore[squants.Dimensionless], - alternativeResult: ApparentPower + alternativeResult: ApparentPower, ): FSM.State[AgentState, ParticipantStateData[ApparentPower]] = { /* No fast reply possible --> Some calculations have to be made */ mostRecentRequest match { @@ -561,7 +561,7 @@ protected trait EvcsAgentFundamentals ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel + EvcsModel, ] => /* Active power is yet calculated, but reactive power needs update */ val nextReactivePower = modelBaseStateData.model @@ -572,18 +572,18 @@ protected trait EvcsAgentFundamentals ValueStore.updateValueStore( baseStateData.requestValueStore, requestTick, - lastResult.withReactivePower(nextReactivePower) + lastResult.withReactivePower(nextReactivePower), ) val nextStateData = modelBaseStateData.copy( requestValueStore = updatedRequestValueStore, - voltageValueStore = updatedVoltageValueStore + voltageValueStore = updatedVoltageValueStore, ) stay() using nextStateData replying AssetPowerChangedMessage( lastResult.p, - nextReactivePower + nextReactivePower, ) case unexpectedStateData => throw new IllegalStateException( @@ -605,7 +605,7 @@ protected trait EvcsAgentFundamentals ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel + EvcsModel, ] => val lastState = getLastOrInitialStateData(modelBaseStateData, requestTick) @@ -614,7 +614,7 @@ protected trait EvcsAgentFundamentals determineResultsAnnounceUpdateValueStore( lastState, requestTick, - modelBaseStateData + modelBaseStateData, ) modelBaseStateData.copy( @@ -630,7 +630,7 @@ protected trait EvcsAgentFundamentals getRelevantResultData( requestTick, updatedBaseStateData.resultValueStore, - updatedBaseStateData.requestValueStore + updatedBaseStateData.requestValueStore, ) match { case Some(relevantData) => /* There is at least one relevant simulation result apparent, which might also be the most recent one @@ -641,7 +641,7 @@ protected trait EvcsAgentFundamentals requestTick, nodalVoltage, updatedVoltageValueStore, - alternativeResult + alternativeResult, ) case None => /* There is no simulation result at all. Reply with zero power */ @@ -649,7 +649,7 @@ protected trait EvcsAgentFundamentals updatedBaseStateData, alternativeResult, requestTick, - updatedVoltageValueStore + updatedVoltageValueStore, ) } } @@ -672,15 +672,15 @@ protected trait EvcsAgentFundamentals ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel + EvcsModel, ], result: ApparentPower, - currentTick: Long + currentTick: Long, ): ParticipantModelBaseStateData[ ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel + EvcsModel, ] = { // calculate results from last schedule @@ -698,7 +698,7 @@ protected trait EvcsAgentFundamentals determineResultsAnnounceUpdateValueStore( lastState, currentTick, - baseStateData + baseStateData, ) baseStateData.copy( @@ -707,7 +707,7 @@ protected trait EvcsAgentFundamentals ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel + EvcsModel, ] } } @@ -734,8 +734,8 @@ protected trait EvcsAgentFundamentals ApparentPower, EvcsRelevantData, EvcsState, - EvcsModel - ] + EvcsModel, + ], ): ValueStore[ApparentPower] = { val voltage = modelBaseStateData.voltageValueStore @@ -748,7 +748,7 @@ protected trait EvcsAgentFundamentals val (evResults, evcsResults) = modelBaseStateData.model.createResults( lastState, currentTick, - voltage + voltage, ) // send out EV results @@ -770,8 +770,8 @@ protected trait EvcsAgentFundamentals result.getTime.toTick(modelBaseStateData.startDate), ApparentPower( Megawatts(result.getP.to(MEGAWATT).getValue.doubleValue), - Megavars(result.getQ.to(MEGAVAR).getValue.doubleValue) - ) + Megavars(result.getQ.to(MEGAVAR).getValue.doubleValue), + ), ) } } @@ -790,13 +790,13 @@ protected trait EvcsAgentFundamentals override protected def buildResult( uuid: UUID, dateTime: ZonedDateTime, - result: ApparentPower + result: ApparentPower, ): SystemParticipantResult = new EvcsResult( dateTime, uuid, result.p.toMegawatts.asMegaWatt, - result.q.toMegavars.asMegaVar + result.q.toMegavars.asMegaVar, ) /** Update the last known model state with the given external, relevant data @@ -820,6 +820,6 @@ protected trait EvcsAgentFundamentals modelState: EvcsState, calcRelevantData: EvcsRelevantData, nodalVoltage: squants.Dimensionless, - model: EvcsModel + model: EvcsModel, ): EvcsState = modelState } diff --git a/src/main/scala/edu/ie3/simona/agent/participant/fixedfeedin/FixedFeedInAgent.scala b/src/main/scala/edu/ie3/simona/agent/participant/fixedfeedin/FixedFeedInAgent.scala index 3d38db1105..9b5b681f90 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/fixedfeedin/FixedFeedInAgent.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/fixedfeedin/FixedFeedInAgent.scala @@ -23,9 +23,9 @@ object FixedFeedInAgent { initStateData: ParticipantInitializeStateData[ FixedFeedInInput, FixedFeedInRuntimeConfig, - ApparentPower + ApparentPower, ], - listener: Iterable[ActorRef] + listener: Iterable[ActorRef], ): Props = Props(new FixedFeedInAgent(scheduler, initStateData, listener)) } @@ -42,9 +42,9 @@ class FixedFeedInAgent( initStateData: ParticipantInitializeStateData[ FixedFeedInInput, FixedFeedInRuntimeConfig, - ApparentPower + ApparentPower, ], - override val listener: Iterable[ActorRef] + override val listener: Iterable[ActorRef], ) extends ParticipantAgent[ ApparentPower, FixedRelevantData.type, @@ -52,7 +52,7 @@ class FixedFeedInAgent( ParticipantStateData[ApparentPower], FixedFeedInInput, FixedFeedInRuntimeConfig, - FixedFeedInModel + FixedFeedInModel, ](scheduler, initStateData) with FixedFeedInAgentFundamentals { diff --git a/src/main/scala/edu/ie3/simona/agent/participant/fixedfeedin/FixedFeedInAgentFundamentals.scala b/src/main/scala/edu/ie3/simona/agent/participant/fixedfeedin/FixedFeedInAgentFundamentals.scala index c68b8a4b82..cbaabae42e 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/fixedfeedin/FixedFeedInAgentFundamentals.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/fixedfeedin/FixedFeedInAgentFundamentals.scala @@ -9,20 +9,20 @@ package edu.ie3.simona.agent.participant.fixedfeedin import edu.ie3.datamodel.models.input.system.FixedFeedInInput import edu.ie3.datamodel.models.result.system.{ FixedFeedInResult, - SystemParticipantResult + SystemParticipantResult, } import edu.ie3.simona.agent.ValueStore import edu.ie3.simona.agent.participant.ParticipantAgent.getAndCheckNodalVoltage import edu.ie3.simona.agent.participant.ParticipantAgentFundamentals import edu.ie3.simona.agent.participant.data.Data.PrimaryData.{ ApparentPower, - ZERO_POWER + ZERO_POWER, } import edu.ie3.simona.agent.participant.data.Data.SecondaryData import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService import edu.ie3.simona.agent.participant.statedata.BaseStateData.{ FlexControlledData, - ParticipantModelBaseStateData + ParticipantModelBaseStateData, } import edu.ie3.simona.agent.participant.statedata.ParticipantStateData import edu.ie3.simona.agent.participant.statedata.ParticipantStateData.InputModelContainer @@ -32,7 +32,7 @@ import edu.ie3.simona.config.SimonaConfig.FixedFeedInRuntimeConfig import edu.ie3.simona.event.notifier.NotifierConfig import edu.ie3.simona.exceptions.agent.{ InconsistentStateException, - InvalidRequestException + InvalidRequestException, } import edu.ie3.simona.model.participant.CalcRelevantData.FixedRelevantData import edu.ie3.simona.model.participant.ModelState.ConstantState @@ -40,11 +40,11 @@ import edu.ie3.simona.model.participant.{ CalcRelevantData, FixedFeedInModel, FlexChangeIndicator, - ModelState + ModelState, } import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage.{ FlexRequest, - FlexResponse + FlexResponse, } import edu.ie3.simona.util.SimonaConstants import edu.ie3.simona.util.TickUtil.RichZonedDateTime @@ -69,7 +69,7 @@ protected trait FixedFeedInAgentFundamentals ParticipantStateData[ApparentPower], FixedFeedInInput, FixedFeedInRuntimeConfig, - FixedFeedInModel + FixedFeedInModel, ] { this: FixedFeedInAgent => override protected val pdClassTag: ClassTag[ApparentPower] = @@ -109,12 +109,12 @@ protected trait FixedFeedInAgentFundamentals resolution: Long, requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, - maybeEmAgent: Option[TypedActorRef[FlexResponse]] + maybeEmAgent: Option[TypedActorRef[FlexResponse]], ): ParticipantModelBaseStateData[ ApparentPower, FixedRelevantData.type, ConstantState.type, - FixedFeedInModel + FixedFeedInModel, ] = { /* Build the calculation model */ val model = @@ -122,7 +122,7 @@ protected trait FixedFeedInAgentFundamentals inputModel, modelConfig, simulationStartDate, - simulationEndDate + simulationEndDate, ) /* Go and collect all ticks, in which new data will be available. Also register for @@ -139,14 +139,14 @@ protected trait FixedFeedInAgentFundamentals SortedSet[Long]( SimonaConstants.FIRST_TICK_IN_SIMULATION, model.operationInterval.start, - model.operationInterval.end + model.operationInterval.end, ).filterNot(_ == lastTickInSimulation) ParticipantModelBaseStateData[ ApparentPower, FixedRelevantData.type, ConstantState.type, - FixedFeedInModel + FixedFeedInModel, ]( simulationStartDate, simulationEndDate, @@ -164,13 +164,13 @@ protected trait FixedFeedInAgentFundamentals .to(PU) .getValue .doubleValue - ) + ), ), ValueStore(resolution), ValueStore(resolution), ValueStore(resolution), ValueStore(resolution), - maybeEmAgent.map(FlexControlledData(_, self.toTyped[FlexRequest])) + maybeEmAgent.map(FlexControlledData(_, self.toTyped[FlexRequest])), ) } @@ -178,12 +178,12 @@ protected trait FixedFeedInAgentFundamentals inputModel: InputModelContainer[FixedFeedInInput], modelConfig: FixedFeedInRuntimeConfig, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): FixedFeedInModel = FixedFeedInModel( inputModel.electricalInputModel, modelConfig, simulationStartDate, - simulationEndDate + simulationEndDate, ) override protected def createInitialState( @@ -191,7 +191,7 @@ protected trait FixedFeedInAgentFundamentals ApparentPower, FixedRelevantData.type, ConstantState.type, - FixedFeedInModel + FixedFeedInModel, ] ): ModelState.ConstantState.type = ConstantState @@ -200,9 +200,9 @@ protected trait FixedFeedInAgentFundamentals ApparentPower, FixedRelevantData.type, ConstantState.type, - FixedFeedInModel + FixedFeedInModel, ], - tick: Long + tick: Long, ): FixedRelevantData.type = FixedRelevantData @@ -226,18 +226,18 @@ protected trait FixedFeedInAgentFundamentals ApparentPower, FixedRelevantData.type, ConstantState.type, - FixedFeedInModel + FixedFeedInModel, ], data: FixedRelevantData.type, lastState: ConstantState.type, - setPower: squants.Power + setPower: squants.Power, ): (ConstantState.type, ApparentPower, FlexChangeIndicator) = { /* Calculate result */ val voltage = getAndCheckNodalVoltage(baseStateData, tick) val reactivePower = baseStateData.model.calculateReactivePower( setPower, - voltage + voltage, ) val result = ApparentPower(setPower, reactivePower) @@ -253,20 +253,20 @@ protected trait FixedFeedInAgentFundamentals ApparentPower, FixedRelevantData.type, ConstantState.type, - FixedFeedInModel + FixedFeedInModel, ], ConstantState.type, - Dimensionless + Dimensionless, ) => ApparentPower = ( currentTick: Long, baseStateData: ParticipantModelBaseStateData[ ApparentPower, FixedRelevantData.type, ConstantState.type, - FixedFeedInModel + FixedFeedInModel, ], state: ConstantState.type, - voltage: Dimensionless + voltage: Dimensionless, ) => baseStateData.model match { case fixedModel: FixedFeedInModel => @@ -274,7 +274,7 @@ protected trait FixedFeedInAgentFundamentals currentTick, voltage, state, - FixedRelevantData + FixedRelevantData, ) case unsupportedModel => throw new InconsistentStateException( @@ -308,11 +308,11 @@ protected trait FixedFeedInAgentFundamentals ApparentPower, FixedRelevantData.type, ConstantState.type, - FixedFeedInModel + FixedFeedInModel, ], lastModelState: ConstantState.type, currentTick: Long, - scheduler: ActorRef + scheduler: ActorRef, ): FSM.State[AgentState, ParticipantStateData[ApparentPower]] = throw new InvalidRequestException( "Request to calculate power with secondary data cannot be processed in a fixed feed in agent." @@ -337,14 +337,14 @@ protected trait FixedFeedInAgentFundamentals windowEnd: Long, activeToReactivePowerFuncOpt: Option[ Power => ReactivePower - ] = None + ] = None, ): ApparentPower = ParticipantAgentFundamentals.averageApparentPower( tickToResults, windowStart, windowEnd, activeToReactivePowerFuncOpt, - log + log, ) /** Determines the correct result. @@ -361,13 +361,13 @@ protected trait FixedFeedInAgentFundamentals override protected def buildResult( uuid: UUID, dateTime: ZonedDateTime, - result: ApparentPower + result: ApparentPower, ): SystemParticipantResult = new FixedFeedInResult( dateTime, uuid, result.p.toMegawatts.asMegaWatt, - result.q.toMegavars.asMegaVar + result.q.toMegavars.asMegaVar, ) /** Update the last known model state with the given external, relevant data @@ -391,6 +391,6 @@ protected trait FixedFeedInAgentFundamentals modelState: ModelState.ConstantState.type, calcRelevantData: CalcRelevantData.FixedRelevantData.type, nodalVoltage: squants.Dimensionless, - model: FixedFeedInModel + model: FixedFeedInModel, ): ModelState.ConstantState.type = modelState } diff --git a/src/main/scala/edu/ie3/simona/agent/participant/hp/HpAgent.scala b/src/main/scala/edu/ie3/simona/agent/participant/hp/HpAgent.scala index 2f587e710a..0be0c2877b 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/hp/HpAgent.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/hp/HpAgent.scala @@ -24,15 +24,15 @@ object HpAgent { initStateData: ParticipantInitializeStateData[ HpInput, HpRuntimeConfig, - ApparentPowerAndHeat + ApparentPowerAndHeat, ], - listener: Iterable[ActorRef] + listener: Iterable[ActorRef], ): Props = Props( new HpAgent( scheduler, initStateData, - listener + listener, ) ) @@ -46,9 +46,9 @@ class HpAgent( initStateData: ParticipantInitializeStateData[ HpInput, HpRuntimeConfig, - ApparentPowerAndHeat + ApparentPowerAndHeat, ], - override val listener: Iterable[ActorRef] + override val listener: Iterable[ActorRef], ) extends ParticipantAgent[ ApparentPowerAndHeat, HpRelevantData, @@ -58,7 +58,7 @@ class HpAgent( ], HpInput, HpRuntimeConfig, - HpModel + HpModel, ](scheduler, initStateData) with HpAgentFundamentals { diff --git a/src/main/scala/edu/ie3/simona/agent/participant/hp/HpAgentFundamentals.scala b/src/main/scala/edu/ie3/simona/agent/participant/hp/HpAgentFundamentals.scala index 2136bb7776..0fb9103312 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/hp/HpAgentFundamentals.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/hp/HpAgentFundamentals.scala @@ -9,7 +9,7 @@ package edu.ie3.simona.agent.participant.hp import edu.ie3.datamodel.models.input.system.HpInput import edu.ie3.datamodel.models.result.system.{ HpResult, - SystemParticipantResult + SystemParticipantResult, } import edu.ie3.simona.agent.ValueStore import edu.ie3.simona.agent.participant.ParticipantAgent.getAndCheckNodalVoltage @@ -20,15 +20,15 @@ import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService import edu.ie3.simona.agent.participant.hp.HpAgent.neededServices import edu.ie3.simona.agent.participant.statedata.BaseStateData.{ FlexControlledData, - ParticipantModelBaseStateData + ParticipantModelBaseStateData, } import edu.ie3.simona.agent.participant.statedata.ParticipantStateData.{ InputModelContainer, - WithHeatInputContainer + WithHeatInputContainer, } import edu.ie3.simona.agent.participant.statedata.{ BaseStateData, - ParticipantStateData + ParticipantStateData, } import edu.ie3.simona.agent.state.AgentState import edu.ie3.simona.agent.state.AgentState.Idle @@ -37,7 +37,7 @@ import edu.ie3.simona.event.notifier.NotifierConfig import edu.ie3.simona.exceptions.agent.{ AgentInitializationException, InconsistentStateException, - InvalidRequestException + InvalidRequestException, } import edu.ie3.simona.io.result.AccompaniedSimulationResult import edu.ie3.simona.model.participant.HpModel.{HpRelevantData, HpState} @@ -45,7 +45,7 @@ import edu.ie3.simona.model.participant.{FlexChangeIndicator, HpModel} import edu.ie3.simona.model.thermal.ThermalGrid import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage.{ FlexRequest, - FlexResponse + FlexResponse, } import edu.ie3.simona.ontology.messages.services.WeatherMessage.WeatherData import edu.ie3.util.quantities.PowerSystemUnits.PU @@ -70,7 +70,7 @@ trait HpAgentFundamentals ParticipantStateData[ApparentPowerAndHeat], HpInput, HpRuntimeConfig, - HpModel + HpModel, ] { this: HpAgent => override protected val pdClassTag: ClassTag[ApparentPowerAndHeat] = @@ -78,7 +78,7 @@ trait HpAgentFundamentals override val alternativeResult: ApparentPowerAndHeat = ApparentPowerAndHeat( Megawatts(0d), Megavars(0d), - Megawatts(0d) + Megawatts(0d), ) /** Partial function, that is able to transfer @@ -91,10 +91,10 @@ trait HpAgentFundamentals ApparentPowerAndHeat, HpRelevantData, HpState, - HpModel + HpModel, ], HpState, - Dimensionless + Dimensionless, ) => ApparentPowerAndHeat = (_, _, _, _) => throw new InvalidRequestException( @@ -106,7 +106,7 @@ trait HpAgentFundamentals ApparentPowerAndHeat, HpRelevantData, HpState, - HpModel + HpModel, ] ): HpState = startingState(baseStateData.model.thermalGrid) @@ -119,7 +119,7 @@ trait HpAgentFundamentals Megawatts(0d), Megawatts(0d), ThermalGrid.startingState(thermalGrid), - None + None, ) /** Handle an active power change by flex control. @@ -142,11 +142,11 @@ trait HpAgentFundamentals ApparentPowerAndHeat, HpRelevantData, HpState, - HpModel + HpModel, ], data: HpRelevantData, lastState: HpState, - setPower: squants.Power + setPower: squants.Power, ): (HpState, ApparentPowerAndHeat, FlexChangeIndicator) = { /* Determine needed information */ val voltage = @@ -180,7 +180,7 @@ trait HpAgentFundamentals tick, voltage, updatedState, - relevantData + relevantData, ) (updatedState, result, flexChangeIndicator) @@ -213,11 +213,11 @@ trait HpAgentFundamentals ApparentPowerAndHeat, HpRelevantData, HpState, - HpModel + HpModel, ], lastModelState: HpState, currentTick: Long, - scheduler: ActorRef + scheduler: ActorRef, ): FSM.State[AgentState, ParticipantStateData[ApparentPowerAndHeat]] = { /* Determine needed information */ @@ -232,7 +232,7 @@ trait HpAgentFundamentals lastModelState, relevantData, voltage, - baseStateData.model + baseStateData.model, ) /* Calculate power results */ @@ -240,7 +240,7 @@ trait HpAgentFundamentals currentTick, voltage, updatedState, - relevantData + relevantData, ) val accompanyingResults = baseStateData.model.thermalGrid.results( lastModelState.thermalGridState @@ -250,7 +250,7 @@ trait HpAgentFundamentals val updatedStateDataStore = ValueStore.updateValueStore( baseStateData.stateDataStore, currentTick, - updatedState + updatedState, ) val updatedBaseStateData = baseStateData.copy(stateDataStore = updatedStateDataStore) @@ -258,7 +258,7 @@ trait HpAgentFundamentals scheduler, updatedBaseStateData, result, - relevantData + relevantData, ) } @@ -283,7 +283,7 @@ trait HpAgentFundamentals modelState: HpState, calcRelevantData: HpRelevantData, nodalVoltage: squants.Dimensionless, - model: HpModel + model: HpModel, ): HpState = model.determineState(modelState, calcRelevantData) /** Abstract definition, individual implementations found in individual agent @@ -298,12 +298,12 @@ trait HpAgentFundamentals resolution: Long, requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, - maybeEmAgent: Option[TypedActorRef[FlexResponse]] + maybeEmAgent: Option[TypedActorRef[FlexResponse]], ): BaseStateData.ParticipantModelBaseStateData[ ApparentPowerAndHeat, HpRelevantData, HpState, - HpModel + HpModel, ] = { if (!services.toSeq.map(_.getClass).containsSlice(neededServices)) throw new AgentInitializationException( @@ -317,7 +317,7 @@ trait HpAgentFundamentals withHeatContainer, modelConfig, simulationStartDate, - simulationEndDate + simulationEndDate, ) /* Determine a proper starting model state and save it into the base state data */ @@ -325,14 +325,14 @@ trait HpAgentFundamentals val stateDataStore = ValueStore.updateValueStore( ValueStore(resolution), -1L, - startingModelState + startingModelState, ) ParticipantModelBaseStateData[ ApparentPowerAndHeat, HpRelevantData, HpState, - HpModel + HpModel, ]( simulationStartDate, simulationEndDate, @@ -350,13 +350,13 @@ trait HpAgentFundamentals .to(PU) .getValue .doubleValue - ) + ), ), ValueStore(resolution), ValueStore(resolution), ValueStore(resolution), stateDataStore, - maybeEmAgent.map(FlexControlledData(_, self.toTyped[FlexRequest])) + maybeEmAgent.map(FlexControlledData(_, self.toTyped[FlexRequest])), ) case unsupported => throw new AgentInitializationException( @@ -371,9 +371,9 @@ trait HpAgentFundamentals ApparentPowerAndHeat, HpRelevantData, HpState, - HpModel + HpModel, ], - tick: Long + tick: Long, ): HpRelevantData = { /* extract weather data from secondary data, which should have been requested and received before */ val weatherData = @@ -398,7 +398,7 @@ trait HpAgentFundamentals HpRelevantData( tick, - weatherData.temp.inKelvin + weatherData.temp.inKelvin, ) } @@ -418,7 +418,7 @@ trait HpAgentFundamentals inputModel: InputModelContainer[HpInput], modelConfig: HpRuntimeConfig, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): HpModel = inputModel match { case ParticipantStateData.SimpleInputContainer(_) => throw new AgentInitializationException( @@ -431,7 +431,7 @@ trait HpAgentFundamentals modelConfig.scaling, simulationStartDate, simulationEndDate, - ThermalGrid(thermalGrid) + ThermalGrid(thermalGrid), ) } @@ -454,14 +454,14 @@ trait HpAgentFundamentals windowEnd: Long, activeToReactivePowerFuncOpt: Option[ Power => ReactivePower - ] + ], ): ApparentPowerAndHeat = ParticipantAgentFundamentals.averageApparentPowerAndHeat( tickToResults, windowStart, windowEnd, activeToReactivePowerFuncOpt, - log + log, ) /** Determines the correct result. @@ -478,12 +478,12 @@ trait HpAgentFundamentals override protected def buildResult( uuid: UUID, dateTime: ZonedDateTime, - result: ApparentPowerAndHeat + result: ApparentPowerAndHeat, ): SystemParticipantResult = new HpResult( dateTime, uuid, result.p.toMegawatts.asMegaWatt, result.q.toMegavars.asMegaVar, - result.qDot.toMegawatts.asMegaWatt + result.qDot.toMegawatts.asMegaWatt, ) } diff --git a/src/main/scala/edu/ie3/simona/agent/participant/load/LoadAgent.scala b/src/main/scala/edu/ie3/simona/agent/participant/load/LoadAgent.scala index ed432fb4be..338547efbc 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/load/LoadAgent.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/load/LoadAgent.scala @@ -12,7 +12,7 @@ import edu.ie3.simona.agent.participant.data.Data.PrimaryData.ApparentPower import edu.ie3.simona.agent.participant.load.LoadAgentFundamentals.{ FixedLoadAgentFundamentals, ProfileLoadAgentFundamentals, - RandomLoadAgentFundamentals + RandomLoadAgentFundamentals, } import edu.ie3.simona.agent.participant.statedata.ParticipantStateData import edu.ie3.simona.agent.participant.statedata.ParticipantStateData.ParticipantInitializeStateData @@ -26,7 +26,7 @@ import edu.ie3.simona.model.participant.load.random.RandomLoadModel.RandomReleva import edu.ie3.simona.model.participant.load.{ FixedLoadModel, LoadModel, - LoadModelBehaviour + LoadModelBehaviour, } import org.apache.pekko.actor.{ActorRef, Props} @@ -36,9 +36,9 @@ object LoadAgent { initStateData: ParticipantInitializeStateData[ LoadInput, LoadRuntimeConfig, - ApparentPower + ApparentPower, ], - listener: Iterable[ActorRef] + listener: Iterable[ActorRef], ): Props = LoadModelBehaviour(initStateData.modelConfig.modelBehaviour) match { case LoadModelBehaviour.FIX => @@ -58,12 +58,12 @@ object LoadAgent { initStateData: ParticipantInitializeStateData[ LoadInput, LoadRuntimeConfig, - ApparentPower + ApparentPower, ], - override val listener: Iterable[ActorRef] + override val listener: Iterable[ActorRef], ) extends LoadAgent[ FixedLoadModel.FixedLoadRelevantData.type, - FixedLoadModel + FixedLoadModel, ](scheduler, initStateData, listener) with FixedLoadAgentFundamentals @@ -72,12 +72,12 @@ object LoadAgent { initStateData: ParticipantInitializeStateData[ LoadInput, LoadRuntimeConfig, - ApparentPower + ApparentPower, ], - override val listener: Iterable[ActorRef] + override val listener: Iterable[ActorRef], ) extends LoadAgent[ ProfileRelevantData, - ProfileLoadModel + ProfileLoadModel, ](scheduler, initStateData, listener) with ProfileLoadAgentFundamentals @@ -86,12 +86,12 @@ object LoadAgent { initStateData: ParticipantInitializeStateData[ LoadInput, LoadRuntimeConfig, - ApparentPower + ApparentPower, ], - override val listener: Iterable[ActorRef] + override val listener: Iterable[ActorRef], ) extends LoadAgent[ RandomRelevantData, - RandomLoadModel + RandomLoadModel, ](scheduler, initStateData, listener) with RandomLoadAgentFundamentals } @@ -108,9 +108,9 @@ abstract class LoadAgent[LD <: LoadRelevantData, LM <: LoadModel[LD]]( initStateData: ParticipantInitializeStateData[ LoadInput, LoadRuntimeConfig, - ApparentPower + ApparentPower, ], - override val listener: Iterable[ActorRef] + override val listener: Iterable[ActorRef], ) extends ParticipantAgent[ ApparentPower, LD, @@ -118,7 +118,7 @@ abstract class LoadAgent[LD <: LoadRelevantData, LM <: LoadModel[LD]]( ParticipantStateData[ApparentPower], LoadInput, LoadRuntimeConfig, - LM + LM, ](scheduler, initStateData) with LoadAgentFundamentals[LD, LM] { /* diff --git a/src/main/scala/edu/ie3/simona/agent/participant/load/LoadAgentFundamentals.scala b/src/main/scala/edu/ie3/simona/agent/participant/load/LoadAgentFundamentals.scala index a419ea5fb7..79df65997c 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/load/LoadAgentFundamentals.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/load/LoadAgentFundamentals.scala @@ -9,20 +9,20 @@ package edu.ie3.simona.agent.participant.load import edu.ie3.datamodel.models.input.system.LoadInput import edu.ie3.datamodel.models.result.system.{ LoadResult, - SystemParticipantResult + SystemParticipantResult, } import edu.ie3.simona.agent.ValueStore import edu.ie3.simona.agent.participant.ParticipantAgent.getAndCheckNodalVoltage import edu.ie3.simona.agent.participant.ParticipantAgentFundamentals import edu.ie3.simona.agent.participant.data.Data.PrimaryData.{ ApparentPower, - ZERO_POWER + ZERO_POWER, } import edu.ie3.simona.agent.participant.data.Data.SecondaryData import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService import edu.ie3.simona.agent.participant.statedata.BaseStateData.{ FlexControlledData, - ParticipantModelBaseStateData + ParticipantModelBaseStateData, } import edu.ie3.simona.agent.participant.statedata.ParticipantStateData import edu.ie3.simona.agent.participant.statedata.ParticipantStateData.InputModelContainer @@ -38,22 +38,22 @@ import edu.ie3.simona.model.participant.load.FixedLoadModel.FixedLoadRelevantDat import edu.ie3.simona.model.participant.load.profile.ProfileLoadModel.ProfileRelevantData import edu.ie3.simona.model.participant.load.profile.{ LoadProfileStore, - ProfileLoadModel + ProfileLoadModel, } import edu.ie3.simona.model.participant.load.random.RandomLoadModel.RandomRelevantData import edu.ie3.simona.model.participant.load.random.{ RandomLoadModel, - RandomLoadParamStore + RandomLoadParamStore, } import edu.ie3.simona.model.participant.load.{ FixedLoadModel, LoadModel, - LoadReference + LoadReference, } import edu.ie3.simona.model.participant.{FlexChangeIndicator, ModelState} import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage.{ FlexRequest, - FlexResponse + FlexResponse, } import edu.ie3.simona.util.SimonaConstants import edu.ie3.simona.util.TickUtil._ @@ -80,7 +80,7 @@ protected trait LoadAgentFundamentals[LD <: LoadRelevantData, LM <: LoadModel[ ParticipantStateData[ApparentPower], LoadInput, LoadRuntimeConfig, - LM + LM, ] { this: LoadAgent[LD, LM] => override protected val pdClassTag: ClassTag[ApparentPower] = @@ -120,12 +120,12 @@ protected trait LoadAgentFundamentals[LD <: LoadRelevantData, LM <: LoadModel[ resolution: Long, requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, - maybeEmAgent: Option[TypedActorRef[FlexResponse]] + maybeEmAgent: Option[TypedActorRef[FlexResponse]], ): ParticipantModelBaseStateData[ ApparentPower, LD, ConstantState.type, - LM + LM, ] = { /* Build the calculation model */ val model = @@ -133,7 +133,7 @@ protected trait LoadAgentFundamentals[LD <: LoadRelevantData, LM <: LoadModel[ inputModel, modelConfig, simulationStartDate, - simulationEndDate + simulationEndDate, ) /* Go and collect all ticks, in which activation is needed in addition to the activations made by incoming data. @@ -152,21 +152,21 @@ protected trait LoadAgentFundamentals[LD <: LoadRelevantData, LM <: LoadModel[ SortedSet[Long]( SimonaConstants.FIRST_TICK_IN_SIMULATION, fixedLoadModel.operationInterval.start, - fixedLoadModel.operationInterval.end + fixedLoadModel.operationInterval.end, ).filterNot(_ == lastTickInSimulation) case profileLoadModel: ProfileLoadModel => activationTicksInOperationTime( simulationStartDate, LoadProfileStore.resolution.getSeconds, profileLoadModel.operationInterval.start, - profileLoadModel.operationInterval.end + profileLoadModel.operationInterval.end, ) case randomLoadModel: RandomLoadModel => activationTicksInOperationTime( simulationStartDate, RandomLoadParamStore.resolution.getSeconds, randomLoadModel.operationInterval.start, - randomLoadModel.operationInterval.end + randomLoadModel.operationInterval.end, ) case _ => SortedSet.empty[Long] @@ -189,13 +189,13 @@ protected trait LoadAgentFundamentals[LD <: LoadRelevantData, LM <: LoadModel[ .to(PU) .getValue .doubleValue - ) + ), ), ValueStore(resolution), ValueStore(resolution), ValueStore(resolution), ValueStore(resolution), - maybeEmAgent.map(FlexControlledData(_, self.toTyped[FlexRequest])) + maybeEmAgent.map(FlexControlledData(_, self.toTyped[FlexRequest])), ) } @@ -203,20 +203,20 @@ protected trait LoadAgentFundamentals[LD <: LoadRelevantData, LM <: LoadModel[ inputModel: InputModelContainer[LoadInput], modelConfig: LoadRuntimeConfig, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): LM = { val operationInterval: OperationInterval = SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - inputModel.electricalInputModel.getOperationTime + inputModel.electricalInputModel.getOperationTime, ) val reference = LoadReference(inputModel.electricalInputModel, modelConfig) buildModel( inputModel.electricalInputModel, operationInterval, modelConfig, - reference + reference, ) } @@ -224,7 +224,7 @@ protected trait LoadAgentFundamentals[LD <: LoadRelevantData, LM <: LoadModel[ inputModel: LoadInput, operationInterval: OperationInterval, modelConfig: LoadRuntimeConfig, - reference: LoadReference + reference: LoadReference, ): LM override protected def createInitialState( @@ -232,7 +232,7 @@ protected trait LoadAgentFundamentals[LD <: LoadRelevantData, LM <: LoadModel[ ApparentPower, LD, ConstantState.type, - LM + LM, ] ): ModelState.ConstantState.type = ConstantState @@ -256,18 +256,18 @@ protected trait LoadAgentFundamentals[LD <: LoadRelevantData, LM <: LoadModel[ ApparentPower, LD, ConstantState.type, - LM + LM, ], data: LD, lastState: ConstantState.type, - setPower: squants.Power + setPower: squants.Power, ): (ConstantState.type, ApparentPower, FlexChangeIndicator) = { /* Calculate result */ val voltage = getAndCheckNodalVoltage(baseStateData, tick) val reactivePower = baseStateData.model.calculateReactivePower( setPower, - voltage + voltage, ) val result = ApparentPower(setPower, reactivePower) @@ -303,11 +303,11 @@ protected trait LoadAgentFundamentals[LD <: LoadRelevantData, LM <: LoadModel[ ApparentPower, LD, ConstantState.type, - LM + LM, ], lastModelState: ConstantState.type, currentTick: Long, - scheduler: ActorRef + scheduler: ActorRef, ): FSM.State[AgentState, ParticipantStateData[ApparentPower]] = throw new InconsistentStateException( s"Load model is not able to calculate power with secondary data." @@ -332,14 +332,14 @@ protected trait LoadAgentFundamentals[LD <: LoadRelevantData, LM <: LoadModel[ windowEnd: Long, activeToReactivePowerFuncOpt: Option[ Power => ReactivePower - ] = None + ] = None, ): ApparentPower = ParticipantAgentFundamentals.averageApparentPower( tickToResults, windowStart, windowEnd, activeToReactivePowerFuncOpt, - log + log, ) /** Determines the correct result. @@ -356,13 +356,13 @@ protected trait LoadAgentFundamentals[LD <: LoadRelevantData, LM <: LoadModel[ override protected def buildResult( uuid: UUID, dateTime: ZonedDateTime, - result: ApparentPower + result: ApparentPower, ): SystemParticipantResult = new LoadResult( dateTime, uuid, result.p.toMegawatts.asMegaWatt, - result.q.toMegavars.asMegaVar + result.q.toMegavars.asMegaVar, ) override protected def updateState( @@ -370,7 +370,7 @@ protected trait LoadAgentFundamentals[LD <: LoadRelevantData, LM <: LoadModel[ modelState: ModelState.ConstantState.type, calcRelevantData: LD, nodalVoltage: squants.Dimensionless, - model: LM + model: LM, ): ModelState.ConstantState.type = modelState } @@ -378,7 +378,7 @@ object LoadAgentFundamentals { trait FixedLoadAgentFundamentals extends LoadAgentFundamentals[ FixedLoadModel.FixedLoadRelevantData.type, - FixedLoadModel + FixedLoadModel, ] { this: LoadAgent.FixedLoadAgent => @@ -386,13 +386,13 @@ object LoadAgentFundamentals { inputModel: LoadInput, operationInterval: OperationInterval, modelConfig: LoadRuntimeConfig, - reference: LoadReference + reference: LoadReference, ): FixedLoadModel = FixedLoadModel( inputModel, modelConfig.scaling, operationInterval, - reference + reference, ) override protected def createCalcRelevantData( @@ -400,9 +400,9 @@ object LoadAgentFundamentals { ApparentPower, FixedLoadRelevantData.type, ConstantState.type, - FixedLoadModel + FixedLoadModel, ], - tick: Long + tick: Long, ): FixedLoadRelevantData.type = FixedLoadRelevantData @@ -416,33 +416,33 @@ object LoadAgentFundamentals { ApparentPower, FixedLoadRelevantData.type, ConstantState.type, - FixedLoadModel + FixedLoadModel, ], ConstantState.type, - Dimensionless + Dimensionless, ) => ApparentPower = ( tick: Long, baseStateData: ParticipantModelBaseStateData[ ApparentPower, FixedLoadRelevantData.type, ConstantState.type, - FixedLoadModel + FixedLoadModel, ], state: ConstantState.type, - voltage: Dimensionless + voltage: Dimensionless, ) => baseStateData.model.calculatePower( tick, voltage, state, - FixedLoadRelevantData + FixedLoadRelevantData, ) } trait ProfileLoadAgentFundamentals extends LoadAgentFundamentals[ ProfileRelevantData, - ProfileLoadModel + ProfileLoadModel, ] { this: LoadAgent.ProfileLoadAgent => @@ -450,13 +450,13 @@ object LoadAgentFundamentals { inputModel: LoadInput, operationInterval: OperationInterval, modelConfig: LoadRuntimeConfig, - reference: LoadReference + reference: LoadReference, ): ProfileLoadModel = ProfileLoadModel( inputModel, operationInterval, modelConfig.scaling, - reference + reference, ) override protected def createCalcRelevantData( @@ -464,9 +464,9 @@ object LoadAgentFundamentals { ApparentPower, ProfileRelevantData, ConstantState.type, - ProfileLoadModel + ProfileLoadModel, ], - currentTick: Long + currentTick: Long, ): ProfileRelevantData = ProfileRelevantData( currentTick.toDateTime(baseStateData.startDate) @@ -482,10 +482,10 @@ object LoadAgentFundamentals { ApparentPower, ProfileRelevantData, ConstantState.type, - ProfileLoadModel + ProfileLoadModel, ], ConstantState.type, - Dimensionless + Dimensionless, ) => ApparentPower = (tick, baseStateData, _, voltage) => { val profileRelevantData = createCalcRelevantData(baseStateData, tick) @@ -494,7 +494,7 @@ object LoadAgentFundamentals { currentTick, voltage, ConstantState, - profileRelevantData + profileRelevantData, ) } } @@ -502,7 +502,7 @@ object LoadAgentFundamentals { trait RandomLoadAgentFundamentals extends LoadAgentFundamentals[ RandomRelevantData, - RandomLoadModel + RandomLoadModel, ] { this: LoadAgent.RandomLoadAgent => @@ -510,13 +510,13 @@ object LoadAgentFundamentals { inputModel: LoadInput, operationInterval: OperationInterval, modelConfig: LoadRuntimeConfig, - reference: LoadReference + reference: LoadReference, ): RandomLoadModel = RandomLoadModel( inputModel, operationInterval, modelConfig.scaling, - reference + reference, ) override protected def createCalcRelevantData( @@ -524,9 +524,9 @@ object LoadAgentFundamentals { ApparentPower, RandomRelevantData, ConstantState.type, - RandomLoadModel + RandomLoadModel, ], - tick: Long + tick: Long, ): RandomRelevantData = RandomRelevantData( tick.toDateTime(baseStateData.startDate) @@ -542,10 +542,10 @@ object LoadAgentFundamentals { ApparentPower, RandomRelevantData, ConstantState.type, - RandomLoadModel + RandomLoadModel, ], ConstantState.type, - Dimensionless + Dimensionless, ) => ApparentPower = (tick, baseStateData, _, voltage) => { val profileRelevantData = createCalcRelevantData(baseStateData, tick) @@ -554,7 +554,7 @@ object LoadAgentFundamentals { currentTick, voltage, ConstantState, - profileRelevantData + profileRelevantData, ) } } diff --git a/src/main/scala/edu/ie3/simona/agent/participant/pv/PvAgent.scala b/src/main/scala/edu/ie3/simona/agent/participant/pv/PvAgent.scala index 68cc7aa485..bf6f5db3b7 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/pv/PvAgent.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/pv/PvAgent.scala @@ -25,15 +25,15 @@ object PvAgent { initStateData: ParticipantInitializeStateData[ PvInput, PvRuntimeConfig, - ApparentPower + ApparentPower, ], - listener: Iterable[ActorRef] + listener: Iterable[ActorRef], ): Props = Props( new PvAgent( scheduler, initStateData, - listener + listener, ) ) @@ -54,9 +54,9 @@ class PvAgent( initStateData: ParticipantInitializeStateData[ PvInput, PvRuntimeConfig, - ApparentPower + ApparentPower, ], - override val listener: Iterable[ActorRef] + override val listener: Iterable[ActorRef], ) extends ParticipantAgent[ ApparentPower, PvRelevantData, @@ -64,10 +64,10 @@ class PvAgent( ParticipantStateData[ApparentPower], PvInput, PvRuntimeConfig, - PvModel + PvModel, ]( scheduler, - initStateData + initStateData, ) with PvAgentFundamentals { diff --git a/src/main/scala/edu/ie3/simona/agent/participant/pv/PvAgentFundamentals.scala b/src/main/scala/edu/ie3/simona/agent/participant/pv/PvAgentFundamentals.scala index 03f8060ebe..a60fa87b63 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/pv/PvAgentFundamentals.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/pv/PvAgentFundamentals.scala @@ -9,21 +9,21 @@ package edu.ie3.simona.agent.participant.pv import edu.ie3.datamodel.models.input.system.PvInput import edu.ie3.datamodel.models.result.system.{ PvResult, - SystemParticipantResult + SystemParticipantResult, } import edu.ie3.simona.agent.ValueStore import edu.ie3.simona.agent.participant.ParticipantAgent.getAndCheckNodalVoltage import edu.ie3.simona.agent.participant.ParticipantAgentFundamentals import edu.ie3.simona.agent.participant.data.Data.PrimaryData.{ ApparentPower, - ZERO_POWER + ZERO_POWER, } import edu.ie3.simona.agent.participant.data.Data.SecondaryData import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService import edu.ie3.simona.agent.participant.pv.PvAgent.neededServices import edu.ie3.simona.agent.participant.statedata.BaseStateData.{ FlexControlledData, - ParticipantModelBaseStateData + ParticipantModelBaseStateData, } import edu.ie3.simona.agent.participant.statedata.ParticipantStateData import edu.ie3.simona.agent.participant.statedata.ParticipantStateData.InputModelContainer @@ -34,7 +34,7 @@ import edu.ie3.simona.event.notifier.NotifierConfig import edu.ie3.simona.exceptions.agent.{ AgentInitializationException, InconsistentStateException, - InvalidRequestException + InvalidRequestException, } import edu.ie3.simona.io.result.AccompaniedSimulationResult import edu.ie3.simona.model.participant.ModelState.ConstantState @@ -42,11 +42,11 @@ import edu.ie3.simona.model.participant.PvModel.PvRelevantData import edu.ie3.simona.model.participant.{ FlexChangeIndicator, ModelState, - PvModel + PvModel, } import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage.{ FlexRequest, - FlexResponse + FlexResponse, } import edu.ie3.simona.ontology.messages.services.WeatherMessage.WeatherData import edu.ie3.simona.service.weather.WeatherService.FALLBACK_WEATHER_STEM_DISTANCE @@ -72,7 +72,7 @@ protected trait PvAgentFundamentals ParticipantStateData[ApparentPower], PvInput, PvRuntimeConfig, - PvModel + PvModel, ] { this: PvAgent => override protected val pdClassTag: ClassTag[ApparentPower] = @@ -112,12 +112,12 @@ protected trait PvAgentFundamentals resolution: Long, requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, - maybeEmAgent: Option[TypedActorRef[FlexResponse]] + maybeEmAgent: Option[TypedActorRef[FlexResponse]], ): ParticipantModelBaseStateData[ ApparentPower, PvRelevantData, ConstantState.type, - PvModel + PvModel, ] = { /* Check for needed services */ if (!services.toSeq.map(_.getClass).containsSlice(neededServices)) @@ -131,14 +131,14 @@ protected trait PvAgentFundamentals inputModel, modelConfig, simulationStartDate, - simulationEndDate + simulationEndDate, ) ParticipantModelBaseStateData[ ApparentPower, PvRelevantData, ConstantState.type, - PvModel + PvModel, ]( simulationStartDate, simulationEndDate, @@ -156,13 +156,13 @@ protected trait PvAgentFundamentals .to(PU) .getValue .doubleValue - ) + ), ), ValueStore(resolution), ValueStore(resolution), ValueStore(resolution), ValueStore(resolution), - maybeEmAgent.map(FlexControlledData(_, self.toTyped[FlexRequest])) + maybeEmAgent.map(FlexControlledData(_, self.toTyped[FlexRequest])), ) } @@ -170,12 +170,12 @@ protected trait PvAgentFundamentals inputModel: InputModelContainer[PvInput], modelConfig: PvRuntimeConfig, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): PvModel = PvModel( inputModel.electricalInputModel, modelConfig.scaling, simulationStartDate, - simulationEndDate + simulationEndDate, ) override protected def createInitialState( @@ -183,7 +183,7 @@ protected trait PvAgentFundamentals ApparentPower, PvRelevantData, ConstantState.type, - PvModel + PvModel, ] ): ModelState.ConstantState.type = ConstantState @@ -193,9 +193,9 @@ protected trait PvAgentFundamentals ApparentPower, PvRelevantData, ConstantState.type, - PvModel + PvModel, ], - tick: Long + tick: Long, ): PvRelevantData = { /* convert current tick to a datetime */ implicit val startDateTime: ZonedDateTime = @@ -241,7 +241,7 @@ protected trait PvAgentFundamentals dateTime, tickInterval, weatherData.diffIrr, - weatherData.dirIrr + weatherData.dirIrr, ) } @@ -265,18 +265,18 @@ protected trait PvAgentFundamentals ApparentPower, PvRelevantData, ConstantState.type, - PvModel + PvModel, ], data: PvRelevantData, lastState: ConstantState.type, - setPower: squants.Power + setPower: squants.Power, ): (ConstantState.type, ApparentPower, FlexChangeIndicator) = { /* Calculate result */ val voltage = getAndCheckNodalVoltage(baseStateData, tick) val reactivePower = baseStateData.model.calculateReactivePower( setPower, - voltage + voltage, ) val result = ApparentPower(setPower, reactivePower) @@ -296,10 +296,10 @@ protected trait PvAgentFundamentals ApparentPower, PvRelevantData, ConstantState.type, - PvModel + PvModel, ], ConstantState.type, - Dimensionless + Dimensionless, ) => ApparentPower = (_, _, _, _) => throw new InvalidRequestException( @@ -332,11 +332,11 @@ protected trait PvAgentFundamentals ApparentPower, PvRelevantData, ConstantState.type, - PvModel + PvModel, ], lastModelState: ConstantState.type, currentTick: Long, - scheduler: ActorRef + scheduler: ActorRef, ): FSM.State[AgentState, ParticipantStateData[ApparentPower]] = { val voltage = getAndCheckNodalVoltage(baseStateData, currentTick) @@ -344,21 +344,21 @@ protected trait PvAgentFundamentals val relevantData = createCalcRelevantData( baseStateData, - currentTick + currentTick, ) val result = baseStateData.model.calculatePower( currentTick, voltage, ConstantState, - relevantData + relevantData, ) updateValueStoresInformListenersAndGoToIdleWithUpdatedBaseStateData( scheduler, baseStateData, AccompaniedSimulationResult(result), - relevantData + relevantData, ) } @@ -381,14 +381,14 @@ protected trait PvAgentFundamentals windowEnd: Long, activeToReactivePowerFuncOpt: Option[ Power => ReactivePower - ] = None + ] = None, ): ApparentPower = ParticipantAgentFundamentals.averageApparentPower( tickToResults, windowStart, windowEnd, activeToReactivePowerFuncOpt, - log + log, ) /** Determines the correct result. @@ -405,13 +405,13 @@ protected trait PvAgentFundamentals override protected def buildResult( uuid: UUID, dateTime: ZonedDateTime, - result: ApparentPower + result: ApparentPower, ): SystemParticipantResult = new PvResult( dateTime, uuid, result.p.toMegawatts.asMegaWatt, - result.q.toMegavars.asMegaVar + result.q.toMegavars.asMegaVar, ) /** Update the last known model state with the given external, relevant data @@ -435,6 +435,6 @@ protected trait PvAgentFundamentals modelState: ModelState.ConstantState.type, calcRelevantData: PvRelevantData, nodalVoltage: squants.Dimensionless, - model: PvModel + model: PvModel, ): ModelState.ConstantState.type = modelState } diff --git a/src/main/scala/edu/ie3/simona/agent/participant/statedata/BaseStateData.scala b/src/main/scala/edu/ie3/simona/agent/participant/statedata/BaseStateData.scala index 0f3a72a881..96758a2d16 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/statedata/BaseStateData.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/statedata/BaseStateData.scala @@ -14,12 +14,12 @@ import edu.ie3.simona.event.notifier.NotifierConfig import edu.ie3.simona.model.participant.{ CalcRelevantData, ModelState, - SystemParticipant + SystemParticipant, } import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage.{ FlexRequest, FlexResponse, - ProvideFlexOptions + ProvideFlexOptions, } import org.apache.pekko.actor.typed.ActorRef import org.apache.pekko.actor.{ActorRef => ClassicActorRef} @@ -100,7 +100,7 @@ object BaseStateData { +PD <: PrimaryDataWithApparentPower[PD], CD <: CalcRelevantData, MS <: ModelState, - +M <: SystemParticipant[_ <: CalcRelevantData, PD, MS] + +M <: SystemParticipant[_ <: CalcRelevantData, PD, MS], ] extends BaseStateData[PD] { /** The physical system model @@ -154,7 +154,7 @@ object BaseStateData { final case class FromOutsideBaseStateData[M <: SystemParticipant[ _ <: CalcRelevantData, P, - _ + _, ], +P <: PrimaryDataWithApparentPower[P]]( model: M, override val startDate: ZonedDateTime, @@ -168,7 +168,7 @@ object BaseStateData { Dimensionless ], override val resultValueStore: ValueStore[P], - override val requestValueStore: ValueStore[P] + override val requestValueStore: ValueStore[P], ) extends BaseStateData[P] { override val modelUuid: UUID = model.getUuid } @@ -209,7 +209,7 @@ object BaseStateData { +PD <: PrimaryDataWithApparentPower[PD], CD <: CalcRelevantData, MS <: ModelState, - M <: SystemParticipant[_ <: CalcRelevantData, PD, MS] + M <: SystemParticipant[_ <: CalcRelevantData, PD, MS], ]( override val startDate: ZonedDateTime, override val endDate: ZonedDateTime, @@ -228,7 +228,7 @@ object BaseStateData { Map[ClassicActorRef, _ <: SecondaryData] ], override val stateDataStore: ValueStore[MS], - override val flexStateData: Option[FlexControlledData] + override val flexStateData: Option[FlexControlledData], ) extends ModelBaseStateData[PD, CD, MS, M] { /** Unique identifier of the simulation model @@ -249,7 +249,7 @@ object BaseStateData { final case class FlexControlledData( emAgent: ActorRef[FlexResponse], flexAdapter: ActorRef[FlexRequest], - lastFlexOptions: Option[ProvideFlexOptions] = None + lastFlexOptions: Option[ProvideFlexOptions] = None, ) /** Updates the base state data with the given value stores @@ -277,7 +277,7 @@ object BaseStateData { updatedRequestValueStore: ValueStore[PD], updatedVoltageValueStore: ValueStore[Dimensionless], updatedAdditionalActivationTicks: SortedSet[Long], - updatedForeseenTicks: Map[ClassicActorRef, Option[Long]] + updatedForeseenTicks: Map[ClassicActorRef, Option[Long]], ): BaseStateData[PD] = { baseStateData match { case external: FromOutsideBaseStateData[_, PD] => @@ -286,7 +286,7 @@ object BaseStateData { requestValueStore = updatedRequestValueStore, voltageValueStore = updatedVoltageValueStore, additionalActivationTicks = updatedAdditionalActivationTicks, - foreseenDataTicks = updatedForeseenTicks + foreseenDataTicks = updatedForeseenTicks, ) case model: ParticipantModelBaseStateData[PD, _, _, _] => model.copy( @@ -294,7 +294,7 @@ object BaseStateData { requestValueStore = updatedRequestValueStore, voltageValueStore = updatedVoltageValueStore, additionalActivationTicks = updatedAdditionalActivationTicks, - foreseenDataTicks = updatedForeseenTicks + foreseenDataTicks = updatedForeseenTicks, ) } } diff --git a/src/main/scala/edu/ie3/simona/agent/participant/statedata/DataCollectionStateData.scala b/src/main/scala/edu/ie3/simona/agent/participant/statedata/DataCollectionStateData.scala index d9b7f63de2..1ce8cf9352 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/statedata/DataCollectionStateData.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/statedata/DataCollectionStateData.scala @@ -32,7 +32,7 @@ final case class DataCollectionStateData[+PD <: PrimaryDataWithApparentPower[ ]]( baseStateData: BaseStateData[PD], data: Map[ActorRef, Option[_ <: Data]], - yetTriggered: Boolean + yetTriggered: Boolean, ) extends ParticipantStateData[PD] { /** Extract the given type of [[Data]] from the list of secondary data diff --git a/src/main/scala/edu/ie3/simona/agent/participant/statedata/InitializeStateData.scala b/src/main/scala/edu/ie3/simona/agent/participant/statedata/InitializeStateData.scala index 08a291afce..de01009850 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/statedata/InitializeStateData.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/statedata/InitializeStateData.scala @@ -27,7 +27,7 @@ object InitializeStateData { val outputConfig: NotifierConfig = NotifierConfig( simulationResultInfo = false, powerRequestReply = true, - flexResult = false + flexResult = false, ) } } diff --git a/src/main/scala/edu/ie3/simona/agent/participant/statedata/ParticipantStateData.scala b/src/main/scala/edu/ie3/simona/agent/participant/statedata/ParticipantStateData.scala index f7c3312a59..95d8df3fcf 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/statedata/ParticipantStateData.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/statedata/ParticipantStateData.scala @@ -67,7 +67,7 @@ object ParticipantStateData { final case class ParticipantInitializingStateData[ I <: SystemParticipantInput, C <: SimonaConfig.BaseRuntimeConfig, - PD <: PrimaryData + PD <: PrimaryData, ]( inputModel: InputModelContainer[I], modelConfig: C, @@ -77,7 +77,7 @@ object ParticipantStateData { resolution: Long, requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, - maybeEmAgent: Option[ActorRef[FlexResponse]] + maybeEmAgent: Option[ActorRef[FlexResponse]], ) extends ParticipantStateData[PD] /** State data to use, when initializing the participant agent @@ -111,7 +111,7 @@ object ParticipantStateData { final case class ParticipantInitializeStateData[ I <: SystemParticipantInput, C <: SimonaConfig.BaseRuntimeConfig, - PD <: PrimaryData + PD <: PrimaryData, ]( inputModel: InputModelContainer[I], modelConfig: C, @@ -122,7 +122,7 @@ object ParticipantStateData { resolution: Long, requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, - maybeEmAgent: Option[ActorRef[FlexResponse]] = None + maybeEmAgent: Option[ActorRef[FlexResponse]] = None, ) extends InitializeStateData[PD] object ParticipantInitializeStateData { @@ -130,7 +130,7 @@ object ParticipantStateData { def apply[ I <: SystemParticipantInput, C <: SimonaConfig.BaseRuntimeConfig, - PD <: PrimaryData + PD <: PrimaryData, ]( inputModel: I, modelConfig: C, @@ -142,7 +142,7 @@ object ParticipantStateData { simulationEndDate: ZonedDateTime, resolution: Long, requestVoltageDeviationThreshold: Double, - outputConfig: NotifierConfig + outputConfig: NotifierConfig, ): ParticipantInitializeStateData[I, C, PD] = new ParticipantInitializeStateData[I, C, PD]( SimpleInputContainer(inputModel), @@ -154,12 +154,12 @@ object ParticipantStateData { resolution, requestVoltageDeviationThreshold, outputConfig, - maybeEmAgent = None + maybeEmAgent = None, ) def apply[ I <: SystemParticipantInput, C <: SimonaConfig.BaseRuntimeConfig, - PD <: PrimaryData + PD <: PrimaryData, ]( inputModel: I, modelConfig: C, @@ -172,7 +172,7 @@ object ParticipantStateData { resolution: Long, requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, - maybeEmAgent: Option[ActorRef[FlexResponse]] + maybeEmAgent: Option[ActorRef[FlexResponse]], ): ParticipantInitializeStateData[I, C, PD] = new ParticipantInitializeStateData[I, C, PD]( SimpleInputContainer(inputModel), @@ -184,13 +184,13 @@ object ParticipantStateData { resolution, requestVoltageDeviationThreshold, outputConfig, - maybeEmAgent + maybeEmAgent, ) def apply[ I <: SystemParticipantInput, C <: SimonaConfig.BaseRuntimeConfig, - PD <: PrimaryData + PD <: PrimaryData, ]( inputModel: I, thermalGrid: ThermalGrid, @@ -203,7 +203,7 @@ object ParticipantStateData { simulationEndDate: ZonedDateTime, resolution: Long, requestVoltageDeviationThreshold: Double, - outputConfig: NotifierConfig + outputConfig: NotifierConfig, ): ParticipantInitializeStateData[I, C, PD] = new ParticipantInitializeStateData[I, C, PD]( WithHeatInputContainer(inputModel, thermalGrid), @@ -215,13 +215,13 @@ object ParticipantStateData { resolution, requestVoltageDeviationThreshold, outputConfig, - maybeEmAgent = None + maybeEmAgent = None, ) def apply[ I <: SystemParticipantInput, C <: SimonaConfig.BaseRuntimeConfig, - PD <: PrimaryData + PD <: PrimaryData, ]( inputModel: I, thermalGrid: ThermalGrid, @@ -235,7 +235,7 @@ object ParticipantStateData { resolution: Long, requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, - maybeEmAgent: Option[ActorRef[FlexResponse]] + maybeEmAgent: Option[ActorRef[FlexResponse]], ): ParticipantInitializeStateData[I, C, PD] = new ParticipantInitializeStateData[I, C, PD]( WithHeatInputContainer(inputModel, thermalGrid), @@ -247,7 +247,7 @@ object ParticipantStateData { resolution, requestVoltageDeviationThreshold, outputConfig, - maybeEmAgent + maybeEmAgent, ) } @@ -269,7 +269,7 @@ object ParticipantStateData { ]( baseStateData: BaseStateData[PD], pendingResponses: Iterable[ClassicActorRef], - foreseenNextDataTicks: Map[ClassicActorRef, Long] = Map.empty + foreseenNextDataTicks: Map[ClassicActorRef, Long] = Map.empty, ) extends ParticipantStateData[PD] sealed trait InputModelContainer[+I <: SystemParticipantInput] { @@ -282,6 +282,6 @@ object ParticipantStateData { final case class WithHeatInputContainer[+I <: SystemParticipantInput]( override val electricalInputModel: I, - thermalGrid: ThermalGrid + thermalGrid: ThermalGrid, ) extends InputModelContainer[I] } diff --git a/src/main/scala/edu/ie3/simona/agent/participant/wec/WecAgent.scala b/src/main/scala/edu/ie3/simona/agent/participant/wec/WecAgent.scala index 9f65245c4c..957d48a28f 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/wec/WecAgent.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/wec/WecAgent.scala @@ -25,15 +25,15 @@ object WecAgent { initStateData: ParticipantInitializeStateData[ WecInput, WecRuntimeConfig, - ApparentPower + ApparentPower, ], - listener: Iterable[ActorRef] + listener: Iterable[ActorRef], ): Props = Props( new WecAgent( scheduler, initStateData, - listener + listener, ) ) @@ -54,9 +54,9 @@ class WecAgent( initStateData: ParticipantInitializeStateData[ WecInput, WecRuntimeConfig, - ApparentPower + ApparentPower, ], - override val listener: Iterable[ActorRef] + override val listener: Iterable[ActorRef], ) extends ParticipantAgent[ ApparentPower, WecRelevantData, @@ -64,7 +64,7 @@ class WecAgent( ParticipantStateData[ApparentPower], WecInput, WecRuntimeConfig, - WecModel + WecModel, ](scheduler, initStateData) with WecAgentFundamentals { diff --git a/src/main/scala/edu/ie3/simona/agent/participant/wec/WecAgentFundamentals.scala b/src/main/scala/edu/ie3/simona/agent/participant/wec/WecAgentFundamentals.scala index f39fbd8d3b..955131bafc 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/wec/WecAgentFundamentals.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/wec/WecAgentFundamentals.scala @@ -9,14 +9,14 @@ package edu.ie3.simona.agent.participant.wec import edu.ie3.datamodel.models.input.system.WecInput import edu.ie3.datamodel.models.result.system.{ SystemParticipantResult, - WecResult + WecResult, } import edu.ie3.simona.agent.ValueStore import edu.ie3.simona.agent.participant.ParticipantAgent._ import edu.ie3.simona.agent.participant.ParticipantAgentFundamentals import edu.ie3.simona.agent.participant.data.Data.PrimaryData.{ ApparentPower, - ZERO_POWER + ZERO_POWER, } import edu.ie3.simona.agent.participant.data.Data.SecondaryData import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService @@ -31,7 +31,7 @@ import edu.ie3.simona.event.notifier.NotifierConfig import edu.ie3.simona.exceptions.agent.{ AgentInitializationException, InconsistentStateException, - InvalidRequestException + InvalidRequestException, } import edu.ie3.simona.io.result.AccompaniedSimulationResult import edu.ie3.simona.model.participant.ModelState.ConstantState @@ -39,11 +39,11 @@ import edu.ie3.simona.model.participant.WecModel.WecRelevantData import edu.ie3.simona.model.participant.{ FlexChangeIndicator, ModelState, - WecModel + WecModel, } import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage.{ FlexRequest, - FlexResponse + FlexResponse, } import edu.ie3.simona.ontology.messages.services.WeatherMessage.WeatherData import edu.ie3.util.quantities.PowerSystemUnits._ @@ -67,7 +67,7 @@ protected trait WecAgentFundamentals ParticipantStateData[ApparentPower], WecInput, WecRuntimeConfig, - WecModel + WecModel, ] { this: WecAgent => override protected val pdClassTag: ClassTag[ApparentPower] = @@ -107,12 +107,12 @@ protected trait WecAgentFundamentals resolution: Long, requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, - maybeEmAgent: Option[TypedActorRef[FlexResponse]] + maybeEmAgent: Option[TypedActorRef[FlexResponse]], ): ParticipantModelBaseStateData[ ApparentPower, WecRelevantData, ConstantState.type, - WecModel + WecModel, ] = { /* Check for needed services */ if (!services.toSeq.map(_.getClass).containsSlice(neededServices)) @@ -126,14 +126,14 @@ protected trait WecAgentFundamentals inputModel, modelConfig, simulationStartDate, - simulationEndDate + simulationEndDate, ) ParticipantModelBaseStateData[ ApparentPower, WecRelevantData, ConstantState.type, - WecModel + WecModel, ]( simulationStartDate, simulationEndDate, @@ -151,13 +151,13 @@ protected trait WecAgentFundamentals .to(PU) .getValue .doubleValue - ) + ), ), ValueStore(resolution), ValueStore(resolution), ValueStore(resolution), ValueStore(resolution), - maybeEmAgent.map(FlexControlledData(_, self.toTyped[FlexRequest])) + maybeEmAgent.map(FlexControlledData(_, self.toTyped[FlexRequest])), ) } @@ -165,12 +165,12 @@ protected trait WecAgentFundamentals inputModel: InputModelContainer[WecInput], modelConfig: WecRuntimeConfig, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): WecModel = WecModel( inputModel.electricalInputModel, modelConfig.scaling, simulationStartDate, - simulationEndDate + simulationEndDate, ) override protected def createInitialState( @@ -178,7 +178,7 @@ protected trait WecAgentFundamentals ApparentPower, WecRelevantData, ConstantState.type, - WecModel + WecModel, ] ): ModelState.ConstantState.type = ConstantState @@ -188,9 +188,9 @@ protected trait WecAgentFundamentals ApparentPower, WecRelevantData, ConstantState.type, - WecModel + WecModel, ], - tick: Long + tick: Long, ): WecRelevantData = { // take the last weather data, not necessarily the one for the current tick: // we might receive flex control messages for irregular ticks @@ -217,7 +217,7 @@ protected trait WecAgentFundamentals WecRelevantData( weatherData.windVel, weatherData.temp, - None + None, ) } @@ -241,18 +241,18 @@ protected trait WecAgentFundamentals ApparentPower, WecRelevantData, ConstantState.type, - WecModel + WecModel, ], data: WecRelevantData, lastState: ConstantState.type, - setPower: squants.Power + setPower: squants.Power, ): (ConstantState.type, ApparentPower, FlexChangeIndicator) = { /* Calculate result */ val voltage = getAndCheckNodalVoltage(baseStateData, tick) val reactivePower = baseStateData.model.calculateReactivePower( setPower, - voltage + voltage, ) val result = ApparentPower(setPower, reactivePower) @@ -272,10 +272,10 @@ protected trait WecAgentFundamentals ApparentPower, WecRelevantData, ConstantState.type, - WecModel + WecModel, ], ConstantState.type, - Dimensionless + Dimensionless, ) => ApparentPower = ( _: Long, @@ -283,10 +283,10 @@ protected trait WecAgentFundamentals ApparentPower, WecRelevantData, ConstantState.type, - WecModel + WecModel, ], _, - _: Dimensionless + _: Dimensionless, ) => throw new InvalidRequestException( "WEC model cannot be run without secondary data." @@ -318,11 +318,11 @@ protected trait WecAgentFundamentals ApparentPower, WecRelevantData, ConstantState.type, - WecModel + WecModel, ], lastModelState: ConstantState.type, currentTick: Long, - scheduler: ActorRef + scheduler: ActorRef, ): FSM.State[AgentState, ParticipantStateData[ApparentPower]] = { val voltage = getAndCheckNodalVoltage(baseStateData, currentTick) @@ -330,21 +330,21 @@ protected trait WecAgentFundamentals val relevantData = createCalcRelevantData( baseStateData, - currentTick + currentTick, ) val result = baseStateData.model.calculatePower( currentTick, voltage, ConstantState, - relevantData + relevantData, ) updateValueStoresInformListenersAndGoToIdleWithUpdatedBaseStateData( scheduler, baseStateData, AccompaniedSimulationResult(result), - relevantData + relevantData, ) } @@ -367,14 +367,14 @@ protected trait WecAgentFundamentals windowEnd: Long, activeToReactivePowerFuncOpt: Option[ Power => ReactivePower - ] = None + ] = None, ): ApparentPower = ParticipantAgentFundamentals.averageApparentPower( tickToResults, windowStart, windowEnd, activeToReactivePowerFuncOpt, - log + log, ) /** Determines the correct result. @@ -391,13 +391,13 @@ protected trait WecAgentFundamentals override protected def buildResult( uuid: UUID, dateTime: ZonedDateTime, - result: ApparentPower + result: ApparentPower, ): SystemParticipantResult = new WecResult( dateTime, uuid, result.p.toMegawatts.asMegaWatt, - result.q.toMegavars.asMegaVar + result.q.toMegavars.asMegaVar, ) /** Update the last known model state with the given external, relevant data @@ -421,6 +421,6 @@ protected trait WecAgentFundamentals modelState: ModelState.ConstantState.type, calcRelevantData: WecRelevantData, nodalVoltage: squants.Dimensionless, - model: WecModel + model: WecModel, ): ModelState.ConstantState.type = modelState } diff --git a/src/main/scala/edu/ie3/simona/agent/state/AgentState.scala b/src/main/scala/edu/ie3/simona/agent/state/AgentState.scala index 0261a7a210..fc4497b77b 100644 --- a/src/main/scala/edu/ie3/simona/agent/state/AgentState.scala +++ b/src/main/scala/edu/ie3/simona/agent/state/AgentState.scala @@ -19,7 +19,7 @@ object AgentState { final case class TerminatedPrematurelyEvent( actorRef: ActorRef, reason: FSM.Reason, - tick: Option[Int] + tick: Option[Int], ) case object Uninitialized extends AgentState diff --git a/src/main/scala/edu/ie3/simona/api/ExtSimAdapter.scala b/src/main/scala/edu/ie3/simona/api/ExtSimAdapter.scala index bce029ea33..be3d434a8a 100644 --- a/src/main/scala/edu/ie3/simona/api/ExtSimAdapter.scala +++ b/src/main/scala/edu/ie3/simona/api/ExtSimAdapter.scala @@ -15,12 +15,12 @@ import edu.ie3.simona.api.simulation.ontology.{ ActivationMessage, TerminationCompleted, TerminationMessage, - CompletionMessage => ExtCompletionMessage + CompletionMessage => ExtCompletionMessage, } import edu.ie3.simona.logging.SimonaActorLogging import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResponseMessage.ScheduleServiceActivation import edu.ie3.simona.ontology.messages.{Activation, StopMessage} @@ -47,7 +47,7 @@ object ExtSimAdapter { final case class ExtSimAdapterStateData( extSimData: ExtSimAdapterData, - currentTick: Option[Long] = None + currentTick: Option[Long] = None, ) } @@ -59,7 +59,7 @@ final case class ExtSimAdapter(scheduler: ActorRef) scheduler ! ScheduleActivation( self.toTyped, INIT_SIM_TICK, - Some(unlockKey) + Some(unlockKey), ) context become receiveIdle( ExtSimAdapterStateData(extSimAdapterData) @@ -75,7 +75,7 @@ final case class ExtSimAdapter(scheduler: ActorRef) ) log.debug( "Tick {} has been activated in external simulation", - tick + tick, ) context become receiveIdle( @@ -91,7 +91,7 @@ final case class ExtSimAdapter(scheduler: ActorRef) scheduler ! Completion(self.toTyped, newTick) log.debug( "Tick {} has been completed in external simulation", - stateData.currentTick + stateData.currentTick, ) context become receiveIdle(stateData.copy(currentTick = None)) @@ -104,7 +104,7 @@ final case class ExtSimAdapter(scheduler: ActorRef) scheduleDataService.getDataService ! ScheduleServiceActivation( tick, - key + key, ) case StopMessage(simulationSuccessful) => diff --git a/src/main/scala/edu/ie3/simona/config/ArgsParser.scala b/src/main/scala/edu/ie3/simona/config/ArgsParser.scala index 132b2f4c50..183aa8149c 100644 --- a/src/main/scala/edu/ie3/simona/config/ArgsParser.scala +++ b/src/main/scala/edu/ie3/simona/config/ArgsParser.scala @@ -30,7 +30,7 @@ object ArgsParser extends LazyLogging { nodePort: Option[String] = None, seedAddress: Option[String] = None, useLocalWorker: Option[Boolean] = None, - tArgs: Map[String, String] = Map.empty + tArgs: Map[String, String] = Map.empty, ) { val useCluster: Boolean = clusterType.isDefined } @@ -42,7 +42,7 @@ object ArgsParser extends LazyLogging { .action((value, args) => { args.copy( config = Some(parseTypesafeConfig(value)), - configLocation = Option(value) + configLocation = Option(value), ) }) .validate(value => @@ -122,7 +122,7 @@ object ArgsParser extends LazyLogging { private def parse( parser: scoptOptionParser[Arguments], - args: Array[String] + args: Array[String], ): Option[Arguments] = parser.parse(args, init = Arguments(args)) diff --git a/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala b/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala index ab3b3895a9..e2ca6a0cb6 100644 --- a/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala +++ b/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala @@ -12,7 +12,7 @@ import edu.ie3.simona.config.SimonaConfig.Simona.Output.Sink.InfluxDb1x import edu.ie3.simona.config.SimonaConfig.{ BaseOutputConfig, RefSystemConfig, - ResultKafkaParams + ResultKafkaParams, } import edu.ie3.simona.exceptions.InvalidConfigParameterException import edu.ie3.simona.io.result.ResultSinkType @@ -22,7 +22,7 @@ import edu.ie3.simona.service.weather.WeatherSource import edu.ie3.simona.util.CollectionUtils import edu.ie3.simona.util.ConfigUtil.DatabaseConfigUtil.{ checkInfluxDb1xParams, - checkKafkaParams + checkKafkaParams, } import edu.ie3.simona.util.ConfigUtil.{CsvConfigUtil, NotifierIdentifier} import edu.ie3.util.scala.ReflectionTools @@ -74,7 +74,7 @@ case object ConfigFailFast extends LazyLogging { case Failure(exception) => throw new InvalidConfigParameterException( "Checking of pekko config failed due to unhandled error.", - exception + exception, ) case Success(_) => } @@ -94,7 +94,7 @@ case object ConfigFailFast extends LazyLogging { case Failure(exception) => throw new InvalidConfigParameterException( "Checking of pekko logging config failed due to unhandled error.", - exception + exception, ) case _ => } @@ -191,7 +191,7 @@ case object ConfigFailFast extends LazyLogging { checkInfluxDb1xParams( "Sink", ResultSinkType.buildInfluxDb1xUrl(influxDb1x), - influxDb1x.database + influxDb1x.database, ) case Some(Some(kafka: ResultKafkaParams)) => checkKafkaParams(kafka, Seq(kafka.topicNodeRes)) @@ -235,7 +235,7 @@ case object ConfigFailFast extends LazyLogging { throw new InvalidConfigParameterException( s"Invalid dateTimeString: $dateTimeString." + s"Please ensure that your date/time parameter match the following pattern: 'yyyy-MM-dd HH:mm:ss'", - e + e, ) } } @@ -256,27 +256,27 @@ case object ConfigFailFast extends LazyLogging { /* Check basic model configuration parameters common to each participant */ checkBaseRuntimeConfigs( subConfig.load.defaultConfig, - subConfig.load.individualConfigs + subConfig.load.individualConfigs, ) checkBaseRuntimeConfigs( subConfig.fixedFeedIn.defaultConfig, - subConfig.fixedFeedIn.individualConfigs + subConfig.fixedFeedIn.individualConfigs, ) checkBaseRuntimeConfigs( subConfig.evcs.defaultConfig, - subConfig.evcs.individualConfigs + subConfig.evcs.individualConfigs, ) checkBaseRuntimeConfigs( subConfig.pv.defaultConfig, - subConfig.pv.individualConfigs + subConfig.pv.individualConfigs, ) checkBaseRuntimeConfigs( subConfig.wec.defaultConfig, - subConfig.wec.individualConfigs + subConfig.wec.individualConfigs, ) /* check model configuration parameters specific to participants */ @@ -304,7 +304,7 @@ case object ConfigFailFast extends LazyLogging { private def checkBaseRuntimeConfigs( defaultConfig: SimonaConfig.BaseRuntimeConfig, individualConfigs: List[SimonaConfig.BaseRuntimeConfig], - defaultString: String = "default" + defaultString: String = "default", ): Unit = { // special default config check val uuidString = defaultConfig.uuids.mkString(",") @@ -346,7 +346,7 @@ case object ConfigFailFast extends LazyLogging { case e: IllegalArgumentException => throw new InvalidConfigParameterException( s"The UUID '$uuid' cannot be parsed as it is invalid.", - e + e, ) } ) @@ -369,7 +369,7 @@ case object ConfigFailFast extends LazyLogging { */ private def checkSingleString( singleString: String, - uuids: List[String] + uuids: List[String], ): Unit = { if (uuids.toVector.size != 1) throw new InvalidConfigParameterException( @@ -388,7 +388,7 @@ case object ConfigFailFast extends LazyLogging { case e: IllegalArgumentException => throw new InvalidConfigParameterException( s"Found invalid UUID '$singleEntry' it was meant to be the string '$singleString' or a valid UUID.", - e + e, ) } case None => @@ -449,7 +449,7 @@ case object ConfigFailFast extends LazyLogging { case Failure(exception) => throw new InvalidConfigParameterException( s"The given nominal voltage '${voltLvl.vNom}' cannot be parsed to a quantity. Did you provide the volt level with it's unit (e.g. \"20 kV\")?", - exception + exception, ) } } @@ -548,7 +548,7 @@ case object ConfigFailFast extends LazyLogging { checkDefaultBaseOutputConfig( subConfig.defaultConfig, - defaultString = "default" + defaultString = "default", ) checkIndividualParticipantsOutputConfigs(subConfig.individualConfigs) } @@ -592,7 +592,7 @@ case object ConfigFailFast extends LazyLogging { */ private def checkDefaultBaseOutputConfig( config: SimonaConfig.BaseOutputConfig, - defaultString: String + defaultString: String, ): Unit = { if ( StringUtils @@ -649,7 +649,7 @@ case object ConfigFailFast extends LazyLogging { case e: NoSuchElementException => throw new InvalidConfigParameterException( s"The identifier '$id' you provided is not valid. Valid input: ${NotifierIdentifier.values.map(_.toString).mkString(",")}", - e + e, ) } } diff --git a/src/main/scala/edu/ie3/simona/config/RefSystemParser.scala b/src/main/scala/edu/ie3/simona/config/RefSystemParser.scala index 66bf1100c1..d299dc16d7 100644 --- a/src/main/scala/edu/ie3/simona/config/RefSystemParser.scala +++ b/src/main/scala/edu/ie3/simona/config/RefSystemParser.scala @@ -18,7 +18,7 @@ object RefSystemParser { final case class ConfigRefSystems( private val gridIdRefSystems: Map[Int, RefSystem], - private val voltLvLRefSystems: Map[VoltageLevel, RefSystem] + private val voltLvLRefSystems: Map[VoltageLevel, RefSystem], ) { /** Returns a [[RefSystem]] based on the provided gridId or the voltLvl as @@ -33,7 +33,7 @@ object RefSystemParser { */ def find( gridId: Int, - voltLvl: Option[VoltageLevel] = None + voltLvl: Option[VoltageLevel] = None, ): Option[RefSystem] = gridIdRefSystems .get(gridId) diff --git a/src/main/scala/edu/ie3/simona/config/SimonaConfig.scala b/src/main/scala/edu/ie3/simona/config/SimonaConfig.scala index 1079b2b932..e437569147 100644 --- a/src/main/scala/edu/ie3/simona/config/SimonaConfig.scala +++ b/src/main/scala/edu/ie3/simona/config/SimonaConfig.scala @@ -13,26 +13,26 @@ object SimonaConfig { final case class BaseCsvParams( override val csvSep: java.lang.String, override val directoryPath: java.lang.String, - override val isHierarchic: scala.Boolean + override val isHierarchic: scala.Boolean, ) extends CsvParams(csvSep, directoryPath, isHierarchic) object BaseCsvParams { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.BaseCsvParams = { SimonaConfig.BaseCsvParams( csvSep = $_reqStr(parentPath, c, "csvSep", $tsCfgValidator), directoryPath = $_reqStr(parentPath, c, "directoryPath", $tsCfgValidator), - isHierarchic = $_reqBln(parentPath, c, "isHierarchic", $tsCfgValidator) + isHierarchic = $_reqBln(parentPath, c, "isHierarchic", $tsCfgValidator), ) } private def $_reqBln( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Boolean = { if (c == null) false else @@ -48,7 +48,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -64,19 +64,19 @@ object SimonaConfig { sealed abstract class BaseOutputConfig( val notifier: java.lang.String, - val simulationResult: scala.Boolean + val simulationResult: scala.Boolean, ) sealed abstract class BaseRuntimeConfig( val calculateMissingReactivePowerWithModel: scala.Boolean, val scaling: scala.Double, - val uuids: scala.List[java.lang.String] + val uuids: scala.List[java.lang.String], ) extends java.io.Serializable sealed abstract class CsvParams( val csvSep: java.lang.String, val directoryPath: java.lang.String, - val isHierarchic: scala.Boolean + val isHierarchic: scala.Boolean, ) final case class EvcsRuntimeConfig( @@ -84,17 +84,17 @@ object SimonaConfig { override val scaling: scala.Double, override val uuids: scala.List[java.lang.String], chargingStrategy: java.lang.String, - lowestEvSoc: scala.Double + lowestEvSoc: scala.Double, ) extends BaseRuntimeConfig( calculateMissingReactivePowerWithModel, scaling, - uuids + uuids, ) object EvcsRuntimeConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.EvcsRuntimeConfig = { SimonaConfig.EvcsRuntimeConfig( chargingStrategy = @@ -108,17 +108,17 @@ object SimonaConfig { parentPath, c, "calculateMissingReactivePowerWithModel", - $tsCfgValidator + $tsCfgValidator, ), scaling = $_reqDbl(parentPath, c, "scaling", $tsCfgValidator), - uuids = $_L$_str(c.getList("uuids"), parentPath, $tsCfgValidator) + uuids = $_L$_str(c.getList("uuids"), parentPath, $tsCfgValidator), ) } private def $_reqBln( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Boolean = { if (c == null) false else @@ -134,7 +134,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Double = { if (c == null) 0 else @@ -151,34 +151,34 @@ object SimonaConfig { final case class FixedFeedInRuntimeConfig( override val calculateMissingReactivePowerWithModel: scala.Boolean, override val scaling: scala.Double, - override val uuids: scala.List[java.lang.String] + override val uuids: scala.List[java.lang.String], ) extends BaseRuntimeConfig( calculateMissingReactivePowerWithModel, scaling, - uuids + uuids, ) object FixedFeedInRuntimeConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.FixedFeedInRuntimeConfig = { SimonaConfig.FixedFeedInRuntimeConfig( calculateMissingReactivePowerWithModel = $_reqBln( parentPath, c, "calculateMissingReactivePowerWithModel", - $tsCfgValidator + $tsCfgValidator, ), scaling = $_reqDbl(parentPath, c, "scaling", $tsCfgValidator), - uuids = $_L$_str(c.getList("uuids"), parentPath, $tsCfgValidator) + uuids = $_L$_str(c.getList("uuids"), parentPath, $tsCfgValidator), ) } private def $_reqBln( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Boolean = { if (c == null) false else @@ -194,7 +194,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Double = { if (c == null) 0 else @@ -214,13 +214,13 @@ object SimonaConfig { notifier: java.lang.String, switches: scala.Boolean, transformers2w: scala.Boolean, - transformers3w: scala.Boolean + transformers3w: scala.Boolean, ) object GridOutputConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.GridOutputConfig = { SimonaConfig.GridOutputConfig( lines = c.hasPathOrNull("lines") && c.getBoolean("lines"), @@ -230,14 +230,14 @@ object SimonaConfig { transformers2w = c.hasPathOrNull("transformers2w") && c.getBoolean("transformers2w"), transformers3w = - c.hasPathOrNull("transformers3w") && c.getBoolean("transformers3w") + c.hasPathOrNull("transformers3w") && c.getBoolean("transformers3w"), ) } private def $_reqStr( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -254,34 +254,34 @@ object SimonaConfig { final case class HpRuntimeConfig( override val calculateMissingReactivePowerWithModel: scala.Boolean, override val scaling: scala.Double, - override val uuids: scala.List[java.lang.String] + override val uuids: scala.List[java.lang.String], ) extends BaseRuntimeConfig( calculateMissingReactivePowerWithModel, scaling, - uuids + uuids, ) object HpRuntimeConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.HpRuntimeConfig = { SimonaConfig.HpRuntimeConfig( calculateMissingReactivePowerWithModel = $_reqBln( parentPath, c, "calculateMissingReactivePowerWithModel", - $tsCfgValidator + $tsCfgValidator, ), scaling = $_reqDbl(parentPath, c, "scaling", $tsCfgValidator), - uuids = $_L$_str(c.getList("uuids"), parentPath, $tsCfgValidator) + uuids = $_L$_str(c.getList("uuids"), parentPath, $tsCfgValidator), ) } private def $_reqBln( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Boolean = { if (c == null) false else @@ -297,7 +297,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Double = { if (c == null) 0 else @@ -315,7 +315,7 @@ object SimonaConfig { val bootstrapServers: java.lang.String, val linger: scala.Int, val runId: java.lang.String, - val schemaRegistryUrl: java.lang.String + val schemaRegistryUrl: java.lang.String, ) final case class LoadRuntimeConfig( @@ -323,17 +323,17 @@ object SimonaConfig { override val scaling: scala.Double, override val uuids: scala.List[java.lang.String], modelBehaviour: java.lang.String, - reference: java.lang.String + reference: java.lang.String, ) extends BaseRuntimeConfig( calculateMissingReactivePowerWithModel, scaling, - uuids + uuids, ) object LoadRuntimeConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.LoadRuntimeConfig = { SimonaConfig.LoadRuntimeConfig( modelBehaviour = @@ -343,17 +343,17 @@ object SimonaConfig { parentPath, c, "calculateMissingReactivePowerWithModel", - $tsCfgValidator + $tsCfgValidator, ), scaling = $_reqDbl(parentPath, c, "scaling", $tsCfgValidator), - uuids = $_L$_str(c.getList("uuids"), parentPath, $tsCfgValidator) + uuids = $_L$_str(c.getList("uuids"), parentPath, $tsCfgValidator), ) } private def $_reqBln( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Boolean = { if (c == null) false else @@ -369,7 +369,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Double = { if (c == null) 0 else @@ -385,7 +385,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -403,13 +403,13 @@ object SimonaConfig { override val notifier: java.lang.String, override val simulationResult: scala.Boolean, flexResult: scala.Boolean, - powerRequestReply: scala.Boolean + powerRequestReply: scala.Boolean, ) extends BaseOutputConfig(notifier, simulationResult) object ParticipantBaseOutputConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.ParticipantBaseOutputConfig = { SimonaConfig.ParticipantBaseOutputConfig( flexResult = @@ -418,14 +418,14 @@ object SimonaConfig { $_reqBln(parentPath, c, "powerRequestReply", $tsCfgValidator), notifier = $_reqStr(parentPath, c, "notifier", $tsCfgValidator), simulationResult = - $_reqBln(parentPath, c, "simulationResult", $tsCfgValidator) + $_reqBln(parentPath, c, "simulationResult", $tsCfgValidator), ) } private def $_reqBln( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Boolean = { if (c == null) false else @@ -441,7 +441,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -459,13 +459,13 @@ object SimonaConfig { override val csvSep: java.lang.String, override val directoryPath: java.lang.String, override val isHierarchic: scala.Boolean, - timePattern: java.lang.String + timePattern: java.lang.String, ) extends CsvParams(csvSep, directoryPath, isHierarchic) object PrimaryDataCsvParams { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.PrimaryDataCsvParams = { SimonaConfig.PrimaryDataCsvParams( timePattern = @@ -474,14 +474,14 @@ object SimonaConfig { csvSep = $_reqStr(parentPath, c, "csvSep", $tsCfgValidator), directoryPath = $_reqStr(parentPath, c, "directoryPath", $tsCfgValidator), - isHierarchic = $_reqBln(parentPath, c, "isHierarchic", $tsCfgValidator) + isHierarchic = $_reqBln(parentPath, c, "isHierarchic", $tsCfgValidator), ) } private def $_reqBln( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Boolean = { if (c == null) false else @@ -497,7 +497,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -514,34 +514,34 @@ object SimonaConfig { final case class PvRuntimeConfig( override val calculateMissingReactivePowerWithModel: scala.Boolean, override val scaling: scala.Double, - override val uuids: scala.List[java.lang.String] + override val uuids: scala.List[java.lang.String], ) extends BaseRuntimeConfig( calculateMissingReactivePowerWithModel, scaling, - uuids + uuids, ) object PvRuntimeConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.PvRuntimeConfig = { SimonaConfig.PvRuntimeConfig( calculateMissingReactivePowerWithModel = $_reqBln( parentPath, c, "calculateMissingReactivePowerWithModel", - $tsCfgValidator + $tsCfgValidator, ), scaling = $_reqDbl(parentPath, c, "scaling", $tsCfgValidator), - uuids = $_L$_str(c.getList("uuids"), parentPath, $tsCfgValidator) + uuids = $_L$_str(c.getList("uuids"), parentPath, $tsCfgValidator), ) } private def $_reqBln( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Boolean = { if (c == null) false else @@ -557,7 +557,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Double = { if (c == null) 0 else @@ -575,13 +575,13 @@ object SimonaConfig { gridIds: scala.Option[scala.List[java.lang.String]], sNom: java.lang.String, vNom: java.lang.String, - voltLvls: scala.Option[scala.List[SimonaConfig.VoltLvlConfig]] + voltLvls: scala.Option[scala.List[SimonaConfig.VoltLvlConfig]], ) object RefSystemConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.RefSystemConfig = { SimonaConfig.RefSystemConfig( gridIds = @@ -598,16 +598,16 @@ object SimonaConfig { $_LSimonaConfig_VoltLvlConfig( c.getList("voltLvls"), parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) - else None + else None, ) } private def $_LSimonaConfig_VoltLvlConfig( cl: com.typesafe.config.ConfigList, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.List[SimonaConfig.VoltLvlConfig] = { import scala.jdk.CollectionConverters._ cl.asScala @@ -615,7 +615,7 @@ object SimonaConfig { SimonaConfig.VoltLvlConfig( cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig, parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) .toList @@ -624,7 +624,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -643,13 +643,13 @@ object SimonaConfig { override val linger: scala.Int, override val runId: java.lang.String, override val schemaRegistryUrl: java.lang.String, - topicNodeRes: java.lang.String + topicNodeRes: java.lang.String, ) extends KafkaParams(bootstrapServers, linger, runId, schemaRegistryUrl) object ResultKafkaParams { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.ResultKafkaParams = { SimonaConfig.ResultKafkaParams( topicNodeRes = $_reqStr(parentPath, c, "topicNodeRes", $tsCfgValidator), @@ -658,14 +658,14 @@ object SimonaConfig { linger = $_reqInt(parentPath, c, "linger", $tsCfgValidator), runId = $_reqStr(parentPath, c, "runId", $tsCfgValidator), schemaRegistryUrl = - $_reqStr(parentPath, c, "schemaRegistryUrl", $tsCfgValidator) + $_reqStr(parentPath, c, "schemaRegistryUrl", $tsCfgValidator), ) } private def $_reqInt( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Int = { if (c == null) 0 else @@ -681,7 +681,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -700,13 +700,13 @@ object SimonaConfig { override val linger: scala.Int, override val runId: java.lang.String, override val schemaRegistryUrl: java.lang.String, - topic: java.lang.String + topic: java.lang.String, ) extends KafkaParams(bootstrapServers, linger, runId, schemaRegistryUrl) object RuntimeKafkaParams { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.RuntimeKafkaParams = { SimonaConfig.RuntimeKafkaParams( topic = $_reqStr(parentPath, c, "topic", $tsCfgValidator), @@ -715,14 +715,14 @@ object SimonaConfig { linger = $_reqInt(parentPath, c, "linger", $tsCfgValidator), runId = $_reqStr(parentPath, c, "runId", $tsCfgValidator), schemaRegistryUrl = - $_reqStr(parentPath, c, "schemaRegistryUrl", $tsCfgValidator) + $_reqStr(parentPath, c, "schemaRegistryUrl", $tsCfgValidator), ) } private def $_reqInt( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Int = { if (c == null) 0 else @@ -738,7 +738,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -754,25 +754,25 @@ object SimonaConfig { final case class SimpleOutputConfig( override val notifier: java.lang.String, - override val simulationResult: scala.Boolean + override val simulationResult: scala.Boolean, ) extends BaseOutputConfig(notifier, simulationResult) object SimpleOutputConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.SimpleOutputConfig = { SimonaConfig.SimpleOutputConfig( notifier = $_reqStr(parentPath, c, "notifier", $tsCfgValidator), simulationResult = - $_reqBln(parentPath, c, "simulationResult", $tsCfgValidator) + $_reqBln(parentPath, c, "simulationResult", $tsCfgValidator), ) } private def $_reqBln( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Boolean = { if (c == null) false else @@ -788,7 +788,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -804,24 +804,24 @@ object SimonaConfig { final case class VoltLvlConfig( id: java.lang.String, - vNom: java.lang.String + vNom: java.lang.String, ) object VoltLvlConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.VoltLvlConfig = { SimonaConfig.VoltLvlConfig( id = $_reqStr(parentPath, c, "id", $tsCfgValidator), - vNom = $_reqStr(parentPath, c, "vNom", $tsCfgValidator) + vNom = $_reqStr(parentPath, c, "vNom", $tsCfgValidator), ) } private def $_reqStr( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -838,34 +838,34 @@ object SimonaConfig { final case class WecRuntimeConfig( override val calculateMissingReactivePowerWithModel: scala.Boolean, override val scaling: scala.Double, - override val uuids: scala.List[java.lang.String] + override val uuids: scala.List[java.lang.String], ) extends BaseRuntimeConfig( calculateMissingReactivePowerWithModel, scaling, - uuids + uuids, ) object WecRuntimeConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.WecRuntimeConfig = { SimonaConfig.WecRuntimeConfig( calculateMissingReactivePowerWithModel = $_reqBln( parentPath, c, "calculateMissingReactivePowerWithModel", - $tsCfgValidator + $tsCfgValidator, ), scaling = $_reqDbl(parentPath, c, "scaling", $tsCfgValidator), - uuids = $_L$_str(c.getList("uuids"), parentPath, $tsCfgValidator) + uuids = $_L$_str(c.getList("uuids"), parentPath, $tsCfgValidator), ) } private def $_reqBln( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Boolean = { if (c == null) false else @@ -881,7 +881,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Double = { if (c == null) 0 else @@ -903,7 +903,7 @@ object SimonaConfig { powerflow: SimonaConfig.Simona.Powerflow, runtime: SimonaConfig.Simona.Runtime, simulationName: java.lang.String, - time: SimonaConfig.Simona.Time + time: SimonaConfig.Simona.Time, ) object Simona { final case class Event( @@ -914,13 +914,13 @@ object SimonaConfig { object Event { final case class Listener$Elm( eventsToProcess: scala.Option[scala.List[java.lang.String]], - fullClassPath: java.lang.String + fullClassPath: java.lang.String, ) object Listener$Elm { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Event.Listener$Elm = { SimonaConfig.Simona.Event.Listener$Elm( eventsToProcess = @@ -929,19 +929,19 @@ object SimonaConfig { $_L$_str( c.getList("eventsToProcess"), parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) else None, fullClassPath = - $_reqStr(parentPath, c, "fullClassPath", $tsCfgValidator) + $_reqStr(parentPath, c, "fullClassPath", $tsCfgValidator), ) } private def $_reqStr( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -958,7 +958,7 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Event = { SimonaConfig.Simona.Event( listener = @@ -967,7 +967,7 @@ object SimonaConfig { $_LSimonaConfig_Simona_Event_Listener$Elm( c.getList("listener"), parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) else None @@ -976,7 +976,7 @@ object SimonaConfig { private def $_LSimonaConfig_Simona_Event_Listener$Elm( cl: com.typesafe.config.ConfigList, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.List[SimonaConfig.Simona.Event.Listener$Elm] = { import scala.jdk.CollectionConverters._ cl.asScala @@ -984,7 +984,7 @@ object SimonaConfig { SimonaConfig.Simona.Event.Listener$Elm( cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig, parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) .toList @@ -998,20 +998,20 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.GridConfig = { SimonaConfig.Simona.GridConfig( refSystems = $_LSimonaConfig_RefSystemConfig( c.getList("refSystems"), parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) } private def $_LSimonaConfig_RefSystemConfig( cl: com.typesafe.config.ConfigList, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.List[SimonaConfig.RefSystemConfig] = { import scala.jdk.CollectionConverters._ cl.asScala @@ -1019,7 +1019,7 @@ object SimonaConfig { SimonaConfig.RefSystemConfig( cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig, parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) .toList @@ -1029,7 +1029,7 @@ object SimonaConfig { final case class Input( grid: SimonaConfig.Simona.Input.Grid, primary: SimonaConfig.Simona.Input.Primary, - weather: SimonaConfig.Simona.Input.Weather + weather: SimonaConfig.Simona.Input.Weather, ) object Input { final case class Grid( @@ -1038,13 +1038,13 @@ object SimonaConfig { object Grid { final case class Datasource( csvParams: scala.Option[SimonaConfig.BaseCsvParams], - id: java.lang.String + id: java.lang.String, ) object Datasource { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input.Grid.Datasource = { SimonaConfig.Simona.Input.Grid.Datasource( csvParams = @@ -1053,18 +1053,18 @@ object SimonaConfig { SimonaConfig.BaseCsvParams( c.getConfig("csvParams"), parentPath + "csvParams.", - $tsCfgValidator + $tsCfgValidator, ) ) else None, - id = $_reqStr(parentPath, c, "id", $tsCfgValidator) + id = $_reqStr(parentPath, c, "id", $tsCfgValidator), ) } private def $_reqStr( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -1081,7 +1081,7 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input.Grid = { SimonaConfig.Simona.Input.Grid( datasource = SimonaConfig.Simona.Input.Grid.Datasource( @@ -1089,7 +1089,7 @@ object SimonaConfig { else com.typesafe.config.ConfigFactory.parseString("datasource{}"), parentPath + "datasource.", - $tsCfgValidator + $tsCfgValidator, ) ) } @@ -1103,7 +1103,7 @@ object SimonaConfig { influxDb1xParams: scala.Option[ SimonaConfig.Simona.Input.Primary.InfluxDb1xParams ], - sqlParams: scala.Option[SimonaConfig.Simona.Input.Primary.SqlParams] + sqlParams: scala.Option[SimonaConfig.Simona.Input.Primary.SqlParams], ) object Primary { final case class CouchbaseParams( @@ -1113,13 +1113,13 @@ object SimonaConfig { password: java.lang.String, timePattern: java.lang.String, url: java.lang.String, - userName: java.lang.String + userName: java.lang.String, ) object CouchbaseParams { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input.Primary.CouchbaseParams = { SimonaConfig.Simona.Input.Primary.CouchbaseParams( bucketName = @@ -1128,7 +1128,7 @@ object SimonaConfig { parentPath, c, "coordinateColumnName", - $tsCfgValidator + $tsCfgValidator, ), keyPrefix = $_reqStr(parentPath, c, "keyPrefix", $tsCfgValidator), password = $_reqStr(parentPath, c, "password", $tsCfgValidator), @@ -1136,14 +1136,14 @@ object SimonaConfig { if (c.hasPathOrNull("timePattern")) c.getString("timePattern") else "yyyy-MM-dd'T'HH:mm:ss[.S[S][S]]'Z'", url = $_reqStr(parentPath, c, "url", $tsCfgValidator), - userName = $_reqStr(parentPath, c, "userName", $tsCfgValidator) + userName = $_reqStr(parentPath, c, "userName", $tsCfgValidator), ) } private def $_reqStr( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -1161,13 +1161,13 @@ object SimonaConfig { database: java.lang.String, port: scala.Int, timePattern: java.lang.String, - url: java.lang.String + url: java.lang.String, ) object InfluxDb1xParams { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input.Primary.InfluxDb1xParams = { SimonaConfig.Simona.Input.Primary.InfluxDb1xParams( database = $_reqStr(parentPath, c, "database", $tsCfgValidator), @@ -1175,14 +1175,14 @@ object SimonaConfig { timePattern = if (c.hasPathOrNull("timePattern")) c.getString("timePattern") else "yyyy-MM-dd'T'HH:mm:ss[.S[S][S]]'Z'", - url = $_reqStr(parentPath, c, "url", $tsCfgValidator) + url = $_reqStr(parentPath, c, "url", $tsCfgValidator), ) } private def $_reqInt( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Int = { if (c == null) 0 else @@ -1198,7 +1198,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -1217,13 +1217,13 @@ object SimonaConfig { password: java.lang.String, schemaName: java.lang.String, timePattern: java.lang.String, - userName: java.lang.String + userName: java.lang.String, ) object SqlParams { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input.Primary.SqlParams = { SimonaConfig.Simona.Input.Primary.SqlParams( jdbcUrl = $_reqStr(parentPath, c, "jdbcUrl", $tsCfgValidator), @@ -1234,14 +1234,14 @@ object SimonaConfig { timePattern = if (c.hasPathOrNull("timePattern")) c.getString("timePattern") else "yyyy-MM-dd'T'HH:mm:ss[.S[S][S]]'Z'", - userName = $_reqStr(parentPath, c, "userName", $tsCfgValidator) + userName = $_reqStr(parentPath, c, "userName", $tsCfgValidator), ) } private def $_reqStr( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -1258,7 +1258,7 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input.Primary = { SimonaConfig.Simona.Input.Primary( couchbaseParams = @@ -1267,7 +1267,7 @@ object SimonaConfig { SimonaConfig.Simona.Input.Primary.CouchbaseParams( c.getConfig("couchbaseParams"), parentPath + "couchbaseParams.", - $tsCfgValidator + $tsCfgValidator, ) ) else None, @@ -1277,7 +1277,7 @@ object SimonaConfig { SimonaConfig.PrimaryDataCsvParams( c.getConfig("csvParams"), parentPath + "csvParams.", - $tsCfgValidator + $tsCfgValidator, ) ) else None, @@ -1287,7 +1287,7 @@ object SimonaConfig { SimonaConfig.Simona.Input.Primary.InfluxDb1xParams( c.getConfig("influxDb1xParams"), parentPath + "influxDb1xParams.", - $tsCfgValidator + $tsCfgValidator, ) ) else None, @@ -1297,10 +1297,10 @@ object SimonaConfig { SimonaConfig.Simona.Input.Primary.SqlParams( c.getConfig("sqlParams"), parentPath + "sqlParams.", - $tsCfgValidator + $tsCfgValidator, ) ) - else None + else None, ) } } @@ -1327,7 +1327,7 @@ object SimonaConfig { sqlParams: scala.Option[ SimonaConfig.Simona.Input.Weather.Datasource.SqlParams ], - timestampPattern: scala.Option[java.lang.String] + timestampPattern: scala.Option[java.lang.String], ) object Datasource { final case class CoordinateSource( @@ -1338,7 +1338,7 @@ object SimonaConfig { ], sqlParams: scala.Option[ SimonaConfig.Simona.Input.Weather.Datasource.CoordinateSource.SqlParams - ] + ], ) object CoordinateSource { final case class SampleParams( @@ -1348,7 +1348,7 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input.Weather.Datasource.CoordinateSource.SampleParams = { SimonaConfig.Simona.Input.Weather.Datasource.CoordinateSource .SampleParams( @@ -1362,13 +1362,13 @@ object SimonaConfig { password: java.lang.String, schemaName: java.lang.String, tableName: java.lang.String, - userName: java.lang.String + userName: java.lang.String, ) object SqlParams { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input.Weather.Datasource.CoordinateSource.SqlParams = { SimonaConfig.Simona.Input.Weather.Datasource.CoordinateSource .SqlParams( @@ -1383,14 +1383,14 @@ object SimonaConfig { tableName = $_reqStr(parentPath, c, "tableName", $tsCfgValidator), userName = - $_reqStr(parentPath, c, "userName", $tsCfgValidator) + $_reqStr(parentPath, c, "userName", $tsCfgValidator), ) } private def $_reqStr( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -1407,7 +1407,7 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input.Weather.Datasource.CoordinateSource = { SimonaConfig.Simona.Input.Weather.Datasource.CoordinateSource( csvParams = @@ -1416,7 +1416,7 @@ object SimonaConfig { SimonaConfig.BaseCsvParams( c.getConfig("csvParams"), parentPath + "csvParams.", - $tsCfgValidator + $tsCfgValidator, ) ) else None, @@ -1430,7 +1430,7 @@ object SimonaConfig { .SampleParams( c.getConfig("sampleParams"), parentPath + "sampleParams.", - $tsCfgValidator + $tsCfgValidator, ) ) else None, @@ -1441,10 +1441,10 @@ object SimonaConfig { .SqlParams( c.getConfig("sqlParams"), parentPath + "sqlParams.", - $tsCfgValidator + $tsCfgValidator, ) ) - else None + else None, ) } } @@ -1455,13 +1455,13 @@ object SimonaConfig { keyPrefix: java.lang.String, password: java.lang.String, url: java.lang.String, - userName: java.lang.String + userName: java.lang.String, ) object CouchbaseParams { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input.Weather.Datasource.CouchbaseParams = { SimonaConfig.Simona.Input.Weather.Datasource.CouchbaseParams( bucketName = @@ -1470,20 +1470,20 @@ object SimonaConfig { parentPath, c, "coordinateColumnName", - $tsCfgValidator + $tsCfgValidator, ), keyPrefix = $_reqStr(parentPath, c, "keyPrefix", $tsCfgValidator), password = $_reqStr(parentPath, c, "password", $tsCfgValidator), url = $_reqStr(parentPath, c, "url", $tsCfgValidator), - userName = $_reqStr(parentPath, c, "userName", $tsCfgValidator) + userName = $_reqStr(parentPath, c, "userName", $tsCfgValidator), ) } private def $_reqStr( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -1500,25 +1500,25 @@ object SimonaConfig { final case class InfluxDb1xParams( database: java.lang.String, port: scala.Int, - url: java.lang.String + url: java.lang.String, ) object InfluxDb1xParams { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input.Weather.Datasource.InfluxDb1xParams = { SimonaConfig.Simona.Input.Weather.Datasource.InfluxDb1xParams( database = $_reqStr(parentPath, c, "database", $tsCfgValidator), port = $_reqInt(parentPath, c, "port", $tsCfgValidator), - url = $_reqStr(parentPath, c, "url", $tsCfgValidator) + url = $_reqStr(parentPath, c, "url", $tsCfgValidator), ) } private def $_reqInt( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Int = { if (c == null) 0 else @@ -1534,7 +1534,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -1555,7 +1555,7 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input.Weather.Datasource.SampleParams = { SimonaConfig.Simona.Input.Weather.Datasource.SampleParams( use = !c.hasPathOrNull("use") || c.getBoolean("use") @@ -1568,13 +1568,13 @@ object SimonaConfig { password: java.lang.String, schemaName: java.lang.String, tableName: java.lang.String, - userName: java.lang.String + userName: java.lang.String, ) object SqlParams { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input.Weather.Datasource.SqlParams = { SimonaConfig.Simona.Input.Weather.Datasource.SqlParams( jdbcUrl = $_reqStr(parentPath, c, "jdbcUrl", $tsCfgValidator), @@ -1584,14 +1584,14 @@ object SimonaConfig { else "public", tableName = $_reqStr(parentPath, c, "tableName", $tsCfgValidator), - userName = $_reqStr(parentPath, c, "userName", $tsCfgValidator) + userName = $_reqStr(parentPath, c, "userName", $tsCfgValidator), ) } private def $_reqStr( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -1608,7 +1608,7 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input.Weather.Datasource = { SimonaConfig.Simona.Input.Weather.Datasource( coordinateSource = @@ -1619,7 +1619,7 @@ object SimonaConfig { com.typesafe.config.ConfigFactory .parseString("coordinateSource{}"), parentPath + "coordinateSource.", - $tsCfgValidator + $tsCfgValidator, ), couchbaseParams = if (c.hasPathOrNull("couchbaseParams")) @@ -1628,7 +1628,7 @@ object SimonaConfig { .CouchbaseParams( c.getConfig("couchbaseParams"), parentPath + "couchbaseParams.", - $tsCfgValidator + $tsCfgValidator, ) ) else None, @@ -1638,7 +1638,7 @@ object SimonaConfig { SimonaConfig.BaseCsvParams( c.getConfig("csvParams"), parentPath + "csvParams.", - $tsCfgValidator + $tsCfgValidator, ) ) else None, @@ -1649,7 +1649,7 @@ object SimonaConfig { .InfluxDb1xParams( c.getConfig("influxDb1xParams"), parentPath + "influxDb1xParams.", - $tsCfgValidator + $tsCfgValidator, ) ) else None, @@ -1667,7 +1667,7 @@ object SimonaConfig { SimonaConfig.Simona.Input.Weather.Datasource.SampleParams( c.getConfig("sampleParams"), parentPath + "sampleParams.", - $tsCfgValidator + $tsCfgValidator, ) ) else None, @@ -1680,14 +1680,14 @@ object SimonaConfig { SimonaConfig.Simona.Input.Weather.Datasource.SqlParams( c.getConfig("sqlParams"), parentPath + "sqlParams.", - $tsCfgValidator + $tsCfgValidator, ) ) else None, timestampPattern = if (c.hasPathOrNull("timestampPattern")) Some(c.getString("timestampPattern")) - else None + else None, ) } } @@ -1695,7 +1695,7 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input.Weather = { SimonaConfig.Simona.Input.Weather( datasource = SimonaConfig.Simona.Input.Weather.Datasource( @@ -1703,7 +1703,7 @@ object SimonaConfig { else com.typesafe.config.ConfigFactory.parseString("datasource{}"), parentPath + "datasource.", - $tsCfgValidator + $tsCfgValidator, ) ) } @@ -1712,27 +1712,27 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Input = { SimonaConfig.Simona.Input( grid = SimonaConfig.Simona.Input.Grid( if (c.hasPathOrNull("grid")) c.getConfig("grid") else com.typesafe.config.ConfigFactory.parseString("grid{}"), parentPath + "grid.", - $tsCfgValidator + $tsCfgValidator, ), primary = SimonaConfig.Simona.Input.Primary( if (c.hasPathOrNull("primary")) c.getConfig("primary") else com.typesafe.config.ConfigFactory.parseString("primary{}"), parentPath + "primary.", - $tsCfgValidator + $tsCfgValidator, ), weather = SimonaConfig.Simona.Input.Weather( if (c.hasPathOrNull("weather")) c.getConfig("weather") else com.typesafe.config.ConfigFactory.parseString("weather{}"), parentPath + "weather.", - $tsCfgValidator - ) + $tsCfgValidator, + ), ) } } @@ -1743,31 +1743,31 @@ object SimonaConfig { grid: SimonaConfig.GridOutputConfig, participant: SimonaConfig.Simona.Output.Participant, sink: SimonaConfig.Simona.Output.Sink, - thermal: SimonaConfig.Simona.Output.Thermal + thermal: SimonaConfig.Simona.Output.Thermal, ) object Output { final case class Base( addTimestampToOutputDir: scala.Boolean, - dir: java.lang.String + dir: java.lang.String, ) object Base { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Output.Base = { SimonaConfig.Simona.Output.Base( addTimestampToOutputDir = !c.hasPathOrNull( "addTimestampToOutputDir" ) || c.getBoolean("addTimestampToOutputDir"), - dir = $_reqStr(parentPath, c, "dir", $tsCfgValidator) + dir = $_reqStr(parentPath, c, "dir", $tsCfgValidator), ) } private def $_reqStr( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -1785,13 +1785,13 @@ object SimonaConfig { defaultConfig: SimonaConfig.ParticipantBaseOutputConfig, individualConfigs: scala.List[ SimonaConfig.ParticipantBaseOutputConfig - ] + ], ) object Participant { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Output.Participant = { SimonaConfig.Simona.Output.Participant( defaultConfig = SimonaConfig.ParticipantBaseOutputConfig( @@ -1800,19 +1800,19 @@ object SimonaConfig { com.typesafe.config.ConfigFactory .parseString("defaultConfig{}"), parentPath + "defaultConfig.", - $tsCfgValidator + $tsCfgValidator, ), individualConfigs = $_LSimonaConfig_ParticipantBaseOutputConfig( c.getList("individualConfigs"), parentPath, - $tsCfgValidator - ) + $tsCfgValidator, + ), ) } private def $_LSimonaConfig_ParticipantBaseOutputConfig( cl: com.typesafe.config.ConfigList, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.List[SimonaConfig.ParticipantBaseOutputConfig] = { import scala.jdk.CollectionConverters._ cl.asScala @@ -1820,7 +1820,7 @@ object SimonaConfig { SimonaConfig.ParticipantBaseOutputConfig( cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig, parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) .toList @@ -1830,20 +1830,20 @@ object SimonaConfig { final case class Sink( csv: scala.Option[SimonaConfig.Simona.Output.Sink.Csv], influxDb1x: scala.Option[SimonaConfig.Simona.Output.Sink.InfluxDb1x], - kafka: scala.Option[SimonaConfig.ResultKafkaParams] + kafka: scala.Option[SimonaConfig.ResultKafkaParams], ) object Sink { final case class Csv( fileFormat: java.lang.String, filePrefix: java.lang.String, fileSuffix: java.lang.String, - isHierarchic: scala.Boolean + isHierarchic: scala.Boolean, ) object Csv { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Output.Sink.Csv = { SimonaConfig.Simona.Output.Sink.Csv( fileFormat = @@ -1856,7 +1856,7 @@ object SimonaConfig { if (c.hasPathOrNull("fileSuffix")) c.getString("fileSuffix") else "", isHierarchic = - c.hasPathOrNull("isHierarchic") && c.getBoolean("isHierarchic") + c.hasPathOrNull("isHierarchic") && c.getBoolean("isHierarchic"), ) } } @@ -1864,25 +1864,25 @@ object SimonaConfig { final case class InfluxDb1x( database: java.lang.String, port: scala.Int, - url: java.lang.String + url: java.lang.String, ) object InfluxDb1x { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Output.Sink.InfluxDb1x = { SimonaConfig.Simona.Output.Sink.InfluxDb1x( database = $_reqStr(parentPath, c, "database", $tsCfgValidator), port = $_reqInt(parentPath, c, "port", $tsCfgValidator), - url = $_reqStr(parentPath, c, "url", $tsCfgValidator) + url = $_reqStr(parentPath, c, "url", $tsCfgValidator), ) } private def $_reqInt( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Int = { if (c == null) 0 else @@ -1898,7 +1898,7 @@ object SimonaConfig { parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -1915,7 +1915,7 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Output.Sink = { SimonaConfig.Simona.Output.Sink( csv = @@ -1924,7 +1924,7 @@ object SimonaConfig { SimonaConfig.Simona.Output.Sink.Csv( c.getConfig("csv"), parentPath + "csv.", - $tsCfgValidator + $tsCfgValidator, ) ) else None, @@ -1934,7 +1934,7 @@ object SimonaConfig { SimonaConfig.Simona.Output.Sink.InfluxDb1x( c.getConfig("influxDb1x"), parentPath + "influxDb1x.", - $tsCfgValidator + $tsCfgValidator, ) ) else None, @@ -1944,23 +1944,23 @@ object SimonaConfig { SimonaConfig.ResultKafkaParams( c.getConfig("kafka"), parentPath + "kafka.", - $tsCfgValidator + $tsCfgValidator, ) ) - else None + else None, ) } } final case class Thermal( defaultConfig: SimonaConfig.SimpleOutputConfig, - individualConfigs: scala.List[SimonaConfig.SimpleOutputConfig] + individualConfigs: scala.List[SimonaConfig.SimpleOutputConfig], ) object Thermal { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Output.Thermal = { SimonaConfig.Simona.Output.Thermal( defaultConfig = SimonaConfig.SimpleOutputConfig( @@ -1969,19 +1969,19 @@ object SimonaConfig { com.typesafe.config.ConfigFactory .parseString("defaultConfig{}"), parentPath + "defaultConfig.", - $tsCfgValidator + $tsCfgValidator, ), individualConfigs = $_LSimonaConfig_SimpleOutputConfig( c.getList("individualConfigs"), parentPath, - $tsCfgValidator - ) + $tsCfgValidator, + ), ) } private def $_LSimonaConfig_SimpleOutputConfig( cl: com.typesafe.config.ConfigList, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.List[SimonaConfig.SimpleOutputConfig] = { import scala.jdk.CollectionConverters._ cl.asScala @@ -1989,7 +1989,7 @@ object SimonaConfig { SimonaConfig.SimpleOutputConfig( cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig, parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) .toList @@ -1999,40 +1999,40 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Output = { SimonaConfig.Simona.Output( base = SimonaConfig.Simona.Output.Base( if (c.hasPathOrNull("base")) c.getConfig("base") else com.typesafe.config.ConfigFactory.parseString("base{}"), parentPath + "base.", - $tsCfgValidator + $tsCfgValidator, ), flex = c.hasPathOrNull("flex") && c.getBoolean("flex"), grid = SimonaConfig.GridOutputConfig( if (c.hasPathOrNull("grid")) c.getConfig("grid") else com.typesafe.config.ConfigFactory.parseString("grid{}"), parentPath + "grid.", - $tsCfgValidator + $tsCfgValidator, ), participant = SimonaConfig.Simona.Output.Participant( if (c.hasPathOrNull("participant")) c.getConfig("participant") else com.typesafe.config.ConfigFactory.parseString("participant{}"), parentPath + "participant.", - $tsCfgValidator + $tsCfgValidator, ), sink = SimonaConfig.Simona.Output.Sink( if (c.hasPathOrNull("sink")) c.getConfig("sink") else com.typesafe.config.ConfigFactory.parseString("sink{}"), parentPath + "sink.", - $tsCfgValidator + $tsCfgValidator, ), thermal = SimonaConfig.Simona.Output.Thermal( if (c.hasPathOrNull("thermal")) c.getConfig("thermal") else com.typesafe.config.ConfigFactory.parseString("thermal{}"), parentPath + "thermal.", - $tsCfgValidator - ) + $tsCfgValidator, + ), ) } } @@ -2042,30 +2042,30 @@ object SimonaConfig { newtonraphson: SimonaConfig.Simona.Powerflow.Newtonraphson, resolution: java.time.Duration, stopOnFailure: scala.Boolean, - sweepTimeout: java.time.Duration + sweepTimeout: java.time.Duration, ) object Powerflow { final case class Newtonraphson( epsilon: scala.List[scala.Double], - iterations: scala.Int + iterations: scala.Int, ) object Newtonraphson { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Powerflow.Newtonraphson = { SimonaConfig.Simona.Powerflow.Newtonraphson( epsilon = $_L$_dbl(c.getList("epsilon"), parentPath, $tsCfgValidator), - iterations = $_reqInt(parentPath, c, "iterations", $tsCfgValidator) + iterations = $_reqInt(parentPath, c, "iterations", $tsCfgValidator), ) } private def $_reqInt( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Int = { if (c == null) 0 else @@ -2082,7 +2082,7 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Powerflow = { SimonaConfig.Simona.Powerflow( maxSweepPowerDeviation = @@ -2092,7 +2092,7 @@ object SimonaConfig { else com.typesafe.config.ConfigFactory.parseString("newtonraphson{}"), parentPath + "newtonraphson.", - $tsCfgValidator + $tsCfgValidator, ), resolution = if (c.hasPathOrNull("resolution")) c.getDuration("resolution") @@ -2101,14 +2101,14 @@ object SimonaConfig { c.hasPathOrNull("stopOnFailure") && c.getBoolean("stopOnFailure"), sweepTimeout = if (c.hasPathOrNull("sweepTimeout")) c.getDuration("sweepTimeout") - else java.time.Duration.parse("PT30S") + else java.time.Duration.parse("PT30S"), ) } private def $_reqDbl( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.Double = { if (c == null) 0 else @@ -2126,18 +2126,18 @@ object SimonaConfig { listener: SimonaConfig.Simona.Runtime.Listener, participant: SimonaConfig.Simona.Runtime.Participant, selected_subgrids: scala.Option[scala.List[scala.Int]], - selected_volt_lvls: scala.Option[scala.List[SimonaConfig.VoltLvlConfig]] + selected_volt_lvls: scala.Option[scala.List[SimonaConfig.VoltLvlConfig]], ) object Runtime { final case class Listener( eventsToProcess: scala.Option[scala.List[java.lang.String]], - kafka: scala.Option[SimonaConfig.RuntimeKafkaParams] + kafka: scala.Option[SimonaConfig.RuntimeKafkaParams], ) object Listener { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Runtime.Listener = { SimonaConfig.Simona.Runtime.Listener( eventsToProcess = @@ -2146,7 +2146,7 @@ object SimonaConfig { $_L$_str( c.getList("eventsToProcess"), parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) else None, @@ -2156,10 +2156,10 @@ object SimonaConfig { SimonaConfig.RuntimeKafkaParams( c.getConfig("kafka"), parentPath + "kafka.", - $tsCfgValidator + $tsCfgValidator, ) ) - else None + else None, ) } } @@ -2171,18 +2171,18 @@ object SimonaConfig { load: SimonaConfig.Simona.Runtime.Participant.Load, pv: SimonaConfig.Simona.Runtime.Participant.Pv, requestVoltageDeviationThreshold: scala.Double, - wec: SimonaConfig.Simona.Runtime.Participant.Wec + wec: SimonaConfig.Simona.Runtime.Participant.Wec, ) object Participant { final case class Evcs( defaultConfig: SimonaConfig.EvcsRuntimeConfig, - individualConfigs: scala.List[SimonaConfig.EvcsRuntimeConfig] + individualConfigs: scala.List[SimonaConfig.EvcsRuntimeConfig], ) object Evcs { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Runtime.Participant.Evcs = { SimonaConfig.Simona.Runtime.Participant.Evcs( defaultConfig = SimonaConfig.EvcsRuntimeConfig( @@ -2192,19 +2192,19 @@ object SimonaConfig { com.typesafe.config.ConfigFactory .parseString("defaultConfig{}"), parentPath + "defaultConfig.", - $tsCfgValidator + $tsCfgValidator, ), individualConfigs = $_LSimonaConfig_EvcsRuntimeConfig( c.getList("individualConfigs"), parentPath, - $tsCfgValidator - ) + $tsCfgValidator, + ), ) } private def $_LSimonaConfig_EvcsRuntimeConfig( cl: com.typesafe.config.ConfigList, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.List[SimonaConfig.EvcsRuntimeConfig] = { import scala.jdk.CollectionConverters._ cl.asScala @@ -2212,7 +2212,7 @@ object SimonaConfig { SimonaConfig.EvcsRuntimeConfig( cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig, parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) .toList @@ -2221,13 +2221,13 @@ object SimonaConfig { final case class FixedFeedIn( defaultConfig: SimonaConfig.FixedFeedInRuntimeConfig, - individualConfigs: scala.List[SimonaConfig.FixedFeedInRuntimeConfig] + individualConfigs: scala.List[SimonaConfig.FixedFeedInRuntimeConfig], ) object FixedFeedIn { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Runtime.Participant.FixedFeedIn = { SimonaConfig.Simona.Runtime.Participant.FixedFeedIn( defaultConfig = SimonaConfig.FixedFeedInRuntimeConfig( @@ -2237,19 +2237,19 @@ object SimonaConfig { com.typesafe.config.ConfigFactory .parseString("defaultConfig{}"), parentPath + "defaultConfig.", - $tsCfgValidator + $tsCfgValidator, ), individualConfigs = $_LSimonaConfig_FixedFeedInRuntimeConfig( c.getList("individualConfigs"), parentPath, - $tsCfgValidator - ) + $tsCfgValidator, + ), ) } private def $_LSimonaConfig_FixedFeedInRuntimeConfig( cl: com.typesafe.config.ConfigList, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.List[SimonaConfig.FixedFeedInRuntimeConfig] = { import scala.jdk.CollectionConverters._ cl.asScala @@ -2257,7 +2257,7 @@ object SimonaConfig { SimonaConfig.FixedFeedInRuntimeConfig( cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig, parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) .toList @@ -2266,13 +2266,13 @@ object SimonaConfig { final case class Hp( defaultConfig: SimonaConfig.HpRuntimeConfig, - individualConfigs: scala.List[SimonaConfig.HpRuntimeConfig] + individualConfigs: scala.List[SimonaConfig.HpRuntimeConfig], ) object Hp { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Runtime.Participant.Hp = { SimonaConfig.Simona.Runtime.Participant.Hp( defaultConfig = SimonaConfig.HpRuntimeConfig( @@ -2282,19 +2282,19 @@ object SimonaConfig { com.typesafe.config.ConfigFactory .parseString("defaultConfig{}"), parentPath + "defaultConfig.", - $tsCfgValidator + $tsCfgValidator, ), individualConfigs = $_LSimonaConfig_HpRuntimeConfig( c.getList("individualConfigs"), parentPath, - $tsCfgValidator - ) + $tsCfgValidator, + ), ) } private def $_LSimonaConfig_HpRuntimeConfig( cl: com.typesafe.config.ConfigList, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.List[SimonaConfig.HpRuntimeConfig] = { import scala.jdk.CollectionConverters._ cl.asScala @@ -2302,7 +2302,7 @@ object SimonaConfig { SimonaConfig.HpRuntimeConfig( cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig, parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) .toList @@ -2311,13 +2311,13 @@ object SimonaConfig { final case class Load( defaultConfig: SimonaConfig.LoadRuntimeConfig, - individualConfigs: scala.List[SimonaConfig.LoadRuntimeConfig] + individualConfigs: scala.List[SimonaConfig.LoadRuntimeConfig], ) object Load { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Runtime.Participant.Load = { SimonaConfig.Simona.Runtime.Participant.Load( defaultConfig = SimonaConfig.LoadRuntimeConfig( @@ -2327,19 +2327,19 @@ object SimonaConfig { com.typesafe.config.ConfigFactory .parseString("defaultConfig{}"), parentPath + "defaultConfig.", - $tsCfgValidator + $tsCfgValidator, ), individualConfigs = $_LSimonaConfig_LoadRuntimeConfig( c.getList("individualConfigs"), parentPath, - $tsCfgValidator - ) + $tsCfgValidator, + ), ) } private def $_LSimonaConfig_LoadRuntimeConfig( cl: com.typesafe.config.ConfigList, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.List[SimonaConfig.LoadRuntimeConfig] = { import scala.jdk.CollectionConverters._ cl.asScala @@ -2347,7 +2347,7 @@ object SimonaConfig { SimonaConfig.LoadRuntimeConfig( cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig, parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) .toList @@ -2356,13 +2356,13 @@ object SimonaConfig { final case class Pv( defaultConfig: SimonaConfig.PvRuntimeConfig, - individualConfigs: scala.List[SimonaConfig.PvRuntimeConfig] + individualConfigs: scala.List[SimonaConfig.PvRuntimeConfig], ) object Pv { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Runtime.Participant.Pv = { SimonaConfig.Simona.Runtime.Participant.Pv( defaultConfig = SimonaConfig.PvRuntimeConfig( @@ -2372,19 +2372,19 @@ object SimonaConfig { com.typesafe.config.ConfigFactory .parseString("defaultConfig{}"), parentPath + "defaultConfig.", - $tsCfgValidator + $tsCfgValidator, ), individualConfigs = $_LSimonaConfig_PvRuntimeConfig( c.getList("individualConfigs"), parentPath, - $tsCfgValidator - ) + $tsCfgValidator, + ), ) } private def $_LSimonaConfig_PvRuntimeConfig( cl: com.typesafe.config.ConfigList, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.List[SimonaConfig.PvRuntimeConfig] = { import scala.jdk.CollectionConverters._ cl.asScala @@ -2392,7 +2392,7 @@ object SimonaConfig { SimonaConfig.PvRuntimeConfig( cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig, parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) .toList @@ -2401,13 +2401,13 @@ object SimonaConfig { final case class Wec( defaultConfig: SimonaConfig.WecRuntimeConfig, - individualConfigs: scala.List[SimonaConfig.WecRuntimeConfig] + individualConfigs: scala.List[SimonaConfig.WecRuntimeConfig], ) object Wec { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Runtime.Participant.Wec = { SimonaConfig.Simona.Runtime.Participant.Wec( defaultConfig = SimonaConfig.WecRuntimeConfig( @@ -2417,19 +2417,19 @@ object SimonaConfig { com.typesafe.config.ConfigFactory .parseString("defaultConfig{}"), parentPath + "defaultConfig.", - $tsCfgValidator + $tsCfgValidator, ), individualConfigs = $_LSimonaConfig_WecRuntimeConfig( c.getList("individualConfigs"), parentPath, - $tsCfgValidator - ) + $tsCfgValidator, + ), ) } private def $_LSimonaConfig_WecRuntimeConfig( cl: com.typesafe.config.ConfigList, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.List[SimonaConfig.WecRuntimeConfig] = { import scala.jdk.CollectionConverters._ cl.asScala @@ -2437,7 +2437,7 @@ object SimonaConfig { SimonaConfig.WecRuntimeConfig( cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig, parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) .toList @@ -2447,39 +2447,39 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Runtime.Participant = { SimonaConfig.Simona.Runtime.Participant( evcs = SimonaConfig.Simona.Runtime.Participant.Evcs( if (c.hasPathOrNull("evcs")) c.getConfig("evcs") else com.typesafe.config.ConfigFactory.parseString("evcs{}"), parentPath + "evcs.", - $tsCfgValidator + $tsCfgValidator, ), fixedFeedIn = SimonaConfig.Simona.Runtime.Participant.FixedFeedIn( if (c.hasPathOrNull("fixedFeedIn")) c.getConfig("fixedFeedIn") else com.typesafe.config.ConfigFactory.parseString("fixedFeedIn{}"), parentPath + "fixedFeedIn.", - $tsCfgValidator + $tsCfgValidator, ), hp = SimonaConfig.Simona.Runtime.Participant.Hp( if (c.hasPathOrNull("hp")) c.getConfig("hp") else com.typesafe.config.ConfigFactory.parseString("hp{}"), parentPath + "hp.", - $tsCfgValidator + $tsCfgValidator, ), load = SimonaConfig.Simona.Runtime.Participant.Load( if (c.hasPathOrNull("load")) c.getConfig("load") else com.typesafe.config.ConfigFactory.parseString("load{}"), parentPath + "load.", - $tsCfgValidator + $tsCfgValidator, ), pv = SimonaConfig.Simona.Runtime.Participant.Pv( if (c.hasPathOrNull("pv")) c.getConfig("pv") else com.typesafe.config.ConfigFactory.parseString("pv{}"), parentPath + "pv.", - $tsCfgValidator + $tsCfgValidator, ), requestVoltageDeviationThreshold = if (c.hasPathOrNull("requestVoltageDeviationThreshold")) @@ -2489,8 +2489,8 @@ object SimonaConfig { if (c.hasPathOrNull("wec")) c.getConfig("wec") else com.typesafe.config.ConfigFactory.parseString("wec{}"), parentPath + "wec.", - $tsCfgValidator - ) + $tsCfgValidator, + ), ) } } @@ -2498,20 +2498,20 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Runtime = { SimonaConfig.Simona.Runtime( listener = SimonaConfig.Simona.Runtime.Listener( if (c.hasPathOrNull("listener")) c.getConfig("listener") else com.typesafe.config.ConfigFactory.parseString("listener{}"), parentPath + "listener.", - $tsCfgValidator + $tsCfgValidator, ), participant = SimonaConfig.Simona.Runtime.Participant( if (c.hasPathOrNull("participant")) c.getConfig("participant") else com.typesafe.config.ConfigFactory.parseString("participant{}"), parentPath + "participant.", - $tsCfgValidator + $tsCfgValidator, ), selected_subgrids = if (c.hasPathOrNull("selected_subgrids")) @@ -2519,7 +2519,7 @@ object SimonaConfig { $_L$_int( c.getList("selected_subgrids"), parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) else None, @@ -2529,16 +2529,16 @@ object SimonaConfig { $_LSimonaConfig_VoltLvlConfig( c.getList("selected_volt_lvls"), parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) - else None + else None, ) } private def $_LSimonaConfig_VoltLvlConfig( cl: com.typesafe.config.ConfigList, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.List[SimonaConfig.VoltLvlConfig] = { import scala.jdk.CollectionConverters._ cl.asScala @@ -2546,7 +2546,7 @@ object SimonaConfig { SimonaConfig.VoltLvlConfig( cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig, parentPath, - $tsCfgValidator + $tsCfgValidator, ) ) .toList @@ -2556,13 +2556,13 @@ object SimonaConfig { final case class Time( endDateTime: java.lang.String, schedulerReadyCheckWindow: scala.Option[scala.Int], - startDateTime: java.lang.String + startDateTime: java.lang.String, ) object Time { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona.Time = { SimonaConfig.Simona.Time( endDateTime = @@ -2574,7 +2574,7 @@ object SimonaConfig { else None, startDateTime = if (c.hasPathOrNull("startDateTime")) c.getString("startDateTime") - else "2011-05-01 00:00:00" + else "2011-05-01 00:00:00", ) } } @@ -2582,44 +2582,44 @@ object SimonaConfig { def apply( c: com.typesafe.config.Config, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): SimonaConfig.Simona = { SimonaConfig.Simona( event = SimonaConfig.Simona.Event( if (c.hasPathOrNull("event")) c.getConfig("event") else com.typesafe.config.ConfigFactory.parseString("event{}"), parentPath + "event.", - $tsCfgValidator + $tsCfgValidator, ), gridConfig = SimonaConfig.Simona.GridConfig( if (c.hasPathOrNull("gridConfig")) c.getConfig("gridConfig") else com.typesafe.config.ConfigFactory.parseString("gridConfig{}"), parentPath + "gridConfig.", - $tsCfgValidator + $tsCfgValidator, ), input = SimonaConfig.Simona.Input( if (c.hasPathOrNull("input")) c.getConfig("input") else com.typesafe.config.ConfigFactory.parseString("input{}"), parentPath + "input.", - $tsCfgValidator + $tsCfgValidator, ), output = SimonaConfig.Simona.Output( if (c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}"), parentPath + "output.", - $tsCfgValidator + $tsCfgValidator, ), powerflow = SimonaConfig.Simona.Powerflow( if (c.hasPathOrNull("powerflow")) c.getConfig("powerflow") else com.typesafe.config.ConfigFactory.parseString("powerflow{}"), parentPath + "powerflow.", - $tsCfgValidator + $tsCfgValidator, ), runtime = SimonaConfig.Simona.Runtime( if (c.hasPathOrNull("runtime")) c.getConfig("runtime") else com.typesafe.config.ConfigFactory.parseString("runtime{}"), parentPath + "runtime.", - $tsCfgValidator + $tsCfgValidator, ), simulationName = $_reqStr(parentPath, c, "simulationName", $tsCfgValidator), @@ -2627,15 +2627,15 @@ object SimonaConfig { if (c.hasPathOrNull("time")) c.getConfig("time") else com.typesafe.config.ConfigFactory.parseString("time{}"), parentPath + "time.", - $tsCfgValidator - ) + $tsCfgValidator, + ), ) } private def $_reqStr( parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): java.lang.String = { if (c == null) null else @@ -2657,7 +2657,7 @@ object SimonaConfig { if (c.hasPathOrNull("simona")) c.getConfig("simona") else com.typesafe.config.ConfigFactory.parseString("simona{}"), parentPath + "simona.", - $tsCfgValidator + $tsCfgValidator, ) ) $tsCfgValidator.validate() @@ -2667,7 +2667,7 @@ object SimonaConfig { private def $_L$_dbl( cl: com.typesafe.config.ConfigList, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.List[scala.Double] = { import scala.jdk.CollectionConverters._ cl.asScala.map(cv => $_dbl(cv)).toList @@ -2675,7 +2675,7 @@ object SimonaConfig { private def $_L$_int( cl: com.typesafe.config.ConfigList, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.List[scala.Int] = { import scala.jdk.CollectionConverters._ cl.asScala.map(cv => $_int(cv)).toList @@ -2683,7 +2683,7 @@ object SimonaConfig { private def $_L$_str( cl: com.typesafe.config.ConfigList, parentPath: java.lang.String, - $tsCfgValidator: $TsCfgValidator + $tsCfgValidator: $TsCfgValidator, ): scala.List[java.lang.String] = { import scala.jdk.CollectionConverters._ cl.asScala.map(cv => $_str(cv)).toList @@ -2699,7 +2699,7 @@ object SimonaConfig { private def $_expE( cv: com.typesafe.config.ConfigValue, - exp: java.lang.String + exp: java.lang.String, ) = { val u: Any = cv.unwrapped new java.lang.RuntimeException( @@ -2728,7 +2728,7 @@ object SimonaConfig { def addBadPath( path: java.lang.String, - e: com.typesafe.config.ConfigException + e: com.typesafe.config.ConfigException, ): Unit = { badPaths += s"'$path': ${e.getClass.getName}(${e.getMessage})" } @@ -2736,7 +2736,7 @@ object SimonaConfig { def addInvalidEnumValue( path: java.lang.String, value: java.lang.String, - enumName: java.lang.String + enumName: java.lang.String, ): Unit = { badPaths += s"'$path': invalid value $value for enumeration $enumName" } diff --git a/src/main/scala/edu/ie3/simona/config/VoltLvlParser.scala b/src/main/scala/edu/ie3/simona/config/VoltLvlParser.scala index 3d3ce38920..885adae81e 100644 --- a/src/main/scala/edu/ie3/simona/config/VoltLvlParser.scala +++ b/src/main/scala/edu/ie3/simona/config/VoltLvlParser.scala @@ -10,7 +10,7 @@ import edu.ie3.datamodel.exceptions.VoltageLevelException import edu.ie3.datamodel.models.voltagelevels.{ CommonVoltageLevel, GermanVoltageLevelUtils, - VoltageLevel + VoltageLevel, } import edu.ie3.simona.config.SimonaConfig.VoltLvlConfig import edu.ie3.simona.exceptions.InvalidConfigParameterException @@ -46,7 +46,7 @@ object VoltLvlParser { */ private def parse( id: String, - vNominal: ComparableQuantity[ElectricPotential] + vNominal: ComparableQuantity[ElectricPotential], ): CommonVoltageLevel = try { GermanVoltageLevelUtils.parse(id, vNominal) @@ -54,7 +54,7 @@ object VoltLvlParser { case vle: VoltageLevelException => throw new InvalidConfigParameterException( s"Cannot find a common voltage level with id $id and nominal voltage $vNominal", - vle + vle, ) } @@ -76,12 +76,12 @@ object VoltLvlParser { case iae: IllegalArgumentException => throw new InvalidConfigParameterException( s"Cannot parse the nominal voltage $quantString", - iae + iae, ) case cce: ClassCastException => throw new InvalidConfigParameterException( s"Cannot parse $quantString to nominal voltage, as it is no voltage.", - cce + cce, ) } } diff --git a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala index 81512e9a9d..6c3b55b8af 100644 --- a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala +++ b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala @@ -10,11 +10,11 @@ import edu.ie3.datamodel.models.result.NodeResult import edu.ie3.datamodel.models.result.connector.{ LineResult, SwitchResult, - Transformer2WResult + Transformer2WResult, } import edu.ie3.datamodel.models.result.system.{ FlexOptionsResult, - SystemParticipantResult + SystemParticipantResult, } import edu.ie3.datamodel.models.result.thermal.ThermalUnitResult import edu.ie3.simona.agent.grid.GridResultsSupport.PartialTransformer3wResult @@ -65,7 +65,7 @@ object ResultEvent { switchResults: Iterable[SwitchResult], lineResults: Iterable[LineResult], transformer2wResults: Iterable[Transformer2WResult], - transformer3wResults: Iterable[PartialTransformer3wResult] + transformer3wResults: Iterable[PartialTransformer3wResult], ) extends ResultEvent /** Event that holds the flexibility options result of a diff --git a/src/main/scala/edu/ie3/simona/event/RuntimeEvent.scala b/src/main/scala/edu/ie3/simona/event/RuntimeEvent.scala index 23a3352e19..c7e793a9a2 100644 --- a/src/main/scala/edu/ie3/simona/event/RuntimeEvent.scala +++ b/src/main/scala/edu/ie3/simona/event/RuntimeEvent.scala @@ -80,7 +80,7 @@ object RuntimeEvent { final case class Done( tick: Long, duration: Long, - errorInSim: Boolean + errorInSim: Boolean, ) extends RuntimeEvent /** Indicates that a power flow calculation has failed. This event is not diff --git a/src/main/scala/edu/ie3/simona/event/listener/ResultEventListener.scala b/src/main/scala/edu/ie3/simona/event/listener/ResultEventListener.scala index 3abe4d831e..fcd820db4c 100644 --- a/src/main/scala/edu/ie3/simona/event/listener/ResultEventListener.scala +++ b/src/main/scala/edu/ie3/simona/event/listener/ResultEventListener.scala @@ -16,11 +16,11 @@ import edu.ie3.simona.event.ResultEvent.{ FlexOptionsResultEvent, ParticipantResultEvent, PowerFlowResultEvent, - ThermalResultEvent + ThermalResultEvent, } import edu.ie3.simona.exceptions.{ FileHierarchyException, - ProcessResultEventException + ProcessResultEventException, } import edu.ie3.simona.io.result._ import edu.ie3.simona.ontology.messages.StopMessage @@ -55,8 +55,8 @@ object ResultEventListener extends Transformer3wResultSupport { classToSink: Map[Class[_], ResultEntitySink], threeWindingResults: Map[ Transformer3wKey, - AggregatedTransformer3wResult - ] = Map.empty + AggregatedTransformer3wResult, + ] = Map.empty, ) /** Initialize the sinks for this listener based on the provided collection @@ -94,8 +94,8 @@ object ResultEventListener extends Transformer3wResultSupport { ResultEntityCsvSink( fileName.replace(".gz", ""), new ResultEntityProcessor(resultClass), - fileName.endsWith(".gz") - ) + fileName.endsWith(".gz"), + ), ) } } else { @@ -121,7 +121,7 @@ object ResultEventListener extends Transformer3wResultSupport { runId, bootstrapServers, schemaRegistryUrl, - linger + linger, ) => val classes: Iterable[Class[_ <: ResultEntity]] = Set( classOf[NodeResult] // currently, only NodeResults are sent out @@ -135,8 +135,8 @@ object ResultEventListener extends Transformer3wResultSupport { runId, bootstrapServers, schemaRegistryUrl, - linger - ) + linger, + ), ) ) ) @@ -155,7 +155,7 @@ object ResultEventListener extends Transformer3wResultSupport { private def handleResult( resultEntity: ResultEntity, baseData: BaseData, - log: Logger + log: Logger, ): BaseData = { handOverToSink(resultEntity, baseData.classToSink, log) baseData @@ -175,14 +175,14 @@ object ResultEventListener extends Transformer3wResultSupport { private def handlePartialTransformer3wResult( result: PartialTransformer3wResult, baseData: BaseData, - log: Logger + log: Logger, ): BaseData = { val key = Transformer3wKey(result.input, result.time) // retrieve existing partial result or use empty one val partialResult = baseData.threeWindingResults.getOrElse( key, - AggregatedTransformer3wResult.EMPTY + AggregatedTransformer3wResult.EMPTY, ) // add partial result val updatedResults = partialResult.add(result).map { updatedResult => @@ -202,7 +202,7 @@ object ResultEventListener extends Transformer3wResultSupport { case Failure(exception) => log.warn( "Failure when handling partial Transformer3w result", - exception + exception, ) // on failure, we just continue with previous results baseData.threeWindingResults @@ -222,7 +222,7 @@ object ResultEventListener extends Transformer3wResultSupport { private def handOverToSink( resultEntity: ResultEntity, classToSink: Map[Class[_], ResultEntitySink], - log: Logger + log: Logger, ): Unit = Try { classToSink @@ -244,7 +244,7 @@ object ResultEventListener extends Transformer3wResultSupport { s"Events that will be processed: {}", resultFileHierarchy.resultEntitiesToConsider .map(_.getSimpleName) - .mkString(",") + .mkString(","), ) } @@ -295,8 +295,8 @@ object ResultEventListener extends Transformer3wResultSupport { switchResults, lineResults, transformer2wResults, - transformer3wResults - ) + transformer3wResults, + ), ) => val updatedBaseData = (nodeResults ++ switchResults ++ lineResults ++ transformer2wResults ++ transformer3wResults) @@ -305,12 +305,12 @@ object ResultEventListener extends Transformer3wResultSupport { handleResult(resultEntity, currentBaseData, ctx.log) case ( currentBaseData, - partialTransformerResult: PartialTransformer3wResult + partialTransformerResult: PartialTransformer3wResult, ) => handlePartialTransformer3wResult( partialTransformerResult, currentBaseData, - ctx.log + ctx.log, ) } idle(updatedBaseData) @@ -341,7 +341,7 @@ object ResultEventListener extends Transformer3wResultSupport { .map { case Transformer3wKey(model, zdt) => s"model '$model' at $zdt" } - .mkString("\n\t\t") + .mkString("\n\t\t"), ) // close sinks concurrently to speed up closing (closing calls might be blocking) @@ -353,7 +353,7 @@ object ResultEventListener extends Transformer3wResultSupport { } ) ), - 5.minutes + 5.minutes, ) ctx.log.debug("Result I/O completed.") diff --git a/src/main/scala/edu/ie3/simona/event/listener/RuntimeEventListener.scala b/src/main/scala/edu/ie3/simona/event/listener/RuntimeEventListener.scala index a45fdd5f86..3b12951688 100644 --- a/src/main/scala/edu/ie3/simona/event/listener/RuntimeEventListener.scala +++ b/src/main/scala/edu/ie3/simona/event/listener/RuntimeEventListener.scala @@ -16,7 +16,7 @@ import edu.ie3.simona.io.runtime.{ RuntimeEventKafkaSink, RuntimeEventLogSink, RuntimeEventQueueSink, - RuntimeEventSink + RuntimeEventSink, } import edu.ie3.util.TimeUtil import org.slf4j.Logger @@ -42,7 +42,7 @@ object RuntimeEventListener { def apply( listenerConf: SimonaConfig.Simona.Runtime.Listener, queue: Option[BlockingQueue[RuntimeEvent]], - startDateTimeString: String + startDateTimeString: String, ): Behavior[RuntimeEvent] = { val listeners = Iterable( Some( @@ -51,19 +51,19 @@ object RuntimeEventListener { ) ), queue.map(qu => RuntimeEventQueueSink(qu)), - listenerConf.kafka.map(kafkaConf => RuntimeEventKafkaSink(kafkaConf)) + listenerConf.kafka.map(kafkaConf => RuntimeEventKafkaSink(kafkaConf)), ).flatten RuntimeEventListener( listeners, - listenerConf.eventsToProcess + listenerConf.eventsToProcess, ) } def apply( listeners: Iterable[RuntimeEventSink], eventsToProcess: Option[List[String]] = None, - runtimeStats: RuntimeStats = RuntimeStats() + runtimeStats: RuntimeStats = RuntimeStats(), ): Behavior[RuntimeEvent] = Behaviors .receive[RuntimeEvent] { case (_, PowerFlowFailed) => @@ -79,7 +79,7 @@ object RuntimeEventListener { else ctx.log.debug( "Skipping event {} as it is not in the list of events to process.", - event.id + event.id, ) Behaviors.same } @@ -92,7 +92,7 @@ object RuntimeEventListener { listeners: Iterable[RuntimeEventSink], event: RuntimeEvent, runtimeStats: RuntimeStats, - log: Logger + log: Logger, ): Unit = listeners.foreach(_.handleRuntimeEvent(event, runtimeStats, log)) diff --git a/src/main/scala/edu/ie3/simona/event/listener/SimonaListenerWithFilter.scala b/src/main/scala/edu/ie3/simona/event/listener/SimonaListenerWithFilter.scala index 8d09e63c0a..666120e80e 100644 --- a/src/main/scala/edu/ie3/simona/event/listener/SimonaListenerWithFilter.scala +++ b/src/main/scala/edu/ie3/simona/event/listener/SimonaListenerWithFilter.scala @@ -49,7 +49,7 @@ abstract class SimonaListenerWithFilter(eventsToProcess: Option[List[String]]) case _ => log.debug( "Skipping event {} as it is not in the list of events to process.", - event.id + event.id, ) } } diff --git a/src/main/scala/edu/ie3/simona/event/listener/Transformer3wResultSupport.scala b/src/main/scala/edu/ie3/simona/event/listener/Transformer3wResultSupport.scala index 5eb68a5653..97e443a2b0 100644 --- a/src/main/scala/edu/ie3/simona/event/listener/Transformer3wResultSupport.scala +++ b/src/main/scala/edu/ie3/simona/event/listener/Transformer3wResultSupport.scala @@ -27,7 +27,7 @@ private[listener] trait Transformer3wResultSupport { */ final case class Transformer3wKey( model: UUID, - zdt: ZonedDateTime + zdt: ZonedDateTime, ) /** Holding the result values of all three ports of a transformer @@ -42,7 +42,7 @@ private[listener] trait Transformer3wResultSupport { final case class AggregatedTransformer3wResult( a: Option[PartialTransformer3wResult.PortA], b: Option[PartialTransformer3wResult.PortB], - c: Option[PartialTransformer3wResult.PortC] + c: Option[PartialTransformer3wResult.PortC], ) { /** Check, if the results can be consolidated @@ -65,29 +65,29 @@ private[listener] trait Transformer3wResultSupport { aResult.input, Quantities.getQuantity( aResult.currentMagnitude.toAmperes, - Units.AMPERE + Units.AMPERE, ), Quantities.getQuantity( aResult.currentAngle.toDegrees, - PowerSystemUnits.DEGREE_GEOM + PowerSystemUnits.DEGREE_GEOM, ), Quantities.getQuantity( bResult.currentMagnitude.toAmperes, - Units.AMPERE + Units.AMPERE, ), Quantities.getQuantity( bResult.currentAngle.toDegrees, - PowerSystemUnits.DEGREE_GEOM + PowerSystemUnits.DEGREE_GEOM, ), Quantities.getQuantity( cResult.currentMagnitude.toAmperes, - Units.AMPERE + Units.AMPERE, ), Quantities.getQuantity( cResult.currentAngle.toDegrees, - PowerSystemUnits.DEGREE_GEOM + PowerSystemUnits.DEGREE_GEOM, ), - aResult.tapPos + aResult.tapPos, ) ) case _ => diff --git a/src/main/scala/edu/ie3/simona/event/notifier/NotifierConfig.scala b/src/main/scala/edu/ie3/simona/event/notifier/NotifierConfig.scala index dfcf9c9e65..bacd0be34d 100644 --- a/src/main/scala/edu/ie3/simona/event/notifier/NotifierConfig.scala +++ b/src/main/scala/edu/ie3/simona/event/notifier/NotifierConfig.scala @@ -15,5 +15,5 @@ package edu.ie3.simona.event.notifier final case class NotifierConfig( simulationResultInfo: Boolean, powerRequestReply: Boolean, - flexResult: Boolean + flexResult: Boolean, ) diff --git a/src/main/scala/edu/ie3/simona/exceptions/WeatherServiceException.scala b/src/main/scala/edu/ie3/simona/exceptions/WeatherServiceException.scala index 5dcdaab211..08d109a2a6 100644 --- a/src/main/scala/edu/ie3/simona/exceptions/WeatherServiceException.scala +++ b/src/main/scala/edu/ie3/simona/exceptions/WeatherServiceException.scala @@ -15,7 +15,7 @@ package edu.ie3.simona.exceptions */ abstract class WeatherServiceException( private val msg: String = "", - private val cause: Throwable = None.orNull + private val cause: Throwable = None.orNull, ) extends Exception(msg, cause) object WeatherServiceException { @@ -30,7 +30,7 @@ object WeatherServiceException { */ final case class WeatherServiceInitializationException( private val msg: String = "", - private val cause: Throwable = None.orNull + private val cause: Throwable = None.orNull, ) extends WeatherServiceException(msg, cause) /** Exception to be thrown, if looking up of weather fails @@ -42,7 +42,7 @@ object WeatherServiceException { */ final case class WeatherLookupException( private val msg: String = "", - private val cause: Throwable = None.orNull + private val cause: Throwable = None.orNull, ) extends WeatherServiceException(msg, cause) /** Exception to be thrown if the registration of the an agent fails @@ -53,7 +53,7 @@ object WeatherServiceException { */ final case class InvalidRegistrationRequestException( private val msg: String = "", - private val cause: Throwable = None.orNull + private val cause: Throwable = None.orNull, ) extends WeatherServiceException(msg, cause) } diff --git a/src/main/scala/edu/ie3/simona/io/grid/CsvGridSource.scala b/src/main/scala/edu/ie3/simona/io/grid/CsvGridSource.scala index fa7016a09a..7726640c1f 100644 --- a/src/main/scala/edu/ie3/simona/io/grid/CsvGridSource.scala +++ b/src/main/scala/edu/ie3/simona/io/grid/CsvGridSource.scala @@ -13,7 +13,7 @@ import edu.ie3.datamodel.models.input.container._ import edu.ie3.datamodel.models.input.thermal.{ ThermalBusInput, ThermalHouseInput, - ThermalStorageInput + ThermalStorageInput, } import java.nio.file.Path @@ -23,7 +23,7 @@ object CsvGridSource { def readThermalGrids( csvSep: String, baseFolder: Path, - fileNamingStrategy: FileNamingStrategy + fileNamingStrategy: FileNamingStrategy, ): Map[ThermalBusInput, ThermalGrid] = { val csvDataSource = new CsvDataSource(csvSep, baseFolder, fileNamingStrategy) @@ -56,7 +56,7 @@ object CsvGridSource { bus -> new ThermalGrid( bus, h, - s + s, ) }.toMap } diff --git a/src/main/scala/edu/ie3/simona/io/grid/GridProvider.scala b/src/main/scala/edu/ie3/simona/io/grid/GridProvider.scala index 4818b95fb1..24277fcd7c 100644 --- a/src/main/scala/edu/ie3/simona/io/grid/GridProvider.scala +++ b/src/main/scala/edu/ie3/simona/io/grid/GridProvider.scala @@ -11,7 +11,7 @@ import edu.ie3.datamodel.io.naming.FileNamingStrategy import edu.ie3.datamodel.io.source.csv.CsvJointGridContainerSource import edu.ie3.datamodel.models.input.container.{ JointGridContainer, - ThermalGrid + ThermalGrid, } import edu.ie3.datamodel.models.input.thermal.ThermalBusInput import edu.ie3.datamodel.utils.validation.ValidationUtils @@ -31,7 +31,7 @@ object GridProvider extends LazyLogging { def gridFromConfig( simulationName: String, - gridDataSource: SimonaConfig.Simona.Input.Grid.Datasource + gridDataSource: SimonaConfig.Simona.Input.Grid.Datasource, ): JointGridContainer = { GridSourceType(gridDataSource.id.toLowerCase) match { case GridSourceType.CSV => @@ -41,14 +41,14 @@ object GridProvider extends LazyLogging { simulationName, params.csvSep, Path.of(params.directoryPath), - params.isHierarchic + params.isHierarchic, ) Try(ValidationUtils.check(jointGridContainer)) match { case Failure(exception) => logger.warn( s"Validation of grid ${jointGridContainer.getGridName} failed: \n\t{}", - exception.getMessage + exception.getMessage, ) case Success(_) => logger.debug( @@ -85,7 +85,7 @@ object GridProvider extends LazyLogging { .readThermalGrids( params.csvSep, Path.of(params.directoryPath), - new FileNamingStrategy() + new FileNamingStrategy(), ) case None => throw new RuntimeException( diff --git a/src/main/scala/edu/ie3/simona/io/result/ResultEntityCsvSink.scala b/src/main/scala/edu/ie3/simona/io/result/ResultEntityCsvSink.scala index 0b41aebbe0..88e6d5a080 100644 --- a/src/main/scala/edu/ie3/simona/io/result/ResultEntityCsvSink.scala +++ b/src/main/scala/edu/ie3/simona/io/result/ResultEntityCsvSink.scala @@ -41,7 +41,7 @@ final case class ResultEntityCsvSink private ( fileWriter: Writer, resultEntityProcessor: ResultEntityProcessor, compressOutputFiles: Boolean, - delimiter: String + delimiter: String, ) extends ResultEntitySink with LazyLogging { @@ -159,7 +159,7 @@ object ResultEntityCsvSink { outfileName: String, resultEntityProcessor: ResultEntityProcessor, compressOutputFiles: Boolean, - delimiter: String = "," + delimiter: String = ",", ): ResultEntityCsvSink = { val file = new File(outfileName) @@ -172,7 +172,7 @@ object ResultEntityCsvSink { writer, resultEntityProcessor, compressOutputFiles, - delimiter + delimiter, ) if (!existedBefore) diff --git a/src/main/scala/edu/ie3/simona/io/result/ResultEntityInfluxDbSink.scala b/src/main/scala/edu/ie3/simona/io/result/ResultEntityInfluxDbSink.scala index 3b101064b5..a8d0ec4a5d 100644 --- a/src/main/scala/edu/ie3/simona/io/result/ResultEntityInfluxDbSink.scala +++ b/src/main/scala/edu/ie3/simona/io/result/ResultEntityInfluxDbSink.scala @@ -48,7 +48,7 @@ object ResultEntityInfluxDbSink { def apply( databaseUrl: String, databaseName: String, - scenarioName: String + scenarioName: String, ): Future[ResultEntityInfluxDbSink] = Future.successful( new ResultEntityInfluxDbSink( diff --git a/src/main/scala/edu/ie3/simona/io/result/ResultEntityKafkaSink.scala b/src/main/scala/edu/ie3/simona/io/result/ResultEntityKafkaSink.scala index b9d8f1f272..3effd9dd2d 100644 --- a/src/main/scala/edu/ie3/simona/io/result/ResultEntityKafkaSink.scala +++ b/src/main/scala/edu/ie3/simona/io/result/ResultEntityKafkaSink.scala @@ -16,7 +16,7 @@ import io.confluent.kafka.serializers.AbstractKafkaSchemaSerDeConfig.SCHEMA_REGI import org.apache.kafka.clients.producer.{ KafkaProducer, ProducerConfig, - ProducerRecord + ProducerRecord, } import org.apache.kafka.common.serialization.{Serdes, Serializer} @@ -26,11 +26,11 @@ import scala.reflect.ClassTag final case class ResultEntityKafkaSink[ V <: ResultEntity, - P <: PlainResult + P <: PlainResult, ] private ( producer: KafkaProducer[String, P], plainWriter: PlainWriter[V, P], - topic: String + topic: String, ) extends ResultEntitySink { override def handleResultEntity(resultEntity: ResultEntity): Unit = { @@ -53,7 +53,7 @@ object ResultEntityKafkaSink { simRunId: UUID, bootstrapServers: String, schemaRegistryUrl: String, - linger: Int + linger: Int, )(implicit tag: ClassTag[R] ): ResultEntityKafkaSink[_ <: ResultEntity, _ <: PlainResult] = { @@ -62,7 +62,7 @@ object ResultEntityKafkaSink { props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers) props.put( ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG, - true + true, ) // exactly once delivery val NodeResClass = classOf[NodeResult] @@ -79,24 +79,24 @@ object ResultEntityKafkaSink { schemaRegistryUrl: String, props: Properties, topic: String, - writer: PlainWriter[F, P] + writer: PlainWriter[F, P], ): ResultEntityKafkaSink[F, P] = { val keySerializer = Serdes.String().serializer() val valueSerializer: Serializer[P] = reflectionSerializer4S[P] valueSerializer.configure( Map(SCHEMA_REGISTRY_URL_CONFIG -> schemaRegistryUrl).asJava, - false + false, ) ResultEntityKafkaSink( new KafkaProducer[String, P]( props, keySerializer, - valueSerializer + valueSerializer, ), writer, - topic + topic, ) } } diff --git a/src/main/scala/edu/ie3/simona/io/result/ResultSinkType.scala b/src/main/scala/edu/ie3/simona/io/result/ResultSinkType.scala index d4c444fdd7..3510810062 100644 --- a/src/main/scala/edu/ie3/simona/io/result/ResultSinkType.scala +++ b/src/main/scala/edu/ie3/simona/io/result/ResultSinkType.scala @@ -20,7 +20,7 @@ object ResultSinkType { final case class Csv( fileFormat: String = ".csv", filePrefix: String = "", - fileSuffix: String = "" + fileSuffix: String = "", ) extends ResultSinkType final case class InfluxDb1x(url: String, database: String, scenario: String) @@ -31,12 +31,12 @@ object ResultSinkType { runId: UUID, bootstrapServers: String, schemaRegistryUrl: String, - linger: Int + linger: Int, ) extends ResultSinkType def apply( sinkConfig: SimonaConfig.Simona.Output.Sink, - runName: String + runName: String, ): ResultSinkType = { val sink: Seq[Any] = Seq(sinkConfig.csv, sinkConfig.influxDb1x, sinkConfig.kafka).flatten @@ -57,7 +57,7 @@ object ResultSinkType { UUID.fromString(params.runId), params.bootstrapServers, params.schemaRegistryUrl, - params.linger + params.linger, ) case None => throw new IllegalArgumentException( diff --git a/src/main/scala/edu/ie3/simona/io/result/plain/PlainResult.scala b/src/main/scala/edu/ie3/simona/io/result/plain/PlainResult.scala index a590441007..19bb41283d 100644 --- a/src/main/scala/edu/ie3/simona/io/result/plain/PlainResult.scala +++ b/src/main/scala/edu/ie3/simona/io/result/plain/PlainResult.scala @@ -40,6 +40,6 @@ object PlainResult { uuid: UUID, inputModel: UUID, vMag: Double, - vAng: Double + vAng: Double, ) extends PlainResult } diff --git a/src/main/scala/edu/ie3/simona/io/result/plain/PlainWriter.scala b/src/main/scala/edu/ie3/simona/io/result/plain/PlainWriter.scala index 993f43d0c9..597dff5ac1 100644 --- a/src/main/scala/edu/ie3/simona/io/result/plain/PlainWriter.scala +++ b/src/main/scala/edu/ie3/simona/io/result/plain/PlainWriter.scala @@ -62,7 +62,7 @@ object PlainWriter { full.getUuid, full.getInputModel, full.getvMag.getValue.doubleValue(), - full.getvAng.getValue.doubleValue() + full.getvAng.getValue.doubleValue(), ) } @@ -72,7 +72,7 @@ object PlainWriter { ZonedDateTime.parse(plain.time, timeFormatter), plain.inputModel, Quantities.getQuantity(plain.vMag, PowerSystemUnits.PU), - Quantities.getQuantity(plain.vAng, PowerSystemUnits.DEGREE_GEOM) + Quantities.getQuantity(plain.vAng, PowerSystemUnits.DEGREE_GEOM), ) } } diff --git a/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventKafkaSink.scala b/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventKafkaSink.scala index dea2b50642..b38e3c252d 100644 --- a/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventKafkaSink.scala +++ b/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventKafkaSink.scala @@ -16,7 +16,7 @@ import io.confluent.kafka.serializers.AbstractKafkaSchemaSerDeConfig.SCHEMA_REGI import org.apache.kafka.clients.producer.{ KafkaProducer, ProducerConfig, - ProducerRecord + ProducerRecord, } import org.apache.kafka.common.serialization.{Serdes, Serializer} import org.slf4j.Logger @@ -36,13 +36,13 @@ import scala.jdk.CollectionConverters._ final case class RuntimeEventKafkaSink( producer: KafkaProducer[String, SimonaEndMessage], simRunId: UUID, - topic: String + topic: String, ) extends RuntimeEventSink { override def handleRuntimeEvent( runtimeEvent: RuntimeEvent, runtimeStats: RuntimeStats, - log: Logger + log: Logger, ): Unit = { (runtimeEvent match { case Done(_, _, errorInSim) => @@ -83,7 +83,7 @@ object RuntimeEventKafkaSink { props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, config.bootstrapServers) props.put( ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG, - true + true, ) // exactly once delivery implicit val recordFormat: RecordFormat[SimonaEndMessage] = @@ -95,23 +95,23 @@ object RuntimeEventKafkaSink { valueSerializer.configure( Map(SCHEMA_REGISTRY_URL_CONFIG -> config.schemaRegistryUrl).asJava, - false + false, ) RuntimeEventKafkaSink( new KafkaProducer[String, SimonaEndMessage]( props, keySerializer, - valueSerializer + valueSerializer, ), simRunId, - config.topic + config.topic, ) } final case class SimonaEndMessage( simRunId: UUID, failedPowerFlows: Int, - error: Boolean + error: Boolean, ) } diff --git a/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventLogSink.scala b/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventLogSink.scala index 833b5907dd..6117ebccb9 100644 --- a/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventLogSink.scala +++ b/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventLogSink.scala @@ -26,7 +26,7 @@ final case class RuntimeEventLogSink( override def handleRuntimeEvent( runtimeEvent: RuntimeEvent, runtimeStats: RuntimeStats, - log: Logger + log: Logger, ): Unit = runtimeEvent match { case Initializing => diff --git a/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventQueueSink.scala b/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventQueueSink.scala index dad7a65686..202f13f0d9 100644 --- a/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventQueueSink.scala +++ b/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventQueueSink.scala @@ -21,7 +21,7 @@ final case class RuntimeEventQueueSink(queue: BlockingQueue[RuntimeEvent]) override def handleRuntimeEvent( runtimeEvent: RuntimeEvent, runtimeStats: RuntimeStats, - log: Logger + log: Logger, ): Unit = queue.put(runtimeEvent) diff --git a/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventSink.scala b/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventSink.scala index 496a2166e3..4a526788be 100644 --- a/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventSink.scala +++ b/src/main/scala/edu/ie3/simona/io/runtime/RuntimeEventSink.scala @@ -28,7 +28,7 @@ trait RuntimeEventSink { def handleRuntimeEvent( runtimeEvent: RuntimeEvent, runtimeStats: RuntimeStats, - log: Logger + log: Logger, ): Unit /** Contains all cleanup operations before closing this sink. Should be diff --git a/src/main/scala/edu/ie3/simona/logging/SimonaFSMActorLogging.scala b/src/main/scala/edu/ie3/simona/logging/SimonaFSMActorLogging.scala index cfc618bc85..9a4b58b069 100644 --- a/src/main/scala/edu/ie3/simona/logging/SimonaFSMActorLogging.scala +++ b/src/main/scala/edu/ie3/simona/logging/SimonaFSMActorLogging.scala @@ -17,7 +17,7 @@ trait SimonaFSMActorLogging extends ActorLogging with SimonaLogging { context.system, () => stateName, this, - actorName + actorName, ) } diff --git a/src/main/scala/edu/ie3/simona/logging/SimonaLogging.scala b/src/main/scala/edu/ie3/simona/logging/SimonaLogging.scala index 5cb449ab3d..933eed80a7 100644 --- a/src/main/scala/edu/ie3/simona/logging/SimonaLogging.scala +++ b/src/main/scala/edu/ie3/simona/logging/SimonaLogging.scala @@ -11,7 +11,7 @@ import org.apache.pekko.event.{ LogSource, LoggingAdapter, LoggingBus, - LoggingFilter + LoggingFilter, } import edu.ie3.simona.actor.SimonaActorNaming @@ -33,7 +33,7 @@ object SimonaLogging { system: ActorSystem, state: () => S, logSource: T, - agentName: String + agentName: String, ): LoggingAdapter = { val (str, clazz) = LogSource(logSource, system) SimonaBusLogging( @@ -41,14 +41,14 @@ object SimonaLogging { str, clazz, logFilter(system), - () => fsmPrefix(agentName, state) + () => fsmPrefix(agentName, state), ) } private[logging] def createAdapter[T: LogSource]( system: ActorSystem, logSource: T, - agentName: String + agentName: String, ): LoggingAdapter = { val (str, clazz) = LogSource(logSource, system) SimonaBusLogging( @@ -56,7 +56,7 @@ object SimonaLogging { str, clazz, logFilter(system), - () => actorPrefix(agentName) + () => actorPrefix(agentName), ) } @@ -79,7 +79,7 @@ object SimonaLogging { logSource: String, logClass: Class[_], loggingFilter: LoggingFilter, - prefix: () => String + prefix: () => String, ) extends LoggingAdapter { import org.apache.pekko.event.Logging._ diff --git a/src/main/scala/edu/ie3/simona/logging/logback/LogbackConfiguration.scala b/src/main/scala/edu/ie3/simona/logging/logback/LogbackConfiguration.scala index 8aa16d5174..3d236a1f41 100644 --- a/src/main/scala/edu/ie3/simona/logging/logback/LogbackConfiguration.scala +++ b/src/main/scala/edu/ie3/simona/logging/logback/LogbackConfiguration.scala @@ -39,7 +39,7 @@ object LogbackConfiguration extends LazyLogging { log, "simona-default", fileLoggerFilterList, - loggerContext + loggerContext, ) ) @@ -61,7 +61,7 @@ object LogbackConfiguration extends LazyLogging { logPath: String, appenderName: String, maybeFilterList: Option[Seq[Filter[ILoggingEvent]]], - loggerContext: LoggerContext + loggerContext: LoggerContext, ): FileAppender[ILoggingEvent] = { val layoutEncoder = new PatternLayoutEncoder diff --git a/src/main/scala/edu/ie3/simona/main/RunSimona.scala b/src/main/scala/edu/ie3/simona/main/RunSimona.scala index 449a16df25..df011e6614 100644 --- a/src/main/scala/edu/ie3/simona/main/RunSimona.scala +++ b/src/main/scala/edu/ie3/simona/main/RunSimona.scala @@ -68,7 +68,7 @@ trait RunSimona[T <: SimonaSetup] extends LazyLogging { "\"Assimiliert das!\" - Worf (in Star Trek: Der erste Kontakt)", "\"Lebe lang und erfolgreich.\" - Gruppe von Vulkanier (in Star Trek: Der erste Kontakt)", "\"Ich bin der Anfang, das Ende, die Eine, die Viele ist. Ich bin die Borg.\" - Borg-Königin (in Star Trek: Der erste Kontakt)", - "\"A horse! A horse! My kingdom for a horse!\" - King Richard III (in Shakespeare's Richard III, 1594)" + "\"A horse! A horse! My kingdom for a horse!\" - King Richard III (in Shakespeare's Richard III, 1594)", ) val rand = new Random diff --git a/src/main/scala/edu/ie3/simona/main/RunSimonaStandalone.scala b/src/main/scala/edu/ie3/simona/main/RunSimonaStandalone.scala index 5a8bee6d2e..1fe37611a5 100644 --- a/src/main/scala/edu/ie3/simona/main/RunSimonaStandalone.scala +++ b/src/main/scala/edu/ie3/simona/main/RunSimonaStandalone.scala @@ -16,7 +16,7 @@ import edu.ie3.simona.sim.SimMessage.{ InitSim, SimulationFailure, SimulationSuccessful, - StartSimulation + StartSimulation, } import edu.ie3.simona.sim.SimonaSim import edu.ie3.simona.sim.setup.SimonaStandaloneSetup @@ -46,7 +46,7 @@ object RunSimonaStandalone extends RunSimona[SimonaStandaloneSetup] { SimonaStandaloneSetup( parsedConfig, SimonaStandaloneSetup.buildResultFileHierarchy(parsedConfig), - mainArgs = arguments.mainArgs + mainArgs = arguments.mainArgs, ) ) } diff --git a/src/main/scala/edu/ie3/simona/model/SystemComponent.scala b/src/main/scala/edu/ie3/simona/model/SystemComponent.scala index a81c235bf9..623e5a58c3 100644 --- a/src/main/scala/edu/ie3/simona/model/SystemComponent.scala +++ b/src/main/scala/edu/ie3/simona/model/SystemComponent.scala @@ -13,7 +13,7 @@ import com.typesafe.scalalogging.LazyLogging import edu.ie3.datamodel.models.OperationTime import edu.ie3.simona.exceptions.{ InvalidActionRequestException, - InvalidParameterException + InvalidParameterException, } import edu.ie3.simona.util.TickUtil._ import edu.ie3.util.scala.OperationInterval @@ -35,7 +35,7 @@ import scala.util.{Failure, Success, Try} abstract class SystemComponent( uuid: UUID, id: String, - operationInterval: OperationInterval + operationInterval: OperationInterval, ) extends LazyLogging { private val elementType: String = this.getClass.getSimpleName @@ -107,7 +107,7 @@ case object SystemComponent { def determineOperationInterval( startDate: ZonedDateTime, endDate: ZonedDateTime, - operationTime: OperationTime + operationTime: OperationTime, ): OperationInterval = { val operationStartOpt = operationTime.getStartDate.toScala val operationEndOpt = operationTime.getEndDate.toScala diff --git a/src/main/scala/edu/ie3/simona/model/em/EmTools.scala b/src/main/scala/edu/ie3/simona/model/em/EmTools.scala index 1eecffa22d..8a10b9c335 100644 --- a/src/main/scala/edu/ie3/simona/model/em/EmTools.scala +++ b/src/main/scala/edu/ie3/simona/model/em/EmTools.scala @@ -11,7 +11,7 @@ import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage.{ IssueFlexControl, IssueNoControl, IssuePowerControl, - ProvideFlexOptions + ProvideFlexOptions, } import edu.ie3.simona.ontology.messages.flex.MinMaxFlexibilityMessage.ProvideMinMaxFlexOptions import squants.Power @@ -32,7 +32,7 @@ object EmTools { */ def determineFlexPower( flexOptionsMsg: ProvideFlexOptions, - flexCtrl: IssueFlexControl + flexCtrl: IssueFlexControl, ): Power = flexOptionsMsg match { case flexOptions: ProvideMinMaxFlexOptions => @@ -64,7 +64,7 @@ object EmTools { */ def checkSetPower( flexOptions: ProvideMinMaxFlexOptions, - setPower: Power + setPower: Power, ): Unit = { if (setPower < flexOptions.min) throw new CriticalFailureException( diff --git a/src/main/scala/edu/ie3/simona/model/grid/GridModel.scala b/src/main/scala/edu/ie3/simona/model/grid/GridModel.scala index fd1ea11df2..27a3f556ea 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/GridModel.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/GridModel.scala @@ -17,7 +17,7 @@ import edu.ie3.simona.model.grid.GridModel.GridComponents import edu.ie3.simona.model.grid.Transformer3wPowerFlowCase.{ PowerFlowCaseA, PowerFlowCaseB, - PowerFlowCaseC + PowerFlowCaseC, } import edu.ie3.simona.util.CollectionUtils import org.jgrapht.Graph @@ -36,7 +36,7 @@ import scala.jdk.CollectionConverters._ final case class GridModel( subnetNo: Int, mainRefSystem: RefSystem, - gridComponents: GridComponents + gridComponents: GridComponents, ) { // init nodeUuidToIndexMap @@ -50,7 +50,7 @@ final case class GridModel( nodeModel.uuid, throw new InvalidGridException( s"Requested slack node with uuid ${nodeModel.uuid} is not part of nodeToIndexMap!" - ) + ), ) ) .toVector @@ -64,7 +64,7 @@ case object GridModel { subGridContainer: SubGridContainer, refSystem: RefSystem, startDate: ZonedDateTime, - endDate: ZonedDateTime + endDate: ZonedDateTime, ): GridModel = { buildAndValidate(subGridContainer, refSystem, startDate, endDate) } @@ -77,7 +77,7 @@ case object GridModel { lines: Set[LineModel], transformers: Set[TransformerModel], transformers3w: Set[Transformer3wModel], - switches: Set[SwitchModel] + switches: Set[SwitchModel], ) /** Checks the availability of node calculation models, that are connected by @@ -93,7 +93,7 @@ case object GridModel { */ private def getConnectedNodes( connector: ConnectorInput, - nodes: Seq[NodeModel] + nodes: Seq[NodeModel], ): (NodeModel, NodeModel) = { val nodeAOpt: Option[NodeModel] = nodes.find(_.uuid.equals(connector.getNodeA.getUuid)) @@ -131,7 +131,7 @@ case object GridModel { */ private def getConnectedNodes( transformerInput: Transformer3WInput, - nodes: Seq[NodeModel] + nodes: Seq[NodeModel], ): (NodeModel, NodeModel, NodeModel) = { val (nodeA, nodeB) = getConnectedNodes(transformerInput.asInstanceOf[ConnectorInput], nodes) @@ -165,7 +165,7 @@ case object GridModel { def composeAdmittanceMatrix( nodeUuidToIndexMap: Map[UUID, Int], - gridComponents: GridComponents + gridComponents: GridComponents, ): DenseMatrix[Complex] = { val _returnAdmittanceMatrixIfValid @@ -176,7 +176,7 @@ case object GridModel { { entry: Complex => !entry.imag.isNaN & !entry.real.isNaN & entry.imag.isFinite & entry.real.isFinite }, - admittanceMatrix + admittanceMatrix, ) ) throw new RuntimeException(s"Admittance matrix is illegal.") @@ -191,17 +191,17 @@ case object GridModel { val linesAdmittanceMatrix = buildAssetAdmittanceMatrix( nodeUuidToIndexMap, gridComponents.lines, - getLinesAdmittance + getLinesAdmittance, ) val trafoAdmittanceMatrix = buildAssetAdmittanceMatrix( nodeUuidToIndexMap, gridComponents.transformers, - getTransformerAdmittance + getTransformerAdmittance, ) val trafo3wAdmittanceMatrix = buildAssetAdmittanceMatrix( nodeUuidToIndexMap, gridComponents.transformers3w, - getTransformer3wAdmittance + getTransformer3wAdmittance, ) _returnAdmittanceMatrixIfValid( @@ -214,8 +214,8 @@ case object GridModel { assets: Set[C], getAssetAdmittance: ( Map[UUID, Int], - C - ) => (Int, Int, Complex, Complex, Complex) + C, + ) => (Int, Int, Complex, Complex, Complex), ): DenseMatrix[Complex] = { val matrixDimension = nodeUuidToIndexMap.values.toSeq.distinct.size @@ -237,20 +237,20 @@ case object GridModel { private def getLinesAdmittance( nodeUuidToIndexMap: Map[UUID, Int], - line: LineModel + line: LineModel, ): (Int, Int, Complex, Complex, Complex) = { val (i: Int, j: Int) = ( nodeUuidToIndexMap.getOrElse( line.nodeAUuid, - throwNodeNotFoundException(line.nodeAUuid) + throwNodeNotFoundException(line.nodeAUuid), ), nodeUuidToIndexMap .getOrElse( line.nodeBUuid, - throwNodeNotFoundException(line.nodeBUuid) - ) + throwNodeNotFoundException(line.nodeBUuid), + ), ) // yaa == ybb => we use yaa only @@ -261,25 +261,25 @@ case object GridModel { private def getTransformerAdmittance( nodeUuidToIndexMap: Map[UUID, Int], - trafo: TransformerModel + trafo: TransformerModel, ): (Int, Int, Complex, Complex, Complex) = { val (i: Int, j: Int) = ( nodeUuidToIndexMap.getOrElse( trafo.hvNodeUuid, - throwNodeNotFoundException(trafo.hvNodeUuid) + throwNodeNotFoundException(trafo.hvNodeUuid), ), nodeUuidToIndexMap.getOrElse( trafo.lvNodeUuid, - throwNodeNotFoundException(trafo.lvNodeUuid) - ) + throwNodeNotFoundException(trafo.lvNodeUuid), + ), ) val (yab, yaa, ybb) = ( TransformerModel.yij(trafo), TransformerModel.y0(trafo, ConnectorPort.A), - TransformerModel.y0(trafo, ConnectorPort.B) + TransformerModel.y0(trafo, ConnectorPort.B), ) (i, j, yab, yaa, ybb) @@ -287,7 +287,7 @@ case object GridModel { private def getTransformer3wAdmittance( nodeUuidToIndexMap: Map[UUID, Int], - trafo3w: Transformer3wModel + trafo3w: Transformer3wModel, ): (Int, Int, Complex, Complex, Complex) = { // start with power flow case specific parameters @@ -298,7 +298,7 @@ case object GridModel { trafo3w.hvNodeUuid, trafo3w.nodeInternalUuid, Transformer3wModel - .y0(trafo3w, Transformer3wModel.Transformer3wPort.INTERNAL) + .y0(trafo3w, Transformer3wModel.Transformer3wPort.INTERNAL), ) case PowerFlowCaseB => @@ -313,7 +313,7 @@ case object GridModel { nodeUuidToIndexMap .getOrElse(nodeAUuid, throwNodeNotFoundException(nodeAUuid)), nodeUuidToIndexMap - .getOrElse(nodeBUuid, throwNodeNotFoundException(nodeBUuid)) + .getOrElse(nodeBUuid, throwNodeNotFoundException(nodeBUuid)), ) // these parameters are the same for all cases @@ -450,7 +450,7 @@ case object GridModel { subGridContainer: SubGridContainer, refSystem: RefSystem, startDate: ZonedDateTime, - endDate: ZonedDateTime + endDate: ZonedDateTime, ): GridModel = { // build @@ -479,7 +479,7 @@ case object GridModel { transformer2wInput, refSystem, startDate, - endDate + endDate, ) } else { throw new InvalidGridException( @@ -498,7 +498,7 @@ case object GridModel { refSystem, subGridContainer.getSubnet, startDate, - endDate + endDate, ) }.toSet @@ -531,7 +531,7 @@ case object GridModel { lines, transformers, transformer3ws, - switches + switches, ) val gridModel = @@ -574,7 +574,7 @@ case object GridModel { case switchModel: SwitchModel => map ++ Map( switchModel.nodeAUuid -> componentId, - switchModel.nodeBUuid -> componentId + switchModel.nodeBUuid -> componentId, ) case nodeModel: NodeModel => diff --git a/src/main/scala/edu/ie3/simona/model/grid/LineModel.scala b/src/main/scala/edu/ie3/simona/model/grid/LineModel.scala index 8ca2b2f0a9..60a2621630 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/LineModel.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/LineModel.scala @@ -63,11 +63,11 @@ final case class LineModel( protected val r: squants.Dimensionless, protected val x: squants.Dimensionless, protected val g: squants.Dimensionless, - protected val b: squants.Dimensionless + protected val b: squants.Dimensionless, ) extends SystemComponent( uuid, id, - operationInterval + operationInterval, ) with PiEquivalentCircuit { @@ -111,7 +111,7 @@ case object LineModel extends LazyLogging { lineInput: LineInput, refSystem: RefSystem, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): LineModel = { // validate the input model first validateInputModel(lineInput) @@ -121,7 +121,7 @@ case object LineModel extends LazyLogging { lineInput, refSystem, simulationStartDate, - simulationEndDate + simulationEndDate, ) } @@ -143,7 +143,7 @@ case object LineModel extends LazyLogging { lineInput: LineInput, refSystem: RefSystem, startDate: ZonedDateTime, - endDate: ZonedDateTime + endDate: ZonedDateTime, ): LineModel = { val lineType = lineInput.getType @@ -183,14 +183,14 @@ case object LineModel extends LazyLogging { .getValue .doubleValue() ) - ) + ), ) val operationInterval = SystemComponent.determineOperationInterval( startDate, endDate, - lineInput.getOperationTime + lineInput.getOperationTime, ) val lineModel = new LineModel( @@ -206,7 +206,7 @@ case object LineModel extends LazyLogging { r, x, g, - b + b, ) // if the line input model is in operation, enable the model @@ -321,7 +321,7 @@ case object LineModel extends LazyLogging { def y0(lineModel: LineModel): Complex = { new Complex( lineModel.g0().value.doubleValue(), - lineModel.b0().value.doubleValue() + lineModel.b0().value.doubleValue(), ) } @@ -335,7 +335,7 @@ case object LineModel extends LazyLogging { */ def yij(lineModel: LineModel): Complex = new Complex( lineModel.gij().value.doubleValue(), - lineModel.bij().value.doubleValue() + lineModel.bij().value.doubleValue(), ) /** Calculates the utilisation of a given line model @@ -352,12 +352,12 @@ case object LineModel extends LazyLogging { def utilisation( lineModel: LineModel, iNodeA: squants.electro.ElectricCurrent, - iNodeB: squants.electro.ElectricCurrent + iNodeB: squants.electro.ElectricCurrent, ): squants.Dimensionless = { Each( Math.max( iNodeA.toAmperes, - iNodeB.toAmperes + iNodeB.toAmperes, ) / lineModel.iNom.toAmperes * 100 / lineModel.amount ) } diff --git a/src/main/scala/edu/ie3/simona/model/grid/NodeModel.scala b/src/main/scala/edu/ie3/simona/model/grid/NodeModel.scala index 67acac7d8b..506ea804a1 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/NodeModel.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/NodeModel.scala @@ -39,18 +39,18 @@ final case class NodeModel( operationInterval: OperationInterval, isSlack: Boolean, vTarget: squants.Dimensionless, - voltLvl: VoltageLevel + voltLvl: VoltageLevel, ) extends SystemComponent( uuid, id, - operationInterval + operationInterval, ) case object NodeModel { def apply( nodeInput: NodeInput, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): NodeModel = { // validate the input model @@ -60,7 +60,7 @@ case object NodeModel { SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - nodeInput.getOperationTime + nodeInput.getOperationTime, ) val nodeModel = new NodeModel( @@ -69,7 +69,7 @@ case object NodeModel { operationInterval, nodeInput.isSlack, Each(nodeInput.getvTarget.to(PowerSystemUnits.PU).getValue.doubleValue()), - nodeInput.getVoltLvl + nodeInput.getVoltLvl, ) /* Checks, if the participant is in operation right from the start */ diff --git a/src/main/scala/edu/ie3/simona/model/grid/PiEquivalentCircuit.scala b/src/main/scala/edu/ie3/simona/model/grid/PiEquivalentCircuit.scala index d1d85d7177..0583d37d74 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/PiEquivalentCircuit.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/PiEquivalentCircuit.scala @@ -125,7 +125,7 @@ trait PiEquivalentCircuit extends LazyLogging { r, x, g, - b + b, ) } diff --git a/src/main/scala/edu/ie3/simona/model/grid/RefSystem.scala b/src/main/scala/edu/ie3/simona/model/grid/RefSystem.scala index 53ee866930..e6826546d3 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/RefSystem.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/RefSystem.scala @@ -24,7 +24,7 @@ final case class RefSystem private ( nominalVoltage: squants.electro.ElectricPotential, nominalCurrent: squants.electro.ElectricCurrent, nominalPower: squants.Power, - nominalImpedance: squants.electro.ElectricalResistance + nominalImpedance: squants.electro.ElectricalResistance, ) { /** Calculates the referenced resistance r (real part of impedance z) of a @@ -146,11 +146,11 @@ final case class RefSystem private ( def vInSi(vInPu: Complex): ( squants.electro.ElectricPotential, - squants.electro.ElectricPotential + squants.electro.ElectricPotential, ) = ( vInSi(Each(vInPu.real)), - vInSi(Each(vInPu.imag)) + vInSi(Each(vInPu.imag)), ) /** Converts a provided voltage value from physical SI value into p.u. value @@ -170,7 +170,7 @@ case object RefSystem { def apply( nominalPower: squants.Power, - nominalVoltage: squants.electro.ElectricPotential + nominalVoltage: squants.electro.ElectricPotential, ): RefSystem = { val nominalCurrent: squants.electro.ElectricCurrent = @@ -183,7 +183,7 @@ case object RefSystem { nominalVoltage, nominalCurrent, nominalPower, - nominalImpedance + nominalImpedance, ) } @@ -227,7 +227,7 @@ case object RefSystem { def transferImpedance( impedance: squants.Dimensionless, from: RefSystem, - to: RefSystem + to: RefSystem, ): squants.Dimensionless = { val ratio = from.nominalImpedance.toOhms / to.nominalImpedance.toOhms Each(impedance.toEach * ratio) @@ -248,7 +248,7 @@ case object RefSystem { def transferAdmittance( admittance: squants.Dimensionless, from: RefSystem, - to: RefSystem + to: RefSystem, ): squants.Dimensionless = { val ratio = to.nominalImpedance.toOhms / from.nominalImpedance.toOhms diff --git a/src/main/scala/edu/ie3/simona/model/grid/SwitchModel.scala b/src/main/scala/edu/ie3/simona/model/grid/SwitchModel.scala index 49d1d73402..5a5a457a5f 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/SwitchModel.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/SwitchModel.scala @@ -35,11 +35,11 @@ final case class SwitchModel( id: String, operationInterval: OperationInterval, nodeAUuid: UUID, - nodeBUuid: UUID + nodeBUuid: UUID, ) extends SystemComponent( uuid, id, - operationInterval + operationInterval, ) { private var _isClosed = true @@ -86,7 +86,7 @@ case object SwitchModel { def apply( switchInput: SwitchInput, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): SwitchModel = { // validate the input model @@ -96,7 +96,7 @@ case object SwitchModel { SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - switchInput.getOperationTime + switchInput.getOperationTime, ) val switchModel = new SwitchModel( @@ -104,7 +104,7 @@ case object SwitchModel { switchInput.getId, operationInterval, switchInput.getNodeA.getUuid, - switchInput.getNodeB.getUuid + switchInput.getNodeB.getUuid, ) if (!switchInput.isClosed) switchModel.open() diff --git a/src/main/scala/edu/ie3/simona/model/grid/Transformer3wModel.scala b/src/main/scala/edu/ie3/simona/model/grid/Transformer3wModel.scala index 25e1ffeca4..8f61c2a897 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/Transformer3wModel.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/Transformer3wModel.scala @@ -16,13 +16,13 @@ import edu.ie3.datamodel.models.input.connector.Transformer3WInput import edu.ie3.datamodel.models.input.connector.`type`.Transformer3WTypeInput import edu.ie3.simona.exceptions.{ InvalidActionRequestException, - InvalidParameterException + InvalidParameterException, } import edu.ie3.simona.model.SystemComponent import edu.ie3.simona.model.grid.Transformer3wPowerFlowCase.{ PowerFlowCaseA, PowerFlowCaseB, - PowerFlowCaseC + PowerFlowCaseC, } import edu.ie3.simona.util.SimonaConstants import edu.ie3.util.quantities.PowerSystemUnits._ @@ -94,11 +94,11 @@ final case class Transformer3wModel( protected val r: squants.Dimensionless, protected val x: squants.Dimensionless, protected val g: squants.Dimensionless, - protected val b: squants.Dimensionless + protected val b: squants.Dimensionless, ) extends SystemComponent( uuid, id, - operationInterval + operationInterval, ) with PiEquivalentCircuit with TransformerTapping { @@ -171,7 +171,7 @@ case object Transformer3wModel extends LazyLogging { refSystem: RefSystem, subnetNo: Int, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): Transformer3wModel = { // validate the input model first validateInputModel(transformer3wInput) @@ -182,7 +182,7 @@ case object Transformer3wModel extends LazyLogging { refSystem, subnetNo, simulationStartDate, - simulationEndDate + simulationEndDate, ) } @@ -213,7 +213,7 @@ case object Transformer3wModel extends LazyLogging { gridRefSystem: RefSystem, subnetNo: Int, startDate: ZonedDateTime, - endDate: ZonedDateTime + endDate: ZonedDateTime, ): Transformer3wModel = { // build the model val trafo3wType = transformer3wInput.getType @@ -238,7 +238,7 @@ case object Transformer3wModel extends LazyLogging { trafo3wType.getTapMax, trafo3wType.getTapMin, trafo3wType.getTapNeutr, - transformer3wInput.isAutoTap + transformer3wInput.isAutoTap, ) val voltRatioNominal = powerFlowCase match { @@ -262,7 +262,7 @@ case object Transformer3wModel extends LazyLogging { SystemComponent.determineOperationInterval( startDate, endDate, - transformer3wInput.getOperationTime + transformer3wInput.getOperationTime, ) val transformer3wModel = new Transformer3wModel( @@ -280,7 +280,7 @@ case object Transformer3wModel extends LazyLogging { r, x, g, - b + b, ) // if the transformer3w input model is in operation, enable the model @@ -314,12 +314,12 @@ case object Transformer3wModel extends LazyLogging { private def rxgbInPu( transformerType: Transformer3WTypeInput, refSystem: RefSystem, - powerFlowCase: Transformer3wPowerFlowCase + powerFlowCase: Transformer3wPowerFlowCase, ): ( squants.Dimensionless, squants.Dimensionless, squants.Dimensionless, - squants.Dimensionless + squants.Dimensionless, ) = { val transformerRefSystem = RefSystem( @@ -328,7 +328,7 @@ case object Transformer3wModel extends LazyLogging { ), Kilovolts( transformerType.getvRatedA.to(KILOVOLT).getValue.doubleValue() - ) + ), ) /* Get the physical equivalent circuit diagram parameters from type. They come with reference to the highest @@ -339,7 +339,7 @@ case object Transformer3wModel extends LazyLogging { transformerType.getrScA, transformerType.getxScA, transformerType.getgM, - transformerType.getbM + transformerType.getbM, ) case PowerFlowCaseB => val nominalRatio = transformerType @@ -353,7 +353,7 @@ case object Transformer3wModel extends LazyLogging { transformerType.getrScB.divide(pow(nominalRatio, 2)), transformerType.getxScB.divide(pow(nominalRatio, 2)), Quantities.getQuantity(0d, StandardUnits.CONDUCTANCE), - Quantities.getQuantity(0d, StandardUnits.SUSCEPTANCE) + Quantities.getQuantity(0d, StandardUnits.SUSCEPTANCE), ) case PowerFlowCaseC => val nominalRatio = transformerType @@ -367,7 +367,7 @@ case object Transformer3wModel extends LazyLogging { transformerType.getrScC.divide(pow(nominalRatio, 2)), transformerType.getxScC.divide(pow(nominalRatio, 2)), Quantities.getQuantity(0d, StandardUnits.CONDUCTANCE), - Quantities.getQuantity(0d, StandardUnits.SUSCEPTANCE) + Quantities.getQuantity(0d, StandardUnits.SUSCEPTANCE), ) } @@ -380,7 +380,7 @@ case object Transformer3wModel extends LazyLogging { /* g */ refSystem.gInPu(Siemens(gTrafo.to(SIEMENS).getValue.doubleValue())), /* b */ - refSystem.bInPu(Siemens(bTrafo.to(SIEMENS).getValue.doubleValue())) + refSystem.bInPu(Siemens(bTrafo.to(SIEMENS).getValue.doubleValue())), ) } @@ -400,17 +400,17 @@ case object Transformer3wModel extends LazyLogging { val (vNodeAVal, vTypeAVal) = ( transformer3wInput.getNodeA.getVoltLvl.getNominalVoltage.getValue.doubleValue, - trafo3wType.getvRatedA.getValue.doubleValue + trafo3wType.getvRatedA.getValue.doubleValue, ) val (vNodeBVal, vTypeBVal) = ( transformer3wInput.getNodeB.getVoltLvl.getNominalVoltage.getValue.doubleValue, - trafo3wType.getvRatedB.getValue.doubleValue + trafo3wType.getvRatedB.getValue.doubleValue, ) val (vNodeCVal, vTypeCVal) = ( transformer3wInput.getNodeC.getVoltLvl.getNominalVoltage.getValue.doubleValue, - trafo3wType.getvRatedC.getValue.doubleValue + trafo3wType.getvRatedC.getValue.doubleValue, ) val nomVoltDevA = vNodeAVal - vTypeAVal @@ -435,7 +435,7 @@ case object Transformer3wModel extends LazyLogging { // check for wrong positioning by comparing node{A,B,C} voltage and transformer type v{A,B,C} val transformerWrongPositionExceptionString: ( Quantity[ElectricPotential], - Quantity[ElectricPotential] + Quantity[ElectricPotential], ) => String = { (vRatedNodeX, typeVNodeX) => s"The rated voltage of node A is $vRatedNodeX, " + s"but the winding A is only rated for $typeVNodeX. Is the transformer connected correctly?" @@ -444,21 +444,21 @@ case object Transformer3wModel extends LazyLogging { throw new InvalidGridException( transformerWrongPositionExceptionString( transformer3wInput.getNodeA.getVoltLvl.getNominalVoltage, - trafo3wType.getvRatedA + trafo3wType.getvRatedA, ) ) if (vNodeBVal < vTypeBVal) throw new InvalidGridException( transformerWrongPositionExceptionString( transformer3wInput.getNodeB.getVoltLvl.getNominalVoltage, - trafo3wType.getvRatedB + trafo3wType.getvRatedB, ) ) if (vNodeCVal < vTypeCVal) throw new InvalidGridException( transformerWrongPositionExceptionString( transformer3wInput.getNodeC.getVoltLvl.getNominalVoltage, - trafo3wType.getvRatedC + trafo3wType.getvRatedC, ) ) @@ -481,7 +481,7 @@ case object Transformer3wModel extends LazyLogging { trafo3wType.getsRatedA(), trafo3wType.getsRatedB(), trafo3wType.getsRatedC(), - trafo3wType.getsRatedB().add(trafo3wType.getsRatedC()) + trafo3wType.getsRatedB().add(trafo3wType.getsRatedC()), ) } } @@ -526,7 +526,7 @@ case object Transformer3wModel extends LazyLogging { */ def y0( transformer3wModel: Transformer3wModel, - port: Transformer3wPort.Value + port: Transformer3wPort.Value, ): Complex = { val amount = transformer3wModel.amount transformer3wModel.powerFlowCase match { @@ -537,10 +537,10 @@ case object Transformer3wModel extends LazyLogging { val bii = transformer3wModel.b0().value.doubleValue() amount * ((1 - 1 / transformer3wModel.tapRatio) * Complex( gij, - bij + bij, ) + Complex( gii, - bii + bii, )) case _ => Complex.zero } diff --git a/src/main/scala/edu/ie3/simona/model/grid/Transformer3wPowerFlowCase.scala b/src/main/scala/edu/ie3/simona/model/grid/Transformer3wPowerFlowCase.scala index 0b3e88252f..cad400df8f 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/Transformer3wPowerFlowCase.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/Transformer3wPowerFlowCase.scala @@ -34,7 +34,7 @@ object Transformer3wPowerFlowCase { def apply( trafo3wInput: Transformer3WInput, - subnetNo: Int + subnetNo: Int, ): Transformer3wPowerFlowCase = { if (trafo3wInput.getNodeA.getSubnet == subnetNo) PowerFlowCaseA diff --git a/src/main/scala/edu/ie3/simona/model/grid/TransformerModel.scala b/src/main/scala/edu/ie3/simona/model/grid/TransformerModel.scala index a34e2f3abc..7a63cbf489 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/TransformerModel.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/TransformerModel.scala @@ -11,7 +11,7 @@ import breeze.numerics.pow import edu.ie3.datamodel.exceptions.InvalidGridException import edu.ie3.datamodel.models.input.connector.{ ConnectorPort, - Transformer2WInput + Transformer2WInput, } import edu.ie3.simona.model.SystemComponent import edu.ie3.simona.util.SimonaConstants @@ -77,11 +77,11 @@ final case class TransformerModel( protected val r: squants.Dimensionless, protected val x: squants.Dimensionless, protected val g: squants.Dimensionless, - protected val b: squants.Dimensionless + protected val b: squants.Dimensionless, ) extends SystemComponent( uuid, id, - operationInterval + operationInterval, ) with PiEquivalentCircuit with TransformerTapping { @@ -95,7 +95,7 @@ case object TransformerModel { transformerInput: Transformer2WInput, refSystem: RefSystem, startDate: ZonedDateTime, - endDate: ZonedDateTime + endDate: ZonedDateTime, ): TransformerModel = { // validate the input model first @@ -125,7 +125,7 @@ case object TransformerModel { transformerInput: Transformer2WInput, gridRefSystem: RefSystem, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): TransformerModel = { // get referenced electric values @@ -167,7 +167,7 @@ case object TransformerModel { .multiply(squaredNominalVoltRatio) .getValue .doubleValue() - ) + ), ) /* Transfer the dimensionless parameters into the grid reference system */ @@ -175,7 +175,7 @@ case object TransformerModel { gridRefSystem.rInPu(rTrafo), gridRefSystem.xInPu(xTrafo), gridRefSystem.gInPu(gTrafo), - gridRefSystem.bInPu(bTrafo) + gridRefSystem.bInPu(bTrafo), ) // iNomHv, iNomLv @@ -201,7 +201,7 @@ case object TransformerModel { Kilovolts( trafoType.getvRatedB.to(KILOVOLT).getValue.doubleValue() ) - ) + ), ) // get the element port, where the transformer tap is located @@ -216,14 +216,14 @@ case object TransformerModel { trafoType.getTapMin, trafoType.getTapNeutr, transformerInput.isAutoTap, - tapSide + tapSide, ) val operationInterval = SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - transformerInput.getOperationTime + transformerInput.getOperationTime, ) val transformerModel = new TransformerModel( @@ -240,7 +240,7 @@ case object TransformerModel { r, x, g, - b + b, ) // if the transformer input model is in operation, enable the model @@ -268,7 +268,7 @@ case object TransformerModel { */ def validateInputModel( transformerInput: Transformer2WInput, - refSystem: RefSystem + refSystem: RefSystem, ): Unit = { val trafoType = transformerInput.getType @@ -371,7 +371,7 @@ case object TransformerModel { new Complex( transformerModel.gij().value.doubleValue(), - transformerModel.bij().value.doubleValue() + transformerModel.bij().value.doubleValue(), ) * amount / tapRatio } @@ -390,14 +390,14 @@ case object TransformerModel { def utilisation( transformerModel: TransformerModel, iNodeHv: Quantity[ElectricCurrent], - iNodeLv: Quantity[ElectricCurrent] + iNodeLv: Quantity[ElectricCurrent], ): squants.Dimensionless = { Each( Math.max( iNodeHv.getValue.doubleValue() / transformerModel.iNomHv.value .doubleValue(), iNodeLv.getValue.doubleValue() / transformerModel.iNomLv.value - .doubleValue() + .doubleValue(), ) * 100 ) } diff --git a/src/main/scala/edu/ie3/simona/model/grid/TransformerTapping.scala b/src/main/scala/edu/ie3/simona/model/grid/TransformerTapping.scala index 5337e0c829..809e7c5f8f 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/TransformerTapping.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/TransformerTapping.scala @@ -72,7 +72,7 @@ trait TransformerTapping { */ def computeDeltaTap( vChangeRequest: Quantity[Dimensionless], - deadBand: Quantity[Dimensionless] = Quantities.getQuantity(0.75, PU) + deadBand: Quantity[Dimensionless] = Quantities.getQuantity(0.75, PU), ): Int = transformerTappingModel.computeDeltaTap(vChangeRequest, deadBand) diff --git a/src/main/scala/edu/ie3/simona/model/grid/TransformerTappingModel.scala b/src/main/scala/edu/ie3/simona/model/grid/TransformerTappingModel.scala index a04b3548e2..602259cec2 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/TransformerTappingModel.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/TransformerTappingModel.scala @@ -43,7 +43,7 @@ final case class TransformerTappingModel( tapMin: Int, tapNeutr: Int, autoTap: Boolean, - tapSide: ConnectorPort = ConnectorPort.A + tapSide: ConnectorPort = ConnectorPort.A, ) extends LazyLogging { private val deltaVval = deltaV.to(PU).getValue.doubleValue() @@ -130,7 +130,7 @@ final case class TransformerTappingModel( */ def computeDeltaTap( vChangeRequest: Quantity[Dimensionless], - deadBandPerTap: Quantity[Dimensionless] = Quantities.getQuantity(0.75, PU) + deadBandPerTap: Quantity[Dimensionless] = Quantities.getQuantity(0.75, PU), ): Int = { /* Determine the tap change, that has to be done in any case, as well as the remainder to fully * fulfill the voltage change request */ @@ -169,7 +169,7 @@ case object TransformerTappingModel { tapMin: Int, tapNeutr: Int, autoTap: Boolean, - elementPort: ConnectorPort = ConnectorPort.A + elementPort: ConnectorPort = ConnectorPort.A, ): TransformerTappingModel = { val tapModel = new TransformerTappingModel( @@ -179,7 +179,7 @@ case object TransformerTappingModel { tapMin, tapNeutr, autoTap, - elementPort + elementPort, ) // update internal state variables diff --git a/src/main/scala/edu/ie3/simona/model/participant/ApparentPowerAndHeatParticipant.scala b/src/main/scala/edu/ie3/simona/model/participant/ApparentPowerAndHeatParticipant.scala index 253518577e..205704bf41 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/ApparentPowerAndHeatParticipant.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/ApparentPowerAndHeatParticipant.scala @@ -12,14 +12,14 @@ import squants.{Dimensionless, Power} trait ApparentPowerAndHeatParticipant[ CD <: CalcRelevantData, - MS <: ModelState + MS <: ModelState, ] { this: SystemParticipant[CD, ApparentPowerAndHeat, MS] => override def calculatePower( tick: Long, voltage: Dimensionless, modelState: MS, - data: CD + data: CD, ): ApparentPowerAndHeat = { val apparentPower = calculateApparentPower(tick, voltage, modelState, data) @@ -46,6 +46,6 @@ trait ApparentPowerAndHeatParticipant[ def calculateHeat( tick: Long, modelState: MS, - data: CD + data: CD, ): Power } diff --git a/src/main/scala/edu/ie3/simona/model/participant/ApparentPowerParticipant.scala b/src/main/scala/edu/ie3/simona/model/participant/ApparentPowerParticipant.scala index 1819e2d2a0..d1d71a58ac 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/ApparentPowerParticipant.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/ApparentPowerParticipant.scala @@ -15,7 +15,7 @@ trait ApparentPowerParticipant[CD <: CalcRelevantData, MS <: ModelState] { tick: Long, voltage: Dimensionless, modelState: MS, - data: CD + data: CD, ): ApparentPower = calculateApparentPower(tick, voltage, modelState, data) } diff --git a/src/main/scala/edu/ie3/simona/model/participant/BMModel.scala b/src/main/scala/edu/ie3/simona/model/participant/BMModel.scala index c3a5e3a9ad..40b149bf95 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/BMModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/BMModel.scala @@ -35,11 +35,11 @@ final case class BMModel( private val isCostControlled: Boolean, private val opex: Money, private val feedInTariff: EnergyPrice, - private val loadGradient: Double + private val loadGradient: Double, ) extends SystemParticipant[ BMCalcRelevantData, ApparentPower, - ConstantState.type + ConstantState.type, ]( uuid, id, @@ -47,7 +47,7 @@ final case class BMModel( scalingFactor, qControl, sRated, - cosPhi + cosPhi, ) with ApparentPowerParticipant[BMCalcRelevantData, ConstantState.type] { @@ -59,7 +59,7 @@ final case class BMModel( tick: Long, voltage: Dimensionless, modelState: ConstantState.type, - data: BMCalcRelevantData + data: BMCalcRelevantData, ): ApparentPower = { val result = super.calculatePower(tick, voltage, modelState, data) _lastPower = Some(result.p) @@ -76,7 +76,7 @@ final case class BMModel( */ override protected def calculateActivePower( modelState: ConstantState.type, - data: BMCalcRelevantData + data: BMCalcRelevantData, ): Power = { // Calculate heat demand // val (k1, k2) = (calculateK1(data.date), calculateK2(data.date)) @@ -142,7 +142,7 @@ final case class BMModel( private def calculatePTh( temp: Temperature, k1: Double, - k2: Double + k2: Double, ): Power = { // linear regression: Heat-demand in relation to temperature (above 19.28°C: independent of temperature) val pTh = temp.toCelsiusScale match { @@ -187,7 +187,7 @@ final case class BMModel( */ private def calculateElOutput( usage: Double, - eff: Double + eff: Double, ): Power = { val currOpex = opex.divide(eff) val avgOpex = (currOpex + opex).divide(2) @@ -228,7 +228,7 @@ final case class BMModel( override def determineFlexOptions( data: BMCalcRelevantData, - lastState: ConstantState.type + lastState: ConstantState.type, ): ProvideFlexOptions = { val power = calculateActivePower(lastState, data) @@ -238,7 +238,7 @@ final case class BMModel( override def handleControlledPowerChange( data: BMCalcRelevantData, lastState: ConstantState.type, - setPower: squants.Power + setPower: squants.Power, ): (ConstantState.type, FlexChangeIndicator) = (lastState, FlexChangeIndicator()) } @@ -254,6 +254,6 @@ object BMModel { */ final case class BMCalcRelevantData( date: ZonedDateTime, - temperature: Temperature + temperature: Temperature, ) extends CalcRelevantData } diff --git a/src/main/scala/edu/ie3/simona/model/participant/ChpModel.scala b/src/main/scala/edu/ie3/simona/model/participant/ChpModel.scala index 89349c4c91..302fa02229 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/ChpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/ChpModel.scala @@ -56,7 +56,7 @@ final case class ChpModel( sRated: Power, cosPhiRated: Double, pThermal: Power, - storage: ThermalStorage with MutableStorage + storage: ThermalStorage with MutableStorage, ) extends SystemParticipant[ChpRelevantData, ApparentPower, ConstantState.type]( uuid, id, @@ -64,7 +64,7 @@ final case class ChpModel( scalingFactor, qControl, sRated, - cosPhiRated + cosPhiRated, ) with ApparentPowerParticipant[ChpRelevantData, ConstantState.type] { @@ -83,7 +83,7 @@ final case class ChpModel( */ override protected def calculateActivePower( modelState: ConstantState.type, - chpData: ChpRelevantData + chpData: ChpRelevantData, ): Power = chpData.chpState.activePower @@ -149,7 +149,7 @@ final case class ChpModel( isRunning = false, chpData.currentTimeTick, DefaultQuantities.zeroKW, - DefaultQuantities.zeroKWH + DefaultQuantities.zeroKWH, ) /** The demand cannot be covered, therefore this function sets storage level @@ -186,7 +186,7 @@ final case class ChpModel( isRunning = false, chpData.currentTimeTick, DefaultQuantities.zeroKW, - DefaultQuantities.zeroKWH + DefaultQuantities.zeroKWH, ) } @@ -226,7 +226,7 @@ final case class ChpModel( */ private def calculateStateRunningSurplus( chpData: ChpRelevantData, - surplus: Option[Energy] = None + surplus: Option[Energy] = None, ): ChpState = { surplus match { case Some(surplusEnergy) => @@ -234,14 +234,14 @@ final case class ChpModel( isRunning = false, chpData.currentTimeTick, pRated, - chpEnergy(chpData) - surplusEnergy + chpEnergy(chpData) - surplusEnergy, ) case None => ChpState( isRunning = true, chpData.currentTimeTick, pRated, - chpEnergy(chpData) + chpEnergy(chpData), ) } } @@ -255,7 +255,7 @@ final case class ChpModel( */ private def powerToEnergy( chpData: ChpRelevantData, - power: Power + power: Power, ): Energy = power * timeRunning(chpData) @@ -294,17 +294,17 @@ final case class ChpModel( override def determineFlexOptions( data: ChpRelevantData, - lastState: ConstantState.type + lastState: ConstantState.type, ): ProvideFlexOptions = ProvideMinMaxFlexOptions.noFlexOption( uuid, - calculateActivePower(lastState, data) + calculateActivePower(lastState, data), ) override def handleControlledPowerChange( data: ChpRelevantData, lastState: ConstantState.type, - setPower: squants.Power + setPower: squants.Power, ): (ConstantState.type, FlexChangeIndicator) = (lastState, FlexChangeIndicator()) @@ -331,7 +331,7 @@ object ChpModel { isRunning: Boolean, lastTimeTick: Long, activePower: Power, - thermalEnergy: Energy + thermalEnergy: Energy, ) /** Main data required for simulation/calculation, containing a [[ChpState]], @@ -350,7 +350,7 @@ object ChpModel { final case class ChpRelevantData( chpState: ChpState, heatDemand: Energy, - currentTimeTick: Long + currentTimeTick: Long, ) extends CalcRelevantData /** Function to construct a new [[ChpModel]] based on a provided [[ChpInput]] @@ -376,12 +376,12 @@ object ChpModel { simulationEndDate: ZonedDateTime, qControl: QControl, scalingFactor: Double, - thermalStorage: ThermalStorage with MutableStorage + thermalStorage: ThermalStorage with MutableStorage, ): ChpModel = { val operationInterval = SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - chpInput.getOperationTime + chpInput.getOperationTime, ) val model = new ChpModel( @@ -403,7 +403,7 @@ object ChpModel { .getValue .doubleValue ), - thermalStorage + thermalStorage, ) model.enable() diff --git a/src/main/scala/edu/ie3/simona/model/participant/FixedFeedInModel.scala b/src/main/scala/edu/ie3/simona/model/participant/FixedFeedInModel.scala index 4229ee5496..a348923bb5 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/FixedFeedInModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/FixedFeedInModel.scala @@ -48,11 +48,11 @@ final case class FixedFeedInModel( override val scalingFactor: Double, qControl: QControl, sRated: Power, - cosPhiRated: Double + cosPhiRated: Double, ) extends SystemParticipant[ FixedRelevantData.type, ApparentPower, - ConstantState.type + ConstantState.type, ]( uuid, id, @@ -60,7 +60,7 @@ final case class FixedFeedInModel( scalingFactor, qControl, sRated, - cosPhiRated + cosPhiRated, ) with ApparentPowerParticipant[FixedRelevantData.type, ConstantState.type] { @@ -74,23 +74,23 @@ final case class FixedFeedInModel( */ override protected def calculateActivePower( modelState: ConstantState.type, - data: FixedRelevantData.type = FixedRelevantData + data: FixedRelevantData.type = FixedRelevantData, ): Power = sRated * (-1) * cosPhiRated override def determineFlexOptions( data: FixedRelevantData.type, - lastState: ConstantState.type + lastState: ConstantState.type, ): ProvideFlexOptions = ProvideMinMaxFlexOptions.noFlexOption( uuid, - calculateActivePower(lastState, data) + calculateActivePower(lastState, data), ) override def handleControlledPowerChange( data: FixedRelevantData.type, lastState: ConstantState.type, - setPower: Power + setPower: Power, ): (ConstantState.type, FlexChangeIndicator) = (lastState, FlexChangeIndicator()) } @@ -100,14 +100,14 @@ object FixedFeedInModel extends LazyLogging { inputModel: FixedFeedInInput, modelConfiguration: SimonaConfig.FixedFeedInRuntimeConfig, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): FixedFeedInModel = { /* Determine the operation interval */ val operationInterval: OperationInterval = SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - inputModel.getOperationTime + inputModel.getOperationTime, ) // build the fixed feed in model @@ -123,7 +123,7 @@ object FixedFeedInModel extends LazyLogging { .getValue .doubleValue ), - inputModel.getCosPhiRated + inputModel.getCosPhiRated, ) model.enable() model diff --git a/src/main/scala/edu/ie3/simona/model/participant/FlexChangeIndicator.scala b/src/main/scala/edu/ie3/simona/model/participant/FlexChangeIndicator.scala index 5a4b7d0839..dda77c2f06 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/FlexChangeIndicator.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/FlexChangeIndicator.scala @@ -8,5 +8,5 @@ package edu.ie3.simona.model.participant final case class FlexChangeIndicator( changesAtNextActivation: Boolean = false, - changesAtTick: Option[Long] = None + changesAtTick: Option[Long] = None, ) diff --git a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala index bd4eedb911..ec2ad37b5e 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -58,11 +58,11 @@ final case class HpModel( sRated: Power, cosPhiRated: Double, pThermal: Power, - thermalGrid: ThermalGrid + thermalGrid: ThermalGrid, ) extends SystemParticipant[ HpRelevantData, ApparentPowerAndHeat, - HpState + HpState, ]( uuid, id, @@ -70,7 +70,7 @@ final case class HpModel( scalingFactor, qControl, sRated, - cosPhiRated + cosPhiRated, ) with ApparentPowerAndHeatParticipant[HpRelevantData, HpState] { @@ -92,7 +92,7 @@ final case class HpModel( */ override protected def calculateActivePower( modelState: HpState, - relevantData: HpRelevantData + relevantData: HpRelevantData, ): Power = modelState.activePower /** "Calculate" the heat output of the heat pump. The hp's state is already @@ -112,7 +112,7 @@ final case class HpModel( override def calculateHeat( tick: Long, modelState: HpState, - data: HpRelevantData + data: HpRelevantData, ): Power = modelState.qDot /** Given a [[HpRelevantData]] object and the current [[HpState]], this @@ -128,7 +128,7 @@ final case class HpModel( */ def determineState( state: HpState, - relevantData: HpRelevantData + relevantData: HpRelevantData, ): HpState = { val turnOn = operatesInNextState(state, relevantData) calcState(state, relevantData, turnOn) @@ -149,12 +149,12 @@ final case class HpModel( */ private def operatesInNextState( state: HpState, - relevantData: HpRelevantData + relevantData: HpRelevantData, ): Boolean = { val demand = thermalGrid.energyDemand( relevantData.currentTick, relevantData.ambientTemperature, - state.thermalGridState + state.thermalGridState, ) demand.hasRequiredDemand || (state.isRunning && demand.hasAdditionalDemand) } @@ -175,7 +175,7 @@ final case class HpModel( private def calcState( state: HpState, relevantData: HpRelevantData, - isRunning: Boolean + isRunning: Boolean, ): HpState = { val (newActivePower, newThermalPower) = if (isRunning) @@ -188,7 +188,7 @@ final case class HpModel( relevantData.currentTick, state.thermalGridState, state.ambientTemperature.getOrElse(relevantData.ambientTemperature), - newThermalPower + newThermalPower, ) HpState( @@ -198,13 +198,13 @@ final case class HpModel( newActivePower, newThermalPower, thermalGridState, - maybeThreshold + maybeThreshold, ) } override def determineFlexOptions( data: HpRelevantData, - lastState: HpState + lastState: HpState, ): ProvideFlexOptions = { /* Determine the operating state in the given tick */ val updatedState = determineState(lastState, data) @@ -213,7 +213,7 @@ final case class HpModel( val thermalEnergyDemand = thermalGrid.energyDemand( data.currentTick, data.ambientTemperature, - lastState.thermalGridState + lastState.thermalGridState, ) val canOperate = thermalEnergyDemand.hasRequiredDemand || thermalEnergyDemand.hasAdditionalDemand @@ -234,7 +234,7 @@ final case class HpModel( uuid, updatedState.activePower, lowerBoundary, - upperBoundary + upperBoundary, ) } @@ -258,7 +258,7 @@ final case class HpModel( override def handleControlledPowerChange( data: HpRelevantData, lastState: HpState, - setPower: Power + setPower: Power, ): (HpState, FlexChangeIndicator) = { /* If the setpoint value is above 50 % of the electrical power, turn on the heat pump otherwise turn it off */ val turnOn = setPower > (sRated * cosPhiRated * 0.5) @@ -268,8 +268,8 @@ final case class HpModel( updatedState, FlexChangeIndicator( changesAtNextActivation = true, - updatedState.maybeThermalThreshold.map(_.tick) - ) + updatedState.maybeThermalThreshold.map(_.tick), + ), ) } } @@ -283,14 +283,14 @@ object HpModel { scaling: Double, simulationStartDate: ZonedDateTime, simulationEndDate: ZonedDateTime, - thermalGrid: ThermalGrid + thermalGrid: ThermalGrid, ): HpModel = { /* Determine the operation interval */ val operationInterval: OperationInterval = SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - inputModel.getOperationTime + inputModel.getOperationTime, ) val qControl = QControl(inputModel.getqCharacteristics()) @@ -314,7 +314,7 @@ object HpModel { .getValue .doubleValue ), - thermalGrid + thermalGrid, ) model.enable() @@ -348,7 +348,7 @@ object HpModel { activePower: Power, qDot: Power, thermalGridState: ThermalGridState, - maybeThermalThreshold: Option[ThermalThreshold] + maybeThermalThreshold: Option[ThermalThreshold], ) extends ModelState /** Main data required for simulation/calculation, containing a [[HpState]] @@ -362,7 +362,7 @@ object HpModel { */ final case class HpRelevantData( currentTick: Long, - ambientTemperature: Temperature + ambientTemperature: Temperature, ) extends CalcRelevantData /** Internal method to construct a new [[HpModel]] based on a provided @@ -389,12 +389,12 @@ object HpModel { simulationEndDate: ZonedDateTime, qControl: QControl, scalingFactor: Double, - thermalGrid: ThermalGrid + thermalGrid: ThermalGrid, ): HpModel = { val operationInterval = SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - hpInput.getOperationTime + hpInput.getOperationTime, ) val model = new HpModel( @@ -416,7 +416,7 @@ object HpModel { .getValue .doubleValue ), - thermalGrid + thermalGrid, ) model.enable() diff --git a/src/main/scala/edu/ie3/simona/model/participant/PvModel.scala b/src/main/scala/edu/ie3/simona/model/participant/PvModel.scala index 30fd1df579..3aca7332d9 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/PvModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/PvModel.scala @@ -42,7 +42,7 @@ final case class PvModel private ( private val etaConv: Dimensionless, private val alphaE: Angle, private val gammaE: Angle, - private val moduleSurface: Area = SquareMeters(1d) + private val moduleSurface: Area = SquareMeters(1d), ) extends SystemParticipant[PvRelevantData, ApparentPower, ConstantState.type]( uuid, id, @@ -50,7 +50,7 @@ final case class PvModel private ( scalingFactor, qControl, sRated, - cosPhiRated + cosPhiRated, ) with ApparentPowerParticipant[PvRelevantData, ConstantState.type] { @@ -76,7 +76,7 @@ final case class PvModel private ( */ override protected def calculateActivePower( modelState: ConstantState.type, - data: PvRelevantData + data: PvRelevantData, ): Power = { // === Weather Base Data === // /* The pv model calculates the power in-feed based on the solar irradiance that is received over a specific @@ -114,7 +114,7 @@ final case class PvModel private ( delta, lat, gammaE, - alphaE + alphaE, ) // === Diffuse Radiation Parameters ===// @@ -130,7 +130,7 @@ final case class PvModel private ( extraterrestrialRadiationI0, thetaZ, thetaG, - gammaE + gammaE, ) // === Reflected Radiation ===// @@ -144,7 +144,7 @@ final case class PvModel private ( calcOutput( eTotal, data.dateTime, - irraditionSTC + irraditionSTC, ) } @@ -203,7 +203,7 @@ final case class PvModel private ( private def calcHourAngleOmega( time: ZonedDateTime, angleJ: Angle, - longitude: Angle + longitude: Angle, ): Angle = { val jInRad = angleJ.toRadians val lambda = longitude.toDegrees @@ -232,7 +232,7 @@ final case class PvModel private ( */ private def calcSunsetAngleOmegaSS( latitude: Angle, - delta: Angle + delta: Angle, ): Angle = { val latInRad = latitude.toRadians val deltaInRad = delta.toRadians @@ -261,7 +261,7 @@ final case class PvModel private ( private def calcSolarAltitudeAngleAlphaS( omega: Angle, delta: Angle, - latitude: Angle + latitude: Angle, ): Angle = { val latInRad = latitude.toRadians val deltaInRad = delta.toRadians @@ -271,9 +271,9 @@ final case class PvModel private ( max( cos(omegaInRad) * cos(latInRad) * cos(deltaInRad) + sin(latInRad) * sin(deltaInRad), - -1 + -1, ), - 1 + 1, ) Radians(asin(sinAlphaS)) } @@ -368,7 +368,7 @@ final case class PvModel private ( latitude: Angle, gammaE: Angle, alphaE: Angle, - omega: Angle + omega: Angle, ): Angle = { val deltaInRad = delta.toRadians val omegaInRad = omega.toRadians @@ -407,7 +407,7 @@ final case class PvModel private ( thetaG: Angle, omega: Angle, omegaSS: Angle, - omegaSR: Angle + omegaSR: Angle, ): Option[(Angle, Angle)] = { val thetaGInRad = thetaG.toRadians val omegaSSInRad = omegaSS.toRadians @@ -470,7 +470,7 @@ final case class PvModel private ( delta: Angle, latitude: Angle, gammaE: Angle, - alphaE: Angle + alphaE: Angle, ): Irradiation = { omegas match { @@ -540,7 +540,7 @@ final case class PvModel private ( extraterrestrialRadiationI0: Irradiation, thetaZ: Angle, thetaG: Angle, - gammaE: Angle + gammaE: Angle, ): Irradiation = { val thetaZInRad = thetaZ.toRadians val thetaGInRad = thetaG.toRadians @@ -558,10 +558,10 @@ final case class PvModel private ( var epsilon = ((eDifH + eBeamH) / eDifH + (5.535d * 1.0e-6) * pow( thetaZInRad, - 3 + 3, )) / (1d + (5.535d * 1.0e-6) * pow( thetaZInRad, - 3 + 3, )) // get the corresponding bin if epsilon is smaller than 6.2 @@ -573,7 +573,7 @@ final case class PvModel private ( Array(1.500, 1.950), Array(1.950, 2.800), Array(2.800, 4.500), - Array(4.500, 6.200) + Array(4.500, 6.200), ) // adapt the epsilon as we have no bin < 1 epsilon = max(1, epsilon) @@ -599,7 +599,7 @@ final case class PvModel private ( val f11 = -0.0161 * pow(x, 3) + 0.1840 * pow(x, 2) - 0.3806 * x + 0.2324 val f12 = 0.0134 * pow(x, 4) - 0.1938 * pow(x, 3) + 0.8410 * pow( x, - 2 + 2, ) - 1.4018 * x + 1.3579 val f13 = 0.0032 * pow(x, 3) - 0.0280 * pow(x, 2) - 0.0056 * x - 0.0385 val f21 = -0.0048 * pow(x, 3) + 0.0536 * pow(x, 2) - 0.1049 * x + 0.0034 @@ -640,7 +640,7 @@ final case class PvModel private ( eBeamH: Irradiation, eDifH: Irradiation, gammaE: Angle, - albedo: Double + albedo: Double, ): Irradiation = { val gammaEInRad = gammaE.toRadians (eBeamH + eDifH) * (albedo * 0.5 * (1 - cos(gammaEInRad))) @@ -648,7 +648,7 @@ final case class PvModel private ( private def generatorCorrectionFactor( time: ZonedDateTime, - gammaE: Angle + gammaE: Angle, ): Double = { val gammaEValInDeg = gammaE.toDegrees @@ -682,7 +682,7 @@ final case class PvModel private ( private def calcOutput( eTotalInWhPerSM: Irradiation, time: ZonedDateTime, - irradiationSTC: Irradiation + irradiationSTC: Irradiation, ): Power = { val genCorr = generatorCorrectionFactor(time, gammaE) val tempCorr = temperatureCorrectionFactor(time) @@ -703,7 +703,7 @@ final case class PvModel private ( "The fed in active power is higher than the estimated maximum active power of this plant ({} < {}). " + "Did you provide wrong weather input data?", proposal, - pMax + pMax, ) /* If the output is marginally small, suppress the output, as we are likely to be in night and then only produce incorrect output */ @@ -714,7 +714,7 @@ final case class PvModel private ( override def determineFlexOptions( data: PvRelevantData, - lastState: ConstantState.type + lastState: ConstantState.type, ): ProvideFlexOptions = { val power = calculateActivePower(ConstantState, data) @@ -724,7 +724,7 @@ final case class PvModel private ( override def handleControlledPowerChange( data: PvRelevantData, lastState: ConstantState.type, - setPower: squants.Power + setPower: squants.Power, ): (ConstantState.type, FlexChangeIndicator) = (lastState, FlexChangeIndicator()) } @@ -747,21 +747,21 @@ object PvModel { dateTime: ZonedDateTime, weatherDataFrameLength: Long, diffIrradiance: Irradiance, - dirIrradiance: Irradiance + dirIrradiance: Irradiance, ) extends CalcRelevantData def apply( inputModel: PvInput, scalingFactor: Double, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): PvModel = { /* Determine the operation interval */ val operationInterval: OperationInterval = SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - inputModel.getOperationTime + inputModel.getOperationTime, ) // moduleSurface and yieldSTC are left out for now @@ -798,7 +798,7 @@ object PvModel { .to(RADIAN) .getValue .doubleValue - ) + ), ) model.enable() diff --git a/src/main/scala/edu/ie3/simona/model/participant/SystemParticipant.scala b/src/main/scala/edu/ie3/simona/model/participant/SystemParticipant.scala index 84f1ed4296..92d47f8ae0 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/SystemParticipant.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/SystemParticipant.scala @@ -8,7 +8,7 @@ package edu.ie3.simona.model.participant import edu.ie3.simona.agent.participant.data.Data.PrimaryData.{ ApparentPower, - PrimaryDataWithApparentPower + PrimaryDataWithApparentPower, } import edu.ie3.simona.model.SystemComponent import edu.ie3.simona.model.participant.control.QControl @@ -17,7 +17,7 @@ import edu.ie3.util.scala.OperationInterval import edu.ie3.util.scala.quantities.{ DefaultQuantities, Megavars, - ReactivePower + ReactivePower, } import squants.Dimensionless import squants.energy.{Kilowatts, Power} @@ -50,7 +50,7 @@ import java.util.UUID abstract class SystemParticipant[ CD <: CalcRelevantData, +PD <: PrimaryDataWithApparentPower[PD], - MS <: ModelState + MS <: ModelState, ]( uuid: UUID, id: String, @@ -58,7 +58,7 @@ abstract class SystemParticipant[ val scalingFactor: Double, qControl: QControl, sRated: Power, - cosPhiRated: Double + cosPhiRated: Double, ) extends SystemComponent(uuid, id, operationInterval) { /** Maximum allowed apparent power output of this system participant. Used to @@ -85,7 +85,7 @@ abstract class SystemParticipant[ tick: Long, voltage: Dimensionless, modelState: MS, - data: CD + data: CD, ): PD /** Calculate the apparent power behaviour based on the given data. @@ -103,7 +103,7 @@ abstract class SystemParticipant[ tick: Long, voltage: Dimensionless, modelState: MS, - data: CD + data: CD, ): ApparentPower = { if (isInOperation(tick)) { val activePower = calculateActivePower(modelState, data) @@ -111,12 +111,12 @@ abstract class SystemParticipant[ calculateReactivePower(activePower, voltage) ApparentPower( activePower * scalingFactor, - reactivePower * scalingFactor + reactivePower * scalingFactor, ) } else { ApparentPower( DefaultQuantities.zeroMW, - DefaultQuantities.zeroMVAr + DefaultQuantities.zeroMVAr, ) } } @@ -132,7 +132,7 @@ abstract class SystemParticipant[ */ protected def calculateActivePower( modelState: MS, - data: CD + data: CD, ): Power /** @param data @@ -142,7 +142,7 @@ abstract class SystemParticipant[ */ def determineFlexOptions( data: CD, - lastState: MS + lastState: MS, ): ProvideFlexOptions /** @param data @@ -156,7 +156,7 @@ abstract class SystemParticipant[ def handleControlledPowerChange( data: CD, lastState: MS, - setPower: Power + setPower: Power, ): (MS, FlexChangeIndicator) /** Get a partial function, that transfers the current active into reactive @@ -173,7 +173,7 @@ abstract class SystemParticipant[ qControl.activeToReactivePowerFunc( sRated, cosPhiRated, - nodalVoltage + nodalVoltage, ) /** Calculate the reactive power of the model @@ -187,11 +187,11 @@ abstract class SystemParticipant[ */ def calculateReactivePower( activePower: Power, - voltage: Dimensionless + voltage: Dimensionless, ): ReactivePower = { limitReactivePower( activePower, - activeToReactivePowerFunc(voltage)(activePower) + activeToReactivePowerFunc(voltage)(activePower), ) } @@ -207,7 +207,7 @@ abstract class SystemParticipant[ */ private def limitReactivePower( activePower: Power, - reactivePower: ReactivePower + reactivePower: ReactivePower, ): ReactivePower = { { val apparentPower: Power = Kilowatts( diff --git a/src/main/scala/edu/ie3/simona/model/participant/WecModel.scala b/src/main/scala/edu/ie3/simona/model/participant/WecModel.scala index 795507a621..2154f03d03 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/WecModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/WecModel.scala @@ -13,7 +13,7 @@ import edu.ie3.simona.model.SystemComponent import edu.ie3.simona.model.participant.ModelState.ConstantState import edu.ie3.simona.model.participant.WecModel.{ WecCharacteristic, - WecRelevantData + WecRelevantData, } import edu.ie3.simona.model.participant.control.QControl import edu.ie3.simona.model.system.Characteristic @@ -65,7 +65,7 @@ final case class WecModel( sRated: Power, cosPhiRated: Double, rotorArea: Area, - betzCurve: WecCharacteristic + betzCurve: WecCharacteristic, ) extends SystemParticipant[WecRelevantData, ApparentPower, ConstantState.type]( uuid, id, @@ -73,7 +73,7 @@ final case class WecModel( scalingFactor, qControl, sRated, - cosPhiRated + cosPhiRated, ) with ApparentPowerParticipant[WecRelevantData, ConstantState.type] { @@ -95,7 +95,7 @@ final case class WecModel( */ override protected def calculateActivePower( modelState: ConstantState.type, - wecData: WecRelevantData + wecData: WecRelevantData, ): Power = { val activePower = determinePower(wecData) val pMax = sMax * cosPhiRated @@ -105,7 +105,7 @@ final case class WecModel( "The fed in active power is higher than the estimated maximum active power of this plant ({} > {}). " + "Did you provide wrong weather input data?", activePower, - pMax + pMax, ) pMax } else { @@ -134,7 +134,7 @@ final case class WecModel( val airDensity = calculateAirDensity( wecData.temperature, - wecData.airPressure + wecData.airPressure, ).toKilogramsPerCubicMeter val v = wecData.windVelocity.toMetersPerSecond @@ -179,7 +179,7 @@ final case class WecModel( */ private def calculateAirDensity( temperature: Temperature, - airPressure: Option[Pressure] + airPressure: Option[Pressure], ): Density = { airPressure match { case None => @@ -195,7 +195,7 @@ final case class WecModel( override def determineFlexOptions( data: WecRelevantData, - lastState: ConstantState.type + lastState: ConstantState.type, ): ProvideFlexOptions = { val power = calculateActivePower(ConstantState, data) @@ -205,7 +205,7 @@ final case class WecModel( override def handleControlledPowerChange( data: WecRelevantData, lastState: ConstantState.type, - setPower: Power + setPower: Power, ): (ConstantState.type, FlexChangeIndicator) = (lastState, FlexChangeIndicator()) } @@ -236,7 +236,7 @@ object WecModel { input.getPoints.asScala.map(p => XYPair[Velocity, Dimensionless]( MetersPerSecond(p.getX.to(METRE_PER_SECOND).getValue.doubleValue), - Each(p.getY.to(PU).getValue.doubleValue) + Each(p.getY.to(PU).getValue.doubleValue), ) ) ) @@ -255,19 +255,19 @@ object WecModel { final case class WecRelevantData( windVelocity: Velocity, temperature: Temperature, - airPressure: Option[Pressure] + airPressure: Option[Pressure], ) extends CalcRelevantData def apply( inputModel: WecInput, scalingFactor: Double, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): WecModel = { val operationInterval = SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - inputModel.getOperationTime + inputModel.getOperationTime, ) val model = new WecModel( @@ -281,7 +281,7 @@ object WecModel { SquareMeters( inputModel.getType.getRotorArea.to(SQUARE_METRE).getValue.doubleValue ), - WecCharacteristic(inputModel.getType.getCpCharacteristic) + WecCharacteristic(inputModel.getType.getCpCharacteristic), ) model.enable() diff --git a/src/main/scala/edu/ie3/simona/model/participant/control/QControl.scala b/src/main/scala/edu/ie3/simona/model/participant/control/QControl.scala index 02c42be94f..37355d55b4 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/control/QControl.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/control/QControl.scala @@ -45,7 +45,7 @@ sealed trait QControl { def activeToReactivePowerFunc( sRated: Power, cosPhiRated: Double, - nodalVoltage: Dimensionless + nodalVoltage: Dimensionless, ): Power => ReactivePower } @@ -73,7 +73,7 @@ object QControl { cosPhiP.getPoints.asScala.map(point => XYPair[Dimensionless, Dimensionless]( Each(point.getX.getValue.doubleValue()), - Each(point.getY.getValue.doubleValue()) + Each(point.getY.getValue.doubleValue()), ) ) ) @@ -85,7 +85,7 @@ object QControl { .map(point => XYPair[Dimensionless, Dimensionless]( Each(point.getX.getValue.doubleValue()), - Each(point.getY.getValue.doubleValue()) + Each(point.getY.getValue.doubleValue()), ) ) .toSeq @@ -118,7 +118,7 @@ object QControl { override def activeToReactivePowerFunc( sRated: Power, cosPhiRated: Double, - nodalVoltage: Dimensionless + nodalVoltage: Dimensionless, ): Power => ReactivePower = { activePower: Power => _cosPhiMultiplication(cosPhi, activePower) } @@ -151,7 +151,7 @@ object QControl { */ def q( vInPu: Dimensionless, - qMax: ReactivePower + qMax: ReactivePower, ): ReactivePower = { qMax * interpolateXy(vInPu)._2.toEach } @@ -170,7 +170,7 @@ object QControl { override def activeToReactivePowerFunc( sRated: Power, cosPhiRated: Double, - nodalVoltage: Dimensionless + nodalVoltage: Dimensionless, ): Power => ReactivePower = { activePower: Power => val qMaxFromP = Megavars( sqrt( @@ -197,7 +197,7 @@ object QControl { */ private def qMaxPossible( qMaxFromP: ReactivePower, - qFromCharacteristic: ReactivePower + qFromCharacteristic: ReactivePower, ): ReactivePower = if (qFromCharacteristic.abs >= qMaxFromP.abs) qMaxFromP * copySign(1, qFromCharacteristic.toMegavars) @@ -245,7 +245,7 @@ object QControl { override def activeToReactivePowerFunc( sRated: Power, cosPhiRated: Double, - nodalVoltage: Dimensionless + nodalVoltage: Dimensionless, ): Power => ReactivePower = { activePower: Power => /* cosphi( P / P_N ) = cosphi( P / (S_N * cosphi_rated) ) */ val pInPu = diff --git a/src/main/scala/edu/ie3/simona/model/participant/evcs/EvModelWrapper.scala b/src/main/scala/edu/ie3/simona/model/participant/evcs/EvModelWrapper.scala index 80cdcf8a9a..f928af2fcf 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/evcs/EvModelWrapper.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/evcs/EvModelWrapper.scala @@ -27,7 +27,7 @@ import java.util.UUID */ final case class EvModelWrapper( storedEnergy: squants.Energy, - private val original: EvModel + private val original: EvModel, ) { def uuid: UUID = original.getUuid @@ -61,7 +61,7 @@ object EvModelWrapper { KilowattHours( evModel.getStoredEnergy.to(KILOWATTHOUR).getValue.doubleValue ), - evModel + evModel, ) } diff --git a/src/main/scala/edu/ie3/simona/model/participant/evcs/EvcsModel.scala b/src/main/scala/edu/ie3/simona/model/participant/evcs/EvcsModel.scala index 0e127f6e6a..c6445dd0ea 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/evcs/EvcsModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/evcs/EvcsModel.scala @@ -17,13 +17,13 @@ import edu.ie3.simona.model.participant.control.QControl import edu.ie3.simona.model.participant.evcs.EvcsModel._ import edu.ie3.simona.model.participant.evcs.uncontrolled.{ ConstantPowerCharging, - MaximumPowerCharging + MaximumPowerCharging, } import edu.ie3.simona.model.participant.{ CalcRelevantData, FlexChangeIndicator, ModelState, - SystemParticipant + SystemParticipant, } import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage import edu.ie3.simona.ontology.messages.flex.MinMaxFlexibilityMessage.ProvideMinMaxFlexOptions @@ -82,7 +82,7 @@ final case class EvcsModel( locationType: EvcsLocationType, vehicle2grid: Boolean, strategy: ChargingStrategy.Value, - lowestEvSoc: Double + lowestEvSoc: Double, ) extends SystemParticipant[EvcsRelevantData, ApparentPower, EvcsState]( uuid, id, @@ -90,7 +90,7 @@ final case class EvcsModel( scalingFactor, qControl, sRated * chargingPoints, - cosPhiRated + cosPhiRated, ) with LazyLogging with MaximumPowerCharging @@ -107,7 +107,7 @@ final case class EvcsModel( */ def calculateNewScheduling( data: EvcsRelevantData, - evs: Seq[EvModelWrapper] + evs: Seq[EvModelWrapper], ): ScheduleMap = { if ( locationType == EvcsLocationType.CHARGING_HUB_TOWN || locationType == EvcsLocationType.CHARGING_HUB_HIGHWAY @@ -115,13 +115,13 @@ final case class EvcsModel( /* Cars at charging hubs always charge eagerly */ chargeWithMaximumPower( data.tick, - evs + evs, ) } else scheduleByStrategy( strategy, data.tick, - evs + evs, ) } @@ -139,17 +139,17 @@ final case class EvcsModel( private def scheduleByStrategy( strategy: ChargingStrategy.Value, currentTick: Long, - evs: Seq[EvModelWrapper] + evs: Seq[EvModelWrapper], ): ScheduleMap = strategy match { case ChargingStrategy.MAX_POWER => chargeWithMaximumPower( currentTick, - evs + evs, ) case ChargingStrategy.CONSTANT_POWER => chargeWithConstantPower( currentTick, - evs + evs, ) case ChargingStrategy.GRID_ORIENTED => throw new NotImplementedError( @@ -173,7 +173,7 @@ final case class EvcsModel( */ def applySchedule( state: EvcsState, - currentTick: Long + currentTick: Long, ): Seq[EvModelWrapper] = if (state.schedule.nonEmpty) { state.evs .map(ev => @@ -184,7 +184,7 @@ final case class EvcsModel( ev, _, state.tick, - currentTick + currentTick, ) } .getOrElse(ev) @@ -214,7 +214,7 @@ final case class EvcsModel( ev: EvModelWrapper, schedule: ChargingSchedule, lastSchedulingTick: Long, - currentTick: Long + currentTick: Long, ): EvModelWrapper = { /* Determine charged energy in the charging interval */ val chargedEnergySinceLastScheduling = @@ -231,7 +231,7 @@ final case class EvcsModel( val trimmedEntry = trimScheduleEntry( scheduleEntry, lastSchedulingTick, - currentTick + currentTick, ) /* Determine the energy charged within this slice of the schedule and accumulate it */ @@ -263,7 +263,7 @@ final case class EvcsModel( def createResults( lastState: EvcsState, currentTick: Long, - voltageMagnitude: Dimensionless + voltageMagnitude: Dimensionless, ): (Iterable[EvResult], Iterable[EvcsResult]) = { val lastTick = lastState.tick @@ -292,7 +292,7 @@ final case class EvcsModel( evUuid -> trimScheduleEntry( entry, lastTick, - currentTick + currentTick, ) } } @@ -324,7 +324,7 @@ final case class EvcsModel( lastEvMap, startingSchedules, Seq.empty[EvResult], - Seq.empty[EvcsResult] + Seq.empty[EvcsResult], ) { case ((evMap, lastActiveEntries, evResults, evcsResults), tick) => val time = tick.toDateTime(simulationStartDate) @@ -353,7 +353,7 @@ final case class EvcsModel( ev, tick, Kilowatts(0d), - voltageMagnitude + voltageMagnitude, ) } @@ -368,7 +368,7 @@ final case class EvcsModel( ev, entry.tickStart, entry.chargingPower, - voltageMagnitude + voltageMagnitude, ) // update EV @@ -378,7 +378,7 @@ final case class EvcsModel( ( evMap.updated(evUuid, newEv), - results.appended(result) + results.appended(result), ) } @@ -391,20 +391,20 @@ final case class EvcsModel( } val evcsQ = calculateReactivePower( evcsP, - voltageMagnitude + voltageMagnitude, ) val evcsResult = new EvcsResult( time, uuid, evcsP.toMegawatts.asMegaWatt, - evcsQ.toMegavars.asMegaVar + evcsQ.toMegavars.asMegaVar, ) ( updatedEvMap, currentActiveEntries, evResults ++ chargingEvResults ++ noChargingEvResults, - evcsResults :+ evcsResult + evcsResults :+ evcsResult, ) } @@ -423,7 +423,7 @@ final case class EvcsModel( _, currentTick, Kilowatts(0d), - voltageMagnitude + voltageMagnitude, ) } @@ -434,11 +434,11 @@ final case class EvcsModel( ev: EvModelWrapper, tick: Long, p: Power, - voltageMagnitude: Dimensionless + voltageMagnitude: Dimensionless, ) = { val q = calculateReactivePower( p, - voltageMagnitude + voltageMagnitude, ) val soc = (ev.storedEnergy / ev.eStorage).asPu .to(PERCENT) @@ -448,7 +448,7 @@ final case class EvcsModel( ev.uuid, p.toMegawatts.asMegaWatt, q.toMegavars.asMegaVar, - soc + soc, ) } @@ -469,11 +469,11 @@ final case class EvcsModel( private def trimScheduleEntry( scheduleEntry: ScheduleEntry, lastSchedulingTick: Long, - currentTick: Long + currentTick: Long, ): ScheduleEntry = scheduleEntry.copy( tickStart = math.max(scheduleEntry.tickStart, lastSchedulingTick), - tickStop = math.min(scheduleEntry.tickStop, currentTick) + tickStop = math.min(scheduleEntry.tickStop, currentTick), ) /** Determine the energy, that has been charged during the schedule entry time @@ -516,19 +516,19 @@ final case class EvcsModel( tick: Long, voltage: Dimensionless, modelState: EvcsState, - data: EvcsRelevantData + data: EvcsRelevantData, ): ApparentPower = throw new NotImplementedError("Use calculatePowerAndEvSoc() instead.") override protected def calculateActivePower( modelState: EvcsState, - data: EvcsRelevantData + data: EvcsRelevantData, ): Power = throw new NotImplementedError("Use calculatePowerAndEvSoc() instead.") override def determineFlexOptions( data: EvcsRelevantData, - lastState: EvcsState + lastState: EvcsState, ): FlexibilityMessage.ProvideFlexOptions = { val currentEvs = determineCurrentEvs(data, lastState) @@ -541,7 +541,7 @@ final case class EvcsModel( ) { case ( (chargingSum, preferredSum, forcedSum, dischargingSum), - ev + ev, ) => val maxPower = getMaxAvailableChargingPower(ev) @@ -575,7 +575,7 @@ final case class EvcsModel( chargingSum + maxCharging, preferredSum + preferred.getOrElse(Kilowatts(0d)), forcedSum + forced, - dischargingSum + maxDischarging + dischargingSum + maxDischarging, ) } @@ -590,7 +590,7 @@ final case class EvcsModel( uuid, adaptedPreferred, adaptedMaxDischarging, - maxCharging + maxCharging, ) } @@ -599,7 +599,7 @@ final case class EvcsModel( override def handleControlledPowerChange( data: EvcsRelevantData, lastState: EvcsState, - setPower: Power + setPower: Power, ): (EvcsState, FlexChangeIndicator) = { val currentEvs = determineCurrentEvs(data, lastState) @@ -608,9 +608,9 @@ final case class EvcsModel( EvcsState( evs = currentEvs, schedule = Map.empty, - tick = data.tick + tick = data.tick, ), - FlexChangeIndicator() + FlexChangeIndicator(), ) // applicable evs can be charged/discharged, other evs cannot @@ -646,9 +646,9 @@ final case class EvcsModel( EvcsState( evs = currentEvs, schedule = allSchedules, - tick = data.tick + tick = data.tick, ), - aggregateFlexChange(combinedSchedules) + aggregateFlexChange(combinedSchedules), ) } @@ -677,7 +677,7 @@ final case class EvcsModel( FlexChangeIndicator( scheduleAtNextActivation, - nextScheduledTick + nextScheduledTick, ) } @@ -698,10 +698,10 @@ final case class EvcsModel( private def createScheduleWithSetPower( currentTick: Long, evs: Seq[EvModelWrapper], - setPower: Power + setPower: Power, ): ( Seq[(UUID, (ChargingSchedule, Long, Boolean))], - Power + Power, ) = { if (evs.isEmpty) return (Seq.empty, setPower) @@ -734,8 +734,8 @@ final case class EvcsModel( ScheduleEntry(currentTick, endTick, proposedPower) ), endTick, - isFull(ev) || isEmpty(ev) || isInLowerMargin(ev) - ) + isFull(ev) || isEmpty(ev) || isInLowerMargin(ev), + ), ) } @@ -764,8 +764,8 @@ final case class EvcsModel( ( SortedSet(ScheduleEntry(currentTick, endTick, power)), endTick, - isFull(ev) || isEmpty(ev) || isInLowerMargin(ev) - ) + isFull(ev) || isEmpty(ev) || isInLowerMargin(ev), + ), ) } @@ -782,7 +782,7 @@ final case class EvcsModel( createScheduleWithSetPower( currentTick, fittingPowerEvs, - remainingAfterAllocation + remainingAfterAllocation, ) val combinedResults = maxChargedResults ++ nextIterationResults @@ -805,7 +805,7 @@ final case class EvcsModel( */ private def calcFlexOptionsChange( ev: EvModelWrapper, - power: Power + power: Power, ): Long = { val timeUntilFullOrEmpty = if (power > Kilowatts(0d)) { @@ -876,7 +876,7 @@ final case class EvcsModel( */ def determineCurrentEvs( data: EvcsRelevantData, - lastState: EvcsState + lastState: EvcsState, ): Seq[EvModelWrapper] = { // If last state is outdated, determine @@ -890,7 +890,7 @@ final case class EvcsModel( validateArrivals( lastState.evs, data.arrivals, - chargingPoints + chargingPoints, ) currentEVs ++ data.arrivals @@ -906,7 +906,7 @@ final case class EvcsModel( */ def validateDepartures( lastEvs: Seq[EvModelWrapper], - departures: Seq[UUID] + departures: Seq[UUID], ): Unit = { departures.foreach { ev => if (!lastEvs.exists(_.uuid == ev)) @@ -931,7 +931,7 @@ final case class EvcsModel( def validateArrivals( lastEvs: Seq[EvModelWrapper], arrivals: Seq[EvModelWrapper], - chargingPoints: Int + chargingPoints: Int, ): Unit = { arrivals.foreach { ev => @@ -974,7 +974,7 @@ object EvcsModel { */ final case class EvcsRelevantData( tick: Long, - arrivals: Seq[EvModelWrapper] + arrivals: Seq[EvModelWrapper], ) extends CalcRelevantData /** Class that represents the state of the charging station (including @@ -991,7 +991,7 @@ object EvcsModel { final case class EvcsState( evs: Seq[EvModelWrapper], schedule: ScheduleMap, - tick: Long + tick: Long, ) extends ModelState /** Schedule entry specifying a time interval in which the EV should be @@ -1007,7 +1007,7 @@ object EvcsModel { final case class ScheduleEntry( tickStart: Long, tickStop: Long, - chargingPower: squants.Power + chargingPower: squants.Power, ) extends Ordered[ScheduleEntry] { override def compare(that: ScheduleEntry): Int = { val startComp = tickStart.compare(that.tickStart) @@ -1047,14 +1047,14 @@ object EvcsModel { simulationStartDate: ZonedDateTime, simulationEndDate: ZonedDateTime, chargingStrategy: String, - lowestEvSoc: Double + lowestEvSoc: Double, ): EvcsModel = { /* Determine the operation interval */ val operationInterval: OperationInterval = SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - inputModel.getOperationTime + inputModel.getOperationTime, ) val model = EvcsModel( @@ -1071,7 +1071,7 @@ object EvcsModel { inputModel.getLocationType, inputModel.getV2gSupport, ChargingStrategy(chargingStrategy), - lowestEvSoc + lowestEvSoc, ) model.enable() diff --git a/src/main/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/ConstantPowerCharging.scala b/src/main/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/ConstantPowerCharging.scala index 4e2a56135e..20106c77af 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/ConstantPowerCharging.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/ConstantPowerCharging.scala @@ -8,7 +8,7 @@ package edu.ie3.simona.model.participant.evcs.uncontrolled import edu.ie3.simona.model.participant.evcs.EvcsModel.{ ScheduleMap, - ScheduleEntry + ScheduleEntry, } import edu.ie3.simona.model.participant.evcs.{EvModelWrapper, EvcsModel} import squants.Seconds @@ -32,7 +32,7 @@ trait ConstantPowerCharging { */ def chargeWithConstantPower( currentTick: Long, - evs: Seq[EvModelWrapper] + evs: Seq[EvModelWrapper], ): ScheduleMap = evs .filter(ev => ev.storedEnergy < ev.eStorage) .map { ev => diff --git a/src/main/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/MaximumPowerCharging.scala b/src/main/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/MaximumPowerCharging.scala index babbc580ac..eac55d9fcc 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/MaximumPowerCharging.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/MaximumPowerCharging.scala @@ -8,7 +8,7 @@ package edu.ie3.simona.model.participant.evcs.uncontrolled import edu.ie3.simona.model.participant.evcs.EvcsModel.{ ScheduleMap, - ScheduleEntry + ScheduleEntry, } import edu.ie3.simona.model.participant.evcs.{EvModelWrapper, EvcsModel} import squants.Seconds @@ -32,7 +32,7 @@ trait MaximumPowerCharging { */ def chargeWithMaximumPower( currentTick: Long, - evs: Seq[EvModelWrapper] + evs: Seq[EvModelWrapper], ): ScheduleMap = evs .filter(ev => ev.storedEnergy < ev.eStorage) .map { ev => diff --git a/src/main/scala/edu/ie3/simona/model/participant/load/FixedLoadModel.scala b/src/main/scala/edu/ie3/simona/model/participant/load/FixedLoadModel.scala index 0f2e4f4b9e..b74e154b61 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/load/FixedLoadModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/load/FixedLoadModel.scala @@ -13,7 +13,7 @@ import edu.ie3.simona.model.participant.control.QControl import edu.ie3.simona.model.participant.load.FixedLoadModel.FixedLoadRelevantData import edu.ie3.simona.model.participant.load.LoadReference.{ ActivePower, - EnergyConsumption + EnergyConsumption, } import edu.ie3.util.quantities.PowerSystemUnits import edu.ie3.util.scala.OperationInterval @@ -50,7 +50,7 @@ final case class FixedLoadModel( qControl: QControl, sRated: Power, cosPhiRated: Double, - reference: LoadReference + reference: LoadReference, ) extends LoadModel[FixedLoadRelevantData.type]( uuid, id, @@ -58,7 +58,7 @@ final case class FixedLoadModel( scalingFactor, qControl, sRated, - cosPhiRated + cosPhiRated, ) { val activePower: Power = reference match { @@ -78,7 +78,7 @@ final case class FixedLoadModel( */ override protected def calculateActivePower( modelState: ConstantState.type, - data: FixedLoadRelevantData.type = FixedLoadRelevantData + data: FixedLoadRelevantData.type = FixedLoadRelevantData, ): Power = activePower } @@ -89,7 +89,7 @@ object FixedLoadModel { input: LoadInput, scalingFactor: Double, operationInterval: OperationInterval, - reference: LoadReference + reference: LoadReference, ): FixedLoadModel = { val model = FixedLoadModel( input.getUuid, @@ -104,7 +104,7 @@ object FixedLoadModel { .doubleValue ), input.getCosPhiRated, - reference + reference, ) model.enable() model diff --git a/src/main/scala/edu/ie3/simona/model/participant/load/LoadModel.scala b/src/main/scala/edu/ie3/simona/model/participant/load/LoadModel.scala index 4d0e81c322..874b5a5038 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/load/LoadModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/load/LoadModel.scala @@ -15,7 +15,7 @@ import edu.ie3.simona.model.participant.control.QControl import edu.ie3.simona.model.participant.{ ApparentPowerParticipant, FlexChangeIndicator, - SystemParticipant + SystemParticipant, } import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage.ProvideFlexOptions import edu.ie3.simona.ontology.messages.flex.MinMaxFlexibilityMessage.ProvideMinMaxFlexOptions @@ -38,7 +38,7 @@ abstract class LoadModel[D <: LoadRelevantData]( scalingFactor: Double, qControl: QControl, sRated: Power, - cosPhiRated: Double + cosPhiRated: Double, ) extends SystemParticipant[D, ApparentPower, ConstantState.type]( uuid, id, @@ -46,23 +46,23 @@ abstract class LoadModel[D <: LoadRelevantData]( scalingFactor, qControl, sRated, - cosPhiRated + cosPhiRated, ) with ApparentPowerParticipant[D, ConstantState.type] { override def determineFlexOptions( data: D, - lastState: ConstantState.type + lastState: ConstantState.type, ): ProvideFlexOptions = ProvideMinMaxFlexOptions.noFlexOption( uuid, - calculateActivePower(lastState, data) + calculateActivePower(lastState, data), ) override def handleControlledPowerChange( data: D, lastState: ConstantState.type, - setPower: Power + setPower: Power, ): (ConstantState.type, FlexChangeIndicator) = (lastState, FlexChangeIndicator()) } @@ -90,7 +90,7 @@ case object LoadModel extends LazyLogging { def scaleSRatedActivePower( inputModel: LoadInput, activePower: Power, - safetyFactor: Double = 1d + safetyFactor: Double = 1d, ): Power = { val sRated = Megawatts( inputModel.getsRated @@ -133,7 +133,7 @@ case object LoadModel extends LazyLogging { energyConsumption: Energy, profileMaxPower: Power, profileEnergyScaling: Energy, - safetyFactor: Double = 1d + safetyFactor: Double = 1d, ): Power = { (profileMaxPower / inputModel.getCosPhiRated) * ( energyConsumption / profileEnergyScaling diff --git a/src/main/scala/edu/ie3/simona/model/participant/load/LoadReference.scala b/src/main/scala/edu/ie3/simona/model/participant/load/LoadReference.scala index 4fbfd67821..5a795673c5 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/load/LoadReference.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/load/LoadReference.scala @@ -61,7 +61,7 @@ object LoadReference { */ def apply( inputModel: LoadInput, - modelConfig: SimonaConfig.LoadRuntimeConfig + modelConfig: SimonaConfig.LoadRuntimeConfig, ): LoadReference = StringUtils.cleanString(modelConfig.reference).toLowerCase match { case "power" => diff --git a/src/main/scala/edu/ie3/simona/model/participant/load/profile/LoadProfileKey.scala b/src/main/scala/edu/ie3/simona/model/participant/load/profile/LoadProfileKey.scala index cb3cb60e90..af77c3fa55 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/load/profile/LoadProfileKey.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/load/profile/LoadProfileKey.scala @@ -25,7 +25,7 @@ import edu.ie3.simona.model.participant.load.{DayType, profile} final case class LoadProfileKey( standardLoadProfile: StandardLoadProfile, season: Season.Value, - dayType: DayType.Value + dayType: DayType.Value, ) case object LoadProfileKey { @@ -64,19 +64,19 @@ case object LoadProfileKey { def apply( loadProfile: String, season: String, - dayType: String + dayType: String, ): LoadProfileKey = { try { new LoadProfileKey( StandardLoadProfile.parse(loadProfile), Season(season), - DayType(dayType) + DayType(dayType), ) } catch { case e: ParsingException => throw new IllegalArgumentException( s"Cannot parse '$loadProfile' to a now StandardLoadProfile.", - e + e, ) } } @@ -93,12 +93,12 @@ case object LoadProfileKey { */ def apply( loadProfile: StandardLoadProfile, - time: ZonedDateTime + time: ZonedDateTime, ): LoadProfileKey = { new LoadProfileKey( loadProfile, profile.Season(time), - load.DayType(time.getDayOfWeek) + load.DayType(time.getDayOfWeek), ) } } diff --git a/src/main/scala/edu/ie3/simona/model/participant/load/profile/LoadProfileStore.scala b/src/main/scala/edu/ie3/simona/model/participant/load/profile/LoadProfileStore.scala index e2f66635cd..f1e7d54f62 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/load/profile/LoadProfileStore.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/load/profile/LoadProfileStore.scala @@ -10,11 +10,11 @@ import breeze.numerics.round import com.typesafe.scalalogging.LazyLogging import edu.ie3.datamodel.models.profile.{ BdewStandardLoadProfile, - StandardLoadProfile + StandardLoadProfile, } import edu.ie3.simona.model.participant.load.profile.LoadProfileStore.{ initializeMaxConsumptionPerProfile, - initializeTypeDayValues + initializeTypeDayValues, } import edu.ie3.simona.model.participant.load.{DayType, profile} import org.apache.commons.csv.CSVFormat @@ -56,7 +56,7 @@ class LoadProfileStore private (val reader: Reader) { */ def entry( time: ZonedDateTime, - loadProfile: StandardLoadProfile + loadProfile: StandardLoadProfile, ): squants.Power = { val key = LoadProfileKey(loadProfile, time) profileMap.get(key) match { diff --git a/src/main/scala/edu/ie3/simona/model/participant/load/profile/ProfileLoadModel.scala b/src/main/scala/edu/ie3/simona/model/participant/load/profile/ProfileLoadModel.scala index 15b0a4f141..8fd4128996 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/load/profile/ProfileLoadModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/load/profile/ProfileLoadModel.scala @@ -50,7 +50,7 @@ final case class ProfileLoadModel( sRated: Power, cosPhiRated: Double, loadProfile: StandardLoadProfile, - reference: LoadReference + reference: LoadReference, ) extends LoadModel[ProfileRelevantData]( uuid, id, @@ -58,7 +58,7 @@ final case class ProfileLoadModel( scalingFactor, qControl, sRated, - cosPhiRated + cosPhiRated, ) { private val loadProfileStore: LoadProfileStore = LoadProfileStore() @@ -86,7 +86,7 @@ final case class ProfileLoadModel( */ override protected def calculateActivePower( modelState: ConstantState.type, - data: ProfileRelevantData + data: ProfileRelevantData, ): Power = { /* The power comes in W and is delivered all 15 minutes */ val averagePower: Power = loadProfileStore @@ -114,7 +114,7 @@ object ProfileLoadModel { input: LoadInput, operationInterval: OperationInterval, scalingFactor: Double, - reference: LoadReference + reference: LoadReference, ): ProfileLoadModel = { val model = reference match { case LoadReference.ActivePower(power) => @@ -128,7 +128,7 @@ object ProfileLoadModel { sRatedPowerScaled, input.getCosPhiRated, input.getLoadProfile.asInstanceOf[StandardLoadProfile], - reference + reference, ) case LoadReference.EnergyConsumption(energyConsumption) => @@ -140,7 +140,7 @@ object ProfileLoadModel { input, energyConsumption, loadProfileMax, - LoadProfileStore.defaultLoadProfileEnergyScaling + LoadProfileStore.defaultLoadProfileEnergyScaling, ) ProfileLoadModel( input.getUuid, @@ -151,7 +151,7 @@ object ProfileLoadModel { sRatedEnergy, input.getCosPhiRated, input.getLoadProfile.asInstanceOf[StandardLoadProfile], - reference + reference, ) } model.enable() diff --git a/src/main/scala/edu/ie3/simona/model/participant/load/random/RandomLoadModel.scala b/src/main/scala/edu/ie3/simona/model/participant/load/random/RandomLoadModel.scala index 6d62344fe0..4897530a1e 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/load/random/RandomLoadModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/load/random/RandomLoadModel.scala @@ -55,7 +55,7 @@ final case class RandomLoadModel( qControl: QControl, sRated: Power, cosPhiRated: Double, - reference: LoadReference + reference: LoadReference, ) extends LoadModel[RandomRelevantData]( uuid, id, @@ -63,7 +63,7 @@ final case class RandomLoadModel( scalingFactor, qControl, sRated, - cosPhiRated + cosPhiRated, ) { private lazy val energyReferenceScalingFactor = reference match { @@ -91,7 +91,7 @@ final case class RandomLoadModel( @tailrec override protected def calculateActivePower( modelState: ConstantState.type, - data: RandomRelevantData + data: RandomRelevantData, ): Power = { val gev = getGevDistribution(data.date) @@ -130,7 +130,7 @@ final case class RandomLoadModel( * available, yet, instantiate one. */ val key: GevKey = ( DayType(dateTime.getDayOfWeek), - TimeUtil.withDefaults.getQuarterHourOfDay(dateTime) + TimeUtil.withDefaults.getQuarterHourOfDay(dateTime), ) gevStorage.get(key) match { case Some(foundIt) => foundIt @@ -142,7 +142,7 @@ final case class RandomLoadModel( gevParameters.my, gevParameters.sigma, gevParameters.k, - randomFactory + randomFactory, ) gevStorage += (key -> newGev) newGev @@ -180,7 +180,7 @@ object RandomLoadModel { input: LoadInput, operationInterval: OperationInterval, scalingFactor: Double, - reference: LoadReference + reference: LoadReference, ): RandomLoadModel = { val model = reference match { case ActivePower(power) => @@ -195,7 +195,7 @@ object RandomLoadModel { QControl.apply(input.getqCharacteristics()), sRatedPowerScaled, input.getCosPhiRated, - reference + reference, ) case EnergyConsumption(energyConsumption) => val sRatedEnergy = LoadModel.scaleSRatedEnergy( @@ -203,7 +203,7 @@ object RandomLoadModel { energyConsumption, randomMaxPower, randomProfileEnergyScaling, - 1.1 + 1.1, ) RandomLoadModel( @@ -214,7 +214,7 @@ object RandomLoadModel { QControl.apply(input.getqCharacteristics()), sRatedEnergy, input.getCosPhiRated, - reference + reference, ) } model.enable() diff --git a/src/main/scala/edu/ie3/simona/model/participant/load/random/RandomLoadParamStore.scala b/src/main/scala/edu/ie3/simona/model/participant/load/random/RandomLoadParamStore.scala index c83620ef84..36635ae940 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/load/random/RandomLoadParamStore.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/load/random/RandomLoadParamStore.scala @@ -36,7 +36,7 @@ final case class RandomLoadParamStore private (reader: Reader) { dayType, throw new RuntimeException( s"Cannot determine the random load parameters for '$time' (day type '$dayType')." - ) + ), ) .getQuarterHourParameters(time) } @@ -106,7 +106,7 @@ case object RandomLoadParamStore extends LazyLogging { case e: FileIOException => throw new FileIOException( s"Cannot determine random load parameters for day type '$dayType' and quarter hour '$quartHour'", - e + e, ) } } @@ -180,7 +180,7 @@ case object RandomLoadParamStore extends LazyLogging { */ private def assembleParameters( record: CSVRecord, - parameterToCol: Map[RandomLoadParameters.Value, Int] + parameterToCol: Map[RandomLoadParameters.Value, Int], ): RandomLoadParameters = { val k = record .get( @@ -188,7 +188,7 @@ case object RandomLoadParamStore extends LazyLogging { RandomLoadParameters.K, throw new FileIOException( s"Cannot determine column index for random load parameter ${RandomLoadParameters.K}." - ) + ), ) ) .toDouble @@ -198,7 +198,7 @@ case object RandomLoadParamStore extends LazyLogging { RandomLoadParameters.MY, throw new FileIOException( s"Cannot determine column index for random load parameter ${RandomLoadParameters.MY}." - ) + ), ) ) .toDouble @@ -208,7 +208,7 @@ case object RandomLoadParamStore extends LazyLogging { RandomLoadParameters.SIGMA, throw new FileIOException( s"Cannot determine column index for random load parameter ${RandomLoadParameters.SIGMA}." - ) + ), ) ) .toDouble diff --git a/src/main/scala/edu/ie3/simona/model/system/Characteristic.scala b/src/main/scala/edu/ie3/simona/model/system/Characteristic.scala index 2be558d535..2088ca6cdc 100644 --- a/src/main/scala/edu/ie3/simona/model/system/Characteristic.scala +++ b/src/main/scala/edu/ie3/simona/model/system/Characteristic.scala @@ -38,7 +38,7 @@ trait Characteristic[A <: Quantity[A], O <: Quantity[O]] { xyCoordinates.toSeq .map(xyPair => xyPair.x -> xyPair.y) .toMap, - requestedAbscissaQuantity + requestedAbscissaQuantity, ) xyCoords.foldLeft( @@ -56,7 +56,7 @@ trait Characteristic[A <: Quantity[A], O <: Quantity[O]] { Some(requestedAbscissaQuantity), Some( b.map(_ + (m * deltaX).value) - ) + ), ) case _ => throw new CharacteristicsException( @@ -75,7 +75,7 @@ trait Characteristic[A <: Quantity[A], O <: Quantity[O]] { object Characteristic { final case class XYPair[A <: Quantity[A], O <: Quantity[O]]( x: A, - y: O + y: O, ) extends Ordered[XYPair[A, O]] { /** The pairs are ordered by their x value first. If two pairs have the same diff --git a/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala b/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala index c3f7ee83b4..b6828f7dc5 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala @@ -10,19 +10,19 @@ import edu.ie3.datamodel.models.OperationTime import edu.ie3.datamodel.models.input.OperatorInput import edu.ie3.datamodel.models.input.thermal.{ CylindricalStorageInput, - ThermalBusInput + ThermalBusInput, } import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageState import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageThreshold.{ StorageEmpty, - StorageFull + StorageFull, } import edu.ie3.util.quantities.PowerSystemUnits import edu.ie3.util.scala.quantities.SquantsUtils.RichEnergy import edu.ie3.util.scala.quantities.{ DefaultQuantities, KilowattHoursPerKelvinCubicMeters, - SpecificHeatCapacity + SpecificHeatCapacity, } import squants.energy.{Kilowatts, Megawatts} import squants.space.{CubicMeters, Volume} @@ -63,7 +63,7 @@ final case class CylindricalThermalStorage( minEnergyThreshold: Energy, maxEnergyThreshold: Energy, chargingPower: Power, - override protected var _storedEnergy: Energy + override protected var _storedEnergy: Energy, ) extends ThermalStorage( uuid, id, @@ -72,7 +72,7 @@ final case class CylindricalThermalStorage( bus, minEnergyThreshold, maxEnergyThreshold, - chargingPower + chargingPower, ) with MutableStorage { @@ -93,7 +93,7 @@ final case class CylindricalThermalStorage( override def updateState( tick: Long, qDot: Power, - lastState: ThermalStorageState + lastState: ThermalStorageState, ): (ThermalStorageState, Option[ThermalThreshold]) = { /* Determine new state based on time difference and given state */ val energyBalance = lastState.qDot * Seconds(tick - lastState.tick) @@ -132,7 +132,7 @@ final case class CylindricalThermalStorage( override def startingState: ThermalStorageState = ThermalStorageState( -1L, getMinEnergyThreshold, - Kilowatts(0d) + Kilowatts(0d), ) @deprecated("Use thermal storage state instead") @@ -185,7 +185,7 @@ object CylindricalThermalStorage { */ def apply( input: CylindricalStorageInput, - initialStoredEnergy: Energy = DefaultQuantities.zeroKWH + initialStoredEnergy: Energy = DefaultQuantities.zeroKWH, ): CylindricalThermalStorage = { val minEnergyThreshold: Energy = CylindricalThermalStorage.volumeToEnergy( @@ -202,7 +202,7 @@ object CylindricalThermalStorage { .doubleValue ), Celsius(input.getInletTemp.to(Units.CELSIUS).getValue.doubleValue()), - Celsius(input.getReturnTemp.to(Units.CELSIUS).getValue.doubleValue()) + Celsius(input.getReturnTemp.to(Units.CELSIUS).getValue.doubleValue()), ) val maxEnergyThreshold: Energy = @@ -217,7 +217,7 @@ object CylindricalThermalStorage { .doubleValue ), Celsius(input.getInletTemp.to(Units.CELSIUS).getValue.doubleValue()), - Celsius(input.getReturnTemp.to(Units.CELSIUS).getValue.doubleValue()) + Celsius(input.getReturnTemp.to(Units.CELSIUS).getValue.doubleValue()), ) /* TODO: Currently, the input model does not define any maximum charge power. Assume, that the usable energy can @@ -233,7 +233,7 @@ object CylindricalThermalStorage { minEnergyThreshold, maxEnergyThreshold, chargingPower, - initialStoredEnergy + initialStoredEnergy, ) } @@ -254,7 +254,7 @@ object CylindricalThermalStorage { volume: Volume, c: SpecificHeatCapacity, inletTemp: Temperature, - returnTemp: Temperature + returnTemp: Temperature, ): Energy = { c.calcEnergy(returnTemp, inletTemp, volume) } @@ -276,7 +276,7 @@ object CylindricalThermalStorage { energy: Energy, c: SpecificHeatCapacity, inletTemp: Temperature, - returnTemp: Temperature + returnTemp: Temperature, ): Volume = { val energyDensity = c.calcEnergyDensity(returnTemp, inletTemp) diff --git a/src/main/scala/edu/ie3/simona/model/thermal/RandomStorageState.scala b/src/main/scala/edu/ie3/simona/model/thermal/RandomStorageState.scala index 1ccb5cc024..c447a5bf73 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/RandomStorageState.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/RandomStorageState.scala @@ -24,7 +24,7 @@ trait RandomStorageState { ThermalStorageState( -1L, storedEnergy, - Kilowatts(0d) + Kilowatts(0d), ) } } diff --git a/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala b/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala index e213a902ed..0586a20ee7 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala @@ -11,12 +11,12 @@ import edu.ie3.datamodel.models.input.thermal.CylindricalStorageInput import edu.ie3.datamodel.models.result.ResultEntity import edu.ie3.datamodel.models.result.thermal.{ CylindricalStorageResult, - ThermalHouseResult + ThermalHouseResult, } import edu.ie3.simona.exceptions.agent.InconsistentStateException import edu.ie3.simona.model.thermal.ThermalGrid.{ ThermalEnergyDemand, - ThermalGridState + ThermalGridState, } import edu.ie3.simona.model.thermal.ThermalHouse.ThermalHouseState import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageState @@ -38,7 +38,7 @@ import scala.jdk.CollectionConverters.SetHasAsScala */ final case class ThermalGrid( house: Option[ThermalHouse], - storage: Option[ThermalStorage] + storage: Option[ThermalStorage], ) extends LazyLogging { /** Determine the energy demand of the total grid at the given instance in @@ -55,7 +55,7 @@ final case class ThermalGrid( def energyDemand( tick: Long, ambientTemperature: Temperature, - state: ThermalGridState + state: ThermalGridState, ): ThermalEnergyDemand = { /* First get the energy demand of the houses */ val houseDemand = house @@ -64,7 +64,7 @@ final case class ThermalGrid( house.energyDemand( tick, ambientTemperature, - state + state, ) } .getOrElse(ThermalEnergyDemand.noDemand) @@ -78,7 +78,7 @@ final case class ThermalGrid( val remaining = storage.getMaxEnergyThreshold - usableEnergy ( usableEnergy, - remaining + remaining, ) } .getOrElse( @@ -95,7 +95,7 @@ final case class ThermalGrid( ThermalEnergyDemand( houseDemand.required - usedEnergy, - houseDemand.possible + finallyRemaining + houseDemand.possible + finallyRemaining, ) } @@ -115,7 +115,7 @@ final case class ThermalGrid( tick: Long, state: ThermalGridState, ambientTemperature: Temperature, - qDot: Power + qDot: Power, ): (ThermalGridState, Option[ThermalThreshold]) = if (qDot > Kilowatts(0d)) handleInfeed(tick, ambientTemperature, state, qDot) else @@ -138,7 +138,7 @@ final case class ThermalGrid( tick: Long, ambientTemperature: Temperature, state: ThermalGridState, - qDot: Power + qDot: Power, ): (ThermalGridState, Option[ThermalThreshold]) = house.zip(state.houseState) match { case Some((thermalHouse, lastHouseState)) => @@ -151,7 +151,7 @@ final case class ThermalGrid( .updateState( tick, Kilowatts(0d), - storageState + storageState, ) ._1 ) @@ -163,7 +163,7 @@ final case class ThermalGrid( tick, lastHouseState, ambientTemperature, - qDot + qDot, ) if ( @@ -177,7 +177,7 @@ final case class ThermalGrid( tick, lastHouseState, ambientTemperature, - Kilowatts(0d) + Kilowatts(0d), ) storage.zip(updatedStorageState) match { case Some((thermalStorage, storageState)) => @@ -187,28 +187,28 @@ final case class ThermalGrid( /* Both house and storage are updated. Determine what reaches the next threshold */ val nextThreshold = determineMostRecentThreshold( maybeFullHouseThreshold, - maybeStorageThreshold + maybeStorageThreshold, ) ( state.copy( houseState = Some(fullHouseState), - storageState = Some(updatedStorageState) + storageState = Some(updatedStorageState), ), - nextThreshold + nextThreshold, ) case None => /* There is no storage, house determines the next activation */ ( state.copy(houseState = Some(fullHouseState)), - maybeFullHouseThreshold + maybeFullHouseThreshold, ) } } else { /* The house can handle the infeed */ ( state.copy(houseState = Some(updatedHouseState)), - maybeHouseThreshold + maybeHouseThreshold, ) } @@ -219,7 +219,7 @@ final case class ThermalGrid( thermalStorage.updateState(tick, qDot, storageState) ( state.copy(storageState = Some(updatedStorageState)), - maybeStorageThreshold + maybeStorageThreshold, ) case None => throw new InconsistentStateException( @@ -230,7 +230,7 @@ final case class ThermalGrid( private def determineMostRecentThreshold( maybeHouseThreshold: Option[ThermalThreshold], - maybeStorageThreshold: Option[ThermalThreshold] + maybeStorageThreshold: Option[ThermalThreshold], ): Option[ThermalThreshold] = (maybeHouseThreshold, maybeStorageThreshold) match { case (Some(houseThreshold), Some(storageThreshold)) => @@ -260,7 +260,7 @@ final case class ThermalGrid( tick: Long, ambientTemperature: Temperature, state: ThermalGridState, - qDot: Power + qDot: Power, ): (ThermalGridState, Option[ThermalThreshold]) = { /* House will be left with no influx in all cases. Determine if and when a threshold is reached */ val maybeUpdatedHouseState = @@ -269,7 +269,7 @@ final case class ThermalGrid( tick, houseState, ambientTemperature, - Megawatts(0d) + Megawatts(0d), ) } @@ -287,20 +287,20 @@ final case class ThermalGrid( state.houseState, state.storageState, ambientTemperature, - qDot + qDot, ) val nextThreshold = determineMostRecentThreshold( revisedHouseState.flatMap(_._2), - revisedStorageState.flatMap(_._2) + revisedStorageState.flatMap(_._2), ) ( state.copy( houseState = revisedHouseState.map(_._1), - storageState = revisedStorageState.map(_._1) + storageState = revisedStorageState.map(_._1), ), - nextThreshold + nextThreshold, ) } @@ -334,15 +334,15 @@ final case class ThermalGrid( formerHouseState: Option[ThermalHouseState], formerStorageState: Option[ThermalStorageState], ambientTemperature: Temperature, - qDot: Power + qDot: Power, ): ( Option[(ThermalHouseState, Option[ThermalThreshold])], - Option[(ThermalStorageState, Option[ThermalThreshold])] + Option[(ThermalStorageState, Option[ThermalThreshold])], ) = house.zip(maybeHouseState).zip(storage.zip(maybeStorageState)) match { case Some( ( (thermalHouse, (houseState, _)), - (thermalStorage, (storageState, _)) + (thermalStorage, (storageState, _)), ) ) if qDot.~=(Kilowatts(0d))(Kilowatts(10e-3)) && @@ -357,7 +357,7 @@ final case class ThermalGrid( throw new InconsistentStateException( "Impossible to find no storage state" ) - ) + ), ) val revisedHouseState = thermalHouse.determineState( tick, @@ -367,7 +367,7 @@ final case class ThermalGrid( ) ), ambientTemperature, - thermalStorage.getChargingPower + thermalStorage.getChargingPower, ) (Some(revisedHouseState), Some(revisedStorageState)) case _ => (maybeHouseState, maybeStorageState) @@ -390,13 +390,13 @@ final case class ThermalGrid( .map { case ( thermalHouse, - ThermalHouseState(tick, innerTemperature, thermalInfeed) + ThermalHouseState(tick, innerTemperature, thermalInfeed), ) => Seq.empty[ResultEntity] :+ new ThermalHouseResult( tick.toDateTime, thermalHouse.uuid, thermalInfeed.toMegawatts.asMegaWatt, - innerTemperature.toKelvinScale.asKelvin + innerTemperature.toKelvinScale.asKelvin, ) } .getOrElse(Seq.empty[ResultEntity]) @@ -406,14 +406,14 @@ final case class ThermalGrid( .map { case ( storage: CylindricalThermalStorage, - ThermalStorageState(tick, storedEnergy, qDot) + ThermalStorageState(tick, storedEnergy, qDot), ) => houseResults :+ new CylindricalStorageResult( tick.toDateTime, storage.uuid, storedEnergy.toMegawattHours.asMegaWattHour, qDot.toMegawatts.asMegaWatt, - (storage.maxEnergyThreshold / storedEnergy).asPu + (storage.maxEnergyThreshold / storedEnergy).asPu, ) case _ => throw new NotImplementedError( @@ -440,7 +440,7 @@ object ThermalGrid { .toSet new ThermalGrid( houses.headOption, - storages.headOption + storages.headOption, ) } @@ -452,13 +452,13 @@ object ThermalGrid { */ final case class ThermalGridState( houseState: Option[ThermalHouseState], - storageState: Option[ThermalStorageState] + storageState: Option[ThermalStorageState], ) def startingState(thermalGrid: ThermalGrid): ThermalGridState = ThermalGridState( thermalGrid.house.map(house => ThermalHouse.startingState(house)), - thermalGrid.storage.map(_.startingState) + thermalGrid.storage.map(_.startingState), ) /** Defines the thermal energy demand of a thermal grid. It comprises the @@ -473,11 +473,11 @@ object ThermalGrid { */ final case class ThermalEnergyDemand private ( required: Energy, - possible: Energy + possible: Energy, ) { def +(rhs: ThermalEnergyDemand): ThermalEnergyDemand = ThermalEnergyDemand( required + rhs.required, - possible + rhs.possible + possible + rhs.possible, ) def hasRequiredDemand: Boolean = required > MegawattHours(0d) @@ -498,7 +498,7 @@ object ThermalGrid { */ def apply( required: Energy, - possible: Energy + possible: Energy, ): ThermalEnergyDemand = { if (possible < required) new ThermalEnergyDemand(possible, possible) @@ -508,7 +508,7 @@ object ThermalGrid { def noDemand: ThermalEnergyDemand = ThermalEnergyDemand( MegawattHours(0d), - MegawattHours(0d) + MegawattHours(0d), ) } } diff --git a/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala b/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala index 874b7c10e3..b702102080 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala @@ -10,16 +10,16 @@ import edu.ie3.datamodel.models.OperationTime import edu.ie3.datamodel.models.input.OperatorInput import edu.ie3.datamodel.models.input.thermal.{ ThermalBusInput, - ThermalHouseInput + ThermalHouseInput, } import edu.ie3.simona.model.thermal.ThermalGrid.ThermalEnergyDemand import edu.ie3.simona.model.thermal.ThermalHouse.ThermalHouseThreshold.{ HouseTemperatureLowerBoundaryReached, - HouseTemperatureUpperBoundaryReached + HouseTemperatureUpperBoundaryReached, } import edu.ie3.simona.model.thermal.ThermalHouse.{ ThermalHouseState, - temperatureTolerance + temperatureTolerance, } import edu.ie3.util.quantities.PowerSystemUnits import edu.ie3.util.scala.quantities.{ThermalConductance, WattsPerKelvin} @@ -64,13 +64,13 @@ final case class ThermalHouse( ethCapa: ThermalCapacity, targetTemperature: Temperature, lowerBoundaryTemperature: Temperature, - upperBoundaryTemperature: Temperature + upperBoundaryTemperature: Temperature, ) extends ThermalSink( uuid, id, operatorInput, operationTime, - bus + bus, ) { /** Calculate the energy demand at the instance in question. If the inner @@ -93,7 +93,7 @@ final case class ThermalHouse( def energyDemand( tick: Long, ambientTemperature: Temperature, - state: ThermalHouseState + state: ThermalHouseState, ): ThermalEnergyDemand = { /* Calculate the inner temperature of the house, at the questioned instance in time */ val duration = Seconds(tick - state.tick) @@ -101,7 +101,7 @@ final case class ThermalHouse( state.qDot, duration, state.innerTemperature, - ambientTemperature + ambientTemperature, ) /* Determine, which temperature boundary triggers a needed energy to reach the temperature constraints */ @@ -118,7 +118,7 @@ final case class ThermalHouse( if ( isInnerTemperatureTooLow( currentInnerTemp, - temperatureToTriggerRequiredEnergy + temperatureToTriggerRequiredEnergy, ) ) energy(targetTemperature, currentInnerTemp) else @@ -146,7 +146,7 @@ final case class ThermalHouse( */ private def energy( targetTemperature: Temperature, - startTemperature: Temperature + startTemperature: Temperature, ): Energy = { ethCapa * Kelvin( targetTemperature.toKelvinScale - startTemperature.toKelvinScale @@ -172,7 +172,7 @@ final case class ThermalHouse( */ def isInnerTemperatureTooLow( innerTemperature: Temperature, - boundaryTemperature: Temperature = lowerBoundaryTemperature + boundaryTemperature: Temperature = lowerBoundaryTemperature, ): Boolean = innerTemperature < Kelvin( boundaryTemperature.toKelvinScale + temperatureTolerance.toKelvinScale @@ -195,19 +195,19 @@ final case class ThermalHouse( thermalPower: Power, duration: Time, currentInnerTemperature: Temperature, - ambientTemperature: Temperature + ambientTemperature: Temperature, ): Temperature = { val thermalEnergyChange = calcThermalEnergyChange( calcThermalEnergyGain(thermalPower, duration), calcThermalEnergyLoss( currentInnerTemperature, ambientTemperature, - duration - ) + duration, + ), ) calcNewInnerTemperature( currentInnerTemperature, - calcInnerTemperatureChange(thermalEnergyChange) + calcInnerTemperatureChange(thermalEnergyChange), ) } @@ -222,7 +222,7 @@ final case class ThermalHouse( */ private def calcNewInnerTemperature( oldInnerTemperature: Temperature, - temperatureChange: Temperature + temperatureChange: Temperature, ): Temperature = oldInnerTemperature + temperatureChange @@ -251,7 +251,7 @@ final case class ThermalHouse( */ private def calcThermalEnergyChange( thermalEnergyGain: Energy, - thermalEnergyLoss: Energy + thermalEnergyLoss: Energy, ): Energy = thermalEnergyGain - thermalEnergyLoss @@ -266,7 +266,7 @@ final case class ThermalHouse( */ private def calcThermalEnergyGain( pThermal: Power, - time: Time + time: Time, ): Energy = pThermal * time /** Calculate the thermal energy loss due to the temperature deviation over @@ -284,12 +284,12 @@ final case class ThermalHouse( private def calcThermalEnergyLoss( innerTemperature: Temperature, ambientTemperature: Temperature, - time: Time + time: Time, ): Energy = { ethLosses.thermalConductanceToEnergy( innerTemperature, ambientTemperature, - time + time, ) } @@ -310,14 +310,14 @@ final case class ThermalHouse( tick: Long, state: ThermalHouseState, ambientTemperature: Temperature, - qDot: Power + qDot: Power, ): (ThermalHouseState, Option[ThermalThreshold]) = { val duration = Seconds(tick - state.tick) val updatedInnerTemperature = newInnerTemperature( state.qDot, duration, state.innerTemperature, - ambientTemperature + ambientTemperature, ) /* Calculate the next given threshold */ @@ -328,9 +328,9 @@ final case class ThermalHouse( state.copy( tick = tick, innerTemperature = updatedInnerTemperature, - qDot = qDot + qDot = qDot, ), - threshold + threshold, ) } @@ -350,13 +350,13 @@ final case class ThermalHouse( tick: Long, qDotExternal: Power, innerTemperature: Temperature, - ambientTemperature: Temperature + ambientTemperature: Temperature, ): Option[ThermalThreshold] = { val artificialDuration = Hours(1d) val loss = calcThermalEnergyLoss( innerTemperature, ambientTemperature, - artificialDuration + artificialDuration, ) / artificialDuration val resultingQDot = qDotExternal - loss if ( @@ -369,7 +369,7 @@ final case class ThermalHouse( tick, innerTemperature, lowerBoundaryTemperature, - resultingQDot + resultingQDot, ).map(HouseTemperatureLowerBoundaryReached) } else if ( resultingQDot > Megawatts(0d) && !isInnerTemperatureTooHigh( @@ -381,7 +381,7 @@ final case class ThermalHouse( tick, upperBoundaryTemperature, innerTemperature, - resultingQDot + resultingQDot, ).map(HouseTemperatureUpperBoundaryReached) } else { /* House is in perfect balance */ @@ -393,7 +393,7 @@ final case class ThermalHouse( tick: Long, higherTemperature: Temperature, lowerTemperature: Temperature, - qDot: Power + qDot: Power, ): Option[Long] = { val flexibleEnergy = energy(higherTemperature, lowerTemperature) if (flexibleEnergy < MegawattHours(0d)) @@ -437,7 +437,7 @@ object ThermalHouse { ), Kelvin( input.getUpperTemperatureLimit.to(Units.KELVIN).getValue.doubleValue - ) + ), ) /** State of a thermal house @@ -452,14 +452,14 @@ object ThermalHouse { final case class ThermalHouseState( tick: Long, innerTemperature: Temperature, - qDot: Power + qDot: Power, ) def startingState(house: ThermalHouse): ThermalHouseState = ThermalHouseState( -1L, house.targetTemperature, - Megawatts(0d) + Megawatts(0d), ) object ThermalHouseThreshold { diff --git a/src/main/scala/edu/ie3/simona/model/thermal/ThermalSink.scala b/src/main/scala/edu/ie3/simona/model/thermal/ThermalSink.scala index 9b46902d8f..97661b0201 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalSink.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalSink.scala @@ -30,5 +30,5 @@ abstract class ThermalSink( id: String, operatorInput: OperatorInput, operationTime: OperationTime, - bus: ThermalBusInput + bus: ThermalBusInput, ) diff --git a/src/main/scala/edu/ie3/simona/model/thermal/ThermalStorage.scala b/src/main/scala/edu/ie3/simona/model/thermal/ThermalStorage.scala index 33304c8974..03460fee5e 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalStorage.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalStorage.scala @@ -42,7 +42,7 @@ abstract class ThermalStorage( bus: ThermalBusInput, minEnergyThreshold: Energy, maxEnergyThreshold: Energy, - chargingPower: Power + chargingPower: Power, ) { protected val zeroEnergy: Energy = KilowattHours(0d) @@ -70,7 +70,7 @@ abstract class ThermalStorage( def updateState( tick: Long, qDot: Power, - lastState: ThermalStorageState + lastState: ThermalStorageState, ): (ThermalStorageState, Option[ThermalThreshold]) } @@ -78,7 +78,7 @@ object ThermalStorage { final case class ThermalStorageState( tick: Long, storedEnergy: Energy, - qDot: Power + qDot: Power, ) object ThermalStorageThreshold { diff --git a/src/main/scala/edu/ie3/simona/ontology/messages/PowerMessage.scala b/src/main/scala/edu/ie3/simona/ontology/messages/PowerMessage.scala index d82961cd5a..3d10fe3f5a 100644 --- a/src/main/scala/edu/ie3/simona/ontology/messages/PowerMessage.scala +++ b/src/main/scala/edu/ie3/simona/ontology/messages/PowerMessage.scala @@ -41,7 +41,7 @@ object PowerMessage { final case class RequestAssetPowerMessage( currentTick: Long, eInPu: Dimensionless, - fInPu: Dimensionless + fInPu: Dimensionless, ) extends PowerRequestMessage /** Provide power values as a reply to a [[RequestAssetPowerMessage]] @@ -53,7 +53,7 @@ object PowerMessage { */ final case class AssetPowerChangedMessage( override val p: Power, - override val q: ReactivePower + override val q: ReactivePower, ) extends ProvidePowerMessage /** Provide values as a reply to a [[RequestAssetPowerMessage]]. In contrast @@ -67,7 +67,7 @@ object PowerMessage { */ final case class AssetPowerUnchangedMessage( override val p: Power, - override val q: ReactivePower + override val q: ReactivePower, ) extends ProvidePowerMessage /** Request complex power at the nodes that the inferior sub grid shares with @@ -79,7 +79,7 @@ object PowerMessage { */ final case class RequestGridPowerMessage( currentSweepNo: Int, - nodeUuids: Seq[UUID] + nodeUuids: Seq[UUID], ) extends PowerRequestMessage /** Provide complex power at the nodes that the sender's sub grid shares with @@ -105,7 +105,7 @@ object PowerMessage { final case class ExchangePower( nodeUuid: UUID, override val p: Power, - override val q: ReactivePower + override val q: ReactivePower, ) extends ProvidePowerMessage } diff --git a/src/main/scala/edu/ie3/simona/ontology/messages/SchedulerMessage.scala b/src/main/scala/edu/ie3/simona/ontology/messages/SchedulerMessage.scala index 866cae63a8..02c1918fc1 100644 --- a/src/main/scala/edu/ie3/simona/ontology/messages/SchedulerMessage.scala +++ b/src/main/scala/edu/ie3/simona/ontology/messages/SchedulerMessage.scala @@ -15,13 +15,13 @@ trait SchedulerMessage extends Scheduler.Incoming with TimeAdvancer.Incoming object SchedulerMessage { final case class Completion( actor: ActorRef[Activation], - newTick: Option[Long] = None + newTick: Option[Long] = None, ) extends SchedulerMessage final case class ScheduleActivation( actor: ActorRef[Activation], tick: Long, - unlockKey: Option[ScheduleKey] = None + unlockKey: Option[ScheduleKey] = None, ) extends SchedulerMessage } diff --git a/src/main/scala/edu/ie3/simona/ontology/messages/VoltageMessage.scala b/src/main/scala/edu/ie3/simona/ontology/messages/VoltageMessage.scala index 3c836b599d..eea6675941 100644 --- a/src/main/scala/edu/ie3/simona/ontology/messages/VoltageMessage.scala +++ b/src/main/scala/edu/ie3/simona/ontology/messages/VoltageMessage.scala @@ -27,7 +27,7 @@ object VoltageMessage { */ final case class RequestSlackVoltageMessage( currentSweepNo: Int, - nodeUuids: Seq[UUID] + nodeUuids: Seq[UUID], ) extends VoltageMessage /** Provide complex voltage at the nodes that the sender's sub grid shares @@ -38,7 +38,7 @@ object VoltageMessage { */ final case class ProvideSlackVoltageMessage( currentSweepNo: Int, - nodalSlackVoltages: Seq[ExchangeVoltage] + nodalSlackVoltages: Seq[ExchangeVoltage], ) extends VoltageMessage object ProvideSlackVoltageMessage { @@ -55,7 +55,7 @@ object VoltageMessage { final case class ExchangeVoltage( nodeUuid: UUID, e: ElectricPotential, - f: ElectricPotential + f: ElectricPotential, ) } diff --git a/src/main/scala/edu/ie3/simona/ontology/messages/flex/FlexibilityMessage.scala b/src/main/scala/edu/ie3/simona/ontology/messages/flex/FlexibilityMessage.scala index 7a4706c3c4..f6994db75c 100644 --- a/src/main/scala/edu/ie3/simona/ontology/messages/flex/FlexibilityMessage.scala +++ b/src/main/scala/edu/ie3/simona/ontology/messages/flex/FlexibilityMessage.scala @@ -49,7 +49,7 @@ object FlexibilityMessage { final case class RegisterParticipant( override val modelUuid: UUID, participant: ActorRef[FlexRequest], - inputModel: AssetInput + inputModel: AssetInput, ) extends FlexResponse /** Message that schedules a flex request for a flex options provider at given @@ -66,7 +66,7 @@ object FlexibilityMessage { final case class ScheduleFlexRequest( override val modelUuid: UUID, tick: Long, - scheduleKey: Option[ScheduleKey] = None + scheduleKey: Option[ScheduleKey] = None, ) extends FlexResponse /** Message that requests flex options from a flex options provider for given @@ -101,7 +101,7 @@ object FlexibilityMessage { */ final case class IssuePowerControl( override val tick: Long, - setPower: Power + setPower: Power, ) extends IssueFlexControl /** Message sent by [[edu.ie3.simona.agent.em.EmAgent]] indicating that no @@ -137,7 +137,7 @@ object FlexibilityMessage { override val modelUuid: UUID, result: ApparentPower, requestAtNextActivation: Boolean = false, - requestAtTick: Option[Long] = None + requestAtTick: Option[Long] = None, ) extends FlexResponse } diff --git a/src/main/scala/edu/ie3/simona/ontology/messages/flex/MinMaxFlexibilityMessage.scala b/src/main/scala/edu/ie3/simona/ontology/messages/flex/MinMaxFlexibilityMessage.scala index 59fc3b0935..c814b14ef0 100644 --- a/src/main/scala/edu/ie3/simona/ontology/messages/flex/MinMaxFlexibilityMessage.scala +++ b/src/main/scala/edu/ie3/simona/ontology/messages/flex/MinMaxFlexibilityMessage.scala @@ -38,7 +38,7 @@ object MinMaxFlexibilityMessage { override val modelUuid: UUID, ref: Power, min: Power, - max: Power + max: Power, ) extends ProvideFlexOptions { /** Checks whether given power fits within the min-max interval and thus @@ -76,7 +76,7 @@ object MinMaxFlexibilityMessage { modelUuid: UUID, ref: Power, min: Power, - max: Power + max: Power, ): ProvideMinMaxFlexOptions = { if (min > ref) throw new CriticalFailureException( @@ -103,7 +103,7 @@ object MinMaxFlexibilityMessage { */ def noFlexOption( modelUuid: UUID, - power: Power + power: Power, ): ProvideMinMaxFlexOptions = ProvideMinMaxFlexOptions(modelUuid, power, power, power) } diff --git a/src/main/scala/edu/ie3/simona/ontology/messages/services/EvMessage.scala b/src/main/scala/edu/ie3/simona/ontology/messages/services/EvMessage.scala index 404cf9e8aa..05a5be6886 100644 --- a/src/main/scala/edu/ie3/simona/ontology/messages/services/EvMessage.scala +++ b/src/main/scala/edu/ie3/simona/ontology/messages/services/EvMessage.scala @@ -10,7 +10,7 @@ import edu.ie3.simona.agent.participant.data.Data.SecondaryData import edu.ie3.simona.model.participant.evcs.EvModelWrapper import edu.ie3.simona.ontology.messages.services.ServiceMessage.{ ProvisionMessage, - ServiceRegistrationMessage + ServiceRegistrationMessage, } import edu.ie3.simona.scheduler.ScheduleLock.ScheduleKey import org.apache.pekko.actor.ActorRef @@ -49,7 +49,7 @@ object EvMessage { override val serviceRef: ActorRef, override val data: EvData, override val nextDataTick: Option[Long] = None, - override val unlockKey: Option[ScheduleKey] = None + override val unlockKey: Option[ScheduleKey] = None, ) extends EvMessage with ProvisionMessage[EvData] @@ -82,12 +82,12 @@ object EvMessage { final case class FreeLotsResponse( evcs: UUID, - freeLots: Int + freeLots: Int, ) extends EvResponseMessage final case class DepartingEvsResponse( evcs: UUID, - evModels: Seq[EvModelWrapper] + evModels: Seq[EvModelWrapper], ) extends EvResponseMessage } diff --git a/src/main/scala/edu/ie3/simona/ontology/messages/services/PrimaryDataMessage.scala b/src/main/scala/edu/ie3/simona/ontology/messages/services/PrimaryDataMessage.scala index 6bd8f79b72..73aa482b64 100644 --- a/src/main/scala/edu/ie3/simona/ontology/messages/services/PrimaryDataMessage.scala +++ b/src/main/scala/edu/ie3/simona/ontology/messages/services/PrimaryDataMessage.scala @@ -30,7 +30,7 @@ object PrimaryDataMessage { override val serviceRef: ActorRef, override val data: ApparentPower, override val nextDataTick: Option[Long], - override val unlockKey: Option[ScheduleKey] = None + override val unlockKey: Option[ScheduleKey] = None, ) extends ProvisionMessage[ApparentPower] with PrimaryDataMessage } diff --git a/src/main/scala/edu/ie3/simona/ontology/messages/services/ServiceMessage.scala b/src/main/scala/edu/ie3/simona/ontology/messages/services/ServiceMessage.scala index 3f061c201c..33946b669f 100644 --- a/src/main/scala/edu/ie3/simona/ontology/messages/services/ServiceMessage.scala +++ b/src/main/scala/edu/ie3/simona/ontology/messages/services/ServiceMessage.scala @@ -51,7 +51,7 @@ case object ServiceMessage { */ final case class RegistrationSuccessfulMessage( override val serviceRef: ActorRef, - nextDataTick: Option[Long] + nextDataTick: Option[Long], ) extends RegistrationResponseMessage /** Message, that is used to announce a failed registration @@ -62,7 +62,7 @@ case object ServiceMessage { final case class ScheduleServiceActivation( tick: Long, - unlockKey: ScheduleKey + unlockKey: ScheduleKey, ) } diff --git a/src/main/scala/edu/ie3/simona/ontology/messages/services/WeatherMessage.scala b/src/main/scala/edu/ie3/simona/ontology/messages/services/WeatherMessage.scala index 1af4f8ae43..9d17284d63 100644 --- a/src/main/scala/edu/ie3/simona/ontology/messages/services/WeatherMessage.scala +++ b/src/main/scala/edu/ie3/simona/ontology/messages/services/WeatherMessage.scala @@ -9,7 +9,7 @@ package edu.ie3.simona.ontology.messages.services import edu.ie3.simona.agent.participant.data.Data.SecondaryData import edu.ie3.simona.ontology.messages.services.ServiceMessage.{ ProvisionMessage, - ServiceRegistrationMessage + ServiceRegistrationMessage, } import edu.ie3.simona.scheduler.ScheduleLock.ScheduleKey import edu.ie3.util.scala.quantities.Irradiance @@ -36,7 +36,7 @@ object WeatherMessage { */ final case class RegisterForWeatherMessage( latitude: Double, - longitude: Double + longitude: Double, ) extends WeatherMessage with ServiceRegistrationMessage @@ -54,7 +54,7 @@ object WeatherMessage { override val serviceRef: ActorRef, override val data: WeatherData, override val nextDataTick: Option[Long], - override val unlockKey: Option[ScheduleKey] = None + override val unlockKey: Option[ScheduleKey] = None, ) extends WeatherMessage with ProvisionMessage[WeatherData] @@ -74,7 +74,7 @@ object WeatherMessage { diffIrr: Irradiance, dirIrr: Irradiance, temp: Temperature, - windVel: Velocity + windVel: Velocity, ) extends SecondaryData } diff --git a/src/main/scala/edu/ie3/simona/scheduler/RuntimeNotifier.scala b/src/main/scala/edu/ie3/simona/scheduler/RuntimeNotifier.scala index 4e11d597e2..844021c530 100644 --- a/src/main/scala/edu/ie3/simona/scheduler/RuntimeNotifier.scala +++ b/src/main/scala/edu/ie3/simona/scheduler/RuntimeNotifier.scala @@ -36,7 +36,7 @@ final case class RuntimeNotifier( private val lastCheck: Option[Long] = None, private val simStartTime: Option[Long] = None, private val lastStartTime: Option[Long] = None, - private val lastCheckWindowTime: Option[Long] = None + private val lastCheckWindowTime: Option[Long] = None, ) { /** Notifier listeners that simulation has started or continued with given @@ -53,7 +53,7 @@ final case class RuntimeNotifier( def starting( tick: Long, pauseTick: Option[Long], - endTick: Long + endTick: Long, ): RuntimeNotifier = { val nowTime = now() @@ -72,7 +72,7 @@ final case class RuntimeNotifier( copy( simStartTime = Some(nowTime), lastStartTime = Some(nowTime), - lastCheckWindowTime = Some(nowTime) + lastCheckWindowTime = Some(nowTime), ) } @@ -119,7 +119,7 @@ final case class RuntimeNotifier( .map { lastPassedCheck => copy( lastCheck = Some(lastPassedCheck), - lastCheckWindowTime = Some(nowTime) + lastCheckWindowTime = Some(nowTime), ) } } @@ -139,7 +139,7 @@ final case class RuntimeNotifier( Done( endTick, duration(simStartTime), - errorInSim = false + errorInSim = false, ) ) } @@ -160,7 +160,7 @@ final case class RuntimeNotifier( Done( endTick, duration(simStartTime), - errorInSim = true + errorInSim = true, ) ) } @@ -185,7 +185,7 @@ object RuntimeNotifier { */ private def duration( intervalStart: Option[Long], - intervalEnd: Long = now() + intervalEnd: Long = now(), ): Long = intervalStart.map(intervalEnd - _).getOrElse(0) diff --git a/src/main/scala/edu/ie3/simona/scheduler/ScheduleLock.scala b/src/main/scala/edu/ie3/simona/scheduler/ScheduleLock.scala index e9ca91c0d1..803d223987 100644 --- a/src/main/scala/edu/ie3/simona/scheduler/ScheduleLock.scala +++ b/src/main/scala/edu/ie3/simona/scheduler/ScheduleLock.scala @@ -11,7 +11,7 @@ import org.apache.pekko.actor.typed.scaladsl.{ActorContext, Behaviors} import org.apache.pekko.actor.typed.{ActorRef, Behavior, Scheduler} import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.{Activation, SchedulerMessage} @@ -38,7 +38,7 @@ object ScheduleLock { private def lockAdapter( lock: ActorRef[LockMsg], - expectedTick: Long + expectedTick: Long, ): Behavior[Activation] = Behaviors.receive { case (ctx, Activation(tick)) => if (tick == expectedTick) @@ -95,7 +95,7 @@ object ScheduleLock { def singleKey( ctx: ActorContext[_], scheduler: ActorRef[SchedulerMessage], - tick: Long + tick: Long, ): ScheduleKey = singleKey(TypedSpawner(ctx), scheduler, tick) @@ -114,7 +114,7 @@ object ScheduleLock { def singleKey( ctx: org.apache.pekko.actor.ActorContext, scheduler: ActorRef[SchedulerMessage], - tick: Long + tick: Long, ): ScheduleKey = singleKey(ClassicSpawner(ctx), scheduler, tick) @@ -133,7 +133,7 @@ object ScheduleLock { def singleKey( spawner: Spawner, scheduler: ActorRef[SchedulerMessage], - tick: Long + tick: Long, ): ScheduleKey = multiKey(spawner, scheduler, tick, 1).headOption.getOrElse( throw new RuntimeException("Should not happen") @@ -157,7 +157,7 @@ object ScheduleLock { ctx: ActorContext[_], scheduler: ActorRef[SchedulerMessage], tick: Long, - count: Int + count: Int, ): Iterable[ScheduleKey] = multiKey(TypedSpawner(ctx), scheduler, tick, count) @@ -179,7 +179,7 @@ object ScheduleLock { ctx: org.apache.pekko.actor.ActorContext, scheduler: ActorRef[SchedulerMessage], tick: Long, - count: Int + count: Int, ): Iterable[ScheduleKey] = multiKey(ClassicSpawner(ctx), scheduler, tick, count) @@ -201,7 +201,7 @@ object ScheduleLock { spawner: Spawner, scheduler: ActorRef[SchedulerMessage], tick: Long, - count: Int + count: Int, ): Iterable[ScheduleKey] = { val keys = (1 to count).map(_ => UUID.randomUUID()) @@ -227,7 +227,7 @@ object ScheduleLock { */ private def apply( scheduler: ActorRef[SchedulerMessage], - awaitedKeys: Set[UUID] + awaitedKeys: Set[UUID], ): Behavior[LockMsg] = Behaviors.withStash(100) { buffer => Behaviors.receiveMessage { @@ -244,7 +244,7 @@ object ScheduleLock { private def uninitialized( scheduler: ActorRef[SchedulerMessage], awaitedKeys: Set[UUID], - adapter: ActorRef[Activation] + adapter: ActorRef[Activation], ): Behavior[LockMsg] = Behaviors.withStash(100) { buffer => Behaviors.receiveMessage { @@ -261,7 +261,7 @@ object ScheduleLock { private def active( scheduler: ActorRef[SchedulerMessage], awaitedKeys: Set[UUID], - adapter: ActorRef[Activation] + adapter: ActorRef[Activation], ): Behavior[LockMsg] = Behaviors.receiveMessage { case Unlock(key) => val updatedKeys = awaitedKeys - key diff --git a/src/main/scala/edu/ie3/simona/scheduler/Scheduler.scala b/src/main/scala/edu/ie3/simona/scheduler/Scheduler.scala index bac0df01ae..1c5f37ad2f 100644 --- a/src/main/scala/edu/ie3/simona/scheduler/Scheduler.scala +++ b/src/main/scala/edu/ie3/simona/scheduler/Scheduler.scala @@ -11,13 +11,13 @@ import org.apache.pekko.actor.typed.{ActorRef, Behavior} import edu.ie3.simona.actor.ActorUtil.stopOnError import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.{Activation, SchedulerMessage} import edu.ie3.simona.scheduler.core.Core.{ ActiveCore, CoreFactory, - InactiveCore + InactiveCore, } import edu.ie3.simona.scheduler.core.RegularSchedulerCore @@ -42,20 +42,20 @@ object Scheduler { */ def apply( parent: ActorRef[SchedulerMessage], - coreFactory: CoreFactory = RegularSchedulerCore + coreFactory: CoreFactory = RegularSchedulerCore, ): Behavior[Incoming] = Behaviors.setup { ctx => val adapter = ctx.messageAdapter[Activation](msg => WrappedActivation(msg)) inactive( SchedulerData(parent, adapter), - coreFactory.create() + coreFactory.create(), ) } private def inactive( data: SchedulerData, - core: InactiveCore + core: InactiveCore, ): Behavior[Incoming] = Behaviors.receive { case (ctx, WrappedActivation(Activation(tick))) => @@ -71,7 +71,7 @@ object Scheduler { case ( ctx, - ScheduleActivation(actor, newTick, unlockKey) + ScheduleActivation(actor, newTick, unlockKey), ) => if (core.checkSchedule(newTick)) { val (maybeSchedule, newCore) = core.handleSchedule(actor, newTick) @@ -84,7 +84,7 @@ object Scheduler { data.parent ! ScheduleActivation( data.activationAdapter, scheduleTick, - unlockKey + unlockKey, ) case None => // we don't need to escalate to the parent, this means that we can release the lock (if applicable) @@ -100,18 +100,18 @@ object Scheduler { case (ctx, unexpected) => stopOnError( ctx, - s"Received unexpected message $unexpected when inactive" + s"Received unexpected message $unexpected when inactive", ) } private def active( data: SchedulerData, - core: ActiveCore + core: ActiveCore, ): Behavior[Incoming] = Behaviors.receive { case ( ctx, - ScheduleActivation(actor, newTick, unlockKey) + ScheduleActivation(actor, newTick, unlockKey), ) => if (core.checkSchedule(actor, newTick)) { val (toActivate, newCore) = @@ -138,7 +138,7 @@ object Scheduler { .cond( core.checkCompletion(actor), core.handleCompletion(actor), - s"Actor $actor is not part of the expected completing actors" + s"Actor $actor is not part of the expected completing actors", ) .flatMap { newCore => // if successful @@ -148,7 +148,7 @@ object Scheduler { .cond( newCore.checkSchedule(actor, newTick), newCore.handleSchedule(actor, newTick), - s"Cannot schedule an event at tick $newTick for completing actor $actor" + s"Cannot schedule an event at tick $newTick for completing actor $actor", ) } .getOrElse(Right(newCore)) @@ -167,7 +167,7 @@ object Scheduler { .map { case (maybeScheduleTick, inactiveCore) => data.parent ! Completion( data.activationAdapter, - maybeScheduleTick + maybeScheduleTick, ) inactive(data, inactiveCore) } @@ -177,7 +177,7 @@ object Scheduler { } .fold( stopOnError(ctx, _), - identity + identity, ) case (ctx, unexpected) => @@ -194,6 +194,6 @@ object Scheduler { parent: ActorRef[ SchedulerMessage ], - activationAdapter: ActorRef[Activation] + activationAdapter: ActorRef[Activation], ) } diff --git a/src/main/scala/edu/ie3/simona/scheduler/TimeAdvancer.scala b/src/main/scala/edu/ie3/simona/scheduler/TimeAdvancer.scala index 5931cbb08a..63aac6d223 100644 --- a/src/main/scala/edu/ie3/simona/scheduler/TimeAdvancer.scala +++ b/src/main/scala/edu/ie3/simona/scheduler/TimeAdvancer.scala @@ -13,7 +13,7 @@ import edu.ie3.simona.event.RuntimeEvent import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.sim.SimMessage.{SimulationFailure, SimulationSuccessful} import edu.ie3.simona.util.SimonaConstants.INIT_SIM_TICK @@ -56,14 +56,14 @@ object TimeAdvancer { simulation: org.apache.pekko.actor.ActorRef, eventListener: Option[ActorRef[RuntimeEvent]], checkWindow: Option[Int], - endTick: Long + endTick: Long, ): Behavior[Incoming] = Behaviors.receivePartial { case (_, ScheduleActivation(actor, tick, _)) => inactive( TimeAdvancerData(simulation, actor, endTick), eventListener.map(RuntimeNotifier(_, checkWindow)), tick, - tick + tick, ) case (ctx, Stop(errorMsg: String)) => @@ -86,14 +86,14 @@ object TimeAdvancer { data: TimeAdvancerData, notifier: Option[RuntimeNotifier], startingTick: Long, - nextActiveTick: Long + nextActiveTick: Long, ): Behavior[Incoming] = Behaviors.receivePartial { case (_, StartSimMessage(pauseTick)) => val updatedNotifier = notifier.map { _.starting( startingTick, pauseTick, - data.endTick + data.endTick, ) } @@ -103,7 +103,7 @@ object TimeAdvancer { data, updatedNotifier, nextActiveTick, - pauseTick + pauseTick, ) case (ctx, Stop(errorMsg: String)) => @@ -126,7 +126,7 @@ object TimeAdvancer { data: TimeAdvancerData, notifier: Option[RuntimeNotifier], activeTick: Long, - pauseTick: Option[Long] + pauseTick: Option[Long], ): Behavior[Incoming] = Behaviors.receivePartial { case (ctx, Completion(_, maybeNewTick)) => checkCompletion(activeTick, maybeNewTick) @@ -152,7 +152,7 @@ object TimeAdvancer { data, updatedNotifier, pauseTick + 1, - newTick + newTick, ) case (Some(newTick), _) => @@ -165,7 +165,7 @@ object TimeAdvancer { notifierCompleted.starting( newTick, pauseTick, - data.endTick + data.endTick, ) else notifierCompleted @@ -177,7 +177,7 @@ object TimeAdvancer { data, updatedNotifier, newTick, - pauseTick + pauseTick, ) case (None, _) => @@ -195,7 +195,7 @@ object TimeAdvancer { private def endSuccessfully( data: TimeAdvancerData, - notifier: Option[RuntimeNotifier] + notifier: Option[RuntimeNotifier], ): Behavior[Incoming] = { data.simulation ! SimulationSuccessful @@ -214,7 +214,7 @@ object TimeAdvancer { simulation: org.apache.pekko.actor.ActorRef, notifier: Option[RuntimeNotifier], tick: Long, - errorMsg: String + errorMsg: String, ): Behavior[Incoming] = { simulation ! SimulationFailure notifier.foreach(_.error(tick, errorMsg)) @@ -224,7 +224,7 @@ object TimeAdvancer { private def checkCompletion( activeTick: Long, - maybeNewTick: Option[Long] + maybeNewTick: Option[Long], ): Option[String] = maybeNewTick.filter(_ <= activeTick).map { newTick => s"The next trigger has tick $newTick, although current active tick was $activeTick." @@ -243,6 +243,6 @@ object TimeAdvancer { private final case class TimeAdvancerData( simulation: org.apache.pekko.actor.ActorRef, schedulee: ActorRef[Activation], - endTick: Long + endTick: Long, ) } diff --git a/src/main/scala/edu/ie3/simona/scheduler/core/Core.scala b/src/main/scala/edu/ie3/simona/scheduler/core/Core.scala index 7fa9220bb5..2735d7f0f4 100644 --- a/src/main/scala/edu/ie3/simona/scheduler/core/Core.scala +++ b/src/main/scala/edu/ie3/simona/scheduler/core/Core.scala @@ -76,7 +76,7 @@ object Core { */ def handleSchedule( actor: Actor, - newTick: Long + newTick: Long, ): (Option[Long], InactiveCore) } diff --git a/src/main/scala/edu/ie3/simona/scheduler/core/PhaseSwitchCore.scala b/src/main/scala/edu/ie3/simona/scheduler/core/PhaseSwitchCore.scala index c6384db107..a1a9ab08e2 100644 --- a/src/main/scala/edu/ie3/simona/scheduler/core/PhaseSwitchCore.scala +++ b/src/main/scala/edu/ie3/simona/scheduler/core/PhaseSwitchCore.scala @@ -10,7 +10,7 @@ import edu.ie3.simona.scheduler.core.Core.{ ActiveCore, Actor, CoreFactory, - InactiveCore + InactiveCore, } import edu.ie3.util.scala.collection.immutable.PrioritySwitchBiSet @@ -32,7 +32,7 @@ object PhaseSwitchCore extends CoreFactory { final case class PhaseSwitchInactive private ( private val activationQueue: PrioritySwitchBiSet[Long, Actor], - private val lastActiveTick: Option[Long] + private val lastActiveTick: Option[Long], ) extends InactiveCore { override def checkActivation(newTick: Long): Boolean = activationQueue.headKeyOption.contains(newTick) @@ -49,7 +49,7 @@ object PhaseSwitchCore extends CoreFactory { override def handleSchedule( actor: Actor, - newTick: Long + newTick: Long, ): (Option[Long], InactiveCore) = { val oldEarliestTick = activationQueue.headKeyOption @@ -68,7 +68,7 @@ object PhaseSwitchCore extends CoreFactory { private val activationQueue: PrioritySwitchBiSet[Long, Actor], activeTick: Long, private val phase: Int = 0, - private val activeActors: Set[Actor] = Set.empty + private val activeActors: Set[Actor] = Set.empty, ) extends ActiveCore { override def checkCompletion(actor: Actor): Boolean = @@ -85,7 +85,7 @@ object PhaseSwitchCore extends CoreFactory { ) { ( activationQueue.headKeyOption, - PhaseSwitchInactive(activationQueue, Some(activeTick)) + PhaseSwitchInactive(activationQueue, Some(activeTick)), ) } } @@ -123,8 +123,8 @@ object PhaseSwitchCore extends CoreFactory { copy( activationQueue = updatedQueue, phase = newPhase, - activeActors = activeActors.incl(actor) - ) + activeActors = activeActors.incl(actor), + ), ) } .getOrElse((Iterable.empty, this)) diff --git a/src/main/scala/edu/ie3/simona/scheduler/core/RegularSchedulerCore.scala b/src/main/scala/edu/ie3/simona/scheduler/core/RegularSchedulerCore.scala index cdc81cfdff..b7e96b3c6c 100644 --- a/src/main/scala/edu/ie3/simona/scheduler/core/RegularSchedulerCore.scala +++ b/src/main/scala/edu/ie3/simona/scheduler/core/RegularSchedulerCore.scala @@ -10,7 +10,7 @@ import edu.ie3.simona.scheduler.core.Core.{ ActiveCore, Actor, CoreFactory, - InactiveCore + InactiveCore, } import edu.ie3.util.scala.collection.mutable.PriorityMultiBiSet @@ -24,7 +24,7 @@ object RegularSchedulerCore extends CoreFactory { final case class SchedulerInactive private ( private val activationQueue: PriorityMultiBiSet[Long, Actor], - private val lastActiveTick: Option[Long] + private val lastActiveTick: Option[Long], ) extends InactiveCore { override def checkActivation(newTick: Long): Boolean = activationQueue.headKeyOption.contains(newTick) @@ -41,7 +41,7 @@ object RegularSchedulerCore extends CoreFactory { override def handleSchedule( actor: Actor, - newTick: Long + newTick: Long, ): (Option[Long], InactiveCore) = { val oldEarliestTick = activationQueue.headKeyOption @@ -59,7 +59,7 @@ object RegularSchedulerCore extends CoreFactory { private final case class SchedulerActive( private val activationQueue: PriorityMultiBiSet[Long, Actor], private val activeActors: Set[Actor] = Set.empty, - activeTick: Long + activeTick: Long, ) extends ActiveCore { override def checkCompletion(actor: Actor): Boolean = activeActors.contains(actor) @@ -74,7 +74,7 @@ object RegularSchedulerCore extends CoreFactory { ) { ( activationQueue.headKeyOption, - SchedulerInactive(activationQueue, Some(activeTick)) + SchedulerInactive(activationQueue, Some(activeTick)), ) } diff --git a/src/main/scala/edu/ie3/simona/service/SimonaService.scala b/src/main/scala/edu/ie3/simona/service/SimonaService.scala index 89d60e57c4..1b41b30400 100644 --- a/src/main/scala/edu/ie3/simona/service/SimonaService.scala +++ b/src/main/scala/edu/ie3/simona/service/SimonaService.scala @@ -12,14 +12,14 @@ import edu.ie3.simona.logging.SimonaActorLogging import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResponseMessage.ScheduleServiceActivation import edu.ie3.simona.ontology.messages.services.ServiceMessage.ServiceRegistrationMessage import edu.ie3.simona.scheduler.ScheduleLock.ScheduleKey import edu.ie3.simona.service.ServiceStateData.{ InitializeServiceStateData, - ServiceBaseStateData + ServiceBaseStateData, } import edu.ie3.simona.service.SimonaService.Create import edu.ie3.simona.util.SimonaConstants.INIT_SIM_TICK @@ -35,7 +35,7 @@ object SimonaService { */ final case class Create[+I <: InitializeServiceStateData]( initializeStateData: I, - unlockKey: ScheduleKey + unlockKey: ScheduleKey, ) } @@ -66,12 +66,12 @@ abstract class SimonaService[ case Create( initializeStateData: InitializeServiceStateData, - unlockKey: ScheduleKey + unlockKey: ScheduleKey, ) => scheduler ! ScheduleActivation( self.toTyped, INIT_SIM_TICK, - Some(unlockKey) + Some(unlockKey), ) context become initializing(initializeStateData) @@ -103,7 +103,7 @@ abstract class SimonaService[ s"\nReceivedData: {}" + s"\nException: {}", initializeStateData, - exception + exception, ) throw exception // if a service fails startup we don't want to go on with the simulation } @@ -142,7 +142,7 @@ abstract class SimonaService[ "\nMsg: {}" + "\nException: {}", registrationMsg, - exception + exception, ) unhandled(registrationMsg) } @@ -151,7 +151,7 @@ abstract class SimonaService[ scheduler ! ScheduleActivation( self.toTyped, tick, - Some(unlockKey) + Some(unlockKey), ) // activity start trigger for this service @@ -226,7 +226,7 @@ abstract class SimonaService[ */ protected def announceInformation(tick: Long)(implicit serviceStateData: S, - ctx: ActorContext + ctx: ActorContext, ): (S, Option[Long]) } diff --git a/src/main/scala/edu/ie3/simona/service/ev/ExtEvDataService.scala b/src/main/scala/edu/ie3/simona/service/ev/ExtEvDataService.scala index 2ccb45197a..c827cb52fb 100644 --- a/src/main/scala/edu/ie3/simona/service/ev/ExtEvDataService.scala +++ b/src/main/scala/edu/ie3/simona/service/ev/ExtEvDataService.scala @@ -21,11 +21,11 @@ import edu.ie3.simona.ontology.messages.services.ServiceMessage.ServiceRegistrat import edu.ie3.simona.scheduler.ScheduleLock import edu.ie3.simona.service.ServiceStateData.{ InitializeServiceStateData, - ServiceBaseStateData + ServiceBaseStateData, } import edu.ie3.simona.service.ev.ExtEvDataService.{ ExtEvStateData, - InitExtEvData + InitExtEvData, } import edu.ie3.simona.service.{ExtDataSupport, ServiceStateData, SimonaService} import edu.ie3.simona.util.ReceiveDataMap @@ -47,7 +47,7 @@ object ExtEvDataService { extEvMessage: Option[EvDataMessageFromExt] = None, freeLots: ReceiveDataMap[UUID, Int] = ReceiveDataMap.empty, departingEvResponses: ReceiveDataMap[UUID, Seq[EvModelWrapper]] = - ReceiveDataMap.empty + ReceiveDataMap.empty, ) extends ServiceBaseStateData final case class InitExtEvData( @@ -65,7 +65,7 @@ class ExtEvDataService(override val scheduler: ActorRef) ): Try[ ( ExtEvStateData, - Option[Long] + Option[Long], ) ] = initServiceData match { @@ -76,7 +76,7 @@ class ExtEvDataService(override val scheduler: ActorRef) Success( evInitializedStateData, - None + None, ) case invalidData => @@ -129,14 +129,14 @@ class ExtEvDataService(override val scheduler: ActorRef) */ private def handleRegistrationRequest( agentToBeRegistered: ActorRef, - evcs: UUID + evcs: UUID, )(implicit serviceStateData: ExtEvStateData ): ExtEvStateData = { log.debug( "Received ev movement service registration from {} for [Evcs:{}]", agentToBeRegistered.path.name, - evcs + evcs, ) serviceStateData.uuidToActorRef.get(evcs) match { @@ -152,7 +152,7 @@ class ExtEvDataService(override val scheduler: ActorRef) // actor is already registered, do nothing log.warning( "Sending actor {} is already registered", - agentToBeRegistered + agentToBeRegistered, ) serviceStateData } @@ -173,7 +173,7 @@ class ExtEvDataService(override val scheduler: ActorRef) tick: Long )(implicit serviceStateData: ExtEvStateData, ctx: ActorContext): ( ExtEvStateData, - Option[Long] + Option[Long], ) = { serviceStateData.extEvMessage.getOrElse( throw ServiceException( @@ -187,7 +187,7 @@ class ExtEvDataService(override val scheduler: ActorRef) case arrivingEvsProvision: ProvideArrivingEvs => handleArrivingEvs(tick, arrivingEvsProvision.arrivals)( serviceStateData, - ctx + ctx, ) } } @@ -211,15 +211,15 @@ class ExtEvDataService(override val scheduler: ActorRef) ( serviceStateData.copy( extEvMessage = None, - freeLots = ReceiveDataMap(freeLots) + freeLots = ReceiveDataMap(freeLots), ), - None + None, ) } private def requestDepartingEvs( tick: Long, - requestedDepartingEvs: java.util.Map[UUID, java.util.List[UUID]] + requestedDepartingEvs: java.util.Map[UUID, java.util.List[UUID]], )(implicit serviceStateData: ExtEvStateData ): (ExtEvStateData, Option[Long]) = { @@ -235,7 +235,7 @@ class ExtEvDataService(override val scheduler: ActorRef) case None => log.warning( "A corresponding actor ref for UUID {} could not be found", - evcs + evcs, ) None @@ -250,18 +250,18 @@ class ExtEvDataService(override val scheduler: ActorRef) ( serviceStateData.copy( extEvMessage = None, - departingEvResponses = ReceiveDataMap(departingEvResponses.toSet) + departingEvResponses = ReceiveDataMap(departingEvResponses.toSet), ), - None + None, ) } private def handleArrivingEvs( tick: Long, - allArrivingEvs: java.util.Map[UUID, java.util.List[EvModel]] + allArrivingEvs: java.util.Map[UUID, java.util.List[EvModel]], )(implicit serviceStateData: ExtEvStateData, - ctx: ActorContext + ctx: ActorContext, ): (ExtEvStateData, Option[Long]) = { val actorToEvs = allArrivingEvs.asScala.flatMap { case (evcs, arrivingEvs) => @@ -271,7 +271,7 @@ class ExtEvDataService(override val scheduler: ActorRef) .orElse { log.warning( "A corresponding actor ref for UUID {} could not be found", - evcs + evcs, ) None } @@ -286,7 +286,7 @@ class ExtEvDataService(override val scheduler: ActorRef) tick, self, ArrivingEvsData(arrivingEvs), - unlockKey = Some(key) + unlockKey = Some(key), ) } @@ -296,7 +296,7 @@ class ExtEvDataService(override val scheduler: ActorRef) serviceStateData.copy( extEvMessage = None ), - None + None, ) } diff --git a/src/main/scala/edu/ie3/simona/service/primary/PrimaryServiceProxy.scala b/src/main/scala/edu/ie3/simona/service/primary/PrimaryServiceProxy.scala index 23e28146b1..688ea5c5c3 100644 --- a/src/main/scala/edu/ie3/simona/service/primary/PrimaryServiceProxy.scala +++ b/src/main/scala/edu/ie3/simona/service/primary/PrimaryServiceProxy.scala @@ -14,19 +14,19 @@ import edu.ie3.datamodel.io.naming.timeseries.IndividualTimeSeriesMetaInformatio import edu.ie3.datamodel.io.naming.{ DatabaseNamingStrategy, EntityPersistenceNamingStrategy, - FileNamingStrategy + FileNamingStrategy, } import edu.ie3.datamodel.io.source.csv.{ CsvTimeSeriesMappingSource, - CsvTimeSeriesMetaInformationSource + CsvTimeSeriesMetaInformationSource, } import edu.ie3.datamodel.io.source.sql.{ SqlTimeSeriesMappingSource, - SqlTimeSeriesMetaInformationSource + SqlTimeSeriesMetaInformationSource, } import edu.ie3.datamodel.io.source.{ TimeSeriesMappingSource, - TimeSeriesMetaInformationSource + TimeSeriesMetaInformationSource, } import edu.ie3.datamodel.models.value.Value import edu.ie3.simona.config.SimonaConfig.PrimaryDataCsvParams @@ -36,7 +36,7 @@ import edu.ie3.simona.config.SimonaConfig.Simona.Input.{ } import edu.ie3.simona.exceptions.{ InitializationException, - InvalidConfigParameterException + InvalidConfigParameterException, } import edu.ie3.simona.logging.SimonaActorLogging import edu.ie3.simona.ontology.messages.Activation @@ -44,7 +44,7 @@ import edu.ie3.simona.ontology.messages.SchedulerMessage.Completion import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResponseMessage.RegistrationFailedMessage import edu.ie3.simona.ontology.messages.services.ServiceMessage.{ PrimaryServiceRegistrationMessage, - WorkerRegistrationMessage + WorkerRegistrationMessage, } import edu.ie3.simona.scheduler.ScheduleLock import edu.ie3.simona.service.{ServiceStateData, SimonaService} @@ -52,12 +52,12 @@ import edu.ie3.simona.service.ServiceStateData.InitializeServiceStateData import edu.ie3.simona.service.primary.PrimaryServiceProxy.{ InitPrimaryServiceProxyStateData, PrimaryServiceStateData, - SourceRef + SourceRef, } import edu.ie3.simona.service.primary.PrimaryServiceWorker.{ CsvInitPrimaryServiceStateData, InitPrimaryServiceStateData, - SqlInitPrimaryServiceStateData + SqlInitPrimaryServiceStateData, } import edu.ie3.simona.util.SimonaConstants.INIT_SIM_TICK @@ -84,7 +84,7 @@ import scala.util.{Failure, Success, Try} case class PrimaryServiceProxy( scheduler: ActorRef, initStateData: InitPrimaryServiceProxyStateData, - private implicit val startDateTime: ZonedDateTime + private implicit val startDateTime: ZonedDateTime, ) extends Actor with SimonaActorLogging { @@ -106,7 +106,7 @@ case class PrimaryServiceProxy( * messages */ prepareStateData( initStateData.primaryConfig, - initStateData.simulationStart + initStateData.simulationStart, ) match { case Success(stateData) => scheduler ! Completion(self.toTyped) @@ -114,7 +114,7 @@ case class PrimaryServiceProxy( case Failure(exception) => log.error( exception, - s"Unable to initialize the $actorName. Shut it down." + s"Unable to initialize the $actorName. Shut it down.", ) self ! PoisonPill } @@ -138,7 +138,7 @@ case class PrimaryServiceProxy( */ private def prepareStateData( primaryConfig: PrimaryConfig, - simulationStart: ZonedDateTime + simulationStart: ZonedDateTime, ): Try[PrimaryServiceStateData] = { createSources(primaryConfig).map { case (mappingSource, metaInformationSource) => @@ -161,7 +161,7 @@ case class PrimaryServiceProxy( case None => log.warning( "Unable to acquire meta information for time series '{}'. Leave that out.", - timeSeriesUuid + timeSeriesUuid, ) None } @@ -172,7 +172,7 @@ case class PrimaryServiceProxy( timeSeriesToSourceRef, simulationStart, primaryConfig, - mappingSource + mappingSource, ) } } @@ -184,7 +184,7 @@ case class PrimaryServiceProxy( primaryConfig.sqlParams, primaryConfig.influxDb1xParams, primaryConfig.csvParams, - primaryConfig.couchbaseParams + primaryConfig.couchbaseParams, ).filter(_.isDefined).flatten.headOption match { case Some(PrimaryDataCsvParams(csvSep, directoryPath, _, _)) => val fileNamingStrategy = new FileNamingStrategy() @@ -192,31 +192,31 @@ case class PrimaryServiceProxy( new CsvTimeSeriesMappingSource( csvSep, Paths.get(directoryPath), - fileNamingStrategy + fileNamingStrategy, ), new CsvTimeSeriesMetaInformationSource( csvSep, Paths.get(directoryPath), - fileNamingStrategy - ) + fileNamingStrategy, + ), ) case Some(sqlParams: SqlParams) => val sqlConnector = new SqlConnector( sqlParams.jdbcUrl, sqlParams.userName, - sqlParams.password + sqlParams.password, ) Success( new SqlTimeSeriesMappingSource( sqlConnector, sqlParams.schemaName, - new EntityPersistenceNamingStrategy() + new EntityPersistenceNamingStrategy(), ), new SqlTimeSeriesMetaInformationSource( sqlConnector, sqlParams.schemaName, - new DatabaseNamingStrategy() - ) + new DatabaseNamingStrategy(), + ), ) case Some(x) => Failure( @@ -253,12 +253,12 @@ case class PrimaryServiceProxy( modelUuid, timeSeriesUuid, stateData, - sender() + sender(), ) case None => log.debug( s"There is no time series apparent for the model with uuid '{}'.", - modelUuid + modelUuid, ) sender() ! RegistrationFailedMessage(self) } @@ -284,7 +284,7 @@ case class PrimaryServiceProxy( modelUuid: UUID, timeSeriesUuid: UUID, stateData: PrimaryServiceStateData, - requestingActor: ActorRef + requestingActor: ActorRef, ): Unit = { val timeSeriesToSourceRef = stateData.timeSeriesToSourceRef timeSeriesToSourceRef.get(timeSeriesUuid) match { @@ -297,7 +297,7 @@ case class PrimaryServiceProxy( initializeWorker( metaInformation, stateData.simulationStart, - stateData.primaryConfig + stateData.primaryConfig, ) match { case Success(workerRef) => /* Forward the registration request. The worker will reply about successful registration or not. */ @@ -311,7 +311,7 @@ case class PrimaryServiceProxy( log.warning( s"A failure occurred during spin-off of a primary source for time series '$timeSeriesUuid'. " + s"Will inform the requesting actor, that registration is not possible.", - exception + exception, ) requestingActor ! RegistrationFailedMessage(self) } @@ -340,21 +340,21 @@ case class PrimaryServiceProxy( protected def initializeWorker( metaInformation: IndividualTimeSeriesMetaInformation, simulationStart: ZonedDateTime, - primaryConfig: PrimaryConfig + primaryConfig: PrimaryConfig, ): Try[ActorRef] = { val workerRef = classToWorkerRef( metaInformation.getColumnScheme.getValueClass, - metaInformation.getUuid.toString + metaInformation.getUuid.toString, ) toInitData( metaInformation, simulationStart, - primaryConfig + primaryConfig, ) match { case Success(initData) => workerRef ! SimonaService.Create( initData, - ScheduleLock.singleKey(context, scheduler.toTyped, INIT_SIM_TICK) + ScheduleLock.singleKey(context, scheduler.toTyped, INIT_SIM_TICK), ) Success(workerRef) case Failure(cause) => @@ -362,7 +362,7 @@ case class PrimaryServiceProxy( Failure( new InitializationException( "Unable to build init data for worker. Kill the uninitialized worker. Goodbye my friend!", - cause + cause, ) ) } @@ -382,12 +382,12 @@ case class PrimaryServiceProxy( */ protected def classToWorkerRef[V <: Value]( valueClass: Class[V], - timeSeriesUuid: String + timeSeriesUuid: String, ): ActorRef = { import edu.ie3.simona.actor.SimonaActorNaming._ context.system.simonaActorOf( PrimaryServiceWorker.props(scheduler, valueClass), - timeSeriesUuid + timeSeriesUuid, ) } @@ -404,14 +404,14 @@ case class PrimaryServiceProxy( private def toInitData( metaInformation: IndividualTimeSeriesMetaInformation, simulationStart: ZonedDateTime, - primaryConfig: PrimaryConfig + primaryConfig: PrimaryConfig, ): Try[InitPrimaryServiceStateData] = primaryConfig match { case PrimaryConfig( None, Some(PrimaryDataCsvParams(csvSep, directoryPath, _, timePattern)), None, - None + None, ) => /* The actual data sources are from csv. Meta information have to match */ metaInformation match { @@ -424,7 +424,7 @@ case class PrimaryServiceProxy( Paths.get(directoryPath), csvMetaData.getFullFilePath, new FileNamingStrategy(), - timePattern + timePattern, ) ) case invalidMetaData => @@ -439,14 +439,14 @@ case class PrimaryServiceProxy( None, None, None, - Some(sqlParams: SqlParams) + Some(sqlParams: SqlParams), ) => Success( SqlInitPrimaryServiceStateData( metaInformation.getUuid, simulationStart, sqlParams, - new DatabaseNamingStrategy() + new DatabaseNamingStrategy(), ) ) @@ -472,18 +472,18 @@ case class PrimaryServiceProxy( private def updateStateData( stateData: PrimaryServiceStateData, timeSeriesUuid: UUID, - workerRef: ActorRef + workerRef: ActorRef, ): PrimaryServiceStateData = { val timeSeriesToSourceRef = stateData.timeSeriesToSourceRef val sourceRef = timeSeriesToSourceRef.getOrElse( timeSeriesUuid, throw new IllegalArgumentException( s"Cannot update entry for time series '$timeSeriesUuid', as it hasn't been part of it before." - ) + ), ) val updatedTimeSeriesToSourceRef = timeSeriesToSourceRef.updated( timeSeriesUuid, - sourceRef.copy(worker = Some(workerRef)) + sourceRef.copy(worker = Some(workerRef)), ) stateData.copy(timeSeriesToSourceRef = updatedTimeSeriesToSourceRef) } @@ -494,7 +494,7 @@ object PrimaryServiceProxy { def props( scheduler: ActorRef, initStateData: InitPrimaryServiceProxyStateData, - startDateTime: ZonedDateTime + startDateTime: ZonedDateTime, ): Props = Props( new PrimaryServiceProxy(scheduler, initStateData, startDateTime) ) @@ -509,7 +509,7 @@ object PrimaryServiceProxy { */ final case class InitPrimaryServiceProxyStateData( primaryConfig: PrimaryConfig, - simulationStart: ZonedDateTime + simulationStart: ZonedDateTime, ) extends InitializeServiceStateData /** Holding the state of an initialized proxy. @@ -530,7 +530,7 @@ object PrimaryServiceProxy { timeSeriesToSourceRef: Map[UUID, SourceRef], simulationStart: ZonedDateTime, primaryConfig: PrimaryConfig, - mappingSource: TimeSeriesMappingSource + mappingSource: TimeSeriesMappingSource, ) extends ServiceStateData /** Giving reference to the target time series and source worker. @@ -543,7 +543,7 @@ object PrimaryServiceProxy { */ final case class SourceRef( metaInformation: IndividualTimeSeriesMetaInformation, - worker: Option[ActorRef] + worker: Option[ActorRef], ) /** Check if the config holds correct information to instantiate a mapping @@ -574,7 +574,7 @@ object PrimaryServiceProxy { primaryConfig.couchbaseParams, primaryConfig.csvParams, primaryConfig.influxDb1xParams, - primaryConfig.sqlParams + primaryConfig.sqlParams, ).filter(_.isDefined).flatten if (sourceConfigs.size > 1) throw new InvalidConfigParameterException( diff --git a/src/main/scala/edu/ie3/simona/service/primary/PrimaryServiceWorker.scala b/src/main/scala/edu/ie3/simona/service/primary/PrimaryServiceWorker.scala index c9da720690..7e5abcd6f9 100644 --- a/src/main/scala/edu/ie3/simona/service/primary/PrimaryServiceWorker.scala +++ b/src/main/scala/edu/ie3/simona/service/primary/PrimaryServiceWorker.scala @@ -25,11 +25,11 @@ import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResp import edu.ie3.simona.scheduler.ScheduleLock.ScheduleKey import edu.ie3.simona.service.ServiceStateData.{ InitializeServiceStateData, - ServiceActivationBaseStateData + ServiceActivationBaseStateData, } import edu.ie3.simona.service.primary.PrimaryServiceWorker.{ PrimaryServiceInitializedStateData, - ProvidePrimaryDataMessage + ProvidePrimaryDataMessage, } import edu.ie3.simona.service.{ServiceStateData, SimonaService} import edu.ie3.simona.util.TickUtil.{RichZonedDateTime, TickLong} @@ -44,7 +44,7 @@ import scala.util.{Failure, Success, Try} final case class PrimaryServiceWorker[V <: Value]( override protected val scheduler: ActorRef, - valueClass: Class[V] + valueClass: Class[V], ) extends SimonaService[PrimaryServiceInitializedStateData[V]](scheduler) { /** Initialize the actor with the given information. Try to figure out the @@ -62,7 +62,7 @@ final case class PrimaryServiceWorker[V <: Value]( ): Try[ ( PrimaryServiceInitializedStateData[V], - Option[Long] + Option[Long], ) ] = { (initServiceData match { @@ -73,7 +73,7 @@ final case class PrimaryServiceWorker[V <: Value]( directoryPath, filePath, fileNamingStrategy, - timePattern + timePattern, ) => Try { /* Set up source and acquire information */ @@ -85,7 +85,7 @@ final case class PrimaryServiceWorker[V <: Value]( timeSeriesUuid, filePath, valueClass, - factory + factory, ) (source, simulationStart) } @@ -94,7 +94,7 @@ final case class PrimaryServiceWorker[V <: Value]( timeSeriesUuid: UUID, simulationStart: ZonedDateTime, sqlParams: SqlParams, - namingStrategy: DatabaseNamingStrategy + namingStrategy: DatabaseNamingStrategy, ) => Try { val factory = @@ -103,7 +103,7 @@ final case class PrimaryServiceWorker[V <: Value]( val sqlConnector = new SqlConnector( sqlParams.jdbcUrl, sqlParams.userName, - sqlParams.password + sqlParams.password, ) val source = new SqlTimeSeriesSource( @@ -112,7 +112,7 @@ final case class PrimaryServiceWorker[V <: Value]( namingStrategy, timeSeriesUuid, valueClass, - factory + factory, ) (source, simulationStart) @@ -148,7 +148,7 @@ final case class PrimaryServiceWorker[V <: Value]( maybeNextTick, furtherActivationTicks, simulationStart, - source + source, ) (initializedStateData, maybeNextTick) } @@ -172,7 +172,7 @@ final case class PrimaryServiceWorker[V <: Value]( case ServiceMessage.WorkerRegistrationMessage(requestingActor) => requestingActor ! RegistrationSuccessfulMessage( self, - serviceStateData.maybeNextActivationTick + serviceStateData.maybeNextActivationTick, ) val subscribers = serviceStateData.subscribers :+ requestingActor Success(serviceStateData.copy(subscribers = subscribers)) @@ -200,10 +200,10 @@ final case class PrimaryServiceWorker[V <: Value]( tick: Long )(implicit serviceBaseStateData: PrimaryServiceInitializedStateData[V], - ctx: ActorContext + ctx: ActorContext, ): ( PrimaryServiceInitializedStateData[V], - Option[Long] + Option[Long], ) = { /* Get the information to distribute */ val wallClockTime = tick.toDateTime(serviceBaseStateData.startDateTime) @@ -215,7 +215,7 @@ final case class PrimaryServiceWorker[V <: Value]( log.warning( s"I expected to get data for tick '{}' ({}), but data is not available", tick, - wallClockTime + wallClockTime, ) updateStateDataAndBuildTriggerMessages(serviceBaseStateData) } @@ -234,16 +234,16 @@ final case class PrimaryServiceWorker[V <: Value]( baseStateData: PrimaryServiceInitializedStateData[V] ): ( PrimaryServiceInitializedStateData[V], - Option[Long] + Option[Long], ) = { val (maybeNextActivationTick, remainderActivationTicks) = baseStateData.activationTicks.pop ( baseStateData.copy( maybeNextActivationTick = maybeNextActivationTick, - activationTicks = remainderActivationTicks + activationTicks = remainderActivationTicks, ), - maybeNextActivationTick + maybeNextActivationTick, ) } @@ -262,10 +262,10 @@ final case class PrimaryServiceWorker[V <: Value]( private def processDataAndAnnounce( tick: Long, value: V, - serviceBaseStateData: PrimaryServiceInitializedStateData[V] + serviceBaseStateData: PrimaryServiceInitializedStateData[V], ): ( PrimaryServiceInitializedStateData[V], - Option[Long] + Option[Long], ) = value.toPrimaryData match { case Success(primaryData) => announcePrimaryData(tick, primaryData, serviceBaseStateData) @@ -274,7 +274,7 @@ final case class PrimaryServiceWorker[V <: Value]( log.warning( "Unable to convert received value to primary data. Skipped that data." + "\nException: {}", - exception + exception, ) updateStateDataAndBuildTriggerMessages(serviceBaseStateData) } @@ -294,17 +294,17 @@ final case class PrimaryServiceWorker[V <: Value]( private def announcePrimaryData( tick: Long, primaryData: PrimaryData, - serviceBaseStateData: PrimaryServiceInitializedStateData[V] + serviceBaseStateData: PrimaryServiceInitializedStateData[V], ): ( PrimaryServiceInitializedStateData[V], - Option[Long] + Option[Long], ) = { val (maybeNextTick, remainderActivationTicks) = serviceBaseStateData.activationTicks.pop val updatedStateData = serviceBaseStateData.copy( maybeNextActivationTick = maybeNextTick, - activationTicks = remainderActivationTicks + activationTicks = remainderActivationTicks, ) val provisionMessage = @@ -323,12 +323,12 @@ object PrimaryServiceWorker { ColumnScheme.ACTIVE_POWER, ColumnScheme.ACTIVE_POWER_AND_HEAT_DEMAND, ColumnScheme.APPARENT_POWER, - ColumnScheme.APPARENT_POWER_AND_HEAT_DEMAND + ColumnScheme.APPARENT_POWER_AND_HEAT_DEMAND, ) def props[V <: Value]( scheduler: ActorRef, - valueClass: Class[V] + valueClass: Class[V], ): Props = Props(new PrimaryServiceWorker(scheduler, valueClass)) @@ -369,7 +369,7 @@ object PrimaryServiceWorker { directoryPath: Path, filePath: Path, fileNamingStrategy: FileNamingStrategy, - timePattern: String + timePattern: String, ) extends InitPrimaryServiceStateData /** Specific implementation of [[InitPrimaryServiceStateData]], if the source @@ -388,7 +388,7 @@ object PrimaryServiceWorker { override val timeSeriesUuid: UUID, override val simulationStart: ZonedDateTime, sqlParams: SqlParams, - databaseNamingStrategy: DatabaseNamingStrategy + databaseNamingStrategy: DatabaseNamingStrategy, ) extends InitPrimaryServiceStateData /** Class carrying the state of a fully initialized [[PrimaryServiceWorker]] @@ -413,7 +413,7 @@ object PrimaryServiceWorker { SortedDistinctSeq.empty, startDateTime: ZonedDateTime, source: TimeSeriesSource[V], - subscribers: Vector[ActorRef] = Vector.empty[ActorRef] + subscribers: Vector[ActorRef] = Vector.empty[ActorRef], ) extends ServiceActivationBaseStateData /** Provide primary data to subscribes @@ -430,6 +430,6 @@ object PrimaryServiceWorker { override val serviceRef: ActorRef, override val data: PrimaryData, override val nextDataTick: Option[Long], - override val unlockKey: Option[ScheduleKey] = None + override val unlockKey: Option[ScheduleKey] = None, ) extends ServiceMessage.ProvisionMessage[PrimaryData] } diff --git a/src/main/scala/edu/ie3/simona/service/weather/SampleWeatherSource.scala b/src/main/scala/edu/ie3/simona/service/weather/SampleWeatherSource.scala index 06c62354ba..b4dfa209d4 100644 --- a/src/main/scala/edu/ie3/simona/service/weather/SampleWeatherSource.scala +++ b/src/main/scala/edu/ie3/simona/service/weather/SampleWeatherSource.scala @@ -50,7 +50,7 @@ final class SampleWeatherSource( */ override def getWeather( tick: Long, - weightedCoordinates: WeatherSource.WeightedCoordinates + weightedCoordinates: WeatherSource.WeightedCoordinates, ): WeatherData = getWeather(tick) /** Get the weather data for the given tick and coordinate. Here, the weather @@ -97,7 +97,7 @@ final class SampleWeatherSource( SampleWeatherSource .windVelocity(index) .doubleValue - ) + ), ) } @@ -113,7 +113,7 @@ final class SampleWeatherSource( */ override def getDataTicks( requestFrameStart: Long, - requestFrameEnd: Long + requestFrameEnd: Long, ): Array[Long] = TickUtil.getTicksInBetween(requestFrameStart, requestFrameEnd, resolution) } @@ -137,13 +137,13 @@ object SampleWeatherSource { override def getClosestCoordinates( coordinate: Point, n: Int, - distance: ComparableQuantity[Length] + distance: ComparableQuantity[Length], ): util.List[CoordinateDistance] = { if (coordinate.getY.abs <= 90 && coordinate.getX.abs <= 180) Vector( new CoordinateDistance( coordinate, - coordinate + coordinate, ) ).asJava else @@ -152,13 +152,13 @@ object SampleWeatherSource { override def getNearestCoordinates( coordinate: Point, - i: Int + i: Int, ): util.List[CoordinateDistance] = { if (coordinate.getY.abs <= 90 && coordinate.getX.abs <= 180) Vector( new CoordinateDistance( coordinate, - coordinate + coordinate, ) ).asJava else diff --git a/src/main/scala/edu/ie3/simona/service/weather/WeatherService.scala b/src/main/scala/edu/ie3/simona/service/weather/WeatherService.scala index 52aa70bd8f..7543dc74c8 100644 --- a/src/main/scala/edu/ie3/simona/service/weather/WeatherService.scala +++ b/src/main/scala/edu/ie3/simona/service/weather/WeatherService.scala @@ -12,22 +12,22 @@ import edu.ie3.simona.config.SimonaConfig import edu.ie3.simona.exceptions.WeatherServiceException.InvalidRegistrationRequestException import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResponseMessage.{ RegistrationFailedMessage, - RegistrationSuccessfulMessage + RegistrationSuccessfulMessage, } import edu.ie3.simona.ontology.messages.services.ServiceMessage.ServiceRegistrationMessage import edu.ie3.simona.ontology.messages.services.WeatherMessage._ import edu.ie3.simona.service.SimonaService import edu.ie3.simona.service.ServiceStateData.{ InitializeServiceStateData, - ServiceActivationBaseStateData + ServiceActivationBaseStateData, } import edu.ie3.simona.service.weather.WeatherService.{ InitWeatherServiceStateData, - WeatherInitializedStateData + WeatherInitializedStateData, } import edu.ie3.simona.service.weather.WeatherSource.{ AgentCoordinates, - WeightedCoordinates + WeightedCoordinates, } import edu.ie3.simona.util.SimonaConstants import edu.ie3.simona.util.TickUtil.RichZonedDateTime @@ -42,14 +42,14 @@ object WeatherService { scheduler: ActorRef, startDateTime: ZonedDateTime, simulationEnd: ZonedDateTime, - amountOfInterpolationCoordinates: Int = 4 + amountOfInterpolationCoordinates: Int = 4, ): Props = Props( new WeatherService( scheduler, startDateTime, simulationEnd, - amountOfInterpolationCoordinates + amountOfInterpolationCoordinates, ) ) @@ -74,7 +74,7 @@ object WeatherService { Map.empty[AgentCoordinates, WeightedCoordinates], override val maybeNextActivationTick: Option[Long], override val activationTicks: SortedDistinctSeq[Long] = - SortedDistinctSeq.empty + SortedDistinctSeq.empty, ) extends ServiceActivationBaseStateData /** Weather service state data used for initialization of the weather service @@ -99,7 +99,7 @@ final case class WeatherService( override val scheduler: ActorRef, private implicit val simulationStart: ZonedDateTime, simulationEnd: ZonedDateTime, - private val amountOfInterpolationCoords: Int + private val amountOfInterpolationCoords: Int, ) extends SimonaService[ WeatherInitializedStateData ](scheduler) { @@ -131,7 +131,7 @@ final case class WeatherService( weatherSource .getDataTicks( SimonaConstants.FIRST_TICK_IN_SIMULATION, - simulationEnd.toTick + simulationEnd.toTick, ) .toSeq ).pop @@ -139,12 +139,12 @@ final case class WeatherService( val weatherInitializedStateData = WeatherInitializedStateData( weatherSource, activationTicks = furtherActivationTicks, - maybeNextActivationTick = maybeNextTick + maybeNextActivationTick = maybeNextTick, ) Success( weatherInitializedStateData, - maybeNextTick + maybeNextTick, ) case invalidData => @@ -200,7 +200,7 @@ final case class WeatherService( private def handleRegistrationRequest( agentToBeRegistered: ActorRef, latitude: Double, - longitude: Double + longitude: Double, )(implicit serviceStateData: WeatherInitializedStateData ): WeatherInitializedStateData = { @@ -208,13 +208,13 @@ final case class WeatherService( "Received weather registration from {} for [Lat:{}, Long:{}]", agentToBeRegistered.path.name, latitude, - longitude + longitude, ) // collate the provided coordinates into a single entity val agentCoord = AgentCoordinates( latitude, - longitude + longitude, ) serviceStateData.coordsToActorRefMap.get(agentCoord) match { @@ -222,12 +222,12 @@ final case class WeatherService( /* The coordinate itself is not known yet. Try to figure out, which weather coordinates are relevant */ serviceStateData.weatherSource.getWeightedCoordinates( agentCoord, - amountOfInterpolationCoords + amountOfInterpolationCoords, ) match { case Success(weightedCoordinates) => agentToBeRegistered ! RegistrationSuccessfulMessage( self, - serviceStateData.maybeNextActivationTick + serviceStateData.maybeNextActivationTick, ) /* Enhance the mapping from agent coordinate to requesting actor's ActorRef as well as the necessary @@ -238,12 +238,12 @@ final case class WeatherService( agentToBeRegistered )), weightedWeatherCoordinates = - serviceStateData.weightedWeatherCoordinates + (agentCoord -> weightedCoordinates) + serviceStateData.weightedWeatherCoordinates + (agentCoord -> weightedCoordinates), ) case Failure(exception) => log.error( exception, - s"Unable to obtain necessary information to register for coordinate $agentCoord." + s"Unable to obtain necessary information to register for coordinate $agentCoord.", ) sender() ! RegistrationFailedMessage(self) serviceStateData @@ -253,7 +253,7 @@ final case class WeatherService( // coordinate is already known (= we have data for it), but this actor is not registered yet agentToBeRegistered ! RegistrationSuccessfulMessage( self, - serviceStateData.maybeNextActivationTick + serviceStateData.maybeNextActivationTick, ) serviceStateData.copy( @@ -265,7 +265,7 @@ final case class WeatherService( // actor is already registered, do nothing log.warning( "Sending actor {} is already registered", - agentToBeRegistered + agentToBeRegistered, ) serviceStateData @@ -290,13 +290,13 @@ final case class WeatherService( */ override protected def announceInformation(tick: Long)(implicit serviceStateData: WeatherInitializedStateData, - ctx: ActorContext + ctx: ActorContext, ): (WeatherInitializedStateData, Option[Long]) = { /* Pop the next activation tick and update the state data */ val ( maybeNextTick: Option[Long], - updatedStateData: WeatherInitializedStateData + updatedStateData: WeatherInitializedStateData, ) = { val (nextTick, remainderTicks) = serviceStateData.activationTicks.pop (nextTick, serviceStateData.copy(activationTicks = remainderTicks)) @@ -316,7 +316,7 @@ final case class WeatherService( tick, self, weatherResult, - maybeNextTick + maybeNextTick, ) ) ) @@ -324,7 +324,7 @@ final case class WeatherService( ( updatedStateData, - maybeNextTick + maybeNextTick, ) } diff --git a/src/main/scala/edu/ie3/simona/service/weather/WeatherSource.scala b/src/main/scala/edu/ie3/simona/service/weather/WeatherSource.scala index e054b01715..b996d5a475 100644 --- a/src/main/scala/edu/ie3/simona/service/weather/WeatherSource.scala +++ b/src/main/scala/edu/ie3/simona/service/weather/WeatherSource.scala @@ -11,7 +11,7 @@ import edu.ie3.datamodel.io.factory.timeseries.{ CosmoIdCoordinateFactory, IconIdCoordinateFactory, IdCoordinateFactory, - SqlIdCoordinateFactory + SqlIdCoordinateFactory, } import edu.ie3.datamodel.io.naming.FileNamingStrategy import edu.ie3.datamodel.io.source.IdCoordinateSource @@ -23,18 +23,18 @@ import edu.ie3.simona.config.SimonaConfig.BaseCsvParams import edu.ie3.simona.config.SimonaConfig.Simona.Input.Weather.Datasource._ import edu.ie3.simona.exceptions.{ InvalidConfigParameterException, - ServiceException + ServiceException, } import edu.ie3.simona.ontology.messages.services.WeatherMessage.WeatherData import edu.ie3.simona.service.weather.WeatherSource.{ AgentCoordinates, - WeightedCoordinates + WeightedCoordinates, } import edu.ie3.simona.util.ConfigUtil.CsvConfigUtil.checkBaseCsvParams import edu.ie3.simona.util.ConfigUtil.DatabaseConfigUtil.{ checkCouchbaseParams, checkInfluxDb1xParams, - checkSqlParams + checkSqlParams, } import edu.ie3.simona.util.ParsableEnumeration import edu.ie3.util.geo.{CoordinateDistance, GeoUtils} @@ -72,11 +72,11 @@ trait WeatherSource { */ def getWeightedCoordinates( coordinate: WeatherSource.AgentCoordinates, - amountOfInterpolationCoords: Int + amountOfInterpolationCoords: Int, ): Try[WeatherSource.WeightedCoordinates] = { getNearestCoordinatesWithDistances( coordinate, - amountOfInterpolationCoords + amountOfInterpolationCoords, ) match { case Success(nearestCoordinates) => determineWeights(nearestCoordinates) @@ -84,7 +84,7 @@ trait WeatherSource { Failure( new ServiceException( "Determination of coordinate weights failed.", - exception + exception, ) ) } @@ -104,7 +104,7 @@ trait WeatherSource { */ def getNearestCoordinatesWithDistances( coordinate: WeatherSource.AgentCoordinates, - amountOfInterpolationCoords: Int + amountOfInterpolationCoords: Int, ): Try[Iterable[CoordinateDistance]] = { val queryPoint = coordinate.toPoint @@ -113,7 +113,7 @@ trait WeatherSource { .getClosestCoordinates( queryPoint, amountOfInterpolationCoords, - maxCoordinateDistance + maxCoordinateDistance, ) .asScala @@ -152,7 +152,7 @@ trait WeatherSource { tl || (point.getX < queryPoint.getX && point.getY > queryPoint.getY), tr || (point.getX > queryPoint.getX && point.getY > queryPoint.getY), bl || (point.getX < queryPoint.getX && point.getY < queryPoint.getY), - br || (point.getX > queryPoint.getX && point.getY < queryPoint.getY) + br || (point.getX > queryPoint.getX && point.getY < queryPoint.getY), ) } @@ -252,7 +252,7 @@ trait WeatherSource { */ def getWeather( tick: Long, - weightedCoordinates: WeightedCoordinates + weightedCoordinates: WeightedCoordinates, ): WeatherData /** Get the weather data for the given tick and agent coordinates having a @@ -267,7 +267,7 @@ trait WeatherSource { */ def getWeather( tick: Long, - agentToWeightedCoordinates: Map[AgentCoordinates, WeightedCoordinates] + agentToWeightedCoordinates: Map[AgentCoordinates, WeightedCoordinates], ): Map[AgentCoordinates, WeatherData] = agentToWeightedCoordinates.map { case (agentCoordinates, weightedCoordinates) => agentCoordinates -> getWeather(tick, weightedCoordinates) @@ -286,7 +286,7 @@ trait WeatherSource { */ def getDataTicks( requestFrameStart: Long, - requestFrameEnd: Long + requestFrameEnd: Long, ): Array[Long] } @@ -294,7 +294,7 @@ object WeatherSource { def apply( dataSourceConfig: SimonaConfig.Simona.Input.Weather.Datasource, - simulationStart: ZonedDateTime + simulationStart: ZonedDateTime, ): WeatherSource = checkConfig(dataSourceConfig)(simulationStart) @@ -334,7 +334,7 @@ object WeatherSource { weatherDataSourceCfg.csvParams, weatherDataSourceCfg.influxDb1xParams, weatherDataSourceCfg.couchbaseParams, - weatherDataSourceCfg.sqlParams + weatherDataSourceCfg.sqlParams, ).filter(_.isDefined) val timestampPattern: Option[String] = weatherDataSourceCfg.timestampPattern @@ -343,7 +343,7 @@ object WeatherSource { val distance: ComparableQuantity[Length] = Quantities.getQuantity( weatherDataSourceCfg.maxCoordinateDistance, - Units.METRE + Units.METRE, ) // check that only one source is defined @@ -365,7 +365,7 @@ object WeatherSource { timestampPattern, scheme, resolution, - distance + distance, )(simulationStart) case Some(Some(params: CouchbaseParams)) => checkCouchbaseParams(params) @@ -376,7 +376,7 @@ object WeatherSource { timestampPattern, scheme, resolution, - distance + distance, )(simulationStart) case Some(Some(params @ InfluxDb1xParams(database, _, url))) => checkInfluxDb1xParams("WeatherSource", url, database) @@ -387,7 +387,7 @@ object WeatherSource { timestampPattern, scheme, resolution, - distance + distance, )(simulationStart) case Some(Some(params: SqlParams)) => checkSqlParams(params) @@ -398,7 +398,7 @@ object WeatherSource { timestampPattern, scheme, resolution, - distance + distance, )(simulationStart) case Some(Some(_: SampleParams)) => // sample weather, no check required @@ -444,7 +444,7 @@ object WeatherSource { val definedCoordSources = Vector( coordinateSourceConfig.sampleParams, coordinateSourceConfig.csvParams, - coordinateSourceConfig.sqlParams + coordinateSourceConfig.sqlParams, ).filter(_.isDefined) // check that only one source is defined @@ -469,8 +469,8 @@ object WeatherSource { new CsvDataSource( csvSep, Paths.get(directoryPath), - new FileNamingStrategy() - ) + new FileNamingStrategy(), + ), ) case Some( Some( @@ -479,7 +479,7 @@ object WeatherSource { userName, password, schemaName, - tableName + tableName, ) ) ) => @@ -490,7 +490,7 @@ object WeatherSource { new SqlConnector(jdbcUrl, userName, password), schemaName, tableName, - new SqlIdCoordinateFactory() + new SqlIdCoordinateFactory(), ) case Some( Some( @@ -544,7 +544,7 @@ object WeatherSource { WattsPerSquareMeter(0.0), WattsPerSquareMeter(0.0), Kelvin(0d), - MetersPerSecond(0d) + MetersPerSecond(0d), ) def toWeatherData( @@ -590,7 +590,7 @@ object WeatherSource { .doubleValue() ) case None => EMPTY_WEATHER_DATA.windVel - } + }, ) } @@ -600,7 +600,7 @@ object WeatherSource { */ private[weather] final case class AgentCoordinates( latitude: Double, - longitude: Double + longitude: Double, ) { def toPoint: Point = GeoUtils.DEFAULT_GEOMETRY_FACTORY.createPoint( diff --git a/src/main/scala/edu/ie3/simona/service/weather/WeatherSourceWrapper.scala b/src/main/scala/edu/ie3/simona/service/weather/WeatherSourceWrapper.scala index 2fc48cd5f9..dac52742ed 100644 --- a/src/main/scala/edu/ie3/simona/service/weather/WeatherSourceWrapper.scala +++ b/src/main/scala/edu/ie3/simona/service/weather/WeatherSourceWrapper.scala @@ -10,11 +10,11 @@ import com.typesafe.scalalogging.LazyLogging import edu.ie3.datamodel.io.connectors.{ CouchbaseConnector, InfluxDbConnector, - SqlConnector + SqlConnector, } import edu.ie3.datamodel.io.factory.timeseries.{ CosmoTimeBasedWeatherValueFactory, - IconTimeBasedWeatherValueFactory + IconTimeBasedWeatherValueFactory, } import edu.ie3.datamodel.io.naming.FileNamingStrategy import edu.ie3.datamodel.io.source.couchbase.CouchbaseWeatherSource @@ -23,12 +23,12 @@ import edu.ie3.datamodel.io.source.influxdb.InfluxDbWeatherSource import edu.ie3.datamodel.io.source.sql.SqlWeatherSource import edu.ie3.datamodel.io.source.{ IdCoordinateSource, - WeatherSource => PsdmWeatherSource + WeatherSource => PsdmWeatherSource, } import edu.ie3.simona.config.SimonaConfig.Simona.Input.Weather.Datasource.{ CouchbaseParams, InfluxDb1xParams, - SqlParams + SqlParams, } import edu.ie3.simona.exceptions.InitializationException import edu.ie3.simona.ontology.messages.services.WeatherMessage @@ -36,7 +36,7 @@ import edu.ie3.simona.ontology.messages.services.WeatherMessage.WeatherData import edu.ie3.simona.service.weather.WeatherSource.{ EMPTY_WEATHER_DATA, WeatherScheme, - toWeatherData + toWeatherData, } import edu.ie3.simona.service.weather.WeatherSourceWrapper.WeightSum import edu.ie3.simona.service.weather.{WeatherSource => SimonaWeatherSource} @@ -72,7 +72,7 @@ private[weather] final case class WeatherSourceWrapper private ( source: PsdmWeatherSource, override val idCoordinateSource: IdCoordinateSource, resolution: Long, - maxCoordinateDistance: ComparableQuantity[Length] + maxCoordinateDistance: ComparableQuantity[Length], )( private implicit val simulationStart: ZonedDateTime ) extends SimonaWeatherSource @@ -90,7 +90,7 @@ private[weather] final case class WeatherSourceWrapper private ( */ override def getWeather( tick: Long, - weightedCoordinates: WeatherSource.WeightedCoordinates + weightedCoordinates: WeatherSource.WeightedCoordinates, ): WeatherMessage.WeatherData = { val dateTime = tick.toDateTime val interval = new ClosedInterval(dateTime, dateTime) @@ -98,7 +98,7 @@ private[weather] final case class WeatherSourceWrapper private ( val results = source .getWeather( interval, - coordinates + coordinates, ) .asScala .toMap @@ -124,7 +124,7 @@ private[weather] final case class WeatherSourceWrapper private ( point, { logger.warn(s"Received an unexpected point: $point") 0d - } + }, ) /* Sum up weight and contributions */ @@ -169,8 +169,8 @@ private[weather] final case class WeatherSourceWrapper private ( diffIrrWeight, dirIrrWeight, tempWeight, - windVelWeight - ) + windVelWeight, + ), ) } match { case (weatherData: WeatherData, weightSum: WeightSum) => @@ -190,7 +190,7 @@ private[weather] final case class WeatherSourceWrapper private ( */ override def getDataTicks( requestFrameStart: Long, - requestFrameEnd: Long + requestFrameEnd: Long, ): Array[Long] = TickUtil.getTicksInBetween(requestFrameStart, requestFrameEnd, resolution) } @@ -205,7 +205,7 @@ private[weather] object WeatherSourceWrapper extends LazyLogging { timestampPattern: Option[String], scheme: String, resolution: Option[Long], - maxCoordinateDistance: ComparableQuantity[Length] + maxCoordinateDistance: ComparableQuantity[Length], )(implicit simulationStart: ZonedDateTime): WeatherSourceWrapper = { val idCoordinateSource = idCoordinateSourceFunction() val source = new CsvWeatherSource( @@ -213,7 +213,7 @@ private[weather] object WeatherSourceWrapper extends LazyLogging { directoryPath, new FileNamingStrategy(), idCoordinateSource, - buildFactory(scheme, timestampPattern) + buildFactory(scheme, timestampPattern), ) logger.info( "Successfully initiated CsvWeatherSource as source for WeatherSourceWrapper." @@ -222,7 +222,7 @@ private[weather] object WeatherSourceWrapper extends LazyLogging { source, idCoordinateSource, resolution.getOrElse(DEFAULT_RESOLUTION), - maxCoordinateDistance + maxCoordinateDistance, ) } @@ -232,13 +232,13 @@ private[weather] object WeatherSourceWrapper extends LazyLogging { timestampPattern: Option[String], scheme: String, resolution: Option[Long], - maxCoordinateDistance: ComparableQuantity[Length] + maxCoordinateDistance: ComparableQuantity[Length], )(implicit simulationStart: ZonedDateTime): WeatherSourceWrapper = { val couchbaseConnector = new CouchbaseConnector( couchbaseParams.url, couchbaseParams.bucketName, couchbaseParams.userName, - couchbaseParams.password + couchbaseParams.password, ) val idCoordinateSource = idCoordinateSourceFunction() val source = new CouchbaseWeatherSource( @@ -247,7 +247,7 @@ private[weather] object WeatherSourceWrapper extends LazyLogging { couchbaseParams.coordinateColumnName, couchbaseParams.keyPrefix, buildFactory(scheme, timestampPattern), - "yyyy-MM-dd'T'HH:mm:ssxxx" + "yyyy-MM-dd'T'HH:mm:ssxxx", ) logger.info( "Successfully initiated CouchbaseWeatherSource as source for WeatherSourceWrapper." @@ -256,7 +256,7 @@ private[weather] object WeatherSourceWrapper extends LazyLogging { source, idCoordinateSource, resolution.getOrElse(DEFAULT_RESOLUTION), - maxCoordinateDistance + maxCoordinateDistance, ) } @@ -266,7 +266,7 @@ private[weather] object WeatherSourceWrapper extends LazyLogging { timestampPattern: Option[String], scheme: String, resolution: Option[Long], - maxCoordinateDistance: ComparableQuantity[Length] + maxCoordinateDistance: ComparableQuantity[Length], )(implicit simulationStart: ZonedDateTime): WeatherSourceWrapper = { val influxDb1xConnector = new InfluxDbConnector(influxDbParams.url, influxDbParams.database) @@ -274,7 +274,7 @@ private[weather] object WeatherSourceWrapper extends LazyLogging { val source = new InfluxDbWeatherSource( influxDb1xConnector, idCoordinateSource, - buildFactory(scheme, timestampPattern) + buildFactory(scheme, timestampPattern), ) logger.info( "Successfully initiated InfluxDbWeatherSource as source for WeatherSourceWrapper." @@ -283,7 +283,7 @@ private[weather] object WeatherSourceWrapper extends LazyLogging { source, idCoordinateSource, resolution.getOrElse(DEFAULT_RESOLUTION), - maxCoordinateDistance + maxCoordinateDistance, ) } @@ -293,12 +293,12 @@ private[weather] object WeatherSourceWrapper extends LazyLogging { timestampPattern: Option[String], scheme: String, resolution: Option[Long], - maxCoordinateDistance: ComparableQuantity[Length] + maxCoordinateDistance: ComparableQuantity[Length], )(implicit simulationStart: ZonedDateTime): WeatherSourceWrapper = { val sqlConnector = new SqlConnector( sqlParams.jdbcUrl, sqlParams.userName, - sqlParams.password + sqlParams.password, ) val idCoordinateSource = idCoordinateSourceFunction() val source = new SqlWeatherSource( @@ -306,7 +306,7 @@ private[weather] object WeatherSourceWrapper extends LazyLogging { idCoordinateSource, sqlParams.schemaName, sqlParams.tableName, - buildFactory(scheme, timestampPattern) + buildFactory(scheme, timestampPattern), ) logger.info( "Successfully initiated SqlWeatherSource as source for WeatherSourceWrapper." @@ -315,7 +315,7 @@ private[weather] object WeatherSourceWrapper extends LazyLogging { source, idCoordinateSource, resolution.getOrElse(DEFAULT_RESOLUTION), - maxCoordinateDistance + maxCoordinateDistance, ) } @@ -325,7 +325,7 @@ private[weather] object WeatherSourceWrapper extends LazyLogging { throw new InitializationException( s"Error while initializing WeatherFactory for weather source wrapper: '$scheme' is not a weather scheme. Supported schemes:\n\t${WeatherScheme.values .mkString("\n\t")}'", - exception + exception, ) case Success(WeatherScheme.ICON) => timestampPattern @@ -358,19 +358,19 @@ private[weather] object WeatherSourceWrapper extends LazyLogging { diffIrr: Double, dirIrr: Double, temp: Double, - windVel: Double + windVel: Double, ) { def add( diffIrr: Double, dirIrr: Double, temp: Double, - windVel: Double + windVel: Double, ): WeightSum = WeightSum( this.diffIrr + diffIrr, this.dirIrr + dirIrr, this.temp + temp, - this.windVel + windVel + this.windVel + windVel, ) /** Scale the given [[WeatherData]] by dividing by the sum of weights per @@ -394,7 +394,7 @@ private[weather] object WeatherSourceWrapper extends LazyLogging { if (this.temp !~= 0d) temp.divide(this.temp) else EMPTY_WEATHER_DATA.temp, if (this.windVel !~= 0d) windVel.divide(this.windVel) - else EMPTY_WEATHER_DATA.windVel + else EMPTY_WEATHER_DATA.windVel, ) } } diff --git a/src/main/scala/edu/ie3/simona/sim/SimonaSim.scala b/src/main/scala/edu/ie3/simona/sim/SimonaSim.scala index 7a619552eb..5200e39371 100644 --- a/src/main/scala/edu/ie3/simona/sim/SimonaSim.scala +++ b/src/main/scala/edu/ie3/simona/sim/SimonaSim.scala @@ -15,7 +15,7 @@ import org.apache.pekko.actor.{ Props, Stash, SupervisorStrategy, - Terminated + Terminated, } import com.typesafe.scalalogging.LazyLogging import edu.ie3.simona.agent.EnvironmentRefs @@ -27,11 +27,11 @@ import edu.ie3.simona.sim.SimMessage.{ InitSim, SimulationFailure, SimulationSuccessful, - StartSimulation + StartSimulation, } import edu.ie3.simona.sim.SimonaSim.{ EmergencyShutdownInitiated, - SimonaSimStateData + SimonaSimStateData, } import edu.ie3.simona.sim.setup.{ExtSimSetupData, SimonaSetup} @@ -63,7 +63,7 @@ class SimonaSim(simonaSetup: SimonaSetup) logger.error( "The simulation's guardian received an uncaught exception. - {}: \"{}\" - Start emergency shutdown.", ex.getClass.getSimpleName, - ex.getMessage + ex.getMessage, ) Stop } @@ -104,9 +104,9 @@ class SimonaSim(simonaSetup: SimonaSetup) runtimeEventListener.toClassic, primaryServiceProxy, weatherService, - extSimulationData.evDataService + extSimulationData.evDataService, ), - systemParticipantsListener + systemParticipantsListener, ) /* watch all actors */ @@ -151,7 +151,7 @@ class SimonaSim(simonaSetup: SimonaSetup) context become waitingForListener( data.initSimSender, simulationSuccessful, - systemParticipantsListener + systemParticipantsListener, ) case EmergencyShutdownInitiated => @@ -165,7 +165,7 @@ class SimonaSim(simonaSetup: SimonaSetup) logger.error( "An actor ({}) unexpectedly terminated. Shut down all children gracefully and report simulation " + "failure. See logs and possible stacktrace for details.", - actorRef + actorRef, ) // stop all children @@ -175,7 +175,7 @@ class SimonaSim(simonaSetup: SimonaSetup) context become waitingForListener( data.initSimSender, successful = false, - systemParticipantsListener + systemParticipantsListener, ) } @@ -190,14 +190,14 @@ class SimonaSim(simonaSetup: SimonaSetup) logger.warn( "Received the following message. Simulation is in emergency shutdown mode. Will neglect that " + "message!\n\t{}", - unsupported + unsupported, ) } def waitingForListener( initSimSender: ActorRef, successful: Boolean, - remainingListeners: Seq[ActorRef] + remainingListeners: Seq[ActorRef], ): Receive = { case Terminated(actor) if remainingListeners.contains(actor) => val updatedRemainingListeners = remainingListeners.filterNot(_ == actor) @@ -205,7 +205,7 @@ class SimonaSim(simonaSetup: SimonaSetup) logger.debug( "Listener {} has been terminated. Remaining listeners: {}", actor, - updatedRemainingListeners + updatedRemainingListeners, ) if (updatedRemainingListeners.isEmpty) { @@ -223,7 +223,7 @@ class SimonaSim(simonaSetup: SimonaSetup) context become waitingForListener( initSimSender, successful, - updatedRemainingListeners + updatedRemainingListeners, ) } diff --git a/src/main/scala/edu/ie3/simona/sim/setup/ExtSimSetupData.scala b/src/main/scala/edu/ie3/simona/sim/setup/ExtSimSetupData.scala index 4706a50f09..d5b34606aa 100644 --- a/src/main/scala/edu/ie3/simona/sim/setup/ExtSimSetupData.scala +++ b/src/main/scala/edu/ie3/simona/sim/setup/ExtSimSetupData.scala @@ -11,7 +11,7 @@ import edu.ie3.simona.service.ev.ExtEvDataService final case class ExtSimSetupData( extSimAdapters: Iterable[ActorRef], - extDataServices: Map[Class[_], ActorRef] + extDataServices: Map[Class[_], ActorRef], ) { def evDataService: Option[ActorRef] = diff --git a/src/main/scala/edu/ie3/simona/sim/setup/SetupHelper.scala b/src/main/scala/edu/ie3/simona/sim/setup/SetupHelper.scala index b7a843ce9a..5aff8bb46a 100644 --- a/src/main/scala/edu/ie3/simona/sim/setup/SetupHelper.scala +++ b/src/main/scala/edu/ie3/simona/sim/setup/SetupHelper.scala @@ -58,12 +58,12 @@ trait SetupHelper extends LazyLogging { subGridToActorRef: Map[Int, ActorRef], gridGates: Set[SubGridGate], configRefSystems: ConfigRefSystems, - thermalGrids: Seq[ThermalGrid] + thermalGrids: Seq[ThermalGrid], ): GridAgentInitData = { val subGridGateToActorRef = buildGateToActorRef( subGridToActorRef, gridGates, - subGridContainer.getSubnet + subGridContainer.getSubnet, ) /* Find the matching reference system */ @@ -79,7 +79,7 @@ trait SetupHelper extends LazyLogging { updatedSubGridContainer, thermalGrids, subGridGateToActorRef, - refSystem + refSystem, ) } @@ -98,7 +98,7 @@ trait SetupHelper extends LazyLogging { def buildGateToActorRef( subGridToActorRefMap: Map[Int, ActorRef], subGridGates: Set[SubGridGate], - currentSubGrid: Int + currentSubGrid: Int, ): Map[SubGridGate, ActorRef] = subGridGates .groupBy(gate => (gate.superiorNode, gate.inferiorNode)) @@ -111,14 +111,14 @@ trait SetupHelper extends LazyLogging { gate -> getActorRef( subGridToActorRefMap, currentSubGrid, - superiorSubGrid + superiorSubGrid, ) } else if (superiorSubGrid == currentSubGrid) { /* This is a gate to an inferior sub grid */ gate -> getActorRef( subGridToActorRefMap, currentSubGrid, - inferiorSubGrid + inferiorSubGrid, ) } else { throw new GridAgentInitializationException( @@ -143,7 +143,7 @@ trait SetupHelper extends LazyLogging { def getActorRef( subGridToActorRefMap: Map[Int, ActorRef], currentSubGrid: Int, - queriedSubGrid: Int + queriedSubGrid: Int, ): ActorRef = { subGridToActorRefMap.get(queriedSubGrid) match { case Some(hit) => hit @@ -166,12 +166,12 @@ trait SetupHelper extends LazyLogging { */ def getRefSystem( configRefSystems: ConfigRefSystems, - subGridContainer: SubGridContainer + subGridContainer: SubGridContainer, ): RefSystem = { val refSystem = configRefSystems .find( subGridContainer.getSubnet, - Some(subGridContainer.getPredominantVoltageLevel) + Some(subGridContainer.getPredominantVoltageLevel), ) .getOrElse( throw new InitializationException( @@ -206,7 +206,7 @@ trait SetupHelper extends LazyLogging { */ def buildResultFileHierarchy( config: TypesafeConfig, - createDirs: Boolean = true + createDirs: Boolean = true, ): ResultFileHierarchy = { val simonaConfig = SimonaConfig(config) @@ -222,12 +222,12 @@ trait SetupHelper extends LazyLogging { modelsToWrite, ResultSinkType( simonaConfig.simona.output.sink, - simonaConfig.simona.simulationName - ) + simonaConfig.simona.simulationName, + ), ), addTimeStampToOutputDir = simonaConfig.simona.output.base.addTimestampToOutputDir, - createDirs = createDirs + createDirs = createDirs, ) // copy config data to output directory diff --git a/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala b/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala index caad2d1b7b..e94f782e4c 100644 --- a/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala +++ b/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala @@ -70,7 +70,7 @@ trait SimonaSetup { */ def primaryServiceProxy( context: ActorContext, - scheduler: ActorRef + scheduler: ActorRef, ): ActorRef /** Creates a weather service @@ -85,7 +85,7 @@ trait SimonaSetup { */ def weatherService( context: ActorContext, - scheduler: ActorRef + scheduler: ActorRef, ): ActorRef /** Loads external simulations and provides corresponding actors and init data @@ -99,7 +99,7 @@ trait SimonaSetup { */ def extSimulations( context: ActorContext, - scheduler: ActorRef + scheduler: ActorRef, ): ExtSimSetupData /** Creates the time advancer @@ -116,7 +116,7 @@ trait SimonaSetup { def timeAdvancer( context: ActorContext, simulation: ActorRef, - runtimeEventListener: org.apache.pekko.actor.typed.ActorRef[RuntimeEvent] + runtimeEventListener: org.apache.pekko.actor.typed.ActorRef[RuntimeEvent], ): org.apache.pekko.actor.typed.ActorRef[TimeAdvancer.Incoming] /** Creates a scheduler service @@ -130,7 +130,7 @@ trait SimonaSetup { */ def scheduler( context: ActorContext, - timeAdvancer: org.apache.pekko.actor.typed.ActorRef[TimeAdvancer.Incoming] + timeAdvancer: org.apache.pekko.actor.typed.ActorRef[TimeAdvancer.Incoming], ): ActorRef /** Creates all the needed grid agents @@ -148,7 +148,7 @@ trait SimonaSetup { def gridAgents( context: ActorContext, environmentRefs: EnvironmentRefs, - systemParticipantListener: Seq[ActorRef] + systemParticipantListener: Seq[ActorRef], ): Iterable[ActorRef] /** SIMONA links sub grids connected by a three winding transformer a bit @@ -163,7 +163,7 @@ trait SimonaSetup { new SubGridGate( transformer, transformer.getNodeInternal, - gate.inferiorNode + gate.inferiorNode, ) case _ => gate } diff --git a/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala b/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala index 246fda0101..cf9e78689f 100644 --- a/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala +++ b/src/main/scala/edu/ie3/simona/sim/setup/SimonaStandaloneSetup.scala @@ -9,7 +9,7 @@ package edu.ie3.simona.sim.setup import org.apache.pekko.actor.typed.scaladsl.adapter.{ ClassicActorContextOps, ClassicActorRefOps, - TypedActorRefOps + TypedActorRefOps, } import org.apache.pekko.actor.{ActorContext, ActorRef, ActorSystem} import com.typesafe.config.Config @@ -57,20 +57,20 @@ class SimonaStandaloneSetup( simonaConfig: SimonaConfig, resultFileHierarchy: ResultFileHierarchy, runtimeEventQueue: Option[LinkedBlockingQueue[RuntimeEvent]] = None, - override val args: Array[String] + override val args: Array[String], ) extends SimonaSetup { override def gridAgents( context: ActorContext, environmentRefs: EnvironmentRefs, - systemParticipantListener: Seq[ActorRef] + systemParticipantListener: Seq[ActorRef], ): Iterable[ActorRef] = { /* get the grid */ val subGridTopologyGraph = GridProvider .gridFromConfig( simonaConfig.simona.simulationName, - simonaConfig.simona.input.grid.datasource + simonaConfig.simona.input.grid.datasource, ) .getSubGridTopologyGraph val thermalGridsByThermalBus = GridProvider.getThermalGridsFromConfig( @@ -86,14 +86,14 @@ class SimonaStandaloneSetup( subGridTopologyGraph, context, environmentRefs, - systemParticipantListener + systemParticipantListener, ) val keys = ScheduleLock.multiKey( context, environmentRefs.scheduler.toTyped, INIT_SIM_TICK, - subGridTopologyGraph.vertexSet().size + subGridTopologyGraph.vertexSet().size, ) /* build the initialization data */ @@ -115,7 +115,7 @@ class SimonaStandaloneSetup( currentSubGrid, throw new GridAgentInitializationException( "Was asked to setup agent for sub grid " + currentSubGrid + ", but did not found it's actor reference." - ) + ), ) val thermalGrids = getThermalGrids(subGridContainer, thermalGridsByThermalBus) @@ -126,7 +126,7 @@ class SimonaStandaloneSetup( subGridToActorRefMap, subGridGates, configRefSystems, - thermalGrids + thermalGrids, ) currentActorRef ! GridAgent.Create(gridAgentInitData, key) @@ -137,7 +137,7 @@ class SimonaStandaloneSetup( override def primaryServiceProxy( context: ActorContext, - scheduler: ActorRef + scheduler: ActorRef, ): ActorRef = { val simulationStart = TimeUtil.withDefaults.toZonedDateTime( simonaConfig.simona.time.startDateTime @@ -147,9 +147,9 @@ class SimonaStandaloneSetup( scheduler, InitPrimaryServiceProxyStateData( simonaConfig.simona.input.primary, - simulationStart + simulationStart, ), - simulationStart + simulationStart, ) ) @@ -159,7 +159,7 @@ class SimonaStandaloneSetup( override def weatherService( context: ActorContext, - scheduler: ActorRef + scheduler: ActorRef, ): ActorRef = { val weatherService = context.simonaActorOf( WeatherService.props( @@ -167,14 +167,14 @@ class SimonaStandaloneSetup( TimeUtil.withDefaults .toZonedDateTime(simonaConfig.simona.time.startDateTime), TimeUtil.withDefaults - .toZonedDateTime(simonaConfig.simona.time.endDateTime) + .toZonedDateTime(simonaConfig.simona.time.endDateTime), ) ) weatherService ! SimonaService.Create( InitWeatherServiceStateData( simonaConfig.simona.input.weather.datasource ), - ScheduleLock.singleKey(context, scheduler.toTyped, INIT_SIM_TICK) + ScheduleLock.singleKey(context, scheduler.toTyped, INIT_SIM_TICK), ) weatherService @@ -182,7 +182,7 @@ class SimonaStandaloneSetup( override def extSimulations( context: ActorContext, - scheduler: ActorRef + scheduler: ActorRef, ): ExtSimSetupData = { val jars = ExtSimLoader.scanInputFolder() @@ -193,26 +193,26 @@ class SimonaStandaloneSetup( // external simulation always needs at least an ExtSimAdapter val extSimAdapter = context.simonaActorOf( ExtSimAdapter.props(scheduler), - s"$index" + s"$index", ) val extSimAdapterData = new ExtSimAdapterData(extSimAdapter, args) // send init data right away, init activation is scheduled extSimAdapter ! ExtSimAdapter.Create( extSimAdapterData, - ScheduleLock.singleKey(context, scheduler.toTyped, INIT_SIM_TICK) + ScheduleLock.singleKey(context, scheduler.toTyped, INIT_SIM_TICK), ) // setup data services that belong to this external simulation val (extData, extDataInit): ( Iterable[ExtData], - Iterable[(Class[_ <: SimonaService[_]], ActorRef)] + Iterable[(Class[_ <: SimonaService[_]], ActorRef)], ) = extLink.getExtDataSimulations.asScala.zipWithIndex.map { case (_: ExtEvSimulation, dIndex) => val extEvDataService = context.simonaActorOf( ExtEvDataService.props(scheduler), - s"$index-$dIndex" + s"$index-$dIndex", ) val extEvData = new ExtEvData(extEvDataService, extSimAdapter) @@ -221,8 +221,8 @@ class SimonaStandaloneSetup( ScheduleLock.singleKey( context, scheduler.toTyped, - INIT_SIM_TICK - ) + INIT_SIM_TICK, + ), ) (extEvData, (classOf[ExtEvDataService], extEvDataService)) @@ -230,7 +230,7 @@ class SimonaStandaloneSetup( extLink.getExtSimulation.setup( extSimAdapterData, - extData.toList.asJava + extData.toList.asJava, ) // starting external simulation @@ -246,7 +246,7 @@ class SimonaStandaloneSetup( override def timeAdvancer( context: ActorContext, simulation: ActorRef, - runtimeEventListener: org.apache.pekko.actor.typed.ActorRef[RuntimeEvent] + runtimeEventListener: org.apache.pekko.actor.typed.ActorRef[RuntimeEvent], ): org.apache.pekko.actor.typed.ActorRef[TimeAdvancer.Incoming] = { val startDateTime = TimeUtil.withDefaults.toZonedDateTime( simonaConfig.simona.time.startDateTime @@ -260,22 +260,22 @@ class SimonaStandaloneSetup( simulation, Some(runtimeEventListener), simonaConfig.simona.time.schedulerReadyCheckWindow, - endDateTime.toTick(startDateTime) + endDateTime.toTick(startDateTime), ), - TimeAdvancer.getClass.getSimpleName + TimeAdvancer.getClass.getSimpleName, ) } override def scheduler( context: ActorContext, - timeAdvancer: org.apache.pekko.actor.typed.ActorRef[TimeAdvancer.Incoming] + timeAdvancer: org.apache.pekko.actor.typed.ActorRef[TimeAdvancer.Incoming], ): ActorRef = context .spawn( Scheduler( timeAdvancer ), - Scheduler.getClass.getSimpleName + Scheduler.getClass.getSimpleName, ) .toClassic @@ -287,9 +287,9 @@ class SimonaStandaloneSetup( RuntimeEventListener( simonaConfig.simona.runtime.listener, runtimeEventQueue, - startDateTimeString = simonaConfig.simona.time.startDateTime + startDateTimeString = simonaConfig.simona.time.startDateTime, ), - RuntimeEventListener.getClass.getSimpleName + RuntimeEventListener.getClass.getSimpleName, ) override def systemParticipantsListener( @@ -302,7 +302,7 @@ class SimonaStandaloneSetup( .map { case ((listenerCompanion, events), index) => context.simonaActorOf( listenerCompanion.props(events), - index.toString + index.toString, ) } .toSeq :+ context @@ -310,7 +310,7 @@ class SimonaStandaloneSetup( ResultEventListener( resultFileHierarchy ), - ResultEventListener.getClass.getSimpleName + ResultEventListener.getClass.getSimpleName, ) .toClassic } @@ -319,7 +319,7 @@ class SimonaStandaloneSetup( subGridTopologyGraph: SubGridTopologyGraph, context: ActorContext, environmentRefs: EnvironmentRefs, - systemParticipantListener: Seq[ActorRef] + systemParticipantListener: Seq[ActorRef], ): Map[Int, ActorRef] = { subGridTopologyGraph .vertexSet() @@ -330,9 +330,9 @@ class SimonaStandaloneSetup( GridAgent.props( environmentRefs, simonaConfig, - systemParticipantListener + systemParticipantListener, ), - subGridContainer.getSubnet.toString + subGridContainer.getSubnet.toString, ) subGridContainer.getSubnet -> gridAgentRef }) @@ -349,7 +349,7 @@ class SimonaStandaloneSetup( */ private def getThermalGrids( grid: GridContainer, - thermalGridByBus: Map[ThermalBusInput, ThermalGrid] + thermalGridByBus: Map[ThermalBusInput, ThermalGrid], ): Seq[ThermalGrid] = { grid.getSystemParticipants.getHeatPumps.asScala .flatten(hpInput => thermalGridByBus.get(hpInput.getThermalBus)) @@ -366,13 +366,13 @@ object SimonaStandaloneSetup extends LazyLogging with SetupHelper { typeSafeConfig: Config, resultFileHierarchy: ResultFileHierarchy, runtimeEventQueue: Option[LinkedBlockingQueue[RuntimeEvent]] = None, - mainArgs: Array[String] = Array.empty[String] + mainArgs: Array[String] = Array.empty[String], ): SimonaStandaloneSetup = new SimonaStandaloneSetup( () => ActorSystem("simona", typeSafeConfig), SimonaConfig(typeSafeConfig), resultFileHierarchy, runtimeEventQueue, - mainArgs + mainArgs, ) } diff --git a/src/main/scala/edu/ie3/simona/util/CollectionUtils.scala b/src/main/scala/edu/ie3/simona/util/CollectionUtils.scala index 835f048cf6..6402ea7b2a 100644 --- a/src/main/scala/edu/ie3/simona/util/CollectionUtils.scala +++ b/src/main/scala/edu/ie3/simona/util/CollectionUtils.scala @@ -106,7 +106,7 @@ object CollectionUtils { */ def closestKeyValuePairs[A <: Quantity[A], O <: Quantity[O]]( map: Map[A, O], - key: A + key: A, ): Seq[(A, O)] = { import scala.collection.immutable.TreeMap implicit val ordering: Double.IeeeOrdering.type = @@ -115,7 +115,7 @@ object CollectionUtils { Seq( treeMap.rangeTo(key).lastOption, - treeMap.rangeFrom(key).headOption + treeMap.rangeFrom(key).headOption, ).flatten.distinct .map { case (k, v) => (k, v) } } diff --git a/src/main/scala/edu/ie3/simona/util/ConfigUtil.scala b/src/main/scala/edu/ie3/simona/util/ConfigUtil.scala index ca70e2d7d0..10acb7ddaf 100644 --- a/src/main/scala/edu/ie3/simona/util/ConfigUtil.scala +++ b/src/main/scala/edu/ie3/simona/util/ConfigUtil.scala @@ -10,13 +10,13 @@ import com.typesafe.scalalogging.LazyLogging import edu.ie3.datamodel.io.connectors.{ CouchbaseConnector, InfluxDbConnector, - SqlConnector + SqlConnector, } import edu.ie3.datamodel.models.result.connector.{ LineResult, SwitchResult, Transformer2WResult, - Transformer3WResult + Transformer3WResult, } import edu.ie3.datamodel.models.result.{NodeResult, ResultEntity} import edu.ie3.simona.config.SimonaConfig @@ -39,7 +39,7 @@ object ConfigUtil { final case class ParticipantConfigUtil private ( private val configs: Map[UUID, SimonaConfig.BaseRuntimeConfig], - private val defaultConfigs: Map[Class[_], BaseRuntimeConfig] + private val defaultConfigs: Map[Class[_], BaseRuntimeConfig], ) { /** Queries for a [[BaseRuntimeConfig]] of type [[T]], that applies for the @@ -88,7 +88,7 @@ object ConfigUtil { subConfig.fixedFeedIn.individualConfigs, subConfig.pv.individualConfigs, subConfig.evcs.individualConfigs, - subConfig.wec.individualConfigs + subConfig.wec.individualConfigs, ).reduceOption(_ ++ _).getOrElse(Seq.empty) ), Seq( @@ -97,8 +97,8 @@ object ConfigUtil { subConfig.pv.defaultConfig, subConfig.evcs.defaultConfig, subConfig.wec.defaultConfig, - subConfig.hp.defaultConfig - ).map { conf => conf.getClass -> conf }.toMap + subConfig.hp.defaultConfig, + ).map { conf => conf.getClass -> conf }.toMap, ) } @@ -127,8 +127,8 @@ object ConfigUtil { private val defaultConfig: NotifierConfig, private val configs: Map[ NotifierIdentifier.Value, - NotifierConfig - ] + NotifierConfig, + ], ) { def getOrDefault( notifierId: NotifierIdentifier.Value @@ -147,7 +147,7 @@ object ConfigUtil { NotifierIdentifier.values -- configs.flatMap { case ( notifierId, - NotifierConfig(resultInfo, _, _) + NotifierConfig(resultInfo, _, _), ) if !resultInfo => Some(notifierId) case _ => None @@ -157,7 +157,7 @@ object ConfigUtil { configs.flatMap { case ( notifierId, - NotifierConfig(resultInfo, _, _) + NotifierConfig(resultInfo, _, _), ) if resultInfo => Some(notifierId) case _ => None @@ -179,7 +179,7 @@ object ConfigUtil { _, simulationResult, flexResult, - powerRequestReply + powerRequestReply, ) => NotifierConfig(simulationResult, powerRequestReply, flexResult) } @@ -188,20 +188,20 @@ object ConfigUtil { notifier, simulationResult, flexResult, - powerRequestReply + powerRequestReply, ) => try { val id = NotifierIdentifier(notifier) id -> NotifierConfig( simulationResult, powerRequestReply, - flexResult + flexResult, ) } catch { case e: NoSuchElementException => throw new InvalidConfigParameterException( s"Cannot parse $notifier to known result event notifier.", - e + e, ) } }.toMap @@ -216,7 +216,7 @@ object ConfigUtil { NotifierConfig( simulationResult, powerRequestReply = false, - flexResult = false + flexResult = false, ) } val configMap = subConfig.individualConfigs.map { @@ -226,13 +226,13 @@ object ConfigUtil { id -> NotifierConfig( simulationResult, powerRequestReply = false, - flexResult = false + flexResult = false, ) } catch { case e: NoSuchElementException => throw new InvalidConfigParameterException( s"Cannot parse $notifier to known result event notifier.", - e + e, ) } }.toMap @@ -295,7 +295,7 @@ object ConfigUtil { */ def checkBaseCsvParams( params: SimonaConfig.BaseCsvParams, - csvParamsName: String + csvParamsName: String, ): Unit = params match { case BaseCsvParams(csvSep, directoryPath, _) => if (!(csvSep.equals(";") || csvSep.equals(","))) @@ -315,7 +315,7 @@ object ConfigUtil { def checkCsvParams( csvParamsName: String, csvSep: String, - folderPath: String + folderPath: String, ): Unit = { if (!(csvSep.equals(";") || csvSep.equals(","))) throw new InvalidConfigParameterException( @@ -370,7 +370,7 @@ object ConfigUtil { case Failure(exception) => throw new IllegalArgumentException( s"Unable to reach configured SQL database with url '${sql.jdbcUrl}' and user name '${sql.userName}'. Exception: $exception", - exception + exception, ) case Success(connection) => val validConnection = connection.isValid(5000) @@ -420,13 +420,13 @@ object ConfigUtil { couchbase.url, couchbase.bucketName, couchbase.userName, - couchbase.password + couchbase.password, ) ) match { case Failure(exception) => throw new IllegalArgumentException( s"Unable to reach configured Couchbase database with url '${couchbase.url}', bucket '${couchbase.bucketName}' and user name '${couchbase.userName}'. Exception: $exception", - exception + exception, ) case Success(connector) => val validConnection = connector.isConnectionValid @@ -445,7 +445,7 @@ object ConfigUtil { def checkInfluxDb1xParams( influxDb1xParamsName: String, url: String, - database: String + database: String, ): Unit = { Try( new InfluxDbConnector(url, database).isConnectionValid @@ -453,7 +453,7 @@ object ConfigUtil { case Failure(exception) => throw new IllegalArgumentException( s"Unable to reach configured influxDb1x with url '$url' for '$influxDb1xParamsName' configuration and database '$database'. Exception: $exception", - exception + exception, ) case Success(validConnection) if !validConnection => throw new IllegalArgumentException( @@ -468,7 +468,7 @@ object ConfigUtil { def checkKafkaParams( kafkaParams: KafkaParams, - topics: Seq[String] + topics: Seq[String], ): Unit = { try { UUID.fromString(kafkaParams.runId) @@ -476,7 +476,7 @@ object ConfigUtil { case e: IllegalArgumentException => throw new InvalidConfigParameterException( s"The UUID '${kafkaParams.runId}' cannot be parsed as it is invalid.", - e + e, ) } @@ -491,17 +491,17 @@ object ConfigUtil { case Failure(ke: KafkaException) => throw new InvalidConfigParameterException( s"Exception creating kafka client for broker ${kafkaParams.bootstrapServers}.", - ke + ke, ) case Failure(ee: ExecutionException) => throw new InvalidConfigParameterException( s"Connection with kafka broker ${kafkaParams.bootstrapServers} failed.", - ee + ee, ) case Failure(other) => throw new InvalidConfigParameterException( s"Checking kafka config failed with unexpected exception.", - other + other, ) case Success(missingTopics) if missingTopics.nonEmpty => throw new InvalidConfigParameterException( diff --git a/src/main/scala/edu/ie3/simona/util/EntityMapperUtil.scala b/src/main/scala/edu/ie3/simona/util/EntityMapperUtil.scala index a6e3398dcc..e52316c88a 100644 --- a/src/main/scala/edu/ie3/simona/util/EntityMapperUtil.scala +++ b/src/main/scala/edu/ie3/simona/util/EntityMapperUtil.scala @@ -25,7 +25,7 @@ case object EntityMapperUtil { ChpPlant -> classOf[ChpResult], Storage -> classOf[StorageResult], Hp -> classOf[HpResult], - House -> classOf[ThermalHouseResult] + House -> classOf[ThermalHouseResult], ) /** Get the classes of [[ResultEntity]], that are issued by the notifier, that @@ -43,6 +43,6 @@ case object EntityMapperUtil { notifierId, throw new NoSuchElementException( s"Cannot determine result entity class of notifier $notifierId" - ) + ), ) } diff --git a/src/main/scala/edu/ie3/simona/util/ReceiveDataMap.scala b/src/main/scala/edu/ie3/simona/util/ReceiveDataMap.scala index ba568a043b..1f7fca229e 100644 --- a/src/main/scala/edu/ie3/simona/util/ReceiveDataMap.scala +++ b/src/main/scala/edu/ie3/simona/util/ReceiveDataMap.scala @@ -19,7 +19,7 @@ package edu.ie3.simona.util */ final case class ReceiveDataMap[K, V]( private val expectedKeys: Set[K], - receivedData: Map[K, V] + receivedData: Map[K, V], ) { def isComplete: Boolean = expectedKeys.isEmpty @@ -27,7 +27,7 @@ final case class ReceiveDataMap[K, V]( def addData( key: K, - value: V + value: V, ): ReceiveDataMap[K, V] = { if (!expectedKeys.contains(key)) @@ -37,7 +37,7 @@ final case class ReceiveDataMap[K, V]( copy( expectedKeys = expectedKeys.excl(key), - receivedData.updated(key, value) + receivedData.updated(key, value), ) } @@ -50,13 +50,13 @@ object ReceiveDataMap { ): ReceiveDataMap[K, V] = ReceiveDataMap( expectedKeys = expectedKeys, - receivedData = Map.empty + receivedData = Map.empty, ) def empty[K, V]: ReceiveDataMap[K, V] = ReceiveDataMap( expectedKeys = Set.empty, - receivedData = Map.empty + receivedData = Map.empty, ) } diff --git a/src/main/scala/edu/ie3/simona/util/ResultFileHierarchy.scala b/src/main/scala/edu/ie3/simona/util/ResultFileHierarchy.scala index 6f27310673..171c5835a2 100644 --- a/src/main/scala/edu/ie3/simona/util/ResultFileHierarchy.scala +++ b/src/main/scala/edu/ie3/simona/util/ResultFileHierarchy.scala @@ -13,7 +13,7 @@ import com.typesafe.config.{ConfigRenderOptions, Config => TypesafeConfig} import com.typesafe.scalalogging.LazyLogging import edu.ie3.datamodel.io.naming.{ EntityPersistenceNamingStrategy, - FileNamingStrategy + FileNamingStrategy, } import edu.ie3.datamodel.models.result.ResultEntity import edu.ie3.simona.exceptions.FileHierarchyException @@ -39,7 +39,7 @@ final case class ResultFileHierarchy( private val resultEntityPathConfig: ResultEntityPathConfig, private val configureLogger: String => Unit = LogbackConfiguration.default, private val addTimeStampToOutputDir: Boolean = true, - private val createDirs: Boolean = false + private val createDirs: Boolean = false, ) extends LazyLogging { private val fileSeparator: String = File.separator @@ -76,8 +76,8 @@ final case class ResultFileHierarchy( resultEntityClass, csv, rawOutputDataDir, - fileSeparator - ) + fileSeparator, + ), ) ) .toMap @@ -101,7 +101,7 @@ final case class ResultFileHierarchy( graphOutputDir, kpiOutputDir, tmpDir, - logOutputDir + logOutputDir, ) // needs to be the latest call because otherwise the values are null as they are not initialized yet @@ -152,7 +152,7 @@ object ResultFileHierarchy extends LazyLogging { */ final case class ResultEntityPathConfig( resultEntitiesToConsider: Set[Class[_ <: ResultEntity]], - resultSinkType: ResultSinkType + resultSinkType: ResultSinkType, ) /** @param modelClass @@ -171,7 +171,7 @@ object ResultFileHierarchy extends LazyLogging { modelClass: Class[_ <: ResultEntity], csvSink: Csv, rawOutputDataDir: String, - fileSeparator: String + fileSeparator: String, ): String = { val fileEnding = if (csvSink.fileFormat.startsWith(".")) @@ -180,7 +180,7 @@ object ResultFileHierarchy extends LazyLogging { val namingStrategy = new FileNamingStrategy( new EntityPersistenceNamingStrategy( csvSink.filePrefix, - csvSink.fileSuffix + csvSink.fileSuffix, ) ) val filename = @@ -209,7 +209,7 @@ object ResultFileHierarchy extends LazyLogging { */ def prepareDirectories( config: TypesafeConfig, - resultFileHierarchy: ResultFileHierarchy + resultFileHierarchy: ResultFileHierarchy, ): Unit = { // create output directories if they are not present yet if (!runOutputDirExists(resultFileHierarchy)) @@ -217,7 +217,7 @@ object ResultFileHierarchy extends LazyLogging { logger.info( "Processing configs for simulation: {}.", - config.getString("simona.simulationName") + config.getString("simona.simulationName"), ) val outFile = diff --git a/src/main/scala/edu/ie3/simona/util/TickUtil.scala b/src/main/scala/edu/ie3/simona/util/TickUtil.scala index b705eb63c2..34f16d8e6e 100644 --- a/src/main/scala/edu/ie3/simona/util/TickUtil.scala +++ b/src/main/scala/edu/ie3/simona/util/TickUtil.scala @@ -45,7 +45,7 @@ object TickUtil { /** Calculate the length for the time interval */ def durationUntil( otherTick: Long, - tickDuration: Time = Seconds(1d) + tickDuration: Time = Seconds(1d), ): Time = tickDuration * (otherTick - tick).toDouble diff --git a/src/main/scala/edu/ie3/util/scala/ReflectionTools.scala b/src/main/scala/edu/ie3/util/scala/ReflectionTools.scala index e29a537bea..6ed62dc580 100644 --- a/src/main/scala/edu/ie3/util/scala/ReflectionTools.scala +++ b/src/main/scala/edu/ie3/util/scala/ReflectionTools.scala @@ -51,7 +51,7 @@ object ReflectionTools { */ def classFieldToVal[A](a: A)(implicit tt: TypeTag[A], - ct: ClassTag[A] + ct: ClassTag[A], ): Map[universe.MethodSymbol, Any] = { val members = tt.tpe.members.collect { case m if m.isMethod && m.asMethod.isCaseAccessor => m.asMethod diff --git a/src/main/scala/edu/ie3/util/scala/collection/immutable/PrioritySwitchBiSet.scala b/src/main/scala/edu/ie3/util/scala/collection/immutable/PrioritySwitchBiSet.scala index bdf18abdb2..5aeaf9591a 100644 --- a/src/main/scala/edu/ie3/util/scala/collection/immutable/PrioritySwitchBiSet.scala +++ b/src/main/scala/edu/ie3/util/scala/collection/immutable/PrioritySwitchBiSet.scala @@ -42,7 +42,7 @@ final case class PrioritySwitchBiSet[K, V]( private val orderedValues: immutable.Vector[V], private val valueToIndex: Map[V, Int], private val queue: immutable.SortedMap[K, immutable.SortedSet[Int]], - private val back: Map[V, K] + private val back: Map[V, K], ) { /** Get the first key of the queue, if the queue is not empty. @@ -107,7 +107,7 @@ final case class PrioritySwitchBiSet[K, V]( copy( queue = updatedQueue, - back = updatedBack + back = updatedBack, ) } .getOrElse(this) @@ -120,9 +120,9 @@ final case class PrioritySwitchBiSet[K, V]( ( copy( orderedValues = orderedValues.appended(value), - valueToIndex = valueToIndex.updated(value, newIndex) + valueToIndex = valueToIndex.updated(value, newIndex), ), - newIndex + newIndex, ) case i => (this, i) @@ -134,7 +134,7 @@ final case class PrioritySwitchBiSet[K, V]( updatedStruct.copy( queue = queue.updated(key, updatedSet), - back = back.updated(value, key) + back = back.updated(value, key), ) } @@ -165,7 +165,7 @@ final case class PrioritySwitchBiSet[K, V]( ( firstValue, - copy(queue = updatedQueue, back = back.removed(firstValue)) + copy(queue = updatedQueue, back = back.removed(firstValue)), ) } } @@ -208,6 +208,6 @@ object PrioritySwitchBiSet { Vector.empty, Map.empty, immutable.SortedMap.empty, - Map.empty + Map.empty, ) } diff --git a/src/main/scala/edu/ie3/util/scala/collection/mutable/PriorityMultiBiSet.scala b/src/main/scala/edu/ie3/util/scala/collection/mutable/PriorityMultiBiSet.scala index d25e20a2d1..bd6bd8feab 100644 --- a/src/main/scala/edu/ie3/util/scala/collection/mutable/PriorityMultiBiSet.scala +++ b/src/main/scala/edu/ie3/util/scala/collection/mutable/PriorityMultiBiSet.scala @@ -32,7 +32,7 @@ import scala.collection.{SortedSet, mutable} final case class PriorityMultiBiSet[K, V] private ( private val queue: mutable.SortedSet[K], private val table: mutable.HashMap[K, mutable.Set[V]], - private val back: mutable.HashMap[V, K] + private val back: mutable.HashMap[V, K], ) { /** Get the first key of the queue, if the queue is not empty. Runs in O(1). @@ -161,7 +161,7 @@ object PriorityMultiBiSet { PriorityMultiBiSet( mutable.SortedSet.empty[K], mutable.HashMap[K, mutable.Set[V]](), - mutable.HashMap[V, K]() + mutable.HashMap[V, K](), ) /** Creates and returns an empty PriorityMultiQueue for given types. The @@ -184,17 +184,17 @@ object PriorityMultiBiSet { */ def empty[K: Ordering, V]( initialKeyCapacity: Int, - loadFactor: Double = mutable.HashMap.defaultLoadFactor + loadFactor: Double = mutable.HashMap.defaultLoadFactor, ): PriorityMultiBiSet[K, V] = PriorityMultiBiSet( mutable.SortedSet.empty[K], new mutable.HashMap[K, mutable.Set[V]]( initialKeyCapacity, - loadFactor + loadFactor, ), new mutable.HashMap[V, K]( initialKeyCapacity, - loadFactor - ) + loadFactor, + ), ) } diff --git a/src/main/scala/edu/ie3/util/scala/io/GraphicDataCleaner.scala b/src/main/scala/edu/ie3/util/scala/io/GraphicDataCleaner.scala index e4a66cbf5c..0e1515df69 100644 --- a/src/main/scala/edu/ie3/util/scala/io/GraphicDataCleaner.scala +++ b/src/main/scala/edu/ie3/util/scala/io/GraphicDataCleaner.scala @@ -38,13 +38,13 @@ object GraphicDataCleaner { val csvRawGridSource: RawGridSource = new RawGridSource( csvTypeSource, - dataSource + dataSource, ) val csvGraphicSource: GraphicSource = new GraphicSource( csvTypeSource, csvRawGridSource, - dataSource + dataSource, ) /* read - by default, the csvGraphicSource only returns valid, that means elements with all diff --git a/src/main/scala/edu/ie3/util/scala/io/ScalaReflectionSerde.scala b/src/main/scala/edu/ie3/util/scala/io/ScalaReflectionSerde.scala index e129c8dff6..f7d6707254 100644 --- a/src/main/scala/edu/ie3/util/scala/io/ScalaReflectionSerde.scala +++ b/src/main/scala/edu/ie3/util/scala/io/ScalaReflectionSerde.scala @@ -9,7 +9,7 @@ package edu.ie3.util.scala.io import com.sksamuel.avro4s.RecordFormat import io.confluent.kafka.streams.serdes.avro.{ GenericAvroDeserializer, - GenericAvroSerializer + GenericAvroSerializer, } import org.apache.kafka.common.serialization.{Deserializer, Serializer} @@ -24,7 +24,7 @@ object ScalaReflectionSerde { override def configure( configs: java.util.Map[String, _], - isKey: Boolean + isKey: Boolean, ): Unit = inner.configure(configs, isKey) override def serialize(topic: String, maybeData: T): Array[Byte] = @@ -43,7 +43,7 @@ object ScalaReflectionSerde { override def configure( configs: java.util.Map[String, _], - isKey: Boolean + isKey: Boolean, ): Unit = inner.configure(configs, isKey) override def deserialize(topic: String, maybeData: Array[Byte]): T = diff --git a/src/main/scala/edu/ie3/util/scala/quantities/EnergyDensity.scala b/src/main/scala/edu/ie3/util/scala/quantities/EnergyDensity.scala index 56806ea8da..2f0ae95ff2 100644 --- a/src/main/scala/edu/ie3/util/scala/quantities/EnergyDensity.scala +++ b/src/main/scala/edu/ie3/util/scala/quantities/EnergyDensity.scala @@ -20,7 +20,7 @@ import scala.util.Try */ final class EnergyDensity private ( val value: Double, - val unit: EnergyDensityUnit + val unit: EnergyDensityUnit, ) extends Quantity[EnergyDensity] { def dimension: EnergyDensity.type = EnergyDensity diff --git a/src/main/scala/edu/ie3/util/scala/quantities/EnergyPrice.scala b/src/main/scala/edu/ie3/util/scala/quantities/EnergyPrice.scala index 96a32d408a..eddd58a99b 100644 --- a/src/main/scala/edu/ie3/util/scala/quantities/EnergyPrice.scala +++ b/src/main/scala/edu/ie3/util/scala/quantities/EnergyPrice.scala @@ -17,7 +17,7 @@ import scala.util.Try final class EnergyPrice private ( val value: Double, - val unit: EnergyPriceUnit + val unit: EnergyPriceUnit, ) extends squants.Quantity[EnergyPrice] { def dimension: EnergyPrice.type = EnergyPrice diff --git a/src/main/scala/edu/ie3/util/scala/quantities/QuantityUtil.scala b/src/main/scala/edu/ie3/util/scala/quantities/QuantityUtil.scala index d5aea08fdd..4ca6d188fb 100644 --- a/src/main/scala/edu/ie3/util/scala/quantities/QuantityUtil.scala +++ b/src/main/scala/edu/ie3/util/scala/quantities/QuantityUtil.scala @@ -61,7 +61,7 @@ object QuantityUtil { ] with TimeIntegral[Q]]( values: Map[Long, Q], windowStart: Long, - windowEnd: Long + windowEnd: Long, ): Try[Q] = { if (windowStart == windowEnd) Failure( @@ -76,7 +76,7 @@ object QuantityUtil { integrate[Q, QI]( values, windowStart, - windowEnd + windowEnd, ) / Seconds(windowEnd - windowStart) } } @@ -102,7 +102,7 @@ object QuantityUtil { ] with TimeIntegral[Q]]( values: Map[Long, Q], windowStart: Long, - windowEnd: Long + windowEnd: Long, ): QI = { /** Case class to hold current state of integration @@ -117,7 +117,7 @@ object QuantityUtil { final case class IntegrationState( currentIntegral: QI, lastTick: Long, - lastValue: Q + lastValue: Q, ) /* Determine the starting and ending value for the integral */ @@ -142,12 +142,12 @@ object QuantityUtil { IntegrationState( startValue * Hours(0), windowStart, - startValue + startValue, ) ) { case ( IntegrationState(currentIntegral, lastTick, lastValue), - (tick, value) + (tick, value), ) => /* Calculate the partial integral over the last know value since it's occurrence and the instance when the newest value comes in */ val duration = Seconds(tick - lastTick) @@ -172,7 +172,7 @@ object QuantityUtil { */ private def startingValue[Q <: squants.Quantity[Q]]( values: Map[Long, Q], - windowStart: Long + windowStart: Long, ): Q = { values .filter { case (tick, _) => @@ -206,7 +206,7 @@ object QuantityUtil { */ private def endingValue[Q <: Quantity[Q]]( values: Map[Long, Q], - windowEnd: Long + windowEnd: Long, ): (Long, Q) = { values .filter { case (tick, _) => diff --git a/src/main/scala/edu/ie3/util/scala/quantities/ReactivePower.scala b/src/main/scala/edu/ie3/util/scala/quantities/ReactivePower.scala index bc696b759c..aaddb36edf 100644 --- a/src/main/scala/edu/ie3/util/scala/quantities/ReactivePower.scala +++ b/src/main/scala/edu/ie3/util/scala/quantities/ReactivePower.scala @@ -14,7 +14,7 @@ import scala.util.Try final class ReactivePower private ( val value: Double, - val unit: ReactivePowerUnit + val unit: ReactivePowerUnit, ) extends Quantity[ReactivePower] with TimeIntegral[PowerRamp] { diff --git a/src/main/scala/edu/ie3/util/scala/quantities/ScalaNumberSystem.scala b/src/main/scala/edu/ie3/util/scala/quantities/ScalaNumberSystem.scala index 7440920287..238668e67a 100644 --- a/src/main/scala/edu/ie3/util/scala/quantities/ScalaNumberSystem.scala +++ b/src/main/scala/edu/ie3/util/scala/quantities/ScalaNumberSystem.scala @@ -29,7 +29,7 @@ final class ScalaNumberSystem extends DefaultNumberSystem { override def divideAndRemainder( x: Number, y: Number, - roundRemainderTowardsZero: Boolean + roundRemainderTowardsZero: Boolean, ): Array[Number] = { val signX = signum(x) val signY = signum(y) diff --git a/src/main/scala/edu/ie3/util/scala/quantities/SpecificHeatCapacity.scala b/src/main/scala/edu/ie3/util/scala/quantities/SpecificHeatCapacity.scala index a9e2c24011..e63ec421f5 100644 --- a/src/main/scala/edu/ie3/util/scala/quantities/SpecificHeatCapacity.scala +++ b/src/main/scala/edu/ie3/util/scala/quantities/SpecificHeatCapacity.scala @@ -20,7 +20,7 @@ import scala.util.Try */ final class SpecificHeatCapacity private ( val value: Double, - val unit: SpecificHeatCapacityUnit + val unit: SpecificHeatCapacityUnit, ) extends Quantity[SpecificHeatCapacity] { def dimension: SpecificHeatCapacity.type = SpecificHeatCapacity @@ -36,7 +36,7 @@ final class SpecificHeatCapacity private ( */ def calcEnergyDensity( temperatureA: Temperature, - temperatureB: Temperature + temperatureB: Temperature, ): EnergyDensity = KilowattHoursPerCubicMeter( this.toKilowattHoursPerKelvinCubicMeters * math.abs( @@ -59,7 +59,7 @@ final class SpecificHeatCapacity private ( def calcEnergy( temperatureA: Temperature, temperatureB: Temperature, - volume: Volume + volume: Volume, ): Energy = KilowattHours( this.toKilowattHoursPerKelvinCubicMeters * math.abs( diff --git a/src/main/scala/edu/ie3/util/scala/quantities/ThermalConductance.scala b/src/main/scala/edu/ie3/util/scala/quantities/ThermalConductance.scala index 1d26ec1f35..ce8f9d4293 100644 --- a/src/main/scala/edu/ie3/util/scala/quantities/ThermalConductance.scala +++ b/src/main/scala/edu/ie3/util/scala/quantities/ThermalConductance.scala @@ -17,7 +17,7 @@ import scala.util.Try */ final class ThermalConductance private ( val value: Double, - val unit: ThermalConductanceUnit + val unit: ThermalConductanceUnit, ) extends Quantity[ThermalConductance] { def dimension: ThermalConductance.type = ThermalConductance @@ -36,7 +36,7 @@ final class ThermalConductance private ( def thermalConductanceToEnergy( temperatureInner: Temperature, temperatureOuter: Temperature, - time: squants.Time + time: squants.Time, ): Energy = WattHours( this.toWattsPerKelvin * (temperatureInner.toKelvinScale - temperatureOuter.toKelvinScale) * time.toHours ) diff --git a/src/test/scala/edu/ie3/simona/agent/ValueStoreSpec.scala b/src/test/scala/edu/ie3/simona/agent/ValueStoreSpec.scala index 870f79064e..ede6b3043b 100644 --- a/src/test/scala/edu/ie3/simona/agent/ValueStoreSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/ValueStoreSpec.scala @@ -44,7 +44,7 @@ class ValueStoreSpec extends UnitSpec with PrivateMethodTester { "A filled value store" should { val filledValueStore: ValueStore[String] = ValueStore[String]( 5, - SortedMap(1L -> "One", 2L -> "Two", 3L -> "Three", 4L -> "Four") + SortedMap(1L -> "One", 2L -> "Two", 3L -> "Three", 4L -> "Four"), ) "be properly instantiated" in { @@ -54,7 +54,7 @@ class ValueStoreSpec extends UnitSpec with PrivateMethodTester { 1L -> "One", 2L -> "Two", 3L -> "Three", - 4L -> "Four" + 4L -> "Four", ) filledValueStore.maxTickSpan shouldBe 5 } @@ -74,7 +74,7 @@ class ValueStoreSpec extends UnitSpec with PrivateMethodTester { "return an empty map on request of tick window" in { filledValueStore.get(2L, 3L) shouldBe Map( 2L -> "Two", - 3L -> "Three" + 3L -> "Three", ) } @@ -88,7 +88,7 @@ class ValueStoreSpec extends UnitSpec with PrivateMethodTester { 3L -> "Three", 4L -> "Four", 5L -> "Five", - 6L -> "Six" + 6L -> "Six", ) } } diff --git a/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmCenGridSpec.scala b/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmCenGridSpec.scala index 5beb87d7b0..ace38eb295 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmCenGridSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmCenGridSpec.scala @@ -22,7 +22,7 @@ import edu.ie3.simona.ontology.messages.PowerMessage.ProvideGridPowerMessage import edu.ie3.simona.ontology.messages.PowerMessage.ProvideGridPowerMessage.ExchangePower import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.VoltageMessage.ProvideSlackVoltageMessage import edu.ie3.simona.ontology.messages.VoltageMessage.ProvideSlackVoltageMessage.ExchangeVoltage @@ -31,7 +31,7 @@ import edu.ie3.simona.test.common.model.grid.DbfsTestGrid import edu.ie3.simona.test.common.{ ConfigTestData, TestKitWithShutdown, - TestSpawnerClassic + TestSpawnerClassic, } import edu.ie3.simona.util.SimonaConstants.INIT_SIM_TICK import edu.ie3.util.scala.quantities.Megavars @@ -56,7 +56,7 @@ class DBFSAlgorithmCenGridSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="OFF" - """.stripMargin) + """.stripMargin), ) ) with DBFSMockGridAgents @@ -71,7 +71,7 @@ class DBFSAlgorithmCenGridSpec private val superiorGridAgent = SuperiorGA( TestProbe("superiorGridAgent_1000"), - Seq(supNodeA.getUuid, supNodeB.getUuid) + Seq(supNodeA.getUuid, supNodeB.getUuid), ) private val inferiorGrid11 = @@ -82,7 +82,7 @@ class DBFSAlgorithmCenGridSpec private val inferiorGrid13 = InferiorGA( TestProbe("inferiorGridAgent_13"), - Seq(node3.getUuid, node4.getUuid) + Seq(node3.getUuid, node4.getUuid), ) private val environmentRefs = EnvironmentRefs( @@ -90,7 +90,7 @@ class DBFSAlgorithmCenGridSpec runtimeEventListener = runtimeEvents.ref, primaryServiceProxy = primaryService.ref, weather = weatherService.ref, - evDataService = None + evDataService = None, ) val resultListener: TestProbe = TestProbe("resultListener") @@ -102,7 +102,7 @@ class DBFSAlgorithmCenGridSpec GridAgent.props( environmentRefs, simonaConfig, - listener = Iterable(resultListener.ref) + listener = Iterable(resultListener.ref), ) ) @@ -126,7 +126,7 @@ class DBFSAlgorithmCenGridSpec hvGridContainer, Seq.empty[ThermalGrid], subGridGateToActorRef, - RefSystem("2000 MVA", "110 kV") + RefSystem("2000 MVA", "110 kV"), ) val key = @@ -135,7 +135,7 @@ class DBFSAlgorithmCenGridSpec centerGridAgent ! GridAgent.Create( gridAgentInitData, - key + key, ) scheduler.expectMsg( ScheduleActivation(centerGridAgent.toTyped, INIT_SIM_TICK, Some(key)) @@ -145,7 +145,7 @@ class DBFSAlgorithmCenGridSpec scheduler.expectMsg( Completion( centerGridAgent.toTyped, - Some(3600) + Some(3600), ) ) @@ -155,13 +155,13 @@ class DBFSAlgorithmCenGridSpec scheduler.send( centerGridAgent, - Activation(3600) + Activation(3600), ) scheduler.expectMsg( Completion( centerGridAgent.toTyped, - Some(3600) + Some(3600), ) ) } @@ -204,9 +204,9 @@ class DBFSAlgorithmCenGridSpec ExchangeVoltage( node1.getUuid, Kilovolts(110d), - Kilovolts(0d) + Kilovolts(0d), ) - ) + ), ) inferiorGrid12.expectSlackVoltageProvision( @@ -215,9 +215,9 @@ class DBFSAlgorithmCenGridSpec ExchangeVoltage( node2.getUuid, Kilovolts(110d), - Kilovolts(0d) + Kilovolts(0d), ) - ) + ), ) inferiorGrid13.expectSlackVoltageProvision( @@ -226,14 +226,14 @@ class DBFSAlgorithmCenGridSpec ExchangeVoltage( node3.getUuid, Kilovolts(110d), - Kilovolts(0d) + Kilovolts(0d), ), ExchangeVoltage( node4.getUuid, Kilovolts(110d), - Kilovolts(0d) - ) - ) + Kilovolts(0d), + ), + ), ) // we now answer the request of our centerGridAgent @@ -246,10 +246,10 @@ class DBFSAlgorithmCenGridSpec ExchangePower( nodeUuid, Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) ) - ) + ), ) inferiorGrid12.gaProbe.send( @@ -259,10 +259,10 @@ class DBFSAlgorithmCenGridSpec ExchangePower( nodeUuid, Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) ) - ) + ), ) inferiorGrid13.gaProbe.send( @@ -272,10 +272,10 @@ class DBFSAlgorithmCenGridSpec ExchangePower( nodeUuid, Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) ) - ) + ), ) superiorGridAgent.gaProbe.send( @@ -286,15 +286,15 @@ class DBFSAlgorithmCenGridSpec ExchangeVoltage( supNodeA.getUuid, Kilovolts(380d), - Kilovolts(0d) + Kilovolts(0d), ), ExchangeVoltage( supNodeB.getUuid, Kilovolts(380d), - Kilovolts(0d) - ) - ) - ) + Kilovolts(0d), + ), + ), + ), ) // power flow calculation should run now. After it's done, @@ -307,13 +307,13 @@ class DBFSAlgorithmCenGridSpec ExchangePower( supNodeA.getUuid, Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ), ExchangePower( supNodeB.getUuid, Megawatts(0.160905770717798), - Megavars(-1.4535602349123878) - ) + Megavars(-1.4535602349123878), + ), ) ) @@ -335,15 +335,15 @@ class DBFSAlgorithmCenGridSpec ExchangeVoltage( supNodeB.getUuid, Kilovolts(374.22694614463d), // 380 kV @ 10° - Kilovolts(65.9863075134335d) // 380 kV @ 10° + Kilovolts(65.9863075134335d), // 380 kV @ 10° ), ExchangeVoltage( // this one should currently be ignored anyways supNodeA.getUuid, Kilovolts(380d), - Kilovolts(0d) - ) - ) - ) + Kilovolts(0d), + ), + ), + ), ) // After the intermediate power flow calculation, we expect one grid power @@ -377,9 +377,9 @@ class DBFSAlgorithmCenGridSpec ExchangeVoltage( node1.getUuid, Kilovolts(108.487669651919932d), - Kilovolts(19.101878551141232d) + Kilovolts(19.101878551141232d), ) - ) + ), ) inferiorGrid12.expectSlackVoltageProvision( @@ -388,9 +388,9 @@ class DBFSAlgorithmCenGridSpec ExchangeVoltage( node2.getUuid, Kilovolts(108.449088870497683d), - Kilovolts(19.10630456834157630d) + Kilovolts(19.10630456834157630d), ) - ) + ), ) inferiorGrid13.expectSlackVoltageProvision( @@ -399,14 +399,14 @@ class DBFSAlgorithmCenGridSpec ExchangeVoltage( node3.getUuid, Kilovolts(108.470028019077087d), - Kilovolts(19.104403047662570d) + Kilovolts(19.104403047662570d), ), ExchangeVoltage( node4.getUuid, Kilovolts(108.482524607256866d), - Kilovolts(19.1025584700935336d) - ) - ) + Kilovolts(19.1025584700935336d), + ), + ), ) // we now answer the requests of our centerGridAgent @@ -418,10 +418,10 @@ class DBFSAlgorithmCenGridSpec ExchangePower( nodeUuid, Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) ) - ) + ), ) inferiorGrid12.gaProbe.send( @@ -431,10 +431,10 @@ class DBFSAlgorithmCenGridSpec ExchangePower( nodeUuid, Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) ) - ) + ), ) inferiorGrid13.gaProbe.send( @@ -444,10 +444,10 @@ class DBFSAlgorithmCenGridSpec ExchangePower( nodeUuid, Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) ) - ) + ), ) // we expect that the GridAgent unstashes the messages and return a value for our power request @@ -456,13 +456,13 @@ class DBFSAlgorithmCenGridSpec ExchangePower( supNodeA.getUuid, Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ), ExchangePower( supNodeB.getUuid, Megawatts(0.16090577067051856), - Megavars(-1.4535602358772026) - ) + Megavars(-1.4535602358772026), + ), ) ) @@ -470,7 +470,7 @@ class DBFSAlgorithmCenGridSpec // connected inferior grids, because the slack node is just a mock, we imitate this behavior superiorGridAgent.gaProbe.send( centerGridAgent, - FinishGridSimulationTrigger(3600) + FinishGridSimulationTrigger(3600), ) // after a FinishGridSimulationTrigger is send the inferior grids, they themselves will send the @@ -484,7 +484,7 @@ class DBFSAlgorithmCenGridSpec scheduler.expectMsg( Completion( centerGridAgent.toTyped, - Some(7200) + Some(7200), ) ) diff --git a/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmFailedPowerFlowSpec.scala b/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmFailedPowerFlowSpec.scala index 85b4bb041a..bd677049a2 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmFailedPowerFlowSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmFailedPowerFlowSpec.scala @@ -20,11 +20,11 @@ import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.PowerMessage.ProvideGridPowerMessage.ExchangePower import edu.ie3.simona.ontology.messages.PowerMessage.{ FailedPowerFlow, - ProvideGridPowerMessage + ProvideGridPowerMessage, } import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.VoltageMessage.ProvideSlackVoltageMessage import edu.ie3.simona.ontology.messages.VoltageMessage.ProvideSlackVoltageMessage.ExchangeVoltage @@ -33,7 +33,7 @@ import edu.ie3.simona.test.common.model.grid.DbfsTestGrid import edu.ie3.simona.test.common.{ ConfigTestData, TestKitWithShutdown, - TestSpawnerClassic + TestSpawnerClassic, } import edu.ie3.simona.util.SimonaConstants.INIT_SIM_TICK import edu.ie3.util.scala.quantities.Megavars @@ -51,7 +51,7 @@ class DBFSAlgorithmFailedPowerFlowSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="OFF" - """.stripMargin) + """.stripMargin), ) ) with DBFSMockGridAgents @@ -67,7 +67,7 @@ class DBFSAlgorithmFailedPowerFlowSpec private val superiorGridAgent = SuperiorGA( TestProbe("superiorGridAgent_1000"), - Seq(supNodeA.getUuid) + Seq(supNodeA.getUuid), ) private val inferiorGridAgent = @@ -78,7 +78,7 @@ class DBFSAlgorithmFailedPowerFlowSpec runtimeEventListener = runtimeEvents.ref, primaryServiceProxy = primaryService.ref, weather = weatherService.ref, - evDataService = None + evDataService = None, ) val resultListener: TestProbe = TestProbe("resultListener") @@ -90,7 +90,7 @@ class DBFSAlgorithmFailedPowerFlowSpec GridAgent.props( environmentRefs, simonaConfig, - listener = Iterable(resultListener.ref) + listener = Iterable(resultListener.ref), ) ) @@ -111,7 +111,7 @@ class DBFSAlgorithmFailedPowerFlowSpec hvGridContainerPF, Seq.empty[ThermalGrid], subGridGateToActorRef, - RefSystem("2000 MVA", "110 kV") + RefSystem("2000 MVA", "110 kV"), ) val key = @@ -120,7 +120,7 @@ class DBFSAlgorithmFailedPowerFlowSpec centerGridAgent ! GridAgent.Create( gridAgentInitData, - key + key, ) scheduler.expectMsg( ScheduleActivation(centerGridAgent.toTyped, INIT_SIM_TICK, Some(key)) @@ -130,7 +130,7 @@ class DBFSAlgorithmFailedPowerFlowSpec scheduler.expectMsg( Completion( centerGridAgent.toTyped, - Some(3600) + Some(3600), ) ) @@ -141,14 +141,14 @@ class DBFSAlgorithmFailedPowerFlowSpec // send init data to agent scheduler.send( centerGridAgent, - Activation(3600) + Activation(3600), ) // we expect a completion message scheduler.expectMsg( Completion( centerGridAgent.toTyped, - Some(3600) + Some(3600), ) ) } @@ -179,9 +179,9 @@ class DBFSAlgorithmFailedPowerFlowSpec ExchangeVoltage( node1.getUuid, Kilovolts(110d), - Kilovolts(0d) + Kilovolts(0d), ) - ) + ), ) // we now answer the request of our centerGridAgent @@ -193,10 +193,10 @@ class DBFSAlgorithmFailedPowerFlowSpec ExchangePower( nodeUuid, Megawatts(1000.0), - Megavars(0.0) + Megavars(0.0), ) ) - ) + ), ) superiorGridAgent.gaProbe.send( @@ -207,10 +207,10 @@ class DBFSAlgorithmFailedPowerFlowSpec ExchangeVoltage( supNodeA.getUuid, Kilovolts(380d), - Kilovolts(0d) + Kilovolts(0d), ) - ) - ) + ), + ), ) // power flow calculation should run now. After it's done, @@ -227,7 +227,7 @@ class DBFSAlgorithmFailedPowerFlowSpec // connected inferior grids, because the slack node is just a mock, we imitate this behavior superiorGridAgent.gaProbe.send( centerGridAgent, - FinishGridSimulationTrigger(3600) + FinishGridSimulationTrigger(3600), ) // after a FinishGridSimulationTrigger is send to the inferior grids, they themselves will @@ -239,7 +239,7 @@ class DBFSAlgorithmFailedPowerFlowSpec scheduler.expectMsg( Completion( centerGridAgent.toTyped, - Some(7200) + Some(7200), ) ) diff --git a/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmParticipantSpec.scala b/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmParticipantSpec.scala index 76c91a359f..c15e254661 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmParticipantSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmParticipantSpec.scala @@ -8,7 +8,7 @@ package edu.ie3.simona.agent.grid import org.apache.pekko.actor.typed.scaladsl.adapter.{ ClassicActorRefOps, - TypedActorRefOps + TypedActorRefOps, } import org.apache.pekko.actor.{ActorRef, ActorSystem} import org.apache.pekko.testkit.{ImplicitSender, TestProbe} @@ -23,7 +23,7 @@ import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.PowerMessage.ProvideGridPowerMessage.ExchangePower import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.VoltageMessage.ProvideSlackVoltageMessage import edu.ie3.simona.ontology.messages.VoltageMessage.ProvideSlackVoltageMessage.ExchangeVoltage @@ -34,7 +34,7 @@ import edu.ie3.simona.test.common.model.grid.DbfsTestGridWithParticipants import edu.ie3.simona.test.common.{ ConfigTestData, TestKitWithShutdown, - TestSpawnerClassic + TestSpawnerClassic, } import edu.ie3.simona.util.SimonaConstants.INIT_SIM_TICK import edu.ie3.util.scala.quantities.Megavars @@ -51,7 +51,7 @@ class DBFSAlgorithmParticipantSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="OFF" - """.stripMargin) + """.stripMargin), ) ) with DBFSMockGridAgents @@ -70,14 +70,14 @@ class DBFSAlgorithmParticipantSpec runtimeEventListener = runtimeEvents.ref, primaryServiceProxy = primaryService.ref, weather = weatherService.ref, - evDataService = None + evDataService = None, ) protected val resultListener: TestProbe = TestProbe("resultListener") private val superiorGridAgent = SuperiorGA( TestProbe("superiorGridAgent_1000"), - Seq(supNodeA.getUuid) + Seq(supNodeA.getUuid), ) "Test participant" should { @@ -85,7 +85,7 @@ class DBFSAlgorithmParticipantSpec GridAgent.props( environmentRefs, simonaConfig, - Iterable(resultListener.ref) + Iterable(resultListener.ref), ) ) @@ -101,7 +101,7 @@ class DBFSAlgorithmParticipantSpec hvGridContainer, Seq.empty, subGridGateToActorRef, - RefSystem("2000 MVA", "110 kV") + RefSystem("2000 MVA", "110 kV"), ) val key = @@ -113,7 +113,7 @@ class DBFSAlgorithmParticipantSpec ScheduleActivation( gridAgentWithParticipants.toTyped, INIT_SIM_TICK, - Some(key) + Some(key), ) ) @@ -125,7 +125,7 @@ class DBFSAlgorithmParticipantSpec case ScheduleActivation( loadAgent, INIT_SIM_TICK, - _ + _, ) => loadAgent } @@ -133,7 +133,7 @@ class DBFSAlgorithmParticipantSpec scheduler.expectMsg( Completion( gridAgentWithParticipants.toTyped, - Some(3600) + Some(3600), ) ) @@ -145,7 +145,7 @@ class DBFSAlgorithmParticipantSpec primaryService.send( loadAgent.toClassic, - RegistrationFailedMessage(primaryService.ref) + RegistrationFailedMessage(primaryService.ref), ) scheduler.expectMsg(Completion(loadAgent, Some(0))) @@ -153,7 +153,7 @@ class DBFSAlgorithmParticipantSpec // triggering the loadAgent's calculation scheduler.send( loadAgent.toClassic, - Activation(0) + Activation(0), ) // the load agent should send a CompletionMessage scheduler.expectMsg(Completion(loadAgent, None)) @@ -165,14 +165,14 @@ class DBFSAlgorithmParticipantSpec // send init data to agent scheduler.send( gridAgentWithParticipants, - Activation(3600) + Activation(3600), ) // we expect a completion message scheduler.expectMsg( Completion( gridAgentWithParticipants.toTyped, - Some(3600) + Some(3600), ) ) @@ -201,10 +201,10 @@ class DBFSAlgorithmParticipantSpec ExchangeVoltage( supNodeA.getUuid, Kilovolts(380d), - Kilovolts(0d) + Kilovolts(0d), ) - ) - ) + ), + ), ) // power flow calculation should run now. After it's done, @@ -212,7 +212,7 @@ class DBFSAlgorithmParticipantSpec // hence we ask for them and expect a corresponding response superiorGridAgent.requestGridPower( gridAgentWithParticipants, - firstSweepNo + firstSweepNo, ) // the gridAgentWithParticipants has received an AssetPowerChangedMessage @@ -222,7 +222,7 @@ class DBFSAlgorithmParticipantSpec ExchangePower( supNodeA.getUuid, Megawatts(135.90837346741768), - Megavars(60.98643348675892) + Megavars(60.98643348675892), ) ) ) @@ -233,7 +233,7 @@ class DBFSAlgorithmParticipantSpec superiorGridAgent.requestGridPower( gridAgentWithParticipants, - secondSweepNo + secondSweepNo, ) // the agent now should ask for updated slack voltages from the superior grid @@ -249,10 +249,10 @@ class DBFSAlgorithmParticipantSpec ExchangeVoltage( supNodeA.getUuid, Kilovolts(374.2269461446d), - Kilovolts(65.9863075134d) + Kilovolts(65.9863075134d), ) - ) - ) + ), + ), ) // here the gridAgentWithParticipants has received a second AssetPowerUnchangedMessage @@ -262,7 +262,7 @@ class DBFSAlgorithmParticipantSpec ExchangePower( supNodeA.getUuid, Megawatts(135.90837346741768), - Megavars(60.98643348675892) + Megavars(60.98643348675892), ) ) ) @@ -271,13 +271,13 @@ class DBFSAlgorithmParticipantSpec // (here we do it by hand) superiorGridAgent.gaProbe.send( gridAgentWithParticipants, - FinishGridSimulationTrigger(3600L) + FinishGridSimulationTrigger(3600L), ) scheduler.expectMsg( Completion( gridAgentWithParticipants.toTyped, - Some(7200) + Some(7200), ) ) } diff --git a/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmSupGridSpec.scala b/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmSupGridSpec.scala index 41fefc20d6..a9dd723f8d 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmSupGridSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmSupGridSpec.scala @@ -22,11 +22,11 @@ import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.PowerMessage.ProvideGridPowerMessage.ExchangePower import edu.ie3.simona.ontology.messages.PowerMessage.{ ProvideGridPowerMessage, - RequestGridPowerMessage + RequestGridPowerMessage, } import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.scheduler.ScheduleLock import edu.ie3.simona.test.common.model.grid.DbfsTestGrid @@ -34,7 +34,7 @@ import edu.ie3.simona.test.common.{ ConfigTestData, TestKitWithShutdown, TestSpawnerClassic, - UnitSpec + UnitSpec, } import edu.ie3.simona.util.SimonaConstants.INIT_SIM_TICK import edu.ie3.util.scala.quantities.Megavars @@ -57,7 +57,7 @@ class DBFSAlgorithmSupGridSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="OFF" - """.stripMargin) + """.stripMargin), ) ) with UnitSpec @@ -77,7 +77,7 @@ class DBFSAlgorithmSupGridSpec runtimeEventListener = runtimeEvents.ref, primaryServiceProxy = primaryService.ref, weather = weatherService.ref, - evDataService = None + evDataService = None, ) val resultListener: TestProbe = TestProbe("resultListener") @@ -87,7 +87,7 @@ class DBFSAlgorithmSupGridSpec GridAgent.props( environmentRefs, simonaConfig, - listener = Iterable(resultListener.ref) + listener = Iterable(resultListener.ref), ) ) @@ -100,7 +100,7 @@ class DBFSAlgorithmSupGridSpec ehvGridContainer, Seq.empty[ThermalGrid], subnetGatesToActorRef, - RefSystem("5000 MVA", "380 kV") + RefSystem("5000 MVA", "380 kV"), ) val key = @@ -112,7 +112,7 @@ class DBFSAlgorithmSupGridSpec ScheduleActivation( superiorGridAgentFSM.toTyped, INIT_SIM_TICK, - Some(key) + Some(key), ) ) @@ -163,10 +163,10 @@ class DBFSAlgorithmSupGridSpec ExchangePower( uuid, Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) } - ) + ), ) // we expect a completion message here and that the agent goes back to simulate grid @@ -221,24 +221,24 @@ class DBFSAlgorithmSupGridSpec Array( ( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ), ( Megawatts(0.1), - Megavars(0.1) + Megavars(0.1), ), ( Megawatts(0.0), - Megavars(0.1) + Megavars(0.1), ), ( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ), ( Megawatts(0.0), - Megavars(0.0) - ) + Megavars(0.0), + ), ) // bring agent in simulate grid state @@ -279,10 +279,10 @@ class DBFSAlgorithmSupGridSpec ExchangePower( uuid, deviations(sweepNo)._1, - deviations(sweepNo)._2 + deviations(sweepNo)._2, ) } - ) + ), ) // we expect a completion message here and that the agent goes back to simulate grid diff --git a/src/test/scala/edu/ie3/simona/agent/grid/DBFSMockGridAgents.scala b/src/test/scala/edu/ie3/simona/agent/grid/DBFSMockGridAgents.scala index 1e12ac315e..6a001d6e1b 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/DBFSMockGridAgents.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/DBFSMockGridAgents.scala @@ -11,12 +11,12 @@ import org.apache.pekko.testkit.TestProbe import edu.ie3.simona.ontology.messages.PowerMessage.ProvideGridPowerMessage.ExchangePower import edu.ie3.simona.ontology.messages.PowerMessage.{ ProvideGridPowerMessage, - RequestGridPowerMessage + RequestGridPowerMessage, } import edu.ie3.simona.ontology.messages.VoltageMessage.ProvideSlackVoltageMessage.ExchangeVoltage import edu.ie3.simona.ontology.messages.VoltageMessage.{ ProvideSlackVoltageMessage, - RequestSlackVoltageMessage + RequestSlackVoltageMessage, } import edu.ie3.simona.test.common.UnitSpec import edu.ie3.util.scala.quantities.{Megavars, ReactivePower} @@ -48,7 +48,7 @@ trait DBFSMockGridAgents extends UnitSpec { final case class InferiorGA( override val gaProbe: TestProbe, - override val nodeUuids: Seq[UUID] + override val nodeUuids: Seq[UUID], ) extends GAActorAndModel { def expectGridPowerRequest(): ActorRef = { @@ -61,7 +61,7 @@ trait DBFSMockGridAgents extends UnitSpec { def expectSlackVoltageProvision( expectedSweepNo: Int, - expectedExchangedVoltages: Seq[ExchangeVoltage] + expectedExchangedVoltages: Seq[ExchangeVoltage], ): Unit = { inside(gaProbe.expectMsgType[ProvideSlackVoltageMessage]) { case ProvideSlackVoltageMessage(sweepNo, exchangedVoltages) => @@ -88,13 +88,13 @@ trait DBFSMockGridAgents extends UnitSpec { def requestSlackVoltage(receiver: ActorRef, sweepNo: Int): Unit = gaProbe.send( receiver, - RequestSlackVoltageMessage(sweepNo, nodeUuids) + RequestSlackVoltageMessage(sweepNo, nodeUuids), ) } final case class SuperiorGA( override val gaProbe: TestProbe, - override val nodeUuids: Seq[UUID] + override val nodeUuids: Seq[UUID], ) extends GAActorAndModel { def expectSlackVoltageRequest(expectedSweepNo: Int): ActorRef = { @@ -113,7 +113,7 @@ trait DBFSMockGridAgents extends UnitSpec { def expectGridPowerProvision( expectedExchangedPowers: Seq[ExchangePower], - maxDuration: FiniteDuration = 30 seconds + maxDuration: FiniteDuration = 30 seconds, ): Unit = { inside(gaProbe.expectMsgType[ProvideGridPowerMessage](maxDuration)) { case ProvideGridPowerMessage(exchangedPower) => @@ -140,8 +140,8 @@ trait DBFSMockGridAgents extends UnitSpec { receiver, RequestGridPowerMessage( sweepNo, - nodeUuids - ) + nodeUuids, + ), ) } } diff --git a/src/test/scala/edu/ie3/simona/agent/grid/GridAgentDataHelperSpec.scala b/src/test/scala/edu/ie3/simona/agent/grid/GridAgentDataHelperSpec.scala index 76a438267d..3e2170cbdc 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/GridAgentDataHelperSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/GridAgentDataHelperSpec.scala @@ -16,7 +16,7 @@ object GridAgentDataHelperSpec { final case class TestGridData( subgridId: Int, - subgridGates: Vector[SubGridGate] + subgridGates: Vector[SubGridGate], ) extends GridAgentDataHelper { def getSuperiorGridGates: Vector[SubGridGate] = @@ -44,31 +44,31 @@ class GridAgentDataHelperSpec extends UnitSpec with SubGridGateMokka { UUID.fromString("107a3c34-d890-4f92-95e6-beb10975d9d3"), 1, UUID.fromString("0292fbe9-63b7-4580-9920-2c7c24032abc"), - 100 + 100, ) val superiorSubGridGate2: SubGridGate = build2wSubGridGate( UUID.fromString("97e957fb-b1c0-4ae0-bfe0-329ed85616b4"), 2, UUID.fromString("f05e40a4-8d48-44c3-bbe9-bebf10022fc0"), - 100 + 100, ) val centerSubGridGate1: SubGridGate = build2wSubGridGate( UUID.fromString("37ff2b4d-de5c-4036-b0b2-f343f839182c"), 100, UUID.fromString("960deb7c-cf50-45d8-8563-5fdd713d90f2"), - 1000 + 1000, ) val centerSubGridGate2: SubGridGate = build2wSubGridGate( UUID.fromString("73a2ec29-9054-4e8d-8f0d-a945434c89d8"), 100, UUID.fromString("b17a0ec9-9567-42c8-990f-186888c6eb37"), - 2000 + 2000, ) val centerSubGridGate3: SubGridGate = build2wSubGridGate( UUID.fromString("44065395-07bf-48ef-9df4-9e82c705946d"), 100, UUID.fromString("3bcda4b0-2d1a-44f5-95c1-a63ce1d40bed"), - 3000 + 3000, ) val superiorGridGates = Vector(superiorSubGridGate1) val centerGridGates = Vector( @@ -76,7 +76,7 @@ class GridAgentDataHelperSpec extends UnitSpec with SubGridGateMokka { superiorSubGridGate2, centerSubGridGate1, centerSubGridGate2, - centerSubGridGate3 + centerSubGridGate3, ) val inferiorGridGates = Vector(centerSubGridGate1) @@ -99,7 +99,7 @@ class GridAgentDataHelperSpec extends UnitSpec with SubGridGateMokka { superiorGridAgent.getSuperiorGridNodeUuids shouldBe Vector.empty[String] centerGridAgent.getSuperiorGridNodeUuids shouldBe Vector( UUID.fromString("107a3c34-d890-4f92-95e6-beb10975d9d3"), - UUID.fromString("97e957fb-b1c0-4ae0-bfe0-329ed85616b4") + UUID.fromString("97e957fb-b1c0-4ae0-bfe0-329ed85616b4"), ) inferiorGridAgent.getSuperiorGridNodeUuids shouldBe Vector( UUID.fromString("37ff2b4d-de5c-4036-b0b2-f343f839182c") @@ -114,7 +114,7 @@ class GridAgentDataHelperSpec extends UnitSpec with SubGridGateMokka { centerGridAgent.getInferiorGridGates shouldBe Vector( centerSubGridGate1, centerSubGridGate2, - centerSubGridGate3 + centerSubGridGate3, ) inferiorGridAgent.getInferiorGridGates shouldBe Vector.empty[SubGridGate] @@ -133,7 +133,7 @@ class GridAgentDataHelperSpec extends UnitSpec with SubGridGateMokka { superiorGridAgent.getSuperiorGridGates shouldBe Vector.empty[SubGridGate] centerGridAgent.getSuperiorGridGates shouldBe Vector( superiorSubGridGate1, - superiorSubGridGate2 + superiorSubGridGate2, ) inferiorGridAgent.getSuperiorGridGates shouldBe Vector(centerSubGridGate1) } @@ -151,7 +151,7 @@ class GridAgentDataHelperSpec extends UnitSpec with SubGridGateMokka { centerGridAgent.getInferiorGridNodeUuids shouldBe Vector( UUID.fromString("960deb7c-cf50-45d8-8563-5fdd713d90f2"), UUID.fromString("b17a0ec9-9567-42c8-990f-186888c6eb37"), - UUID.fromString("3bcda4b0-2d1a-44f5-95c1-a63ce1d40bed") + UUID.fromString("3bcda4b0-2d1a-44f5-95c1-a63ce1d40bed"), ) inferiorGridAgent.getInferiorGridNodeUuids shouldBe Vector.empty[String] } diff --git a/src/test/scala/edu/ie3/simona/agent/grid/GridAgentSetup2WSpec.scala b/src/test/scala/edu/ie3/simona/agent/grid/GridAgentSetup2WSpec.scala index e58ad3c2fb..3a5490b892 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/GridAgentSetup2WSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/GridAgentSetup2WSpec.scala @@ -12,7 +12,7 @@ import org.apache.pekko.actor.{ ActorRef, ActorSystem, Identify, - Props + Props, } import org.apache.pekko.testkit.ImplicitSender import org.apache.pekko.util.Timeout @@ -40,7 +40,7 @@ class GridAgentSetup2WSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="OFF" - """.stripMargin) + """.stripMargin), ) ) with ImplicitSender @@ -64,7 +64,7 @@ class GridAgentSetup2WSpec runtimeEventListener = self, primaryServiceProxy = self, weather = ActorRef.noSender, - evDataService = None + evDataService = None, ) SimonaStandaloneSetup( @@ -76,20 +76,20 @@ class GridAgentSetup2WSpec Set.empty[Class[_ <: ResultEntity]], ResultSinkType( simonaConfig.simona.output.sink, - simonaConfig.simona.simulationName - ) - ) - ) + simonaConfig.simona.simulationName, + ), + ), + ), ).buildSubGridToActorRefMap( gridContainer.getSubGridTopologyGraph, context, environmentRefs, - Seq.empty[ActorRef] + Seq.empty[ActorRef], ) sender() ! "done" } })) ? "setup", - Duration(1, TimeUnit.SECONDS) + Duration(1, TimeUnit.SECONDS), ) val sel = system.actorSelection("user/**/GridAgent_*") @@ -99,7 +99,7 @@ class GridAgentSetup2WSpec val responses: Seq[ActorIdentity] = receiveWhile( max = Duration.create(500, "ms"), - idle = Duration.create(250, "ms") + idle = Duration.create(250, "ms"), ) { case msg: ActorIdentity => msg } diff --git a/src/test/scala/edu/ie3/simona/agent/grid/GridAgentSetup3WSpec.scala b/src/test/scala/edu/ie3/simona/agent/grid/GridAgentSetup3WSpec.scala index f2b2d44f41..e12209b4f2 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/GridAgentSetup3WSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/GridAgentSetup3WSpec.scala @@ -12,7 +12,7 @@ import org.apache.pekko.actor.{ ActorRef, ActorSystem, Identify, - Props + Props, } import org.apache.pekko.testkit.ImplicitSender import org.apache.pekko.util.Timeout @@ -25,7 +25,7 @@ import edu.ie3.simona.sim.setup.SimonaStandaloneSetup import edu.ie3.simona.test.common.{ ConfigTestData, TestKitWithShutdown, - ThreeWindingTestData + ThreeWindingTestData, } import edu.ie3.simona.util.ResultFileHierarchy import edu.ie3.simona.util.ResultFileHierarchy.ResultEntityPathConfig @@ -43,7 +43,7 @@ class GridAgentSetup3WSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="DEBUG" - """.stripMargin) + """.stripMargin), ) ) with ImplicitSender @@ -66,7 +66,7 @@ class GridAgentSetup3WSpec runtimeEventListener = self, primaryServiceProxy = self, weather = ActorRef.noSender, - evDataService = None + evDataService = None, ) SimonaStandaloneSetup( @@ -78,20 +78,20 @@ class GridAgentSetup3WSpec Set.empty[Class[_ <: ResultEntity]], ResultSinkType( simonaConfig.simona.output.sink, - simonaConfig.simona.simulationName - ) - ) - ) + simonaConfig.simona.simulationName, + ), + ), + ), ).buildSubGridToActorRefMap( threeWindingTestGrid.getSubGridTopologyGraph, context, environmentRefs, - Seq.empty[ActorRef] + Seq.empty[ActorRef], ) sender() ! "done" } })) ? "setup", - Duration(1, TimeUnit.SECONDS) + Duration(1, TimeUnit.SECONDS), ) val sel = system.actorSelection("user/**/GridAgent_*") @@ -101,7 +101,7 @@ class GridAgentSetup3WSpec val responses: Seq[ActorIdentity] = receiveWhile( max = Duration.create(500, "ms"), - idle = Duration.create(250, "ms") + idle = Duration.create(250, "ms"), ) { case msg: ActorIdentity => msg } diff --git a/src/test/scala/edu/ie3/simona/agent/grid/GridResultsSupportSpec.scala b/src/test/scala/edu/ie3/simona/agent/grid/GridResultsSupportSpec.scala index 2ae971cc5f..ce67a10c04 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/GridResultsSupportSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/GridResultsSupportSpec.scala @@ -14,7 +14,7 @@ import edu.ie3.datamodel.models.result.NodeResult import edu.ie3.datamodel.models.result.connector.{ LineResult, SwitchResult, - Transformer2WResult + Transformer2WResult, } import edu.ie3.powerflow.model.NodeData.StateData import edu.ie3.powerflow.model.enums.NodeType @@ -22,20 +22,20 @@ import edu.ie3.simona.agent.grid.GridResultsSupport.PartialTransformer3wResult import edu.ie3.simona.model.grid.Transformer3wPowerFlowCase.{ PowerFlowCaseA, PowerFlowCaseB, - PowerFlowCaseC + PowerFlowCaseC, } import edu.ie3.simona.model.grid.{ RefSystem, Transformer3wModel, TransformerModel, - TransformerTappingModel + TransformerTappingModel, } import edu.ie3.simona.test.common.exceptions.InvalidTestDataException import edu.ie3.simona.test.common.input.GridInputTestData import edu.ie3.simona.test.common.model.grid.{ BasicGrid, BasicGridWithSwitches, - TransformerTestData + TransformerTestData, } import edu.ie3.simona.test.common.{DefaultTestData, UnitSpec} import edu.ie3.util.TimeUtil @@ -75,8 +75,8 @@ class GridResultsSupportSpec 0, NodeType.PQ, Complex(0.9583756183209947, -0.04673985022513541), - Complex(0.006466666857417822, 2.7286658176028933e-15) - ) + Complex(0.006466666857417822, 2.7286658176028933e-15), + ), ) val nodeResult = @@ -86,7 +86,7 @@ class GridResultsSupportSpec nodeUuid, Quantities.getQuantity(0.9595146895129939, PU), Quantities - .getQuantity(-2.79209521012981881159, DEGREE_GEOM) + .getQuantity(-2.79209521012981881159, DEGREE_GEOM), ) nodeResult.getInputModel shouldBe expectedNodeResult.getInputModel @@ -95,12 +95,12 @@ class GridResultsSupportSpec QuantityUtil.isEquivalentAngle( nodeResult.getvAng, expectedNodeResult.getvAng, - 1e-12 + 1e-12, ) shouldBe true QuantityUtil.isEquivalentAbs( nodeResult.getvMag, expectedNodeResult.getvMag, - 1e-12 + 1e-12, ) shouldBe true } } @@ -112,7 +112,7 @@ class GridResultsSupportSpec val expectedSwitchResult = new SwitchResult( defaultSimulationStart, switch1.uuid, - switch1.isClosed + switch1.isClosed, ) switchResult.getTime shouldBe expectedSwitchResult.getTime @@ -132,7 +132,7 @@ class GridResultsSupportSpec Quantities .getQuantity(24.9409944828817942724, Units.AMPERE), Quantities - .getQuantity(153.57729374050189129708, DEGREE_GEOM) + .getQuantity(153.57729374050189129708, DEGREE_GEOM), ) val nodeAStateData = new StateData( @@ -140,18 +140,18 @@ class GridResultsSupportSpec NodeType.PQ, Complex( 0.8655176782269813, - -0.037052090894132306 + -0.037052090894132306, ), // Angle = -2,4512878986765928398° - Complex(0.319999917504236, 4.86242990316299e-15) + Complex(0.319999917504236, 4.86242990316299e-15), ) val nodeBStateData = new StateData( 2, NodeType.PQ, Complex( 0.8637364806386005, - -0.03745498173182088 + -0.03745498173182088, ), // Angle = -2,4830128149755043846° - Complex(0.31999991750423107, -2.3469073906490223e-14) + Complex(0.31999991750423107, -2.3469073906490223e-14), ) val lineResult: LineResult = calcLineResult( @@ -159,7 +159,7 @@ class GridResultsSupportSpec nodeAStateData, nodeBStateData, default400Kva10KvRefSystem.nominalCurrent, - defaultSimulationStart + defaultSimulationStart, ) lineResult.getInputModel shouldBe expectedLineResult.getInputModel @@ -167,23 +167,23 @@ class GridResultsSupportSpec QuantityUtil.isEquivalentAbs( lineResult.getiAMag, expectedLineResult.getiAMag, - 1e-4 + 1e-4, ) shouldBe true QuantityUtil.isEquivalentAngle( lineResult.getiAAng, expectedLineResult.getiAAng, - 1e-3 + 1e-3, ) shouldBe true QuantityUtil.isEquivalentAbs( lineResult.getiBMag, expectedLineResult.getiBMag, - 1e-4 + 1e-4, ) shouldBe true QuantityUtil.isEquivalentAngle( lineResult.getiBAng, expectedLineResult.getiBAng, - 1e-3 + 1e-3, ) shouldBe true // if line is disabled zero results are expected @@ -193,7 +193,7 @@ class GridResultsSupportSpec nodeAStateData, nodeBStateData, default400Kva10KvRefSystem.nominalCurrent, - defaultSimulationStart + defaultSimulationStart, ) disabledLineResult shouldBe new LineResult( @@ -202,7 +202,7 @@ class GridResultsSupportSpec ScalaQuantityUtil.zeroCompQuantity(Units.AMPERE), ScalaQuantityUtil.zeroCompQuantity(DEGREE_GEOM), ScalaQuantityUtil.zeroCompQuantity(Units.AMPERE), - ScalaQuantityUtil.zeroCompQuantity(DEGREE_GEOM) + ScalaQuantityUtil.zeroCompQuantity(DEGREE_GEOM), ) } @@ -220,7 +220,7 @@ class GridResultsSupportSpec iAMag: Double, iAAng: Double, iBMag: Double, - iBAng: Double + iBAng: Double, ) => /* === Prepare test data and expected result === */ /* Get the correct transformer model */ @@ -241,7 +241,7 @@ class GridResultsSupportSpec 0, NodeType.SL, voltageHv, - Complex.zero + Complex.zero, ) /* Prepare node information for low voltage node */ @@ -249,13 +249,13 @@ class GridResultsSupportSpec 1, NodeType.PQ, voltageLv, - powerLv + powerLv, ) /* Set up grid's reference system */ val refSys = RefSystem( Kilowatts(400d), - Volts(400d) + Volts(400d), ) /* Artificial time stamp */ @@ -270,7 +270,7 @@ class GridResultsSupportSpec Quantities.getQuantity(iAAng, DEGREE_GEOM), Quantities.getQuantity(iBMag, AMPERE), Quantities.getQuantity(iBAng, DEGREE_GEOM), - tapPos + tapPos, ) /* === Perform the operation to test === */ @@ -279,7 +279,7 @@ class GridResultsSupportSpec hvNodeStateData, lvNodeStateData, refSys.nominalCurrent, - time + time, ) /* === Examine the result === */ @@ -288,23 +288,23 @@ class GridResultsSupportSpec QuantityUtil.isEquivalentAbs( actual.getiAMag(), expectedResult.getiAMag(), - 1e-3 + 1e-3, ) shouldBe true QuantityUtil.isEquivalentAngle( actual.getiAAng(), expectedResult.getiAAng(), - 1e-3 + 1e-3, ) shouldBe true QuantityUtil.isEquivalentAbs( actual.getiBMag(), expectedResult.getiBMag(), - 1e-3 + 1e-3, ) shouldBe true if ( QuantityUtil.isEquivalentAngle( actual.getiBAng(), expectedResult.getiBAng(), - 1e-3 + 1e-3, ) ) { /* Angles are considerably equal */ @@ -343,7 +343,7 @@ class GridResultsSupportSpec ) ) .to(AMPERE), - 1e-4 + 1e-4, ) shouldBe true /* Testing the imaginary part of the current */ QuantityUtil.isEquivalentAbs( @@ -373,7 +373,7 @@ class GridResultsSupportSpec ) ) .to(AMPERE), - 1e-4 + 1e-4, ) shouldBe true } actual.getTapPos shouldBe expectedResult.getTapPos @@ -391,13 +391,13 @@ class GridResultsSupportSpec 0, NodeType.SL, Complex.one, - Complex.zero + Complex.zero, ) val nodeStateDataLv: StateData = StateData( 1, NodeType.PQ, Complex.one, - Complex.zero + Complex.zero, ) val expectedResult: Transformer2WResult = new Transformer2WResult( @@ -407,7 +407,7 @@ class GridResultsSupportSpec ScalaQuantityUtil.zeroCompQuantity(DEGREE_GEOM), ScalaQuantityUtil.zeroCompQuantity(AMPERE), ScalaQuantityUtil.zeroCompQuantity(DEGREE_GEOM), - transformerModel.currentTapPos + transformerModel.currentTapPos, ) calcTransformer2wResult( @@ -416,9 +416,9 @@ class GridResultsSupportSpec nodeStateDataLv, RefSystem( Kilowatts(400d), - Volts(400d) + Volts(400d), ).nominalCurrent, - TimeUtil.withDefaults.toZonedDateTime("2020-06-08 09:03:00") + TimeUtil.withDefaults.toZonedDateTime("2020-06-08 09:03:00"), ) shouldBe expectedResult } } @@ -443,25 +443,25 @@ class GridResultsSupportSpec 10, -10, 0, - autoTap = true + autoTap = true, ), 1, PowerFlowCaseA, Each(0.1d), Each(0.2d), Each(0.3d), - Each(0.4d) + Each(0.4d), ) transformerA.initTapping() val transformerB = transformerA.copy( powerFlowCase = PowerFlowCaseB, g = Each(0d), - b = Each(0d) + b = Each(0d), ) val transformerC = transformerA.copy( powerFlowCase = PowerFlowCaseC, g = Each(0d), - b = Each(0d) + b = Each(0d), ) val iNominal = Amperes(100d) @@ -477,14 +477,14 @@ class GridResultsSupportSpec nodeStateData, internalNodeStateData, iNominal, - timeStamp + timeStamp, ) match { case PartialTransformer3wResult.PortA( time, input, currentMagnitude, currentAngle, - tapPos + tapPos, ) => time shouldBe timeStamp input shouldBe transformerA.uuid @@ -505,13 +505,13 @@ class GridResultsSupportSpec nodeStateData, internalNodeStateData, iNominal, - timeStamp + timeStamp, ) match { case PartialTransformer3wResult.PortB( time, input, currentMagnitude, - currentAngle + currentAngle, ) => time shouldBe timeStamp input shouldBe transformerB.uuid @@ -531,13 +531,13 @@ class GridResultsSupportSpec nodeStateData, internalNodeStateData, iNominal, - timeStamp + timeStamp, ) match { case PartialTransformer3wResult.PortC( time, input, currentMagnitude, - currentAngle + currentAngle, ) => time shouldBe timeStamp input shouldBe transformerC.uuid @@ -554,18 +554,18 @@ class GridResultsSupportSpec default400Kva10KvRefSystem, 2, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ), new StateData(0, NodeType.PQ, Complex(1, 0), Complex(1, 0)), new StateData(1, NodeType.PQ, Complex(0.99, 0), Complex(0.98, 0)), default400Kva10KvRefSystem.nominalCurrent, - timeStamp + timeStamp, ) match { case PartialTransformer3wResult.PortB( time, input, currentMagnitude, - currentAngle + currentAngle, ) => time shouldBe timeStamp input shouldBe transformer3wInput.getUuid diff --git a/src/test/scala/edu/ie3/simona/agent/grid/PowerFlowSupportSpec.scala b/src/test/scala/edu/ie3/simona/agent/grid/PowerFlowSupportSpec.scala index 66805b06d9..3be73dc240 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/PowerFlowSupportSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/PowerFlowSupportSpec.scala @@ -49,7 +49,7 @@ class PowerFlowSupportSpec ExchangeVoltage( node6.uuid, Kilovolts(110d), - Kilovolts(0d) + Kilovolts(0d), ) ) ), @@ -59,11 +59,11 @@ class PowerFlowSupportSpec ExchangePower( node1.uuid, Megawatts(1d), - Megavars(0d) + Megavars(0d), ) ) ) - ) + ), ) val currentTolerance = 1e-3 // 1 mA @@ -97,7 +97,7 @@ class PowerFlowSupportSpec gridModel.gridComponents.transformers3w, gridModel.nodeUuidToIndexMap, receivedValuesStore, - gridModel.mainRefSystem + gridModel.mainRefSystem, ) operatingPoint.length shouldBe 10 withClue "safety check: 13 nodes minus 3 closed switches" @@ -106,7 +106,7 @@ class PowerFlowSupportSpec gridModel, 3, operatingPoint, - slackNodeVoltages + slackNodeVoltages, )(Vector(1e-12)) match { case successResult: ValidNewtonRaphsonPFResult => successResult case failure => fail(s"Newton-Raphson failed: $failure") @@ -115,7 +115,7 @@ class PowerFlowSupportSpec val sweepValueStore = SweepValueStore( result, gridModel.gridComponents.nodes, - gridModel.nodeUuidToIndexMap + gridModel.nodeUuidToIndexMap, ) val pfResult = @@ -127,26 +127,26 @@ class PowerFlowSupportSpec line18To1, line0To17, line0To15, - line16To3 + line16To3, ).map(_.uuid).toSet pfResult.lineResults .filter(lineRes => loadLinesLeft.contains(lineRes.getInputModel)) .foreach { lineRes => lineRes.getiAMag() should equalWithTolerance( 30.4954d.asAmpere, - currentTolerance + currentTolerance, ) lineRes.getiBMag() should equalWithTolerance( 30.4954d.asAmpere, - currentTolerance + currentTolerance, ) normalizeAngle(lineRes.getiAAng()) should equalWithTolerance( 179.7095d.asDegreeGeom, - angleTolerance + angleTolerance, ) normalizeAngle(lineRes.getiBAng()) should equalWithTolerance( 179.7095d.asDegreeGeom, - angleTolerance + angleTolerance, ) } @@ -155,26 +155,26 @@ class PowerFlowSupportSpec Iterable( line1To13, line14To2, - line2To3 + line2To3, ).map(_.uuid).toSet pfResult.lineResults .filter(lineRes => loadLinesRight.contains(lineRes.getInputModel)) .foreach { lineRes => lineRes.getiAMag() should equalWithTolerance( 27.723d.asAmpere, - currentTolerance + currentTolerance, ) lineRes.getiBMag() should equalWithTolerance( 27.723d.asAmpere, - currentTolerance + currentTolerance, ) normalizeAngle(lineRes.getiAAng()) should equalWithTolerance( 179.7095d.asDegreeGeom, - angleTolerance + angleTolerance, ) normalizeAngle(lineRes.getiBAng()) should equalWithTolerance( 179.7095d.asDegreeGeom, - angleTolerance + angleTolerance, ) } @@ -198,7 +198,7 @@ class PowerFlowSupportSpec gridModel.gridComponents.transformers3w, gridModel.nodeUuidToIndexMap, receivedValuesStore, - gridModel.mainRefSystem + gridModel.mainRefSystem, ) operatingPoint.length shouldBe 11 withClue "safety check: 13 nodes minus 2 closed switches" @@ -207,7 +207,7 @@ class PowerFlowSupportSpec gridModel, 50, operatingPoint, - slackNodeVoltages + slackNodeVoltages, )(Vector(1e-12)) match { case successResult: ValidNewtonRaphsonPFResult => successResult case failure => fail(s"Newton-Raphson failed: $failure") @@ -218,8 +218,8 @@ class PowerFlowSupportSpec SweepValueStore( result, gridModel.gridComponents.nodes, - gridModel.nodeUuidToIndexMap - ) + gridModel.nodeUuidToIndexMap, + ), )(ZonedDateTime.now()) // left/top side segments (lines that are adjacent to the open switch) should have no load @@ -230,11 +230,11 @@ class PowerFlowSupportSpec .foreach { lineRes => lineRes.getiAMag() should equalWithTolerance( 0.0001d.asAmpere, - currentTolerance + currentTolerance, ) lineRes.getiBMag() should equalWithTolerance( 0.0001d.asAmpere, - currentTolerance + currentTolerance, ) // angles are not reliable enough with such small magnitudes } @@ -247,19 +247,19 @@ class PowerFlowSupportSpec .foreach { lineRes => lineRes.getiAMag() should equalWithTolerance( 58.6017d.asAmpere, - currentTolerance + currentTolerance, ) lineRes.getiBMag() should equalWithTolerance( 58.6017d.asAmpere, - currentTolerance + currentTolerance, ) normalizeAngle(lineRes.getiAAng()) should equalWithTolerance( 179.4090d.asDegreeGeom, - angleTolerance + angleTolerance, ) normalizeAngle(lineRes.getiBAng()) should equalWithTolerance( 179.4090d.asDegreeGeom, - angleTolerance + angleTolerance, ) } @@ -283,7 +283,7 @@ class PowerFlowSupportSpec gridModel.gridComponents.transformers3w, gridModel.nodeUuidToIndexMap, receivedValuesStore, - gridModel.mainRefSystem + gridModel.mainRefSystem, ) operatingPoint.length shouldBe 11 withClue "safety check: 13 nodes minus 2 closed switches" @@ -292,7 +292,7 @@ class PowerFlowSupportSpec gridModel, 50, operatingPoint, - slackNodeVoltages + slackNodeVoltages, )(Vector(1e-12)) match { case successResult: ValidNewtonRaphsonPFResult => successResult case failure => fail(s"Newton-Raphson failed: $failure") @@ -303,8 +303,8 @@ class PowerFlowSupportSpec SweepValueStore( result, gridModel.gridComponents.nodes, - gridModel.nodeUuidToIndexMap - ) + gridModel.nodeUuidToIndexMap, + ), )(ZonedDateTime.now()) // left/top side segments (lines that are adjacent to the open switch) should have load @@ -315,19 +315,19 @@ class PowerFlowSupportSpec .foreach { lineRes => lineRes.getiAMag() should equalWithTolerance( 58.5343d.asAmpere, - currentTolerance + currentTolerance, ) lineRes.getiBMag() should equalWithTolerance( 58.5343d.asAmpere, - currentTolerance + currentTolerance, ) normalizeAngle(lineRes.getiAAng()) should equalWithTolerance( 179.461d.asDegreeGeom, - angleTolerance + angleTolerance, ) normalizeAngle(lineRes.getiBAng()) should equalWithTolerance( 179.461d.asDegreeGeom, - angleTolerance + angleTolerance, ) } @@ -341,11 +341,11 @@ class PowerFlowSupportSpec .foreach { lineRes => lineRes.getiAMag() should equalWithTolerance( 0.0001d.asAmpere, - currentTolerance + currentTolerance, ) lineRes.getiBMag() should equalWithTolerance( 0.0001d.asAmpere, - currentTolerance + currentTolerance, ) // angles are not reliable enough with such small magnitudes } diff --git a/src/test/scala/edu/ie3/simona/agent/grid/ReceivedValuesStoreSpec.scala b/src/test/scala/edu/ie3/simona/agent/grid/ReceivedValuesStoreSpec.scala index e4d9fedf2c..0902a476ce 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/ReceivedValuesStoreSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/ReceivedValuesStoreSpec.scala @@ -23,7 +23,7 @@ class ReceivedValuesStoreSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="OFF" - """.stripMargin) + """.stripMargin), ) ) with UnitSpec @@ -42,7 +42,7 @@ class ReceivedValuesStoreSpec ), UUID.fromString("34e807f1-c62b-4968-b0f6-980ce500ff97") -> Set( actorProbe2.ref - ) + ), ) // / subnet gate mapping for inferior grids @@ -51,7 +51,7 @@ class ReceivedValuesStoreSpec UUID.fromString("5cd55ab5-a7d2-499f-a25f-6dbc3845c5e8"), 1, UUID.fromString("1676360a-c7c4-43a9-a667-90ddfe8a18e6"), - 2 + 2, ) -> actorProbe3.ref ) @@ -72,7 +72,7 @@ class ReceivedValuesStoreSpec ReceivedValuesStore.empty( nodeToAssetAgentsMap, inferiorSubGridGateToActorRefMap, - superiorGridNodeUuids + superiorGridNodeUuids, ) receivedValuesStore.nodeToReceivedSlackVoltage.size shouldBe 0 @@ -86,7 +86,7 @@ class ReceivedValuesStoreSpec ReceivedValuesStore.empty( nodeToAssetAgentsMap, inferiorSubGridGateToActorRefMap, - superiorGridNodeUuids + superiorGridNodeUuids, ) receivedValuesStore.nodeToReceivedPower.size shouldBe 3 @@ -116,8 +116,8 @@ class ReceivedValuesStoreSpec ), UUID.fromString("34e807f1-c62b-4968-b0f6-980ce500ff97") -> Set( actorProbe2.ref, - actorProbe3.ref - ) + actorProbe3.ref, + ), ) val inferiorSubGridGateToActorRefMap = Map.empty[SubGridGate, ActorRef] @@ -127,7 +127,7 @@ class ReceivedValuesStoreSpec ReceivedValuesStore.empty( nodeToAssetAgentsMap, inferiorSubGridGateToActorRefMap, - superiorGridNodeUuids + superiorGridNodeUuids, ) receivedValuesStore.nodeToReceivedSlackVoltage.size shouldBe 0 @@ -140,7 +140,7 @@ class ReceivedValuesStoreSpec UUID.fromString("34e807f1-c62b-4968-b0f6-980ce500ff97") ) shouldBe Map( actorProbe2.ref -> None, - actorProbe3.ref -> None + actorProbe3.ref -> None, ) } @@ -153,7 +153,7 @@ class ReceivedValuesStoreSpec ReceivedValuesStore.empty( nodeToAssetAgentsMap, inferiorSubGridGateToActorRefMap, - superiorGridNodeUuids + superiorGridNodeUuids, ) receivedValuesStore.nodeToReceivedSlackVoltage.size shouldBe 0 @@ -178,14 +178,14 @@ class ReceivedValuesStoreSpec val superiorGridNodeUuids = Vector( UUID.fromString("baded8c4-b703-4316-b62f-75ffe09c9843"), - UUID.fromString("d5040bf7-56c1-4d6a-908a-47c05b0c5c54") + UUID.fromString("d5040bf7-56c1-4d6a-908a-47c05b0c5c54"), ) val receivedValuesStore = ReceivedValuesStore.empty( nodeToAssetAgentsMap, inferiorSubGridGateToActorRefMap, - superiorGridNodeUuids + superiorGridNodeUuids, ) receivedValuesStore.nodeToReceivedPower.size shouldBe 0 @@ -209,7 +209,7 @@ class ReceivedValuesStoreSpec ReceivedValuesStore.empty( nodeToAssetAgentsMap, inferiorSubGridGateToActorRefMap, - superiorGridNodeUuids + superiorGridNodeUuids, ) receivedValuesStore.nodeToReceivedSlackVoltage.size shouldBe 0 diff --git a/src/test/scala/edu/ie3/simona/agent/participant/EvcsAgentModelCalculationSpec.scala b/src/test/scala/edu/ie3/simona/agent/participant/EvcsAgentModelCalculationSpec.scala index ad8fbca59d..73239981d3 100644 --- a/src/test/scala/edu/ie3/simona/agent/participant/EvcsAgentModelCalculationSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/participant/EvcsAgentModelCalculationSpec.scala @@ -22,23 +22,23 @@ import edu.ie3.simona.agent.state.ParticipantAgentState.HandleInformation import edu.ie3.simona.config.SimonaConfig.EvcsRuntimeConfig import edu.ie3.simona.event.ResultEvent.{ FlexOptionsResultEvent, - ParticipantResultEvent + ParticipantResultEvent, } import edu.ie3.simona.event.notifier.NotifierConfig import edu.ie3.simona.model.participant.evcs.EvModelWrapper import edu.ie3.simona.model.participant.evcs.EvcsModel.{ EvcsState, - ScheduleEntry + ScheduleEntry, } import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.PowerMessage.{ AssetPowerChangedMessage, AssetPowerUnchangedMessage, - RequestAssetPowerMessage + RequestAssetPowerMessage, } import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage._ import edu.ie3.simona.ontology.messages.flex.MinMaxFlexibilityMessage.ProvideMinMaxFlexOptions @@ -46,7 +46,7 @@ import edu.ie3.simona.ontology.messages.services.EvMessage._ import edu.ie3.simona.ontology.messages.services.ServiceMessage.PrimaryServiceRegistrationMessage import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResponseMessage.{ RegistrationFailedMessage, - RegistrationSuccessfulMessage + RegistrationSuccessfulMessage, } import edu.ie3.simona.scheduler.ScheduleLock.ScheduleKey import edu.ie3.simona.test.ParticipantAgentSpec @@ -76,7 +76,7 @@ class EvcsAgentModelCalculationSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="DEBUG" - """.stripMargin) + """.stripMargin), ) ) with EvcsInputTestData @@ -89,7 +89,7 @@ class EvcsAgentModelCalculationSpec NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false + flexResult = false, ) private val modelConfig = @@ -98,7 +98,7 @@ class EvcsAgentModelCalculationSpec scaling = 1.0, uuids = List("default"), chargingStrategy = "maxPower", - lowestEvSoc = 0.2 + lowestEvSoc = 0.2, ) protected implicit val simulationStartDate: ZonedDateTime = @@ -122,7 +122,7 @@ class EvcsAgentModelCalculationSpec val initStateData = ParticipantInitializeStateData[ EvcsInput, EvcsRuntimeConfig, - ApparentPower + ApparentPower, ]( inputModel = evcsInputModel, modelConfig = modelConfig, @@ -132,7 +132,7 @@ class EvcsAgentModelCalculationSpec resolution = resolution, requestVoltageDeviationThreshold = requestVoltageDeviationThreshold, outputConfig = defaultOutputConfig, - primaryServiceProxy = primaryServiceProxy.ref + primaryServiceProxy = primaryServiceProxy.ref, ) "be instantiated correctly" in { @@ -140,7 +140,7 @@ class EvcsAgentModelCalculationSpec new EvcsAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = Iterable.empty + listener = Iterable.empty, ) ) evcsAgent.stateName shouldBe Uninitialized @@ -161,7 +161,7 @@ class EvcsAgentModelCalculationSpec new EvcsAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = Iterable.empty + listener = Iterable.empty, ) ) @@ -173,7 +173,7 @@ class EvcsAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( evcsAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) deathProbe.expectTerminated(evcsAgent.ref) @@ -186,7 +186,7 @@ class EvcsAgentModelCalculationSpec val initStateData = ParticipantInitializeStateData[ EvcsInput, EvcsRuntimeConfig, - ApparentPower + ApparentPower, ]( inputModel = evcsInputModel, modelConfig = modelConfig, @@ -198,7 +198,7 @@ class EvcsAgentModelCalculationSpec resolution = resolution, requestVoltageDeviationThreshold = requestVoltageDeviationThreshold, outputConfig = defaultOutputConfig, - primaryServiceProxy = primaryServiceProxy.ref + primaryServiceProxy = primaryServiceProxy.ref, ) "be instantiated correctly" in { @@ -206,7 +206,7 @@ class EvcsAgentModelCalculationSpec new EvcsAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = Iterable.empty + listener = Iterable.empty, ) ) @@ -226,7 +226,7 @@ class EvcsAgentModelCalculationSpec new EvcsAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = Iterable.empty + listener = Iterable.empty, ) ) @@ -248,7 +248,7 @@ class EvcsAgentModelCalculationSpec timeBin, requestVoltageDeviationThreshold, outputConfig, - maybeEmAgent + maybeEmAgent, ) => inputModel shouldBe SimpleInputContainer(evcsInputModel) modelConfig shouldBe modelConfig @@ -268,7 +268,7 @@ class EvcsAgentModelCalculationSpec /* Refuse registration */ primaryServiceProxy.send( evcsAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* Expect a registration message */ @@ -292,10 +292,10 @@ class EvcsAgentModelCalculationSpec requestValueStore, _, _, - _ + _, ), awaitRegistrationResponsesFrom, - foreseenNextDataTicks + foreseenNextDataTicks, ) => /* Base state data */ startDate shouldBe simulationStartDate @@ -306,13 +306,13 @@ class EvcsAgentModelCalculationSpec outputConfig shouldBe NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false + flexResult = false, ) additionalActivationTicks shouldBe empty foreseenDataTicks shouldBe Map.empty voltageValueStore shouldBe ValueStore( resolution, - SortedMap(0L -> Each(1.0)) + SortedMap(0L -> Each(1.0)), ) resultValueStore shouldBe ValueStore(resolution) requestValueStore shouldBe ValueStore[ApparentPower](resolution) @@ -329,7 +329,7 @@ class EvcsAgentModelCalculationSpec /* Reply, that registration was successful */ evService.send( evcsAgent, - RegistrationSuccessfulMessage(evService.ref, None) + RegistrationSuccessfulMessage(evService.ref, None), ) /* Expect a completion message */ @@ -353,7 +353,7 @@ class EvcsAgentModelCalculationSpec new EvcsAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = Iterable.empty + listener = Iterable.empty, ) ) @@ -363,14 +363,14 @@ class EvcsAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( evcsAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* Expect a registration message */ evService.expectMsg(RegisterForEvDataMessage(evcsInputModel.getUuid)) evService.send( evcsAgent, - RegistrationSuccessfulMessage(evService.ref, Some(900L)) + RegistrationSuccessfulMessage(evService.ref, Some(900L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -382,12 +382,12 @@ class EvcsAgentModelCalculationSpec evcsAgent ! RequestAssetPowerMessage( 0L, Each(1.0), - Each(0.0) + Each(0.0), ) expectMsg( AssetPowerChangedMessage( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) ) @@ -400,9 +400,9 @@ class EvcsAgentModelCalculationSpec SortedMap( 0L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) - ) + ), ) case _ => fail( @@ -418,27 +418,27 @@ class EvcsAgentModelCalculationSpec new EvcsAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = Iterable.empty + listener = Iterable.empty, ) ) scheduler.send( evcsAgent, - Activation(INIT_SIM_TICK) + Activation(INIT_SIM_TICK), ) /* Refuse registration with primary service */ primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( evcsAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ evService.expectMsgType[RegisterForEvDataMessage] evService.send( evcsAgent, - RegistrationSuccessfulMessage(evService.ref, None) + RegistrationSuccessfulMessage(evService.ref, None), ) /* I'm not interested in the content of the CompletionMessage */ @@ -457,8 +457,8 @@ class EvcsAgentModelCalculationSpec 0L, evService.ref, arrivingEvsData, - unlockKey = key1 - ) + unlockKey = key1, + ), ) scheduler.expectMsg(ScheduleActivation(evcsAgent.toTyped, 0, key1)) @@ -468,7 +468,7 @@ class EvcsAgentModelCalculationSpec case DataCollectionStateData( baseStateData: ParticipantModelBaseStateData[_, _, _, _], expectedSenders, - isYetTriggered + isYetTriggered, ) => /* The next data tick is already registered */ baseStateData.foreseenDataTicks shouldBe Map(evService.ref -> None) @@ -489,7 +489,7 @@ class EvcsAgentModelCalculationSpec /* Trigger the agent */ scheduler.send( evcsAgent, - Activation(0) + Activation(0), ) /* The agent will notice, that all expected information are apparent, switch to Calculate and trigger itself @@ -508,7 +508,7 @@ class EvcsAgentModelCalculationSpec case Some(EvcsState(currentEvs, schedule, tick)) => currentEvs should contain theSameElementsAs Set( EvModelWrapper(evA), - EvModelWrapper(evB) + EvModelWrapper(evB), ) schedule shouldBe Map( @@ -516,16 +516,16 @@ class EvcsAgentModelCalculationSpec ScheduleEntry( 0, 200, - Kilowatts(11.0) + Kilowatts(11.0), ) ), evB.getUuid -> SortedSet( ScheduleEntry( 0, 200, - Kilowatts(11.0) + Kilowatts(11.0), ) - ) + ), ) tick shouldBe 0L @@ -554,27 +554,27 @@ class EvcsAgentModelCalculationSpec new EvcsAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = Iterable.empty + listener = Iterable.empty, ) ) scheduler.send( evcsAgent, - Activation(INIT_SIM_TICK) + Activation(INIT_SIM_TICK), ) /* Refuse registration with primary service */ primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( evcsAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ evService.expectMsgType[RegisterForEvDataMessage] evService.send( evcsAgent, - RegistrationSuccessfulMessage(evService.ref, None) + RegistrationSuccessfulMessage(evService.ref, None), ) /* I'm not interested in the content of the CompletionMessage */ @@ -585,7 +585,7 @@ class EvcsAgentModelCalculationSpec /* Send out activation */ scheduler.send( evcsAgent, - Activation(0) + Activation(0), ) /* Find yourself in corresponding state and state data */ @@ -594,7 +594,7 @@ class EvcsAgentModelCalculationSpec case DataCollectionStateData( baseStateData: ParticipantModelBaseStateData[_, _, _, _], expectedSenders, - isYetTriggered + isYetTriggered, ) => /* The next data tick is already registered */ baseStateData.foreseenDataTicks shouldBe Map(evService.ref -> None) @@ -621,8 +621,8 @@ class EvcsAgentModelCalculationSpec 0L, evService.ref, arrivingEvsData, - unlockKey = key1 - ) + unlockKey = key1, + ), ) scheduler.expectMsg(ScheduleActivation(evcsAgent.toTyped, 0, key1)) @@ -642,7 +642,7 @@ class EvcsAgentModelCalculationSpec case Some(EvcsState(currentEvs, schedule, tick)) => currentEvs should contain theSameElementsAs Set( EvModelWrapper(evA), - EvModelWrapper(evB) + EvModelWrapper(evB), ) schedule shouldBe Map( evA.getUuid -> @@ -650,7 +650,7 @@ class EvcsAgentModelCalculationSpec ScheduleEntry( 0, 200, - Kilowatts(11.0) + Kilowatts(11.0), ) ), evB.getUuid -> @@ -658,9 +658,9 @@ class EvcsAgentModelCalculationSpec ScheduleEntry( 0, 200, - Kilowatts(11.0) + Kilowatts(11.0), ) - ) + ), ) tick shouldBe 0L @@ -687,27 +687,27 @@ class EvcsAgentModelCalculationSpec new EvcsAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = Iterable.empty + listener = Iterable.empty, ) ) scheduler.send( evcsAgent, - Activation(INIT_SIM_TICK) + Activation(INIT_SIM_TICK), ) /* Refuse registration with primary service */ primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( evcsAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ evService.expectMsgType[RegisterForEvDataMessage] evService.send( evcsAgent, - RegistrationSuccessfulMessage(evService.ref, None) + RegistrationSuccessfulMessage(evService.ref, None), ) /* I'm not interested in the content of the CompletionMessage */ @@ -717,7 +717,7 @@ class EvcsAgentModelCalculationSpec evcsAgent ! RequestAssetPowerMessage( 7200L, Each(1.0), - Each(0.0) + Each(0.0), ) expectMsgType[AssetPowerChangedMessage] match { @@ -734,27 +734,27 @@ class EvcsAgentModelCalculationSpec new EvcsAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = Iterable.empty + listener = Iterable.empty, ) ) scheduler.send( evcsAgent, - Activation(INIT_SIM_TICK) + Activation(INIT_SIM_TICK), ) /* Refuse registration with primary service */ primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( evcsAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ evService.expectMsgType[RegisterForEvDataMessage] evService.send( evcsAgent, - RegistrationSuccessfulMessage(evService.ref, None) + RegistrationSuccessfulMessage(evService.ref, None), ) /* I'm not interested in the content of the CompletionMessage */ @@ -764,13 +764,13 @@ class EvcsAgentModelCalculationSpec /* Send out public evcs request */ evService.send( evcsAgent, - EvFreeLotsRequest(0L) + EvFreeLotsRequest(0L), ) evService.expectMsg( FreeLotsResponse( evcsInputModel.getUuid, - 2 + 2, ) ) @@ -784,28 +784,28 @@ class EvcsAgentModelCalculationSpec 0L, evService.ref, ArrivingEvsData(Seq(EvModelWrapper(evA))), - unlockKey = key1 - ) + unlockKey = key1, + ), ) scheduler.expectMsg(ScheduleActivation(evcsAgent.toTyped, 0, key1)) scheduler.send( evcsAgent, - Activation(0) + Activation(0), ) scheduler.expectMsg(Completion(evcsAgent.toTyped)) /* Ask for public evcs lot count again with a later tick */ evService.send( evcsAgent, - EvFreeLotsRequest(3600L) + EvFreeLotsRequest(3600L), ) // this time, only one is still free evService.expectMsg( FreeLotsResponse( evcsInputModel.getUuid, - 1 + 1, ) ) @@ -826,9 +826,9 @@ class EvcsAgentModelCalculationSpec resolution = resolution, requestVoltageDeviationThreshold = requestVoltageDeviationThreshold, outputConfig = defaultOutputConfig, - primaryServiceProxy = primaryServiceProxy.ref + primaryServiceProxy = primaryServiceProxy.ref, ), - listener = systemListener + listener = systemListener, ) ) @@ -841,14 +841,14 @@ class EvcsAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( evcsAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ evService.expectMsgType[RegisterForEvDataMessage] evService.send( evcsAgent, - RegistrationSuccessfulMessage(evService.ref, None) + RegistrationSuccessfulMessage(evService.ref, None), ) /* I'm not interested in the content of the CompletionMessage */ @@ -864,8 +864,8 @@ class EvcsAgentModelCalculationSpec 0L, evService.ref, ArrivingEvsData(Seq(EvModelWrapper(evA.copyWithDeparture(3600L)))), - unlockKey = key1 - ) + unlockKey = key1, + ), ) scheduler.expectMsg(ScheduleActivation(evcsAgent.toTyped, 0, key1)) scheduler.send(evcsAgent, Activation(0)) @@ -876,7 +876,7 @@ class EvcsAgentModelCalculationSpec // departures first evService.send( evcsAgent, - DepartingEvsRequest(3600L, Seq(evA.getUuid)) + DepartingEvsRequest(3600L, Seq(evA.getUuid)), ) evService.expectMsgType[DepartingEvsResponse] match { case DepartingEvsResponse(evcs, evModels) => @@ -898,8 +898,8 @@ class EvcsAgentModelCalculationSpec 3600L, evService.ref, ArrivingEvsData(Seq(EvModelWrapper(evB.copyWithDeparture(7200L)))), - unlockKey = key2 - ) + unlockKey = key2, + ), ) scheduler.expectMsg(ScheduleActivation(evcsAgent.toTyped, 3600, key2)) @@ -911,7 +911,7 @@ class EvcsAgentModelCalculationSpec // departures first evService.send( evcsAgent, - DepartingEvsRequest(7200L, Seq(evB.getUuid)) + DepartingEvsRequest(7200L, Seq(evB.getUuid)), ) evService.expectMsgType[DepartingEvsResponse] match { case DepartingEvsResponse(evcs, evModels) => @@ -932,8 +932,8 @@ class EvcsAgentModelCalculationSpec 7200L, evService.ref, ArrivingEvsData(Seq(EvModelWrapper(evA.copyWithDeparture(10800L)))), - unlockKey = key3 - ) + unlockKey = key3, + ), ) scheduler.expectMsg(ScheduleActivation(evcsAgent.toTyped, 7200, key3)) @@ -945,7 +945,7 @@ class EvcsAgentModelCalculationSpec evcsAgent ! RequestAssetPowerMessage( 7500L, Each(1.0), - Each(0.0) + Each(0.0), ) expectMsgType[AssetPowerChangedMessage] match { @@ -962,7 +962,7 @@ class EvcsAgentModelCalculationSpec evcsAgent ! RequestAssetPowerMessage( 7500L, Each(1.000000000000001d), - Each(0.0) + Each(0.0), ) /* Expect, that nothing has changed */ @@ -978,7 +978,7 @@ class EvcsAgentModelCalculationSpec evcsAgent ! RequestAssetPowerMessage( 7500L, Each(0.98), - Each(0.0) + Each(0.0), ) /* Expect, the correct values (this model has fixed power factor) */ @@ -1011,9 +1011,9 @@ class EvcsAgentModelCalculationSpec requestVoltageDeviationThreshold = requestVoltageDeviationThreshold, outputConfig = defaultOutputConfig, primaryServiceProxy = primaryServiceProxy.ref, - maybeEmAgent = Some(emAgent.ref.toTyped) + maybeEmAgent = Some(emAgent.ref.toTyped), ), - listener = Iterable.empty + listener = Iterable.empty, ) ) @@ -1035,7 +1035,7 @@ class EvcsAgentModelCalculationSpec resolution, requestVoltageDeviationThreshold, outputConfig, - maybeEmAgent + maybeEmAgent, ) => inputModel shouldBe SimpleInputContainer(evcsInputModelQv) modelConfig shouldBe modelConfig @@ -1055,14 +1055,14 @@ class EvcsAgentModelCalculationSpec /* Refuse registration */ primaryServiceProxy.send( evcsAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) emAgent.expectMsg( RegisterParticipant( evcsInputModelQv.getUuid, evcsAgent.toTyped, - evcsInputModelQv + evcsInputModelQv, ) ) // only receive registration message. ScheduleFlexRequest after secondary service initialized @@ -1071,7 +1071,7 @@ class EvcsAgentModelCalculationSpec evService.expectMsg(RegisterForEvDataMessage(evcsInputModelQv.getUuid)) evService.send( evcsAgent, - RegistrationSuccessfulMessage(evService.ref, None) + RegistrationSuccessfulMessage(evService.ref, None), ) emAgent.expectMsg( @@ -1097,7 +1097,7 @@ class EvcsAgentModelCalculationSpec requestValueStore, _, _, - _ + _, ) => /* Base state data */ startDate shouldBe simulationStartDate @@ -1110,7 +1110,7 @@ class EvcsAgentModelCalculationSpec foreseenDataTicks shouldBe Map(evService.ref -> None) voltageValueStore shouldBe ValueStore( resolution, - SortedMap(0L -> Each(1.0)) + SortedMap(0L -> Each(1.0)), ) resultValueStore shouldBe ValueStore( resolution @@ -1146,12 +1146,12 @@ class EvcsAgentModelCalculationSpec outputConfig = NotifierConfig( simulationResultInfo = true, powerRequestReply = false, - flexResult = true + flexResult = true, ), primaryServiceProxy = primaryServiceProxy.ref, - maybeEmAgent = Some(emAgent.ref.toTyped) + maybeEmAgent = Some(emAgent.ref.toTyped), ), - listener = Iterable(resultListener.ref) + listener = Iterable(resultListener.ref), ) ) @@ -1173,7 +1173,7 @@ class EvcsAgentModelCalculationSpec resolution, requestVoltageDeviationThreshold, outputConfig, - maybeEmAgent + maybeEmAgent, ) => inputModel shouldBe SimpleInputContainer(evcsInputModelQv) modelConfig shouldBe modelConfig @@ -1187,7 +1187,7 @@ class EvcsAgentModelCalculationSpec outputConfig shouldBe NotifierConfig( simulationResultInfo = true, powerRequestReply = false, - flexResult = true + flexResult = true, ) maybeEmAgent shouldBe Some(emAgent.ref.toTyped) case unsuitableStateData => @@ -1197,14 +1197,14 @@ class EvcsAgentModelCalculationSpec /* Refuse registration */ primaryServiceProxy.send( evcsAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) emAgent.expectMsg( RegisterParticipant( evcsInputModelQv.getUuid, evcsAgent.toTyped, - evcsInputModelQv + evcsInputModelQv, ) ) emAgent.expectNoMessage() @@ -1212,7 +1212,7 @@ class EvcsAgentModelCalculationSpec evService.expectMsg(RegisterForEvDataMessage(evcsInputModelQv.getUuid)) evService.send( evcsAgent, - RegistrationSuccessfulMessage(evService.ref, None) + RegistrationSuccessfulMessage(evService.ref, None), ) emAgent.expectMsg( @@ -1232,7 +1232,7 @@ class EvcsAgentModelCalculationSpec modelUuid, refPower, minPower, - maxPower + maxPower, ) => modelUuid shouldBe evcsInputModelQv.getUuid refPower should approximate(Kilowatts(0.0)) @@ -1250,7 +1250,7 @@ class EvcsAgentModelCalculationSpec emAgent.send( evcsAgent, - IssueNoControl(0) + IssueNoControl(0), ) // next potential activation at fully charged battery: @@ -1261,7 +1261,7 @@ class EvcsAgentModelCalculationSpec modelUuid, result, requestAtNextActivation, - requestAtTick + requestAtTick, ) => modelUuid shouldBe evcsInputModelQv.getUuid result.p should approximate(Kilowatts(0)) @@ -1285,8 +1285,8 @@ class EvcsAgentModelCalculationSpec ProvideEvDataMessage( 900, evService.ref, - ArrivingEvsData(Seq(ev900)) - ) + ArrivingEvsData(Seq(ev900)), + ), ) emAgent.expectMsg(ScheduleFlexRequest(evcsInputModelQv.getUuid, 900)) @@ -1297,7 +1297,7 @@ class EvcsAgentModelCalculationSpec modelUuid, referencePower, minPower, - maxPower + maxPower, ) => modelUuid shouldBe evcsInputModelQv.getUuid referencePower shouldBe ev900.sRatedAc @@ -1321,7 +1321,7 @@ class EvcsAgentModelCalculationSpec modelUuid, result, requestAtNextActivation, - requestAtTick + requestAtTick, ) => modelUuid shouldBe evcsInputModelQv.getUuid result.p should approximate( @@ -1356,7 +1356,7 @@ class EvcsAgentModelCalculationSpec // departure first evService.send( evcsAgent, - DepartingEvsRequest(4500, Seq(ev900.uuid)) + DepartingEvsRequest(4500, Seq(ev900.uuid)), ) evService.expectMsgPF() { case DepartingEvsResponse(uuid, evs) => @@ -1403,8 +1403,8 @@ class EvcsAgentModelCalculationSpec ProvideEvDataMessage( 4500, evService.ref, - ArrivingEvsData(Seq(ev4500)) - ) + ArrivingEvsData(Seq(ev4500)), + ), ) emAgent.expectMsg(ScheduleFlexRequest(evcsInputModelQv.getUuid, 4500)) @@ -1415,7 +1415,7 @@ class EvcsAgentModelCalculationSpec modelUuid, referencePower, minPower, - maxPower + maxPower, ) => modelUuid shouldBe evcsInputModelQv.getUuid referencePower shouldBe ev4500.sRatedAc @@ -1441,7 +1441,7 @@ class EvcsAgentModelCalculationSpec modelUuid, result, requestAtNextActivation, - requestAtTick + requestAtTick, ) => modelUuid shouldBe evcsInputModelQv.getUuid result.p should approximate(Kilowatts(11)) @@ -1466,7 +1466,7 @@ class EvcsAgentModelCalculationSpec modelUuid, referencePower, minPower, - maxPower + maxPower, ) => modelUuid shouldBe evcsInputModelQv.getUuid referencePower shouldBe ev4500.sRatedAc @@ -1494,7 +1494,7 @@ class EvcsAgentModelCalculationSpec modelUuid, result, requestAtNextActivation, - requestAtTick + requestAtTick, ) => modelUuid shouldBe evcsInputModelQv.getUuid result.p should approximate(Kilowatts(10)) @@ -1536,8 +1536,8 @@ class EvcsAgentModelCalculationSpec ProvideEvDataMessage( 11700, evService.ref, - ArrivingEvsData(Seq(ev11700)) - ) + ArrivingEvsData(Seq(ev11700)), + ), ) emAgent.expectMsg(ScheduleFlexRequest(evcsInputModelQv.getUuid, 11700)) @@ -1554,7 +1554,7 @@ class EvcsAgentModelCalculationSpec modelUuid, refPower, minPower, - maxPower + maxPower, ) => modelUuid shouldBe evcsInputModelQv.getUuid refPower shouldBe combinedChargingPowerSq @@ -1586,7 +1586,7 @@ class EvcsAgentModelCalculationSpec modelUuid, result, requestAtNextActivation, - requestAtTick + requestAtTick, ) => modelUuid shouldBe evcsInputModelQv.getUuid result.p should approximate(Kilowatts(16)) @@ -1626,7 +1626,7 @@ class EvcsAgentModelCalculationSpec modelUuid, referencePower, minPower, - maxPower + maxPower, ) => modelUuid shouldBe evcsInputModelQv.getUuid referencePower shouldBe combinedChargingPowerSq @@ -1660,7 +1660,7 @@ class EvcsAgentModelCalculationSpec modelUuid, result, requestAtNextActivation, - requestAtTick + requestAtTick, ) => modelUuid shouldBe evcsInputModelQv.getUuid result.p should approximate(Kilowatts(-20)) @@ -1708,7 +1708,7 @@ class EvcsAgentModelCalculationSpec modelUuid, referencePower, minPower, - maxPower + maxPower, ) => modelUuid shouldBe evcsInputModelQv.getUuid referencePower shouldBe combinedChargingPowerSq @@ -1744,7 +1744,7 @@ class EvcsAgentModelCalculationSpec modelUuid, result, requestAtNextActivation, - requestAtTick + requestAtTick, ) => modelUuid shouldBe evcsInputModelQv.getUuid result.p should approximate(Kilowatts(-10)) @@ -1792,7 +1792,7 @@ class EvcsAgentModelCalculationSpec modelUuid, referencePower, minPower, - maxPower + maxPower, ) => modelUuid shouldBe evcsInputModelQv.getUuid referencePower shouldBe combinedChargingPowerSq @@ -1819,7 +1819,7 @@ class EvcsAgentModelCalculationSpec modelUuid, result, requestAtNextActivation, - requestAtTick + requestAtTick, ) => modelUuid shouldBe evcsInputModelQv.getUuid result.p should approximate(Kilowatts(0)) @@ -1863,7 +1863,7 @@ class EvcsAgentModelCalculationSpec // departure first evService.send( evcsAgent, - DepartingEvsRequest(36000, Seq(ev900.uuid)) + DepartingEvsRequest(36000, Seq(ev900.uuid)), ) evService.expectMsgPF() { case DepartingEvsResponse(uuid, evs) => @@ -1910,7 +1910,7 @@ class EvcsAgentModelCalculationSpec modelUuid, referencePower, minPower, - maxPower + maxPower, ) => modelUuid shouldBe evcsInputModelQv.getUuid referencePower shouldBe ev4500.sRatedAc @@ -1937,7 +1937,7 @@ class EvcsAgentModelCalculationSpec modelUuid, result, requestAtNextActivation, - requestAtTick + requestAtTick, ) => modelUuid shouldBe evcsInputModelQv.getUuid result.p should approximate(Kilowatts(4)) diff --git a/src/test/scala/edu/ie3/simona/agent/participant/FixedFeedInAgentModelCalculationSpec.scala b/src/test/scala/edu/ie3/simona/agent/participant/FixedFeedInAgentModelCalculationSpec.scala index 8b64aa9c26..bdda047856 100644 --- a/src/test/scala/edu/ie3/simona/agent/participant/FixedFeedInAgentModelCalculationSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/participant/FixedFeedInAgentModelCalculationSpec.scala @@ -21,7 +21,7 @@ import edu.ie3.simona.agent.participant.statedata.ParticipantStateData.{ ParticipantInitializeStateData, ParticipantInitializingStateData, ParticipantUninitializedStateData, - SimpleInputContainer + SimpleInputContainer, } import edu.ie3.simona.agent.state.AgentState.{Idle, Uninitialized} import edu.ie3.simona.agent.state.ParticipantAgentState.HandleInformation @@ -33,7 +33,7 @@ import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.PowerMessage.{ AssetPowerChangedMessage, AssetPowerUnchangedMessage, - RequestAssetPowerMessage + RequestAssetPowerMessage, } import edu.ie3.simona.ontology.messages.SchedulerMessage.Completion import edu.ie3.simona.ontology.messages.services.ServiceMessage.PrimaryServiceRegistrationMessage @@ -59,7 +59,7 @@ class FixedFeedInAgentModelCalculationSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="DEBUG" - """.stripMargin) + """.stripMargin), ) ) with FixedFeedInputTestData { @@ -83,12 +83,12 @@ class FixedFeedInAgentModelCalculationSpec private val simonaConfig: SimonaConfig = createSimonaConfig( LoadModelBehaviour.FIX, - LoadReference.ActivePower(Kilowatts(0d)) + LoadReference.ActivePower(Kilowatts(0d)), ) private val defaultOutputConfig = NotifierConfig( simonaConfig.simona.output.participant.defaultConfig.simulationResult, simonaConfig.simona.output.participant.defaultConfig.powerRequestReply, - simonaConfig.simona.output.participant.defaultConfig.flexResult + simonaConfig.simona.output.participant.defaultConfig.flexResult, ) private val fixedFeedConfigUtil = ConfigUtil.ParticipantConfigUtil( @@ -105,7 +105,7 @@ class FixedFeedInAgentModelCalculationSpec val initStateData = ParticipantInitializeStateData[ FixedFeedInInput, FixedFeedInRuntimeConfig, - ApparentPower + ApparentPower, ]( inputModel = voltageSensitiveInput, modelConfig = modelConfig, @@ -116,7 +116,7 @@ class FixedFeedInAgentModelCalculationSpec requestVoltageDeviationThreshold = simonaConfig.simona.runtime.participant.requestVoltageDeviationThreshold, outputConfig = defaultOutputConfig, - primaryServiceProxy = primaryServiceProxy.ref + primaryServiceProxy = primaryServiceProxy.ref, ) "be instantiated correctly" in { @@ -124,7 +124,7 @@ class FixedFeedInAgentModelCalculationSpec new FixedFeedInAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -144,7 +144,7 @@ class FixedFeedInAgentModelCalculationSpec new FixedFeedInAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -166,7 +166,7 @@ class FixedFeedInAgentModelCalculationSpec resolution, requestVoltageDeviationThreshold, outputConfig, - maybeEmAgent + maybeEmAgent, ) => inputModel shouldBe SimpleInputContainer(voltageSensitiveInput) modelConfig shouldBe modelConfig @@ -184,7 +184,7 @@ class FixedFeedInAgentModelCalculationSpec /* Refuse registration */ primaryServiceProxy.send( fixedFeedAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* Expect a completion notification */ @@ -207,7 +207,7 @@ class FixedFeedInAgentModelCalculationSpec requestValueStore, _, _, - _ + _, ) => /* Base state data */ startDate shouldBe simulationStartDate @@ -218,7 +218,7 @@ class FixedFeedInAgentModelCalculationSpec foreseenDataTicks shouldBe Map.empty voltageValueStore shouldBe ValueStore( resolution, - SortedMap(0L -> Each(1.0)) + SortedMap(0L -> Each(1.0)), ) resultValueStore shouldBe ValueStore(resolution) requestValueStore shouldBe ValueStore[ApparentPower]( @@ -236,7 +236,7 @@ class FixedFeedInAgentModelCalculationSpec new FixedFeedInAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -246,7 +246,7 @@ class FixedFeedInAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( fixedFeedAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the CompletionMessage */ @@ -258,12 +258,12 @@ class FixedFeedInAgentModelCalculationSpec fixedFeedAgent ! RequestAssetPowerMessage( 0L, Each(1d), - Each(0d) + Each(0d), ) expectMsg( AssetPowerChangedMessage( Megawatts(0d), - Megavars(0d) + Megavars(0d), ) ) @@ -276,9 +276,9 @@ class FixedFeedInAgentModelCalculationSpec SortedMap( 0L -> ApparentPower( Megawatts(0d), - Megavars(0d) + Megavars(0d), ) - ) + ), ) case _ => fail( @@ -292,7 +292,7 @@ class FixedFeedInAgentModelCalculationSpec new FixedFeedInAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -302,7 +302,7 @@ class FixedFeedInAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( fixedFeedAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I am not interested in the CompletionMessage */ @@ -343,7 +343,7 @@ class FixedFeedInAgentModelCalculationSpec new FixedFeedInAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -354,7 +354,7 @@ class FixedFeedInAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( fixedFeedAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) scheduler.expectMsg(Completion(fixedFeedAgent.toTyped, Some(0))) @@ -370,7 +370,7 @@ class FixedFeedInAgentModelCalculationSpec fixedFeedAgent ! RequestAssetPowerMessage( 3000L, Each(1d), - Each(0d) + Each(0d), ) expectMsgType[AssetPowerChangedMessage] match { @@ -384,7 +384,7 @@ class FixedFeedInAgentModelCalculationSpec new FixedFeedInAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -397,7 +397,7 @@ class FixedFeedInAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( fixedFeedAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) scheduler.expectMsg(Completion(fixedFeedAgent.toTyped, Some(0))) @@ -411,7 +411,7 @@ class FixedFeedInAgentModelCalculationSpec fixedFeedAgent ! RequestAssetPowerMessage( 3000L, Each(1d), - Each(0d) + Each(0d), ) expectMsgType[AssetPowerChangedMessage] match { @@ -428,7 +428,7 @@ class FixedFeedInAgentModelCalculationSpec fixedFeedAgent ! RequestAssetPowerMessage( 3000L, Each(1.000000000000001d), - Each(0d) + Each(0d), ) /* Expect, that nothing has changed */ @@ -444,7 +444,7 @@ class FixedFeedInAgentModelCalculationSpec fixedFeedAgent ! RequestAssetPowerMessage( 3000L, Each(0.98), - Each(0d) + Each(0d), ) /* Expect, the correct values (this model has fixed power factor) */ diff --git a/src/test/scala/edu/ie3/simona/agent/participant/HpAgentModelCalculationSpec.scala b/src/test/scala/edu/ie3/simona/agent/participant/HpAgentModelCalculationSpec.scala index 88508845f5..e8fd0715aa 100644 --- a/src/test/scala/edu/ie3/simona/agent/participant/HpAgentModelCalculationSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/participant/HpAgentModelCalculationSpec.scala @@ -27,18 +27,18 @@ import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.PowerMessage.{ AssetPowerChangedMessage, AssetPowerUnchangedMessage, - RequestAssetPowerMessage + RequestAssetPowerMessage, } import edu.ie3.simona.ontology.messages.SchedulerMessage.Completion import edu.ie3.simona.ontology.messages.services.ServiceMessage.PrimaryServiceRegistrationMessage import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResponseMessage.{ RegistrationFailedMessage, - RegistrationSuccessfulMessage + RegistrationSuccessfulMessage, } import edu.ie3.simona.ontology.messages.services.WeatherMessage.{ ProvideWeatherMessage, RegisterForWeatherMessage, - WeatherData + WeatherData, } import edu.ie3.simona.test.ParticipantAgentSpec import edu.ie3.simona.test.common.model.participant.HpTestData @@ -48,7 +48,7 @@ import edu.ie3.util.scala.quantities.{ Megavars, ReactivePower, Vars, - WattsPerSquareMeter + WattsPerSquareMeter, } import org.apache.pekko.actor.ActorSystem import org.apache.pekko.actor.typed.scaladsl.adapter.ClassicActorRefOps @@ -73,7 +73,7 @@ class HpAgentModelCalculationSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="DEBUG" - """.stripMargin) + """.stripMargin), ) ) with HpTestData @@ -101,7 +101,7 @@ class HpAgentModelCalculationSpec private val defaultOutputConfig = NotifierConfig( simonaConfig.simona.output.participant.defaultConfig.simulationResult, simonaConfig.simona.output.participant.defaultConfig.powerRequestReply, - simonaConfig.simona.output.participant.defaultConfig.flexResult + simonaConfig.simona.output.participant.defaultConfig.flexResult, ) private val participantConfigUtil = ConfigUtil.ParticipantConfigUtil( simonaConfig.simona.runtime.participant @@ -120,7 +120,7 @@ class HpAgentModelCalculationSpec val initStateData = ParticipantInitializeStateData[ HpInput, HpRuntimeConfig, - ApparentPowerAndHeat + ApparentPowerAndHeat, ]( inputModel = hpInput, modelConfig = modelConfig, @@ -132,7 +132,7 @@ class HpAgentModelCalculationSpec simonaConfig.simona.runtime.participant.requestVoltageDeviationThreshold, outputConfig = defaultOutputConfig, primaryServiceProxy = primaryServiceProxy.ref, - maybeEmAgent = None + maybeEmAgent = None, ) "be instantiated correctly" in { @@ -140,7 +140,7 @@ class HpAgentModelCalculationSpec new HpAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -162,7 +162,7 @@ class HpAgentModelCalculationSpec new HpAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -174,7 +174,7 @@ class HpAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( hpAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) deathProbe.expectTerminated(hpAgent) @@ -185,7 +185,7 @@ class HpAgentModelCalculationSpec val initStateData = ParticipantInitializeStateData[ HpInput, HpRuntimeConfig, - ApparentPowerAndHeat + ApparentPowerAndHeat, ]( inputModel = hpInput, thermalGrid = thermalGrid, @@ -198,7 +198,7 @@ class HpAgentModelCalculationSpec simonaConfig.simona.runtime.participant.requestVoltageDeviationThreshold, outputConfig = defaultOutputConfig, primaryServiceProxy = primaryServiceProxy.ref, - maybeEmAgent = None + maybeEmAgent = None, ) "be instantiated correctly" in { @@ -206,7 +206,7 @@ class HpAgentModelCalculationSpec new HpAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -226,7 +226,7 @@ class HpAgentModelCalculationSpec new HpAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -248,7 +248,7 @@ class HpAgentModelCalculationSpec resolution, requestVoltageDeviationThreshold, outputConfig, - _ + _, ) => inputModel shouldBe WithHeatInputContainer(hpInput, thermalGrid) modelConfig shouldBe modelConfig @@ -265,7 +265,7 @@ class HpAgentModelCalculationSpec /* Refuse registration */ primaryServiceProxy.send( hpAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* Expect a registration message */ @@ -291,10 +291,10 @@ class HpAgentModelCalculationSpec requestValueStore, _, _, - _ + _, ), awaitRegistrationResponsesFrom, - foreseenNextDataTicks + foreseenNextDataTicks, ) => /* Base state data */ startDate shouldBe defaultSimulationStart @@ -305,13 +305,13 @@ class HpAgentModelCalculationSpec outputConfig shouldBe NotifierConfig( simulationResultInfo = true, powerRequestReply = false, - flexResult = false + flexResult = false, ) additionalActivationTicks shouldBe empty foreseenDataTicks shouldBe Map.empty voltageValueStore shouldBe ValueStore( resolution, - SortedMap(0L -> Each(1.0)) + SortedMap(0L -> Each(1.0)), ) resultValueStore shouldBe ValueStore(resolution) requestValueStore shouldBe ValueStore[ApparentPowerAndHeat]( @@ -330,7 +330,7 @@ class HpAgentModelCalculationSpec /* Reply, that registration was successful */ weatherService.send( hpAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(4711L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(4711L)), ) /* Expect a completion message */ @@ -356,7 +356,7 @@ class HpAgentModelCalculationSpec new HpAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -366,7 +366,7 @@ class HpAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( hpAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* Expect a registration message */ @@ -375,7 +375,7 @@ class HpAgentModelCalculationSpec ) weatherService.send( hpAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(900L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(900L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -387,12 +387,12 @@ class HpAgentModelCalculationSpec hpAgent ! RequestAssetPowerMessage( 0L, Dimensionless.primaryUnit(1.0), - Dimensionless.primaryUnit(0.0) + Dimensionless.primaryUnit(0.0), ) expectMsg( AssetPowerChangedMessage( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) ) @@ -406,9 +406,9 @@ class HpAgentModelCalculationSpec 0L -> ApparentPowerAndHeat( Megawatts(0.0), Megavars(0.0), - Megawatts(0.0) + Megawatts(0.0), ) - ) + ), ) case _ => fail( @@ -422,7 +422,7 @@ class HpAgentModelCalculationSpec new HpAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -432,14 +432,14 @@ class HpAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( hpAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ weatherService.expectMsgType[RegisterForWeatherMessage] weatherService.send( hpAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(0L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(0L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -452,12 +452,12 @@ class HpAgentModelCalculationSpec WattsPerSquareMeter(0), WattsPerSquareMeter(0), Celsius(1.815), - MetersPerSecond(7.726576) + MetersPerSecond(7.726576), ) weatherService.send( hpAgent, - ProvideWeatherMessage(0L, weatherService.ref, weatherData, Some(3600L)) + ProvideWeatherMessage(0L, weatherService.ref, weatherData, Some(3600L)), ) /* Find yourself in corresponding state and state data */ @@ -466,7 +466,7 @@ class HpAgentModelCalculationSpec case DataCollectionStateData( baseStateData: ParticipantModelBaseStateData[_, _, _, _], expectedSenders, - isYetTriggered + isYetTriggered, ) => /* The next data tick is already registered */ baseStateData.foreseenDataTicks shouldBe Map( @@ -507,8 +507,8 @@ class HpAgentModelCalculationSpec activePower, qDot, thermalGridState, - _ - ) + _, + ), ) ) => isRunning shouldBe false @@ -533,7 +533,7 @@ class HpAgentModelCalculationSpec store.size shouldBe 1 store.getOrElse( 0L, - fail("Expected a simulation result for tick 900.") + fail("Expected a simulation result for tick 900."), ) match { case ApparentPowerAndHeat(p, q, qDot) => p should approximate(Megawatts(0d)) @@ -553,7 +553,7 @@ class HpAgentModelCalculationSpec new HpAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -563,14 +563,14 @@ class HpAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( hpAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ weatherService.expectMsgType[RegisterForWeatherMessage] weatherService.send( hpAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(0L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(0L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -586,7 +586,7 @@ class HpAgentModelCalculationSpec case DataCollectionStateData( baseStateData: ParticipantModelBaseStateData[_, _, _, _], expectedSenders, - isYetTriggered + isYetTriggered, ) => /* The next data tick is already registered */ baseStateData.foreseenDataTicks shouldBe Map( @@ -609,12 +609,12 @@ class HpAgentModelCalculationSpec WattsPerSquareMeter(0), WattsPerSquareMeter(0), Celsius(1.815), - MetersPerSecond(7.726576) + MetersPerSecond(7.726576), ) weatherService.send( hpAgent, - ProvideWeatherMessage(0L, weatherService.ref, weatherData, Some(3600L)) + ProvideWeatherMessage(0L, weatherService.ref, weatherData, Some(3600L)), ) /* Expect confirmation */ @@ -635,8 +635,8 @@ class HpAgentModelCalculationSpec activePower, qDot, thermalGridState, - _ - ) + _, + ), ) ) => isRunning shouldBe false @@ -661,7 +661,7 @@ class HpAgentModelCalculationSpec store.size shouldBe 1 store.getOrElse( 0L, - fail("Expected a simulation result for tick 0.") + fail("Expected a simulation result for tick 0."), ) match { case ApparentPowerAndHeat(p, q, qDot) => p should approximate(Megawatts(0d)) @@ -681,7 +681,7 @@ class HpAgentModelCalculationSpec new HpAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -692,14 +692,14 @@ class HpAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( hpAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ weatherService.expectMsgType[RegisterForWeatherMessage] weatherService.send( hpAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(3600L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(3600L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -710,7 +710,7 @@ class HpAgentModelCalculationSpec hpAgent ! RequestAssetPowerMessage( 7200L, Each(1.0), - Each(0.0) + Each(0.0), ) expectNoMessage(noReceiveTimeOut.duration) awaitAssert(hpAgent.stateName == Idle) @@ -720,7 +720,7 @@ class HpAgentModelCalculationSpec WattsPerSquareMeter(0), WattsPerSquareMeter(0), Celsius(1.815), - MetersPerSecond(7.726576) + MetersPerSecond(7.726576), ) weatherService.send( hpAgent, @@ -728,8 +728,8 @@ class HpAgentModelCalculationSpec 3600L, weatherService.ref, weatherData, - Some(7200L) - ) + Some(7200L), + ), ) /* Trigger the agent */ @@ -751,7 +751,7 @@ class HpAgentModelCalculationSpec new HpAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -763,14 +763,14 @@ class HpAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( hpAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ weatherService.expectMsgType[RegisterForWeatherMessage] weatherService.send( hpAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(0L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(0L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -788,10 +788,10 @@ class HpAgentModelCalculationSpec WattsPerSquareMeter(0), WattsPerSquareMeter(0), Celsius(1.815), - MetersPerSecond(7.726576) + MetersPerSecond(7.726576), ), - Some(3600L) - ) + Some(3600L), + ), ) scheduler.send(hpAgent, Activation(0)) scheduler.expectMsg(Completion(hpAgent.toTyped, Some(3600))) @@ -806,10 +806,10 @@ class HpAgentModelCalculationSpec WattsPerSquareMeter(0), WattsPerSquareMeter(0), Celsius(1.815), - MetersPerSecond(7.726576) + MetersPerSecond(7.726576), ), - Some(7200L) - ) + Some(7200L), + ), ) scheduler.send(hpAgent, Activation(3600)) scheduler.expectMsg(Completion(hpAgent.toTyped, Some(7200))) @@ -824,10 +824,10 @@ class HpAgentModelCalculationSpec WattsPerSquareMeter(0), WattsPerSquareMeter(0), Celsius(1.815), - MetersPerSecond(7.726576) + MetersPerSecond(7.726576), ), - None - ) + None, + ), ) scheduler.send(hpAgent, Activation(7200)) scheduler.expectMsg(Completion(hpAgent.toTyped)) @@ -836,7 +836,7 @@ class HpAgentModelCalculationSpec hpAgent ! RequestAssetPowerMessage( 7500L, Each(1.0), - Each(0.0) + Each(0.0), ) expectMsgType[AssetPowerChangedMessage] match { @@ -853,7 +853,7 @@ class HpAgentModelCalculationSpec hpAgent ! RequestAssetPowerMessage( 7500L, Each(1.000000000000001d), - Each(0.0) + Each(0.0), ) /* Expect, that nothing has changed */ @@ -869,7 +869,7 @@ class HpAgentModelCalculationSpec hpAgent ! RequestAssetPowerMessage( 7500L, Each(0.98), - Each(0.0) + Each(0.0), ) /* Expect, the correct values (this model has fixed power factor) */ diff --git a/src/test/scala/edu/ie3/simona/agent/participant/LoadAgentFixedModelCalculationSpec.scala b/src/test/scala/edu/ie3/simona/agent/participant/LoadAgentFixedModelCalculationSpec.scala index 544f9c58b1..df28adfa5f 100644 --- a/src/test/scala/edu/ie3/simona/agent/participant/LoadAgentFixedModelCalculationSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/participant/LoadAgentFixedModelCalculationSpec.scala @@ -21,7 +21,7 @@ import edu.ie3.simona.agent.participant.statedata.ParticipantStateData.{ ParticipantInitializeStateData, ParticipantInitializingStateData, ParticipantUninitializedStateData, - SimpleInputContainer + SimpleInputContainer, } import edu.ie3.simona.agent.state.AgentState.{Idle, Uninitialized} import edu.ie3.simona.agent.state.ParticipantAgentState.HandleInformation @@ -33,7 +33,7 @@ import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.PowerMessage.{ AssetPowerChangedMessage, AssetPowerUnchangedMessage, - RequestAssetPowerMessage + RequestAssetPowerMessage, } import edu.ie3.simona.ontology.messages.SchedulerMessage.Completion import edu.ie3.simona.ontology.messages.services.ServiceMessage.PrimaryServiceRegistrationMessage @@ -58,7 +58,7 @@ class LoadAgentFixedModelCalculationSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="DEBUG" - """.stripMargin) + """.stripMargin), ) ) with LoadTestData @@ -75,12 +75,12 @@ class LoadAgentFixedModelCalculationSpec private val simonaConfig: SimonaConfig = createSimonaConfig( LoadModelBehaviour.FIX, - LoadReference.ActivePower(Kilowatts(0d)) + LoadReference.ActivePower(Kilowatts(0d)), ) private val defaultOutputConfig = NotifierConfig( simonaConfig.simona.output.participant.defaultConfig.simulationResult, simonaConfig.simona.output.participant.defaultConfig.powerRequestReply, - simonaConfig.simona.output.participant.defaultConfig.flexResult + simonaConfig.simona.output.participant.defaultConfig.flexResult, ) private val loadConfigUtil = ConfigUtil.ParticipantConfigUtil( simonaConfig.simona.runtime.participant @@ -99,7 +99,7 @@ class LoadAgentFixedModelCalculationSpec val initStateData = ParticipantInitializeStateData[ LoadInput, LoadRuntimeConfig, - ApparentPower + ApparentPower, ]( inputModel = voltageSensitiveInput, modelConfig = modelConfig, @@ -110,7 +110,7 @@ class LoadAgentFixedModelCalculationSpec requestVoltageDeviationThreshold = simonaConfig.simona.runtime.participant.requestVoltageDeviationThreshold, outputConfig = defaultOutputConfig, - primaryServiceProxy = primaryServiceProxy.ref + primaryServiceProxy = primaryServiceProxy.ref, ) "be instantiated correctly" in { @@ -118,7 +118,7 @@ class LoadAgentFixedModelCalculationSpec new FixedLoadAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -138,7 +138,7 @@ class LoadAgentFixedModelCalculationSpec new FixedLoadAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -160,7 +160,7 @@ class LoadAgentFixedModelCalculationSpec resolution, requestVoltageDeviationThreshold, outputConfig, - maybeEmAgent + maybeEmAgent, ) => inputModel shouldBe SimpleInputContainer(voltageSensitiveInput) modelConfig shouldBe modelConfig @@ -178,7 +178,7 @@ class LoadAgentFixedModelCalculationSpec /* Refuse registration */ primaryServiceProxy.send( loadAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* Expect a completion notification */ @@ -201,7 +201,7 @@ class LoadAgentFixedModelCalculationSpec requestValueStore, _, _, - _ + _, ) => /* Base state data */ startDate shouldBe simulationStartDate @@ -212,7 +212,7 @@ class LoadAgentFixedModelCalculationSpec foreseenDataTicks shouldBe Map.empty voltageValueStore shouldBe ValueStore( resolution, - SortedMap(0L -> Each(1.0)) + SortedMap(0L -> Each(1.0)), ) resultValueStore shouldBe ValueStore(resolution) requestValueStore shouldBe ValueStore[ApparentPower]( @@ -230,7 +230,7 @@ class LoadAgentFixedModelCalculationSpec new FixedLoadAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -240,7 +240,7 @@ class LoadAgentFixedModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( loadAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the CompletionMessage */ @@ -252,12 +252,12 @@ class LoadAgentFixedModelCalculationSpec loadAgent ! RequestAssetPowerMessage( 0L, Each(1d), - Each(0d) + Each(0d), ) expectMsg( AssetPowerChangedMessage( Megawatts(0d), - Megavars(0d) + Megavars(0d), ) ) @@ -270,9 +270,9 @@ class LoadAgentFixedModelCalculationSpec SortedMap( 0L -> ApparentPower( Megawatts(0d), - Megavars(0d) + Megavars(0d), ) - ) + ), ) case _ => fail( @@ -286,7 +286,7 @@ class LoadAgentFixedModelCalculationSpec new FixedLoadAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -296,7 +296,7 @@ class LoadAgentFixedModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( loadAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I am not interested in the CompletionMessage */ @@ -337,7 +337,7 @@ class LoadAgentFixedModelCalculationSpec new FixedLoadAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -348,7 +348,7 @@ class LoadAgentFixedModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( loadAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) scheduler.expectMsg(Completion(loadAgent.toTyped, Some(0))) @@ -364,7 +364,7 @@ class LoadAgentFixedModelCalculationSpec loadAgent ! RequestAssetPowerMessage( 3000L, Each(1d), - Each(0d) + Each(0d), ) expectMsgType[AssetPowerChangedMessage] match { @@ -378,7 +378,7 @@ class LoadAgentFixedModelCalculationSpec new FixedLoadAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -391,7 +391,7 @@ class LoadAgentFixedModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( loadAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) scheduler.expectMsg(Completion(loadAgent.toTyped, Some(0))) @@ -405,7 +405,7 @@ class LoadAgentFixedModelCalculationSpec loadAgent ! RequestAssetPowerMessage( 3000L, Each(1d), - Each(0d) + Each(0d), ) expectMsgType[AssetPowerChangedMessage] match { @@ -422,7 +422,7 @@ class LoadAgentFixedModelCalculationSpec loadAgent ! RequestAssetPowerMessage( 3000L, Each(1.000000000000001d), - Each(0d) + Each(0d), ) /* Expect, that nothing has changed */ @@ -438,7 +438,7 @@ class LoadAgentFixedModelCalculationSpec loadAgent ! RequestAssetPowerMessage( 3000L, Each(0.98), - Each(0d) + Each(0d), ) /* Expect, the correct values (this model has fixed power factor) */ diff --git a/src/test/scala/edu/ie3/simona/agent/participant/LoadAgentProfileModelCalculationSpec.scala b/src/test/scala/edu/ie3/simona/agent/participant/LoadAgentProfileModelCalculationSpec.scala index 6ce6f8761b..46df19190a 100644 --- a/src/test/scala/edu/ie3/simona/agent/participant/LoadAgentProfileModelCalculationSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/participant/LoadAgentProfileModelCalculationSpec.scala @@ -21,7 +21,7 @@ import edu.ie3.simona.agent.participant.statedata.ParticipantStateData.{ ParticipantInitializeStateData, ParticipantInitializingStateData, ParticipantUninitializedStateData, - SimpleInputContainer + SimpleInputContainer, } import edu.ie3.simona.agent.state.AgentState.{Idle, Uninitialized} import edu.ie3.simona.agent.state.ParticipantAgentState.HandleInformation @@ -33,7 +33,7 @@ import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.PowerMessage.{ AssetPowerChangedMessage, AssetPowerUnchangedMessage, - RequestAssetPowerMessage + RequestAssetPowerMessage, } import edu.ie3.simona.ontology.messages.SchedulerMessage.Completion import edu.ie3.simona.ontology.messages.services.ServiceMessage.PrimaryServiceRegistrationMessage @@ -58,7 +58,7 @@ class LoadAgentProfileModelCalculationSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="DEBUG" - """.stripMargin) + """.stripMargin), ) ) with LoadTestData @@ -75,12 +75,12 @@ class LoadAgentProfileModelCalculationSpec private val simonaConfig: SimonaConfig = createSimonaConfig( LoadModelBehaviour.PROFILE, - LoadReference.ActivePower(Kilowatts(0d)) + LoadReference.ActivePower(Kilowatts(0d)), ) private val defaultOutputConfig = NotifierConfig( simonaConfig.simona.output.participant.defaultConfig.simulationResult, simonaConfig.simona.output.participant.defaultConfig.powerRequestReply, - simonaConfig.simona.output.participant.defaultConfig.flexResult + simonaConfig.simona.output.participant.defaultConfig.flexResult, ) private val loadConfigUtil = ConfigUtil.ParticipantConfigUtil( simonaConfig.simona.runtime.participant @@ -99,7 +99,7 @@ class LoadAgentProfileModelCalculationSpec val initStateData = ParticipantInitializeStateData[ LoadInput, LoadRuntimeConfig, - ApparentPower + ApparentPower, ]( inputModel = voltageSensitiveInput, modelConfig = modelConfig, @@ -110,7 +110,7 @@ class LoadAgentProfileModelCalculationSpec requestVoltageDeviationThreshold = simonaConfig.simona.runtime.participant.requestVoltageDeviationThreshold, outputConfig = defaultOutputConfig, - primaryServiceProxy = primaryServiceProxy.ref + primaryServiceProxy = primaryServiceProxy.ref, ) "be instantiated correctly" in { @@ -118,7 +118,7 @@ class LoadAgentProfileModelCalculationSpec new ProfileLoadAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -138,7 +138,7 @@ class LoadAgentProfileModelCalculationSpec new ProfileLoadAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -159,7 +159,7 @@ class LoadAgentProfileModelCalculationSpec resolution, requestVoltageDeviationThreshold, outputConfig, - maybeEmAgent + maybeEmAgent, ) => inputModel shouldBe SimpleInputContainer(voltageSensitiveInput) modelConfig shouldBe modelConfig @@ -177,7 +177,7 @@ class LoadAgentProfileModelCalculationSpec /* Refuse registration */ primaryServiceProxy.send( loadAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* Expect a completion notification */ @@ -200,7 +200,7 @@ class LoadAgentProfileModelCalculationSpec requestValueStore, _, _, - _ + _, ) => /* Base state data */ startDate shouldBe simulationStartDate @@ -212,7 +212,7 @@ class LoadAgentProfileModelCalculationSpec foreseenDataTicks shouldBe Map.empty voltageValueStore shouldBe ValueStore( resolution, - SortedMap(0L -> Each(1.0)) + SortedMap(0L -> Each(1.0)), ) resultValueStore shouldBe ValueStore(resolution) requestValueStore shouldBe ValueStore[ApparentPower]( @@ -230,7 +230,7 @@ class LoadAgentProfileModelCalculationSpec new ProfileLoadAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -240,7 +240,7 @@ class LoadAgentProfileModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( loadAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the CompletionMessage */ @@ -252,12 +252,12 @@ class LoadAgentProfileModelCalculationSpec loadAgent ! RequestAssetPowerMessage( 0L, Each(1d), - Each(0d) + Each(0d), ) expectMsg( AssetPowerChangedMessage( Megawatts(0d), - Megavars(0d) + Megavars(0d), ) ) @@ -270,9 +270,9 @@ class LoadAgentProfileModelCalculationSpec SortedMap( 0L -> ApparentPower( Megawatts(0d), - Megavars(0d) + Megavars(0d), ) - ) + ), ) case _ => fail( @@ -286,7 +286,7 @@ class LoadAgentProfileModelCalculationSpec new ProfileLoadAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -296,7 +296,7 @@ class LoadAgentProfileModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( loadAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I am not interested in the CompletionMessage */ @@ -336,7 +336,7 @@ class LoadAgentProfileModelCalculationSpec new ProfileLoadAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -348,7 +348,7 @@ class LoadAgentProfileModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( loadAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) scheduler.expectMsg(Completion(loadAgent.toTyped, Some(0))) @@ -366,7 +366,7 @@ class LoadAgentProfileModelCalculationSpec loadAgent ! RequestAssetPowerMessage( 1800L, Each(1d), - Each(0d) + Each(0d), ) expectMsgType[AssetPowerChangedMessage] match { @@ -382,7 +382,7 @@ class LoadAgentProfileModelCalculationSpec loadAgent ! RequestAssetPowerMessage( 1800L, Each(1.000000000000001d), - Each(0d) + Each(0d), ) /* Expect, that nothing has changed */ @@ -398,7 +398,7 @@ class LoadAgentProfileModelCalculationSpec loadAgent ! RequestAssetPowerMessage( 1800L, Each(0.98), - Each(0) + Each(0), ) /* Expect, the correct values (this model has fixed power factor) */ diff --git a/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgent2ListenerSpec.scala b/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgent2ListenerSpec.scala index 0395abb332..fc5d0f66f5 100644 --- a/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgent2ListenerSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgent2ListenerSpec.scala @@ -21,7 +21,7 @@ import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.PowerMessage.{ AssetPowerChangedMessage, AssetPowerUnchangedMessage, - RequestAssetPowerMessage + RequestAssetPowerMessage, } import edu.ie3.simona.ontology.messages.SchedulerMessage.Completion import edu.ie3.simona.ontology.messages.services.ServiceMessage.PrimaryServiceRegistrationMessage @@ -52,7 +52,7 @@ class ParticipantAgent2ListenerSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="OFF" - """.stripMargin) + """.stripMargin), ) ) with DefaultTestData @@ -72,7 +72,7 @@ class ParticipantAgent2ListenerSpec private val simonaConfig: SimonaConfig = createSimonaConfig( LoadModelBehaviour.FIX, - LoadReference.ActivePower(Kilowatts(0d)) + LoadReference.ActivePower(Kilowatts(0d)), ) private val mockInputModel = mock[SystemParticipantInput] @@ -85,12 +85,12 @@ class ParticipantAgent2ListenerSpec val initStateData: NotifierConfig => ParticipantInitializeStateData[ SystemParticipantInput, BaseRuntimeConfig, - ApparentPower + ApparentPower, ] = outputConfig => ParticipantInitializeStateData[ SystemParticipantInput, BaseRuntimeConfig, - ApparentPower + ApparentPower, ]( inputModel = mockInputModel, modelConfig = mock[BaseRuntimeConfig], @@ -101,7 +101,7 @@ class ParticipantAgent2ListenerSpec requestVoltageDeviationThreshold = simonaConfig.simona.runtime.participant.requestVoltageDeviationThreshold, outputConfig = outputConfig, - primaryServiceProxy = primaryServiceProxy.ref + primaryServiceProxy = primaryServiceProxy.ref, ) "inform listeners about new simulation results, when asked to do" in { @@ -109,14 +109,14 @@ class ParticipantAgent2ListenerSpec val outputConfig = NotifierConfig( simulationResultInfo = true, powerRequestReply = false, - flexResult = false + flexResult = false, ) val mockAgent = TestFSMRef( new ParticipantAgentMock( scheduler = scheduler.ref, initStateData = initStateData(outputConfig), - listener = systemListener + listener = systemListener, ) ) @@ -127,7 +127,7 @@ class ParticipantAgent2ListenerSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( mockAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) scheduler.expectMsg(Completion(mockAgent.toTyped)) @@ -146,11 +146,11 @@ class ParticipantAgent2ListenerSpec ) => systemParticipantResult.getP should equalWithTolerance( Quantities.getQuantity(2, MEGAWATT), - quantityTolerance + quantityTolerance, ) systemParticipantResult.getQ should equalWithTolerance( Quantities.getQuantity(1, MEGAVAR), - quantityTolerance + quantityTolerance, ) case _ => fail("Expected a SystemParticipantResult") } @@ -161,14 +161,14 @@ class ParticipantAgent2ListenerSpec val outputConfig = NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false + flexResult = false, ) val mockAgent = TestFSMRef( new ParticipantAgentMock( scheduler = scheduler.ref, initStateData = initStateData(outputConfig), - listener = systemListener + listener = systemListener, ) ) @@ -179,7 +179,7 @@ class ParticipantAgent2ListenerSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( mockAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) scheduler.expectMsg(Completion(mockAgent.toTyped)) @@ -197,14 +197,14 @@ class ParticipantAgent2ListenerSpec val outputConfig = NotifierConfig( simulationResultInfo = false, powerRequestReply = true, - flexResult = false + flexResult = false, ) val mockAgent = TestFSMRef( new ParticipantAgentMock( scheduler = scheduler.ref, initStateData = initStateData(outputConfig), - listener = systemListener + listener = systemListener, ) ) @@ -215,7 +215,7 @@ class ParticipantAgent2ListenerSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( mockAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) scheduler.expectMsg(Completion(mockAgent.toTyped)) @@ -229,7 +229,7 @@ class ParticipantAgent2ListenerSpec mockAgent ! RequestAssetPowerMessage( 3000L, Each(1d), - Each(0d) + Each(0d), ) /* Wait for original reply (this is the querying agent) */ @@ -258,14 +258,14 @@ class ParticipantAgent2ListenerSpec val outputConfig = NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false + flexResult = false, ) val mockAgent = TestFSMRef( new ParticipantAgentMock( scheduler = scheduler.ref, initStateData = initStateData(outputConfig), - listener = systemListener + listener = systemListener, ) ) @@ -276,7 +276,7 @@ class ParticipantAgent2ListenerSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( mockAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) scheduler.expectMsg(Completion(mockAgent.toTyped)) @@ -291,7 +291,7 @@ class ParticipantAgent2ListenerSpec mockAgent ! RequestAssetPowerMessage( 3000L, Each(1d), - Each(0d) + Each(0d), ) /* Wait for original reply (this is the querying agent) */ diff --git a/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentExternalSourceSpec.scala b/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentExternalSourceSpec.scala index 976a2c25b6..784fde78dd 100644 --- a/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentExternalSourceSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentExternalSourceSpec.scala @@ -19,7 +19,7 @@ import edu.ie3.simona.agent.participant.data.Data.PrimaryData.{ ActivePower, ActivePowerAndHeat, ApparentPower, - ApparentPowerAndHeat + ApparentPowerAndHeat, } import edu.ie3.simona.agent.participant.statedata.BaseStateData.FromOutsideBaseStateData import edu.ie3.simona.agent.participant.statedata.DataCollectionStateData @@ -27,7 +27,7 @@ import edu.ie3.simona.agent.participant.statedata.ParticipantStateData.{ ParticipantInitializeStateData, ParticipantInitializingStateData, ParticipantUninitializedStateData, - SimpleInputContainer + SimpleInputContainer, } import edu.ie3.simona.agent.state.AgentState.{Idle, Uninitialized} import edu.ie3.simona.agent.state.ParticipantAgentState.HandleInformation @@ -42,7 +42,7 @@ import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.PowerMessage.{ AssetPowerChangedMessage, AssetPowerUnchangedMessage, - RequestAssetPowerMessage + RequestAssetPowerMessage, } import edu.ie3.simona.ontology.messages.SchedulerMessage.Completion import edu.ie3.simona.ontology.messages.services.ServiceMessage.PrimaryServiceRegistrationMessage @@ -77,7 +77,7 @@ class ParticipantAgentExternalSourceSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="DEBUG" - """.stripMargin) + """.stripMargin), ) ) with DefaultTestData @@ -98,7 +98,7 @@ class ParticipantAgentExternalSourceSpec mock[SystemParticipant[ CalcRelevantData.FixedRelevantData.type, ApparentPower, - ConstantState.type + ConstantState.type, ]] when(mockModel.getUuid).thenReturn(testUUID) private val activeToReactivePowerFunction: Power => ReactivePower = @@ -111,12 +111,12 @@ class ParticipantAgentExternalSourceSpec private val simonaConfig: SimonaConfig = createSimonaConfig( LoadModelBehaviour.FIX, - LoadReference.ActivePower(Kilowatts(0.0)) + LoadReference.ActivePower(Kilowatts(0.0)), ) private val defaultOutputConfig = NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false + flexResult = false, ) private val resolution = simonaConfig.simona.powerflow.resolution.getSeconds @@ -128,7 +128,7 @@ class ParticipantAgentExternalSourceSpec val initStateData = ParticipantInitializeStateData[ SystemParticipantInput, BaseRuntimeConfig, - ApparentPower + ApparentPower, ]( inputModel = mockInputModel, modelConfig = mock[BaseRuntimeConfig], @@ -139,14 +139,14 @@ class ParticipantAgentExternalSourceSpec requestVoltageDeviationThreshold = simonaConfig.simona.runtime.participant.requestVoltageDeviationThreshold, outputConfig = defaultOutputConfig, - primaryServiceProxy = primaryServiceProxy.ref + primaryServiceProxy = primaryServiceProxy.ref, ) "be instantiated correctly" in { val mockAgent = TestFSMRef( new ParticipantAgentMock( scheduler = scheduler.ref, - initStateData = initStateData + initStateData = initStateData, ) ) @@ -165,7 +165,7 @@ class ParticipantAgentExternalSourceSpec val mockAgent = TestFSMRef( new ParticipantAgentMock( scheduler = scheduler.ref, - initStateData = initStateData + initStateData = initStateData, ) ) @@ -188,7 +188,7 @@ class ParticipantAgentExternalSourceSpec resolution, requestVoltageDeviationThreshold, outputConfig, - maybeEmAgent + maybeEmAgent, ) => inputModel shouldBe SimpleInputContainer(mockInputModel) modelConfig shouldBe modelConfig @@ -206,7 +206,7 @@ class ParticipantAgentExternalSourceSpec /* Reply, that registration was successful */ primaryServiceProxy.send( mockAgent, - RegistrationSuccessfulMessage(primaryServiceProxy.ref, Some(4711L)) + RegistrationSuccessfulMessage(primaryServiceProxy.ref, Some(4711L)), ) scheduler.expectMsg(Completion(mockAgent.toTyped, Some(4711L))) @@ -217,7 +217,7 @@ class ParticipantAgentExternalSourceSpec case baseStateData: FromOutsideBaseStateData[SystemParticipant[ FixedRelevantData.type, ApparentPower, - ConstantState.type + ConstantState.type, ], ApparentPower] => /* Only check the awaited next data ticks, as the rest has yet been checked */ baseStateData.foreseenDataTicks shouldBe Map( @@ -234,7 +234,7 @@ class ParticipantAgentExternalSourceSpec val mockAgent = TestFSMRef( new ParticipantAgentMock( scheduler = scheduler.ref, - initStateData = initStateData + initStateData = initStateData, ) ) @@ -244,7 +244,7 @@ class ParticipantAgentExternalSourceSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( mockAgent, - RegistrationSuccessfulMessage(primaryServiceProxy.ref, Some(900L)) + RegistrationSuccessfulMessage(primaryServiceProxy.ref, Some(900L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -256,12 +256,12 @@ class ParticipantAgentExternalSourceSpec mockAgent ! RequestAssetPowerMessage( 0L, Each(1.0), - Each(0.0) + Each(0.0), ) expectMsg( AssetPowerChangedMessage( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) ) @@ -277,16 +277,16 @@ class ParticipantAgentExternalSourceSpec _, _, _, - requestValueStore + requestValueStore, ) => requestValueStore shouldBe ValueStore[ApparentPower]( resolution, SortedMap( 0L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) - ) + ), ) case _ => fail( @@ -299,7 +299,7 @@ class ParticipantAgentExternalSourceSpec val mockAgent = TestFSMRef( new ParticipantAgentMock( scheduler = scheduler.ref, - initStateData = initStateData + initStateData = initStateData, ) ) @@ -309,7 +309,7 @@ class ParticipantAgentExternalSourceSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( mockAgent, - RegistrationSuccessfulMessage(primaryServiceProxy.ref, Some(900L)) + RegistrationSuccessfulMessage(primaryServiceProxy.ref, Some(900L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -324,10 +324,10 @@ class ParticipantAgentExternalSourceSpec primaryServiceProxy.ref, ApparentPower( Kilowatts(0.0), - Kilovars(900.0) + Kilovars(900.0), ), - Some(1800L) - ) + Some(1800L), + ), ) /* Find yourself in corresponding state and state data */ @@ -337,10 +337,10 @@ class ParticipantAgentExternalSourceSpec baseStateData: FromOutsideBaseStateData[SystemParticipant[ CalcRelevantData, ApparentPower, - ConstantState.type + ConstantState.type, ], ApparentPower], expectedSenders, - isYetTriggered + isYetTriggered, ) => /* The next data tick is already registered */ baseStateData.foreseenDataTicks shouldBe Map( @@ -352,7 +352,7 @@ class ParticipantAgentExternalSourceSpec primaryServiceProxy.ref -> Some( ApparentPower( Kilowatts(0.0), - Kilovars(900.0) + Kilovars(900.0), ) ) ) @@ -377,7 +377,7 @@ class ParticipantAgentExternalSourceSpec case baseStateData: FromOutsideBaseStateData[SystemParticipant[ CalcRelevantData, ApparentPower, - ConstantState.type + ConstantState.type, ], ApparentPower] => /* The new data is apparent in the result value store */ baseStateData.resultValueStore match { @@ -385,7 +385,7 @@ class ParticipantAgentExternalSourceSpec store shouldBe Map( 900L -> ApparentPower( Kilowatts(0.0), - Kilovars(900.0) + Kilovars(900.0), ) ) } @@ -400,7 +400,7 @@ class ParticipantAgentExternalSourceSpec val mockAgent = TestFSMRef( new ParticipantAgentMock( scheduler = scheduler.ref, - initStateData = initStateData + initStateData = initStateData, ) ) @@ -410,7 +410,7 @@ class ParticipantAgentExternalSourceSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( mockAgent, - RegistrationSuccessfulMessage(primaryServiceProxy.ref, Some(900L)) + RegistrationSuccessfulMessage(primaryServiceProxy.ref, Some(900L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -427,10 +427,10 @@ class ParticipantAgentExternalSourceSpec baseStateData: FromOutsideBaseStateData[SystemParticipant[ CalcRelevantData, ApparentPower, - ConstantState.type + ConstantState.type, ], ApparentPower], expectedSenders, - isYetTriggered + isYetTriggered, ) => /* The next data tick is already registered */ baseStateData.foreseenDataTicks shouldBe Map( @@ -456,10 +456,10 @@ class ParticipantAgentExternalSourceSpec primaryServiceProxy.ref, ApparentPower( Kilowatts(0.0), - Kilovars(900.0) + Kilovars(900.0), ), - Some(1800L) - ) + Some(1800L), + ), ) /* Expect confirmation */ @@ -471,7 +471,7 @@ class ParticipantAgentExternalSourceSpec case baseStateData: FromOutsideBaseStateData[SystemParticipant[ CalcRelevantData, ApparentPower, - ConstantState.type + ConstantState.type, ], ApparentPower] => /* The new data is apparent in the result value store */ baseStateData.resultValueStore match { @@ -479,7 +479,7 @@ class ParticipantAgentExternalSourceSpec store shouldBe Map( 900L -> ApparentPower( Kilowatts(0.0), - Kilovars(900.0) + Kilovars(900.0), ) ) } @@ -494,7 +494,7 @@ class ParticipantAgentExternalSourceSpec val mockAgent = TestFSMRef( new ParticipantAgentMock( scheduler = scheduler.ref, - initStateData = initStateData + initStateData = initStateData, ) ) @@ -505,7 +505,7 @@ class ParticipantAgentExternalSourceSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( mockAgent, - RegistrationSuccessfulMessage(primaryServiceProxy.ref, Some(900L)) + RegistrationSuccessfulMessage(primaryServiceProxy.ref, Some(900L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -516,7 +516,7 @@ class ParticipantAgentExternalSourceSpec mockAgent ! RequestAssetPowerMessage( 1800L, Each(1.0), - Each(0.0) + Each(0.0), ) expectNoMessage(noReceiveTimeOut.duration) awaitAssert(mockAgent.stateName == Idle) @@ -529,10 +529,10 @@ class ParticipantAgentExternalSourceSpec primaryServiceProxy.ref, ApparentPower( Kilowatts(0.0), - Kilovars(900.0) + Kilovars(900.0), ), - Some(1800L) - ) + Some(1800L), + ), ) /* Trigger the agent */ @@ -547,7 +547,7 @@ class ParticipantAgentExternalSourceSpec val mockAgent = TestFSMRef( new ParticipantAgentMock( scheduler = scheduler.ref, - initStateData = initStateData + initStateData = initStateData, ) ) @@ -555,11 +555,11 @@ class ParticipantAgentExternalSourceSpec val baseStateData: FromOutsideBaseStateData[SystemParticipant[ CalcRelevantData.FixedRelevantData.type, ApparentPower, - ConstantState.type + ConstantState.type, ], ApparentPower] = FromOutsideBaseStateData[SystemParticipant[ CalcRelevantData.FixedRelevantData.type, ApparentPower, - ConstantState.type + ConstantState.type, ], ApparentPower]( mockModel, defaultSimulationStart, @@ -571,10 +571,10 @@ class ParticipantAgentExternalSourceSpec 1e-4, ValueStore.forVoltage( 900L, - Each(1.0) + Each(1.0), ), ValueStore.forResult(900L, 1L), - ValueStore(900L) + ValueStore(900L), ) val actualFunction = @@ -586,11 +586,11 @@ class ParticipantAgentExternalSourceSpec val baseStateData: FromOutsideBaseStateData[SystemParticipant[ CalcRelevantData.FixedRelevantData.type, ApparentPower, - ConstantState.type + ConstantState.type, ], ApparentPower] = FromOutsideBaseStateData[SystemParticipant[ CalcRelevantData.FixedRelevantData.type, ApparentPower, - ConstantState.type + ConstantState.type, ], ApparentPower]( mockModel, defaultSimulationStart, @@ -602,10 +602,10 @@ class ParticipantAgentExternalSourceSpec 1e-4, ValueStore.forVoltage( 900L, - Each(1.0) + Each(1.0), ), ValueStore.forResult(900L, 1L), - ValueStore(900L) + ValueStore(900L), ) val actualFunction = @@ -621,7 +621,7 @@ class ParticipantAgentExternalSourceSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( mockAgent, - RegistrationSuccessfulMessage(primaryServiceProxy.ref, Some(900L)) + RegistrationSuccessfulMessage(primaryServiceProxy.ref, Some(900L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -637,10 +637,10 @@ class ParticipantAgentExternalSourceSpec primaryServiceProxy.ref, ApparentPower( Kilowatts(100.0), - Kilovars(33.0) + Kilovars(33.0), ), - Some(1800L) - ) + Some(1800L), + ), ) scheduler.send(mockAgent, Activation(900)) scheduler.expectMsg(Completion(mockAgent.toTyped, Some(1800))) @@ -653,10 +653,10 @@ class ParticipantAgentExternalSourceSpec primaryServiceProxy.ref, ApparentPower( Kilowatts(150.0), - Kilovars(49.0) + Kilovars(49.0), ), - Some(2700L) - ) + Some(2700L), + ), ) scheduler.send(mockAgent, Activation(1800)) scheduler.expectMsg(Completion(mockAgent.toTyped, Some(2700))) @@ -669,10 +669,10 @@ class ParticipantAgentExternalSourceSpec primaryServiceProxy.ref, ApparentPower( Kilowatts(200.0), - Kilovars(66.0) + Kilovars(66.0), ), - None - ) + None, + ), ) scheduler.send(mockAgent, Activation(2700)) scheduler.expectMsg(Completion(mockAgent.toTyped)) @@ -683,7 +683,7 @@ class ParticipantAgentExternalSourceSpec mockAgent ! RequestAssetPowerMessage( 3000L, Each(1.0), - Each(0.0) + Each(0.0), ) expectMsgType[AssetPowerChangedMessage] match { @@ -699,7 +699,7 @@ class ParticipantAgentExternalSourceSpec mockAgent ! RequestAssetPowerMessage( 3000L, Each(1.000000000000001d), - Each(0.0) + Each(0.0), ) /* Expect, that nothing has changed */ @@ -716,7 +716,7 @@ class ParticipantAgentExternalSourceSpec mockAgent ! RequestAssetPowerMessage( 3000L, Each(0.98d), - Each(0.0) + Each(0.0), ) /* Expect, that nothing has changed, as this model is meant to forward information from outside */ @@ -741,7 +741,7 @@ class ParticipantAgentExternalSourceSpec ApparentPowerAndHeat( Kilowatts(0.0), Kilovars(0.0), - Kilowatts(0.0) + Kilowatts(0.0), ) ) ) @@ -762,7 +762,7 @@ class ParticipantAgentExternalSourceSpec primaryServiceProxy.ref -> Some( ActivePowerAndHeat( Kilowatts(0.0), - Kilowatts(0.0) + Kilowatts(0.0), ) ) ) @@ -792,7 +792,7 @@ class ParticipantAgentExternalSourceSpec case Failure(exception) => fail( "Was meant to succeed, but failed with exception.", - exception + exception, ) } } @@ -806,7 +806,7 @@ class ParticipantAgentExternalSourceSpec participantAgent.prepareData( data, - (p: squants.Power) => Kilovars(p.toKilowatts * tan(acos(0.9))) + (p: squants.Power) => Kilovars(p.toKilowatts * tan(acos(0.9))), ) match { case Success(ApparentPower(p, q)) => p should approximate(Kilowatts(100.0)) @@ -816,7 +816,7 @@ class ParticipantAgentExternalSourceSpec case Failure(exception) => fail( "Was meant to succeed, but failed with exception.", - exception + exception, ) } } diff --git a/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentalsSpec.scala b/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentalsSpec.scala index 752dcc424f..02ba2dd0ad 100644 --- a/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentalsSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentalsSpec.scala @@ -24,7 +24,7 @@ import edu.ie3.simona.config.SimonaConfig.BaseRuntimeConfig import edu.ie3.simona.event.notifier.NotifierConfig import edu.ie3.simona.exceptions.agent.{ AgentInitializationException, - InconsistentStateException + InconsistentStateException, } import edu.ie3.simona.model.participant.CalcRelevantData.FixedRelevantData import edu.ie3.simona.model.participant.SystemParticipant @@ -56,7 +56,7 @@ class ParticipantAgentFundamentalsSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="DEBUG" - """.stripMargin) + """.stripMargin), ) ) with LoadTestData @@ -72,7 +72,7 @@ class ParticipantAgentFundamentalsSpec NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false + flexResult = false, ) /* Get one instance of the mock for participant agent */ @@ -85,8 +85,8 @@ class ParticipantAgentFundamentalsSpec initStateData = mock[ParticipantInitializeStateData[ SystemParticipantInput, BaseRuntimeConfig, - ApparentPower - ]] + ApparentPower, + ]], ) ) val mockAgent: ParticipantAgentMock = mockAgentTestRef.underlyingActor @@ -95,36 +95,36 @@ class ParticipantAgentFundamentalsSpec Map( 0L -> ApparentPower( Megawatts(1.0), - Megavars(0.0) + Megavars(0.0), ), 1L -> ApparentPower( Megawatts(2.0), - Megavars(1.0) + Megavars(1.0), ), 3L -> ApparentPower( Megawatts(3.0), - Megavars(2.0) + Megavars(2.0), ), 4L -> ApparentPower( Megawatts(5.0), - Megavars(4.0) + Megavars(4.0), ), 7L -> ApparentPower( Megawatts(3.0), - Megavars(2.0) + Megavars(2.0), ), 8L -> ApparentPower( Megawatts(6.0), - Megavars(5.0) + Megavars(5.0), ), 9L -> ApparentPower( Megawatts(6.0), - Megavars(5.0) + Megavars(5.0), ), 10L -> ApparentPower( Megawatts(4.0), - Megavars(3.0) - ) + Megavars(3.0), + ), ) /* Calculates the reactive power as the square of the active power */ @@ -161,21 +161,21 @@ class ParticipantAgentFundamentalsSpec ("2020-01-01 00:15:00", 900L, 0L), ("2020-01-01 00:15:10", 900L, 890L), ("2020-01-01 00:15:00", 1800L, 900L), - ("2020-01-01 00:14:10", 1800L, 950L) + ("2020-01-01 00:14:10", 1800L, 950L), ) forAll(testData) { ( simulationStartString: String, resolution: Long, - expectedFirstTick: Long + expectedFirstTick: Long, ) => { val simulationStart = TimeUtil.withDefaults.toZonedDateTime(simulationStartString) val firstTick = mockAgent.firstFullResolutionInSimulation( simulationStart, - resolution + resolution, ) firstTick shouldBe expectedFirstTick @@ -190,7 +190,7 @@ class ParticipantAgentFundamentalsSpec "resolution", "operationStart", "operationEnd", - "expectedTicks" + "expectedTicks", ), ("2020-01-01 00:00:00", 900L, 0L, 2700L, List(0L, 900L, 1800L, 2700L)), ("2020-01-01 00:15:00", 900L, 0L, 2700L, List(0L, 900L, 1800L, 2700L)), @@ -201,8 +201,8 @@ class ParticipantAgentFundamentalsSpec 900L, 0L, 2880L, - List(180L, 1080L, 1980L, 2880L) - ) + List(180L, 1080L, 1980L, 2880L), + ), ) forAll(testData) { @@ -211,7 +211,7 @@ class ParticipantAgentFundamentalsSpec resolution: Long, operationStart: Long, operationEnd: Long, - expectedTicks: List[Long] + expectedTicks: List[Long], ) => { val simulationStart = @@ -221,7 +221,7 @@ class ParticipantAgentFundamentalsSpec simulationStart, resolution, operationStart, - operationEnd + operationEnd, ) additionalActivationTicks.corresponds(expectedTicks)( @@ -236,7 +236,7 @@ class ParticipantAgentFundamentalsSpec "bring up no activation trigger" in { val baseStateData = ParticipantAgentFundamentalsSpec.mockBaseStateData( SortedSet.empty, - Map.empty + Map.empty, ) mockAgent.popNextActivationTrigger(baseStateData) match { @@ -253,8 +253,8 @@ class ParticipantAgentFundamentalsSpec SortedSet(100L, 200L, 300L), Map( self -> Some(10L), - noSender -> Some(0L) - ) + noSender -> Some(0L), + ), ) mockAgent.popNextActivationTrigger(baseStateData) match { @@ -272,8 +272,8 @@ class ParticipantAgentFundamentalsSpec SortedSet(0L, 10L, 20L), Map( self -> Some(200L), - noSender -> Some(100L) - ) + noSender -> Some(100L), + ), ) mockAgent.popNextActivationTrigger(baseStateData) match { @@ -294,8 +294,8 @@ class ParticipantAgentFundamentalsSpec SortedSet(0L, 10L, 20L), Map( self -> Some(20L), - noSender -> Some(0L) - ) + noSender -> Some(0L), + ), ) mockAgent.popNextActivationTrigger(baseStateData) match { @@ -318,7 +318,7 @@ class ParticipantAgentFundamentalsSpec powerValues, -10L, 5L, - None + None, ) apparentPower match { case ApparentPower(p, q) => @@ -333,7 +333,7 @@ class ParticipantAgentFundamentalsSpec powerValues, 8L, 15L, - None + None, ) apparentPower match { case ApparentPower(p, q) => @@ -348,7 +348,7 @@ class ParticipantAgentFundamentalsSpec powerValues, 8L, 15L, - None + None, ) apparentPower match { case ApparentPower(p, q) => @@ -363,7 +363,7 @@ class ParticipantAgentFundamentalsSpec powerValues, -10L, 5L, - activeToReactivePowerFuncOpt + activeToReactivePowerFuncOpt, ) apparentPower match { case ApparentPower(p, q) => @@ -378,7 +378,7 @@ class ParticipantAgentFundamentalsSpec powerValues, 8L, 15L, - activeToReactivePowerFuncOpt + activeToReactivePowerFuncOpt, ) apparentPower match { case ApparentPower(p, q) => @@ -393,7 +393,7 @@ class ParticipantAgentFundamentalsSpec powerValues, 8L, 15L, - activeToReactivePowerFuncOpt + activeToReactivePowerFuncOpt, ) apparentPower match { case ApparentPower(p, q) => @@ -411,44 +411,44 @@ class ParticipantAgentFundamentalsSpec SortedMap( 800L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ), 1000L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ), 1200L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ), 1400L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ), 1600L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ), 1800L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) - ) - ) + Megavars(0.0), + ), + ), ) val requestValueStore = ValueStore( 900, SortedMap( 900L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) - ) + ), ) mockAgent.getRelevantResultData( requestTick, resultValueStore, - requestValueStore + requestValueStore, ) shouldBe Some( RelevantResultValues( 900L, @@ -456,29 +456,29 @@ class ParticipantAgentFundamentalsSpec Map( 800L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ), 1000L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ), 1200L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ), 1400L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ), 1600L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ), 1800L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) - ) - ) + Megavars(0.0), + ), + ), ) ) } @@ -490,24 +490,24 @@ class ParticipantAgentFundamentalsSpec SortedMap( 800L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) - ) + ), ) val requestValueStore = ValueStore( 900, SortedMap( 900L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) - ) + ), ) mockAgent.getRelevantResultData( requestTick, resultValueStore, - requestValueStore + requestValueStore, ) shouldBe Some( RelevantResultValues( 900L, @@ -515,9 +515,9 @@ class ParticipantAgentFundamentalsSpec Map( 800L -> ApparentPower( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) - ) + ), ) ) } @@ -529,7 +529,7 @@ class ParticipantAgentFundamentalsSpec ApparentPower, FixedLoadRelevantData.type, ConstantState.type, - FixedLoadModel + FixedLoadModel, ]( simulationStartDate, simulationEndDate, @@ -541,7 +541,7 @@ class ParticipantAgentFundamentalsSpec CosPhiFixed(0.95), Kilowatts(100.0), 0.95, - LoadReference.ActivePower(Kilowatts(95.0)) + LoadReference.ActivePower(Kilowatts(95.0)), ), None, outputConfig, @@ -553,12 +553,12 @@ class ParticipantAgentFundamentalsSpec ValueStore(901L), ValueStore(901L), ValueStore(901L), - None + None, ) ParticipantAgent.getAndCheckNodalVoltage( baseStateData, - 1000L + 1000L, ) shouldBe Each(1.0) } @@ -567,7 +567,7 @@ class ParticipantAgentFundamentalsSpec ApparentPower, FixedLoadRelevantData.type, ConstantState.type, - FixedLoadModel + FixedLoadModel, ]( simulationStartDate, simulationEndDate, @@ -579,7 +579,7 @@ class ParticipantAgentFundamentalsSpec CosPhiFixed(0.95), Kilowatts(100.0), 0.95, - LoadReference.ActivePower(Kilowatts(95.0)) + LoadReference.ActivePower(Kilowatts(95.0)), ), None, outputConfig, @@ -591,7 +591,7 @@ class ParticipantAgentFundamentalsSpec ValueStore(901L), ValueStore(901L), ValueStore(901L), - None + None, ) intercept[InconsistentStateException] { @@ -615,17 +615,17 @@ case object ParticipantAgentFundamentalsSpec extends MockitoSugar { */ def mockBaseStateData( additionalActivationTicks: SortedSet[Long], - foreseenDataTicks: Map[ActorRef, Option[Long]] + foreseenDataTicks: Map[ActorRef, Option[Long]], ): ParticipantModelBaseStateData[ ApparentPower, FixedRelevantData.type, ConstantState.type, - SystemParticipant[FixedRelevantData.type, ApparentPower, ConstantState.type] + SystemParticipant[FixedRelevantData.type, ApparentPower, ConstantState.type], ] = { val modelMock = mock[SystemParticipant[ FixedRelevantData.type, ApparentPower, - ConstantState.type + ConstantState.type, ]] when(modelMock.getUuid).thenReturn(UUID.randomUUID()) @@ -636,8 +636,8 @@ case object ParticipantAgentFundamentalsSpec extends MockitoSugar { SystemParticipant[ FixedRelevantData.type, ApparentPower, - ConstantState.type - ] + ConstantState.type, + ], ]( TimeUtil.withDefaults.toZonedDateTime("2020-01-01 00:00:00"), TimeUtil.withDefaults.toZonedDateTime("2020-01-01 23:59:00"), @@ -646,7 +646,7 @@ case object ParticipantAgentFundamentalsSpec extends MockitoSugar { NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false + flexResult = false, ), additionalActivationTicks, foreseenDataTicks, @@ -656,7 +656,7 @@ case object ParticipantAgentFundamentalsSpec extends MockitoSugar { ValueStore(0L), ValueStore(0L), ValueStore(0L), - None + None, ) } } diff --git a/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentMock.scala b/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentMock.scala index 82e6d896f8..2b7b5f399e 100644 --- a/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentMock.scala +++ b/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentMock.scala @@ -13,18 +13,18 @@ import edu.ie3.datamodel.models.result.system.SystemParticipantResult import edu.ie3.simona.agent.ValueStore import edu.ie3.simona.agent.participant.data.Data.PrimaryData.{ ApparentPower, - ZERO_POWER + ZERO_POWER, } import edu.ie3.simona.agent.participant.data.Data.SecondaryData import edu.ie3.simona.agent.participant.data.secondary.SecondaryDataService import edu.ie3.simona.agent.participant.statedata.BaseStateData.ParticipantModelBaseStateData import edu.ie3.simona.agent.participant.statedata.ParticipantStateData.{ InputModelContainer, - ParticipantInitializeStateData + ParticipantInitializeStateData, } import edu.ie3.simona.agent.participant.statedata.{ BaseStateData, - ParticipantStateData + ParticipantStateData, } import edu.ie3.simona.agent.state.AgentState import edu.ie3.simona.agent.state.AgentState.Idle @@ -39,7 +39,7 @@ import edu.ie3.simona.model.participant.{ CalcRelevantData, FlexChangeIndicator, ModelState, - SystemParticipant + SystemParticipant, } import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage.FlexResponse import edu.ie3.util.quantities.QuantityUtils.RichQuantityDouble @@ -66,9 +66,9 @@ class ParticipantAgentMock( initStateData: ParticipantInitializeStateData[ SystemParticipantInput, SimonaConfig.BaseRuntimeConfig, - ApparentPower + ApparentPower, ], - override val listener: Iterable[ActorRef] = Iterable.empty[ActorRef] + override val listener: Iterable[ActorRef] = Iterable.empty[ActorRef], ) extends ParticipantAgent[ ApparentPower, FixedRelevantData.type, @@ -79,8 +79,8 @@ class ParticipantAgentMock( SystemParticipant[ FixedRelevantData.type, ApparentPower, - ConstantState.type - ] + ConstantState.type, + ], ](scheduler, initStateData) with ParticipantAgentFundamentals[ ApparentPower, @@ -92,8 +92,8 @@ class ParticipantAgentMock( SystemParticipant[ FixedRelevantData.type, ApparentPower, - ConstantState.type - ] + ConstantState.type, + ], ] { override protected val pdClassTag: ClassTag[ApparentPower] = classTag[ApparentPower] @@ -112,16 +112,16 @@ class ParticipantAgentMock( SystemParticipant[ FixedRelevantData.type, ApparentPower, - ConstantState.type - ] + ConstantState.type, + ], ], ConstantState.type, - squants.Dimensionless + squants.Dimensionless, ) => ApparentPower = (_, _, _, _) => // output different from default (0, 0) ApparentPower( Megawatts(2.0), - Megavars(1.0) + Megavars(1.0), ) /** Abstractly calculate the power output of the participant with all needed @@ -148,12 +148,12 @@ class ParticipantAgentMock( SystemParticipant[ FixedRelevantData.type, ApparentPower, - ConstantState.type - ] + ConstantState.type, + ], ], modelState: ConstantState.type, currentTick: Long, - scheduler: ActorRef + scheduler: ActorRef, ): FSM.State[AgentState, ParticipantStateData[ApparentPower]] = throw new InvalidRequestException( "Request to calculate power with secondary data cannot be processed for this mock agent." @@ -192,27 +192,27 @@ class ParticipantAgentMock( resolution: Long, requestVoltageDeviationThreshold: Double, outputConfig: NotifierConfig, - maybeEmAgent: Option[TypedActorRef[FlexResponse]] + maybeEmAgent: Option[TypedActorRef[FlexResponse]], ): ParticipantModelBaseStateData[ ApparentPower, FixedRelevantData.type, ConstantState.type, - SystemParticipant[FixedRelevantData.type, ApparentPower, ConstantState.type] + SystemParticipant[FixedRelevantData.type, ApparentPower, ConstantState.type], ] = { val func = CosPhiFixed(0.95).activeToReactivePowerFunc( Kilowatts(0.0), 0.95d, - Each(1.0) + Each(1.0), ) val participant: SystemParticipant[ FixedRelevantData.type, ApparentPower, - ConstantState.type + ConstantState.type, ] = mock[SystemParticipant[ FixedRelevantData.type, ApparentPower, - ConstantState.type + ConstantState.type, ]] doReturn(func).when(participant).activeToReactivePowerFunc(any()) @@ -223,8 +223,8 @@ class ParticipantAgentMock( SystemParticipant[ FixedRelevantData.type, ApparentPower, - ConstantState.type - ] + ConstantState.type, + ], ]( simulationStartDate, simulationEndDate, @@ -236,13 +236,13 @@ class ParticipantAgentMock( requestVoltageDeviationThreshold, ValueStore.forVoltage( resolution, - Each(1.0) + Each(1.0), ), ValueStore.forResult(resolution, 2), ValueStore(resolution), ValueStore(resolution), ValueStore(resolution), - None + None, ) } @@ -262,17 +262,17 @@ class ParticipantAgentMock( inputModel: InputModelContainer[SystemParticipantInput], modelConfig: BaseRuntimeConfig, simulationStartDate: ZonedDateTime, - simulationEndDate: ZonedDateTime + simulationEndDate: ZonedDateTime, ): SystemParticipant[ FixedRelevantData.type, ApparentPower, - ConstantState.type + ConstantState.type, ] = { val mockModel = mock[SystemParticipant[ FixedRelevantData.type, ApparentPower, - ConstantState.type + ConstantState.type, ]] val uuid = inputModel.electricalInputModel.getUuid Mockito.when(mockModel.getUuid).thenReturn(uuid) @@ -287,8 +287,8 @@ class ParticipantAgentMock( SystemParticipant[ FixedRelevantData.type, ApparentPower, - ConstantState.type - ] + ConstantState.type, + ], ] ): ModelState.ConstantState.type = ConstantState @@ -301,10 +301,10 @@ class ParticipantAgentMock( SystemParticipant[ FixedRelevantData.type, ApparentPower, - ConstantState.type - ] + ConstantState.type, + ], ], - tick: Long + tick: Long, ): FixedRelevantData.type = FixedRelevantData @@ -319,7 +319,7 @@ class ParticipantAgentMock( */ override def finalizeTickAfterPF( baseStateData: BaseStateData[ApparentPower], - currentTick: Long + currentTick: Long, ): FSM.State[AgentState, ParticipantStateData[ApparentPower]] = goto(Idle) using baseStateData @@ -342,14 +342,14 @@ class ParticipantAgentMock( windowEnd: Long, activeToReactivePowerFuncOpt: Option[ squants.Power => ReactivePower - ] = None + ] = None, ): ApparentPower = ParticipantAgentFundamentals.averageApparentPower( tickToResults, windowStart, windowEnd, activeToReactivePowerFuncOpt, - log + log, ) /** Determines the correct result. @@ -366,13 +366,13 @@ class ParticipantAgentMock( override protected def buildResult( uuid: UUID, dateTime: ZonedDateTime, - result: ApparentPower + result: ApparentPower, ): SystemParticipantResult = new SystemParticipantResult( dateTime, uuid, result.p.toMegawatts.asMegaWatt, - result.q.toMegavars.asMegaVar + result.q.toMegavars.asMegaVar, ) {} /** Handle an active power change by flex control. @@ -399,19 +399,19 @@ class ParticipantAgentMock( SystemParticipant[ CalcRelevantData.FixedRelevantData.type, ApparentPower, - ModelState.ConstantState.type - ] + ModelState.ConstantState.type, + ], ], data: CalcRelevantData.FixedRelevantData.type, lastState: ModelState.ConstantState.type, - setPower: squants.Power + setPower: squants.Power, ): (ModelState.ConstantState.type, ApparentPower, FlexChangeIndicator) = ( ConstantState, ApparentPower( Kilowatts(0.0), - Kilovars(0.0) + Kilovars(0.0), ), - FlexChangeIndicator() + FlexChangeIndicator(), ) /** Update the last known model state with the given external, relevant data @@ -438,8 +438,8 @@ class ParticipantAgentMock( model: SystemParticipant[ CalcRelevantData.FixedRelevantData.type, ApparentPower, - ModelState.ConstantState.type - ] + ModelState.ConstantState.type, + ], ): ModelState.ConstantState.type = modelState } @@ -449,13 +449,13 @@ object ParticipantAgentMock { initStateData: ParticipantInitializeStateData[ SystemParticipantInput, SimonaConfig.BaseRuntimeConfig, - ApparentPower - ] + ApparentPower, + ], ): Props = Props( new ParticipantAgentMock( scheduler, - initStateData + initStateData, ) ) } diff --git a/src/test/scala/edu/ie3/simona/agent/participant/PvAgentModelCalculationSpec.scala b/src/test/scala/edu/ie3/simona/agent/participant/PvAgentModelCalculationSpec.scala index 471ce0dff6..7e7e7d28f2 100644 --- a/src/test/scala/edu/ie3/simona/agent/participant/PvAgentModelCalculationSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/participant/PvAgentModelCalculationSpec.scala @@ -30,18 +30,18 @@ import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.PowerMessage.{ AssetPowerChangedMessage, AssetPowerUnchangedMessage, - RequestAssetPowerMessage + RequestAssetPowerMessage, } import edu.ie3.simona.ontology.messages.SchedulerMessage.Completion import edu.ie3.simona.ontology.messages.services.ServiceMessage.PrimaryServiceRegistrationMessage import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResponseMessage.{ RegistrationFailedMessage, - RegistrationSuccessfulMessage + RegistrationSuccessfulMessage, } import edu.ie3.simona.ontology.messages.services.WeatherMessage.{ ProvideWeatherMessage, RegisterForWeatherMessage, - WeatherData + WeatherData, } import edu.ie3.simona.test.ParticipantAgentSpec import edu.ie3.simona.test.common.input.PvInputTestData @@ -52,7 +52,7 @@ import edu.ie3.util.scala.quantities.{ Megavars, ReactivePower, Vars, - WattsPerSquareMeter + WattsPerSquareMeter, } import squants.energy.{Kilowatts, Megawatts, Watts} import squants.motion.MetersPerSecond @@ -71,7 +71,7 @@ class PvAgentModelCalculationSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="DEBUG" - """.stripMargin) + """.stripMargin), ) ) with PvInputTestData { @@ -96,12 +96,12 @@ class PvAgentModelCalculationSpec private val simonaConfig: SimonaConfig = createSimonaConfig( LoadModelBehaviour.FIX, - LoadReference.ActivePower(Kilowatts(0d)) + LoadReference.ActivePower(Kilowatts(0d)), ) private val defaultOutputConfig = NotifierConfig( simonaConfig.simona.output.participant.defaultConfig.simulationResult, simonaConfig.simona.output.participant.defaultConfig.powerRequestReply, - simonaConfig.simona.output.participant.defaultConfig.flexResult + simonaConfig.simona.output.participant.defaultConfig.flexResult, ) private val configUtil = ConfigUtil.ParticipantConfigUtil( simonaConfig.simona.runtime.participant @@ -122,7 +122,7 @@ class PvAgentModelCalculationSpec val initStateData = ParticipantInitializeStateData[ PvInput, PvRuntimeConfig, - ApparentPower + ApparentPower, ]( inputModel = voltageSensitiveInput, modelConfig = modelConfig, @@ -133,7 +133,7 @@ class PvAgentModelCalculationSpec requestVoltageDeviationThreshold = simonaConfig.simona.runtime.participant.requestVoltageDeviationThreshold, outputConfig = defaultOutputConfig, - primaryServiceProxy = primaryServiceProxy.ref + primaryServiceProxy = primaryServiceProxy.ref, ) "be instantiated correctly" in { @@ -141,7 +141,7 @@ class PvAgentModelCalculationSpec new PvAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -163,7 +163,7 @@ class PvAgentModelCalculationSpec new PvAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -175,7 +175,7 @@ class PvAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( pvAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) deathProbe.expectTerminated(pvAgent.ref) @@ -186,7 +186,7 @@ class PvAgentModelCalculationSpec val initStateData = ParticipantInitializeStateData[ PvInput, PvRuntimeConfig, - ApparentPower + ApparentPower, ]( inputModel = voltageSensitiveInput, modelConfig = modelConfig, @@ -197,7 +197,7 @@ class PvAgentModelCalculationSpec requestVoltageDeviationThreshold = simonaConfig.simona.runtime.participant.requestVoltageDeviationThreshold, outputConfig = defaultOutputConfig, - primaryServiceProxy = primaryServiceProxy.ref + primaryServiceProxy = primaryServiceProxy.ref, ) "be instantiated correctly" in { @@ -205,7 +205,7 @@ class PvAgentModelCalculationSpec new PvAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -225,7 +225,7 @@ class PvAgentModelCalculationSpec new PvAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -247,7 +247,7 @@ class PvAgentModelCalculationSpec resolution, requestVoltageDeviationThreshold, outputConfig, - maybeEmAgent + maybeEmAgent, ) => inputModel shouldBe SimpleInputContainer(voltageSensitiveInput) modelConfig shouldBe modelConfig @@ -265,7 +265,7 @@ class PvAgentModelCalculationSpec /* Refuse registration */ primaryServiceProxy.send( pvAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* Expect a registration message */ @@ -291,10 +291,10 @@ class PvAgentModelCalculationSpec requestValueStore, _, _, - _ + _, ), awaitRegistrationResponsesFrom, - foreseenNextDataTicks + foreseenNextDataTicks, ) => /* Base state data */ startDate shouldBe simulationStartDate @@ -305,13 +305,13 @@ class PvAgentModelCalculationSpec outputConfig shouldBe NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false + flexResult = false, ) additionalActivationTicks shouldBe empty foreseenDataTicks shouldBe Map.empty voltageValueStore shouldBe ValueStore( resolution, - SortedMap(0L -> Each(1.0)) + SortedMap(0L -> Each(1.0)), ) resultValueStore shouldBe ValueStore(resolution) requestValueStore shouldBe ValueStore[ApparentPower](resolution) @@ -328,7 +328,7 @@ class PvAgentModelCalculationSpec /* Reply, that registration was successful */ weatherService.send( pvAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(4711L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(4711L)), ) /* Expect a completion message */ @@ -354,7 +354,7 @@ class PvAgentModelCalculationSpec new PvAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -364,7 +364,7 @@ class PvAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( pvAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* Expect a registration message */ @@ -373,7 +373,7 @@ class PvAgentModelCalculationSpec ) weatherService.send( pvAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(900L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(900L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -385,12 +385,12 @@ class PvAgentModelCalculationSpec pvAgent ! RequestAssetPowerMessage( 0L, Each(1d), - Each(0d) + Each(0d), ) expectMsg( AssetPowerChangedMessage( Megawatts(0d), - Megavars(0d) + Megavars(0d), ) ) @@ -403,9 +403,9 @@ class PvAgentModelCalculationSpec SortedMap( 0L -> ApparentPower( Megawatts(0d), - Megavars(0d) + Megavars(0d), ) - ) + ), ) case _ => fail( @@ -419,7 +419,7 @@ class PvAgentModelCalculationSpec new PvAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -429,14 +429,14 @@ class PvAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( pvAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ weatherService.expectMsgType[RegisterForWeatherMessage] weatherService.send( pvAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(0L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(0L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -449,12 +449,12 @@ class PvAgentModelCalculationSpec WattsPerSquareMeter(0d), WattsPerSquareMeter(0d), Celsius(1.815d), - MetersPerSecond(7.726576d) + MetersPerSecond(7.726576d), ) weatherService.send( pvAgent, - ProvideWeatherMessage(0L, weatherService.ref, weatherData, Some(3600L)) + ProvideWeatherMessage(0L, weatherService.ref, weatherData, Some(3600L)), ) /* Find yourself in corresponding state and state data */ @@ -463,7 +463,7 @@ class PvAgentModelCalculationSpec case DataCollectionStateData( baseStateData: ParticipantModelBaseStateData[_, _, _, _], expectedSenders, - isYetTriggered + isYetTriggered, ) => /* The next data tick is already registered */ baseStateData.foreseenDataTicks shouldBe Map( @@ -507,7 +507,7 @@ class PvAgentModelCalculationSpec store.size shouldBe 1 store.getOrElse( 0L, - fail("Expected a simulation result for tick 900.") + fail("Expected a simulation result for tick 900."), ) match { case ApparentPower(p, q) => p should approximate(Megawatts(0.0)) @@ -526,7 +526,7 @@ class PvAgentModelCalculationSpec new PvAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -536,14 +536,14 @@ class PvAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( pvAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ weatherService.expectMsgType[RegisterForWeatherMessage] weatherService.send( pvAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(0L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(0L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -559,7 +559,7 @@ class PvAgentModelCalculationSpec case DataCollectionStateData( baseStateData: ParticipantModelBaseStateData[_, _, _, _], expectedSenders, - isYetTriggered + isYetTriggered, ) => /* The next data tick is already registered */ baseStateData.foreseenDataTicks shouldBe Map( @@ -582,12 +582,12 @@ class PvAgentModelCalculationSpec WattsPerSquareMeter(0d), WattsPerSquareMeter(0d), Celsius(1.815d), - MetersPerSecond(7.726576d) + MetersPerSecond(7.726576d), ) weatherService.send( pvAgent, - ProvideWeatherMessage(0L, weatherService.ref, weatherData, Some(3600L)) + ProvideWeatherMessage(0L, weatherService.ref, weatherData, Some(3600L)), ) /* Expect confirmation */ @@ -611,7 +611,7 @@ class PvAgentModelCalculationSpec store.size shouldBe 1 store.getOrElse( 0L, - fail("Expected a simulation result for tick 0.") + fail("Expected a simulation result for tick 0."), ) match { case ApparentPower(p, q) => p should approximate(Megawatts(0.0)) @@ -630,7 +630,7 @@ class PvAgentModelCalculationSpec new PvAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -641,14 +641,14 @@ class PvAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( pvAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ weatherService.expectMsgType[RegisterForWeatherMessage] weatherService.send( pvAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(3600L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(3600L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -659,7 +659,7 @@ class PvAgentModelCalculationSpec pvAgent ! RequestAssetPowerMessage( 7200L, Each(1d), - Each(0d) + Each(0d), ) expectNoMessage(noReceiveTimeOut.duration) awaitAssert(pvAgent.stateName == Idle) @@ -669,7 +669,7 @@ class PvAgentModelCalculationSpec WattsPerSquareMeter(0d), WattsPerSquareMeter(0d), Celsius(1.815d), - MetersPerSecond(7.726576d) + MetersPerSecond(7.726576d), ) weatherService.send( pvAgent, @@ -677,8 +677,8 @@ class PvAgentModelCalculationSpec 3600L, weatherService.ref, weatherData, - Some(7200L) - ) + Some(7200L), + ), ) /* Trigger the agent */ @@ -700,7 +700,7 @@ class PvAgentModelCalculationSpec new PvAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -712,14 +712,14 @@ class PvAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( pvAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ weatherService.expectMsgType[RegisterForWeatherMessage] weatherService.send( pvAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(0L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(0L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -737,10 +737,10 @@ class PvAgentModelCalculationSpec WattsPerSquareMeter(0d), WattsPerSquareMeter(0d), Celsius(1.815d), - MetersPerSecond(7.726576d) + MetersPerSecond(7.726576d), ), - Some(3600L) - ) + Some(3600L), + ), ) scheduler.send(pvAgent, Activation(0)) scheduler.expectMsg(Completion(pvAgent.toTyped, Some(3600))) @@ -755,10 +755,10 @@ class PvAgentModelCalculationSpec WattsPerSquareMeter(0d), WattsPerSquareMeter(0d), Celsius(1.815d), - MetersPerSecond(7.726576d) + MetersPerSecond(7.726576d), ), - Some(7200L) - ) + Some(7200L), + ), ) scheduler.send(pvAgent, Activation(3600)) scheduler.expectMsg(Completion(pvAgent.toTyped, Some(7200))) @@ -773,10 +773,10 @@ class PvAgentModelCalculationSpec WattsPerSquareMeter(0d), WattsPerSquareMeter(0d), Celsius(1.815d), - MetersPerSecond(7.726576d) + MetersPerSecond(7.726576d), ), - None - ) + None, + ), ) scheduler.send(pvAgent, Activation(7200)) scheduler.expectMsg(Completion(pvAgent.toTyped)) @@ -785,7 +785,7 @@ class PvAgentModelCalculationSpec pvAgent ! RequestAssetPowerMessage( 7500L, Each(1d), - Each(0d) + Each(0d), ) expectMsgType[AssetPowerChangedMessage] match { @@ -802,7 +802,7 @@ class PvAgentModelCalculationSpec pvAgent ! RequestAssetPowerMessage( 7500L, Each(1.000000000000001d), - Each(0d) + Each(0d), ) /* Expect, that nothing has changed */ @@ -818,7 +818,7 @@ class PvAgentModelCalculationSpec pvAgent ! RequestAssetPowerMessage( 7500L, Each(0.98), - Each(0d) + Each(0d), ) /* Expect, the correct values (this model has fixed power factor) */ diff --git a/src/test/scala/edu/ie3/simona/agent/participant/RichValueSpec.scala b/src/test/scala/edu/ie3/simona/agent/participant/RichValueSpec.scala index 5cf286ba8c..5710c15417 100644 --- a/src/test/scala/edu/ie3/simona/agent/participant/RichValueSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/participant/RichValueSpec.scala @@ -12,7 +12,7 @@ import edu.ie3.datamodel.models.value.{ HeatDemandValue, PValue, SValue, - Value + Value, } import edu.ie3.simona.agent.participant.data.Data.PrimaryData import edu.ie3.simona.agent.participant.data.Data.PrimaryData.{ @@ -20,7 +20,7 @@ import edu.ie3.simona.agent.participant.data.Data.PrimaryData.{ ActivePowerAndHeat, ApparentPower, ApparentPowerAndHeat, - RichValue + RichValue, } import edu.ie3.simona.test.common.UnitSpec import edu.ie3.util.quantities.PowerSystemUnits @@ -54,32 +54,32 @@ class RichValueSpec extends UnitSpec with TableDrivenPropertyChecks { new PValue(null), new HeatAndPValue( null, - Quantities.getQuantity(12.5, PowerSystemUnits.KILOWATT) + Quantities.getQuantity(12.5, PowerSystemUnits.KILOWATT), ), new HeatAndPValue( Quantities.getQuantity(50d, PowerSystemUnits.KILOWATT), - null + null, ), new SValue(null, Quantities.getQuantity(25d, PowerSystemUnits.KILOVAR)), new SValue( Quantities.getQuantity(50d, PowerSystemUnits.KILOWATT), - null + null, ), new HeatAndSValue( null, Quantities.getQuantity(25d, PowerSystemUnits.KILOVAR), - Quantities.getQuantity(12.5, PowerSystemUnits.KILOWATT) + Quantities.getQuantity(12.5, PowerSystemUnits.KILOWATT), ), new HeatAndSValue( Quantities.getQuantity(50d, PowerSystemUnits.KILOWATT), null, - Quantities.getQuantity(12.5, PowerSystemUnits.KILOWATT) + Quantities.getQuantity(12.5, PowerSystemUnits.KILOWATT), ), new HeatAndSValue( Quantities.getQuantity(50d, PowerSystemUnits.KILOWATT), Quantities.getQuantity(25d, PowerSystemUnits.KILOVAR), - null - ) + null, + ), ) forAll(table)({ maliciousValue: Value => @@ -99,40 +99,40 @@ class RichValueSpec extends UnitSpec with TableDrivenPropertyChecks { ("value", "primaryData"), ( new PValue(Quantities.getQuantity(50d, PowerSystemUnits.KILOWATT)), - ActivePower(Kilowatts(50d)) + ActivePower(Kilowatts(50d)), ), ( new HeatAndPValue( Quantities.getQuantity(50d, PowerSystemUnits.KILOWATT), - Quantities.getQuantity(12.5, PowerSystemUnits.KILOWATT) + Quantities.getQuantity(12.5, PowerSystemUnits.KILOWATT), ), ActivePowerAndHeat( Kilowatts(50d), - Kilowatts(12.5d) - ) + Kilowatts(12.5d), + ), ), ( new SValue( Quantities.getQuantity(50d, PowerSystemUnits.KILOWATT), - Quantities.getQuantity(25d, PowerSystemUnits.KILOVAR) + Quantities.getQuantity(25d, PowerSystemUnits.KILOVAR), ), ApparentPower( Kilowatts(50d), - Kilovars(25d) - ) + Kilovars(25d), + ), ), ( new HeatAndSValue( Quantities.getQuantity(50d, PowerSystemUnits.KILOWATT), Quantities.getQuantity(25d, PowerSystemUnits.KILOVAR), - Quantities.getQuantity(12.5, PowerSystemUnits.KILOWATT) + Quantities.getQuantity(12.5, PowerSystemUnits.KILOWATT), ), ApparentPowerAndHeat( Kilowatts(50d), Kilovars(25d), - Kilowatts(12.5) - ) - ) + Kilowatts(12.5), + ), + ), ) forAll(table)({ case (value: Value, primaryData: PrimaryData) => @@ -142,7 +142,7 @@ class RichValueSpec extends UnitSpec with TableDrivenPropertyChecks { case Failure(exception) => fail( s"Conversion of '$value' to primary data should succeed, but failed.", - exception + exception, ) } }) diff --git a/src/test/scala/edu/ie3/simona/agent/participant/WecAgentModelCalculationSpec.scala b/src/test/scala/edu/ie3/simona/agent/participant/WecAgentModelCalculationSpec.scala index a0b6df4aaf..4e2151087f 100644 --- a/src/test/scala/edu/ie3/simona/agent/participant/WecAgentModelCalculationSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/participant/WecAgentModelCalculationSpec.scala @@ -21,7 +21,7 @@ import edu.ie3.simona.agent.participant.statedata.DataCollectionStateData import edu.ie3.simona.agent.participant.statedata.ParticipantStateData.{ CollectRegistrationConfirmMessages, ParticipantInitializeStateData, - ParticipantUninitializedStateData + ParticipantUninitializedStateData, } import edu.ie3.simona.agent.participant.wec.WecAgent import edu.ie3.simona.agent.state.AgentState.{Idle, Uninitialized} @@ -37,18 +37,18 @@ import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.PowerMessage.{ AssetPowerChangedMessage, AssetPowerUnchangedMessage, - RequestAssetPowerMessage + RequestAssetPowerMessage, } import edu.ie3.simona.ontology.messages.SchedulerMessage.Completion import edu.ie3.simona.ontology.messages.services.ServiceMessage.PrimaryServiceRegistrationMessage import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResponseMessage.{ RegistrationFailedMessage, - RegistrationSuccessfulMessage + RegistrationSuccessfulMessage, } import edu.ie3.simona.ontology.messages.services.WeatherMessage.{ ProvideWeatherMessage, RegisterForWeatherMessage, - WeatherData + WeatherData, } import edu.ie3.simona.test.ParticipantAgentSpec import edu.ie3.simona.test.common.input.WecInputTestData @@ -59,7 +59,7 @@ import edu.ie3.util.scala.quantities.{ Megavars, ReactivePower, Vars, - WattsPerSquareMeter + WattsPerSquareMeter, } import org.scalatest.PrivateMethodTester import squants.Each @@ -79,7 +79,7 @@ class WecAgentModelCalculationSpec .parseString(""" |pekko.loggers =["org.apache.pekko.event.slf4j.Slf4jLogger"] |pekko.loglevel="DEBUG" - """.stripMargin) + """.stripMargin), ) ) with PrivateMethodTester @@ -104,7 +104,7 @@ class WecAgentModelCalculationSpec private val simonaConfig: SimonaConfig = createSimonaConfig( LoadModelBehaviour.FIX, - LoadReference.ActivePower(Kilowatts(0d)) + LoadReference.ActivePower(Kilowatts(0d)), ) private val configUtil = ConfigUtil.ParticipantConfigUtil( simonaConfig.simona.runtime.participant @@ -125,7 +125,7 @@ class WecAgentModelCalculationSpec val initStateData = ParticipantInitializeStateData[ WecInput, WecRuntimeConfig, - ApparentPower + ApparentPower, ]( inputModel = voltageSensitiveInput, simulationStartDate = simulationStartDate, @@ -139,8 +139,8 @@ class WecAgentModelCalculationSpec outputConfig = NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false - ) + flexResult = false, + ), ) "be instantiated correctly" in { @@ -148,7 +148,7 @@ class WecAgentModelCalculationSpec new WecAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -170,7 +170,7 @@ class WecAgentModelCalculationSpec new WecAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -182,7 +182,7 @@ class WecAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( wecAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) deathProbe.expectTerminated(wecAgent.ref) @@ -193,7 +193,7 @@ class WecAgentModelCalculationSpec val initStateData = ParticipantInitializeStateData[ WecInput, WecRuntimeConfig, - ApparentPower + ApparentPower, ]( inputModel = voltageSensitiveInput, modelConfig = modelConfig, @@ -207,8 +207,8 @@ class WecAgentModelCalculationSpec outputConfig = NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false - ) + flexResult = false, + ), ) "be instantiated correctly" in { @@ -216,7 +216,7 @@ class WecAgentModelCalculationSpec new WecAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -236,7 +236,7 @@ class WecAgentModelCalculationSpec new WecAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -246,7 +246,7 @@ class WecAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( wecAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* Expect a registration message */ @@ -270,10 +270,10 @@ class WecAgentModelCalculationSpec requestValueStore, _, _, - _ + _, ), awaitRegistrationResponsesFrom, - foreseenNextDataTicks + foreseenNextDataTicks, ) => /* Base state data */ startDate shouldBe simulationStartDate @@ -282,13 +282,13 @@ class WecAgentModelCalculationSpec outputConfig shouldBe NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false + flexResult = false, ) additionalActivationTicks shouldBe empty foreseenDataTicks shouldBe Map.empty voltageValueStore shouldBe ValueStore( resolution, - SortedMap(0L -> Each(1.0)) + SortedMap(0L -> Each(1.0)), ) resultValueStore shouldBe ValueStore(resolution) requestValueStore shouldBe ValueStore[ApparentPower](resolution) @@ -305,7 +305,7 @@ class WecAgentModelCalculationSpec /* Reply, that registration was successful */ weatherService.send( wecAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(4711L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(4711L)), ) /* Expect a completion message */ @@ -318,7 +318,7 @@ class WecAgentModelCalculationSpec ApparentPower, WecRelevantData, ConstantState.type, - WecModel + WecModel, ] => /* Only check the awaited next data ticks, as the rest has yet been checked */ baseStateData.foreseenDataTicks shouldBe Map( @@ -336,7 +336,7 @@ class WecAgentModelCalculationSpec new WecAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -346,14 +346,14 @@ class WecAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( wecAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* Expect a registration message */ weatherService.expectMsg(RegisterForWeatherMessage(51.4843281, 7.4116482)) weatherService.send( wecAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(900L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(900L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -365,12 +365,12 @@ class WecAgentModelCalculationSpec wecAgent ! RequestAssetPowerMessage( 0L, Each(1.0), - Each(0.0) + Each(0.0), ) expectMsg( AssetPowerChangedMessage( Megawatts(0.0), - Megavars(0.0) + Megavars(0.0), ) ) @@ -379,7 +379,7 @@ class WecAgentModelCalculationSpec ApparentPower, WecRelevantData, ConstantState.type, - WecModel + WecModel, ] => modelBaseStateData.requestValueStore shouldBe ValueStore[ ApparentPower @@ -388,9 +388,9 @@ class WecAgentModelCalculationSpec SortedMap( 0L -> ApparentPower( Megawatts(0d), - Megavars(0d) + Megavars(0d), ) - ) + ), ) case _ => fail( @@ -404,7 +404,7 @@ class WecAgentModelCalculationSpec new WecAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -414,14 +414,14 @@ class WecAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( wecAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ weatherService.expectMsgType[RegisterForWeatherMessage] weatherService.send( wecAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(900L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(900L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -434,7 +434,7 @@ class WecAgentModelCalculationSpec WattsPerSquareMeter(50d), WattsPerSquareMeter(100d), Celsius(0d), - MetersPerSecond(0d) + MetersPerSecond(0d), ) weatherService.send( @@ -443,8 +443,8 @@ class WecAgentModelCalculationSpec 900L, weatherService.ref, weatherData, - Some(1800L) - ) + Some(1800L), + ), ) /* Find yourself in corresponding state and state data */ @@ -455,10 +455,10 @@ class WecAgentModelCalculationSpec ApparentPower, WecRelevantData, ConstantState.type, - WecModel + WecModel, ], expectedSenders, - isYetTriggered + isYetTriggered, ) => /* The next data tick is already registered */ baseStateData.foreseenDataTicks shouldBe Map( @@ -491,7 +491,7 @@ class WecAgentModelCalculationSpec ApparentPower, WecRelevantData, ConstantState.type, - WecModel + WecModel, ] => /* The store for calculation relevant data has been extended */ baseStateData.receivedSecondaryDataStore match { @@ -507,7 +507,7 @@ class WecAgentModelCalculationSpec store.size shouldBe 1 store.getOrElse( 900L, - fail("Expected a simulation result for tick 900.") + fail("Expected a simulation result for tick 900."), ) match { case ApparentPower(p, q) => p should approximate(Megawatts(0.0)) @@ -526,7 +526,7 @@ class WecAgentModelCalculationSpec new WecAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -536,14 +536,14 @@ class WecAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( wecAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ weatherService.expectMsgType[RegisterForWeatherMessage] weatherService.send( wecAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(900L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(900L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -561,10 +561,10 @@ class WecAgentModelCalculationSpec ApparentPower, WecRelevantData, ConstantState.type, - WecModel + WecModel, ], expectedSenders, - isYetTriggered + isYetTriggered, ) => /* The next data tick is already registered */ baseStateData.foreseenDataTicks shouldBe Map( @@ -587,7 +587,7 @@ class WecAgentModelCalculationSpec WattsPerSquareMeter(50d), WattsPerSquareMeter(100d), Celsius(0d), - MetersPerSecond(0d) + MetersPerSecond(0d), ) weatherService.send( @@ -596,8 +596,8 @@ class WecAgentModelCalculationSpec 900L, weatherService.ref, weatherData, - Some(1800L) - ) + Some(1800L), + ), ) /* Expect confirmation */ @@ -610,7 +610,7 @@ class WecAgentModelCalculationSpec ApparentPower, WecRelevantData, ConstantState.type, - WecModel + WecModel, ] => /* The store for calculation relevant data has been extended */ baseStateData.receivedSecondaryDataStore match { @@ -626,7 +626,7 @@ class WecAgentModelCalculationSpec store.size shouldBe 1 store.getOrElse( 900L, - fail("Expected a simulation result for tick 900.") + fail("Expected a simulation result for tick 900."), ) match { case ApparentPower(p, q) => p should approximate(Megawatts(0.0)) @@ -645,7 +645,7 @@ class WecAgentModelCalculationSpec new WecAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -656,14 +656,14 @@ class WecAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( wecAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ weatherService.expectMsgType[RegisterForWeatherMessage] weatherService.send( wecAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(900L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(900L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -674,7 +674,7 @@ class WecAgentModelCalculationSpec wecAgent ! RequestAssetPowerMessage( 1800L, Each(1.0), - Each(0.0) + Each(0.0), ) expectNoMessage(noReceiveTimeOut.duration) awaitAssert(wecAgent.stateName == Idle) @@ -684,7 +684,7 @@ class WecAgentModelCalculationSpec WattsPerSquareMeter(50d), WattsPerSquareMeter(100d), Celsius(0d), - MetersPerSecond(0d) + MetersPerSecond(0d), ) weatherService.send( wecAgent, @@ -692,8 +692,8 @@ class WecAgentModelCalculationSpec 900L, weatherService.ref, weatherData, - Some(1800L) - ) + Some(1800L), + ), ) /* Trigger the agent */ @@ -715,7 +715,7 @@ class WecAgentModelCalculationSpec new WecAgent( scheduler = scheduler.ref, initStateData = initStateData, - listener = systemListener + listener = systemListener, ) ) @@ -727,14 +727,14 @@ class WecAgentModelCalculationSpec primaryServiceProxy.expectMsgType[PrimaryServiceRegistrationMessage] primaryServiceProxy.send( wecAgent, - RegistrationFailedMessage(primaryServiceProxy.ref) + RegistrationFailedMessage(primaryServiceProxy.ref), ) /* I'm not interested in the content of the RegistrationMessage */ weatherService.expectMsgType[RegisterForWeatherMessage] weatherService.send( wecAgent, - RegistrationSuccessfulMessage(weatherService.ref, Some(900L)) + RegistrationSuccessfulMessage(weatherService.ref, Some(900L)), ) /* I'm not interested in the content of the CompletionMessage */ @@ -752,10 +752,10 @@ class WecAgentModelCalculationSpec WattsPerSquareMeter(50d), WattsPerSquareMeter(100d), Celsius(0d), - MetersPerSecond(0d) + MetersPerSecond(0d), ), - Some(1800L) - ) + Some(1800L), + ), ) scheduler.send(wecAgent, Activation(900)) scheduler.expectMsg(Completion(wecAgent.toTyped, Some(1800))) @@ -770,10 +770,10 @@ class WecAgentModelCalculationSpec WattsPerSquareMeter(50d), WattsPerSquareMeter(100d), Celsius(0d), - MetersPerSecond(0d) + MetersPerSecond(0d), ), - Some(2700L) - ) + Some(2700L), + ), ) scheduler.send(wecAgent, Activation(1800)) scheduler.expectMsg(Completion(wecAgent.toTyped, Some(2700))) @@ -788,10 +788,10 @@ class WecAgentModelCalculationSpec WattsPerSquareMeter(50d), WattsPerSquareMeter(100d), Celsius(0d), - MetersPerSecond(0d) + MetersPerSecond(0d), ), - None - ) + None, + ), ) scheduler.send(wecAgent, Activation(2700)) scheduler.expectMsg(Completion(wecAgent.toTyped)) @@ -800,7 +800,7 @@ class WecAgentModelCalculationSpec wecAgent ! RequestAssetPowerMessage( 3000L, Each(1.0), - Each(0.0) + Each(0.0), ) expectMsgType[AssetPowerChangedMessage] match { @@ -817,7 +817,7 @@ class WecAgentModelCalculationSpec wecAgent ! RequestAssetPowerMessage( 3000L, Each(1.000000000000001d), - Each(0.0) + Each(0.0), ) /* Expect, that nothing has changed */ @@ -833,7 +833,7 @@ class WecAgentModelCalculationSpec wecAgent ! RequestAssetPowerMessage( 3000L, Each(0.98d), - Each(0.0) + Each(0.0), ) /* Expect, the correct values (this model has fixed power factor) */ diff --git a/src/test/scala/edu/ie3/simona/api/ExtSimAdapterSpec.scala b/src/test/scala/edu/ie3/simona/api/ExtSimAdapterSpec.scala index 54dcd9f061..da6431493b 100644 --- a/src/test/scala/edu/ie3/simona/api/ExtSimAdapterSpec.scala +++ b/src/test/scala/edu/ie3/simona/api/ExtSimAdapterSpec.scala @@ -16,11 +16,11 @@ import edu.ie3.simona.api.simulation.ontology.{ ActivationMessage, TerminationCompleted, TerminationMessage, - CompletionMessage => ExtCompletionMessage + CompletionMessage => ExtCompletionMessage, } import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResponseMessage.ScheduleServiceActivation import edu.ie3.simona.ontology.messages.{Activation, StopMessage} @@ -41,7 +41,7 @@ class ExtSimAdapterSpec .parseString(""" |pekko.loggers = ["org.apache.pekko.testkit.TestEventListener"] |pekko.loglevel = "INFO" - |""".stripMargin) + |""".stripMargin), ) ) with AnyWordSpecLike @@ -89,7 +89,7 @@ class ExtSimAdapterSpec awaitCond( !extData.receiveMessageQueue.isEmpty, max = 3.seconds, - message = "No message received" + message = "No message received", ) extData.receiveMessageQueue.size() shouldBe 1 extData.receiveMessageQueue.take() shouldBe new ActivationMessage( @@ -129,7 +129,7 @@ class ExtSimAdapterSpec awaitCond( !extData.receiveMessageQueue.isEmpty, max = 3.seconds, - message = "No message received" + message = "No message received", ) extData.receiveMessageQueue.size() shouldBe 1 extData.receiveMessageQueue.take() @@ -169,7 +169,7 @@ class ExtSimAdapterSpec awaitCond( !extData.receiveMessageQueue.isEmpty, max = 3.seconds, - message = "No message received" + message = "No message received", ) extData.receiveMessageQueue.size() shouldBe 1 extData.receiveMessageQueue.take() shouldBe new TerminationMessage( diff --git a/src/test/scala/edu/ie3/simona/config/ConfigFailFastSpec.scala b/src/test/scala/edu/ie3/simona/config/ConfigFailFastSpec.scala index df2333ca9f..a9eacda69a 100644 --- a/src/test/scala/edu/ie3/simona/config/ConfigFailFastSpec.scala +++ b/src/test/scala/edu/ie3/simona/config/ConfigFailFastSpec.scala @@ -33,7 +33,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { new Time( "2020-06-18 13:41:00", None, - "2020-05-18 13:41:00" + "2020-05-18 13:41:00", ) ) } @@ -45,7 +45,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { new Time( "2020-06-18 13:41:00", None, - "2020-07-18 13:41:00" + "2020-07-18 13:41:00", ) ) }.getMessage shouldBe "Invalid time configuration." + @@ -88,11 +88,11 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { 10, new Newtonraphson( List(10, 30), - 100 + 100, ), Duration.of(3600, ChronoUnit.SECONDS), stopOnFailure = false, - Duration.of(3600, ChronoUnit.SECONDS) + Duration.of(3600, ChronoUnit.SECONDS), ) ) } @@ -105,11 +105,11 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { 10, new Newtonraphson( List(10, 30), - 100 + 100, ), resolution = Duration.of(3600, ChronoUnit.NANOS), stopOnFailure = false, - sweepTimeout = Duration.of(3600, ChronoUnit.SECONDS) + sweepTimeout = Duration.of(3600, ChronoUnit.SECONDS), ) ) }.getMessage shouldBe "Invalid time resolution. Please ensure, that the time resolution for power flow calculation is at least rounded to a full second!" @@ -450,7 +450,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { ConfigFailFast invokePrivate checkBaseRuntimeConfigs( simonaConfig.simona.runtime.participant.load.defaultConfig, simonaConfig.simona.runtime.participant.load.individualConfigs, - defaultString + defaultString, ) }.getMessage shouldBe "There has to be at least one identifier for each participant." } @@ -476,7 +476,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { ConfigFailFast invokePrivate checkBaseRuntimeConfigs( simonaConfig.simona.runtime.participant.load.defaultConfig, simonaConfig.simona.runtime.participant.load.individualConfigs, - defaultString + defaultString, ) }.getMessage shouldBe "Found invalid UUID 'blabla' it was meant to be the string 'default' or a valid UUID." } @@ -502,7 +502,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { ConfigFailFast invokePrivate checkBaseRuntimeConfigs( simonaConfig.simona.runtime.participant.load.defaultConfig, simonaConfig.simona.runtime.participant.load.individualConfigs, - defaultString + defaultString, ) }.getMessage shouldBe s"Found invalid UUID 'blabla' it was meant to be the string 'default' or a valid UUID." } @@ -528,7 +528,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { ConfigFailFast invokePrivate checkBaseRuntimeConfigs( simonaConfig.simona.runtime.participant.load.defaultConfig, simonaConfig.simona.runtime.participant.load.individualConfigs, - defaultString + defaultString, ) }.getMessage shouldBe "The scaling factor for system participants with UUID '49f250fa-41ff-4434-a083-79c98d260a76' may not be negative." } @@ -569,7 +569,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { ConfigFailFast invokePrivate checkBaseRuntimeConfigs( simonaConfig.simona.runtime.participant.load.defaultConfig, simonaConfig.simona.runtime.participant.load.individualConfigs, - defaultString + defaultString, ) }.getMessage shouldBe "The basic model configurations contain ambiguous definitions." } @@ -688,20 +688,20 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { notifier = "load", powerRequestReply = true, simulationResult = false, - flexResult = false + flexResult = false, ), SimonaConfig.ParticipantBaseOutputConfig( notifier = "pv", powerRequestReply = true, simulationResult = false, - flexResult = false + flexResult = false, ), SimonaConfig.ParticipantBaseOutputConfig( notifier = "chp", powerRequestReply = true, simulationResult = false, - flexResult = false - ) + flexResult = false, + ), ) noException shouldBe thrownBy { @@ -717,20 +717,20 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { notifier = "load", powerRequestReply = true, simulationResult = false, - flexResult = false + flexResult = false, ), SimonaConfig.ParticipantBaseOutputConfig( notifier = "pv", powerRequestReply = true, simulationResult = false, - flexResult = false + flexResult = false, ), SimonaConfig.ParticipantBaseOutputConfig( notifier = "load", powerRequestReply = false, simulationResult = true, - flexResult = false - ) + flexResult = false, + ), ) intercept[InvalidConfigParameterException]( @@ -757,7 +757,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { Sink( Some(Csv("", "", "", isHierarchic = false)), Some(InfluxDb1x("", 0, "")), - None + None, ) ) }.getLocalizedMessage shouldBe "Multiple sink configurations are not supported! Please ensure that only " + @@ -785,9 +785,9 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { 0, "00000000-0000-0000-0000-000000000000", "https://reg:123", - "topic" + "topic", ) - ) + ), ) ) }.getMessage shouldBe "Connection with kafka broker localhost:12345 failed." @@ -802,7 +802,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { intercept[InvalidConfigParameterException] { CsvConfigUtil.checkBaseCsvParams( csvParams, - "CsvGridData" + "CsvGridData", ) }.getMessage shouldBe "The csvSep parameter '\t' for 'CsvGridData' configuration is invalid! Please choose between ';' or ','!" } @@ -812,7 +812,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { intercept[InvalidConfigParameterException] { CsvConfigUtil.checkBaseCsvParams( csvParams, - "CsvGridData" + "CsvGridData", ) }.getMessage shouldBe "The provided directoryPath for .csv-files '' for 'CsvGridData' configuration is invalid! Please correct the path!" } @@ -824,7 +824,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { intercept[InvalidConfigParameterException] { CsvConfigUtil.checkBaseCsvParams( csvParams, - "CsvGridData" + "CsvGridData", ) }.getMessage shouldBe "The provided directoryPath for .csv-files 'somewhere/else' for 'CsvGridData' configuration is invalid! Please correct the path!" } @@ -833,13 +833,13 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { val csvParams = BaseCsvParams( ",", "inputData/common/pekko.conf", - isHierarchic = false + isHierarchic = false, ) intercept[InvalidConfigParameterException] { CsvConfigUtil.checkBaseCsvParams( csvParams, - "CsvGridData" + "CsvGridData", ) }.getMessage shouldBe "The provided directoryPath for .csv-files 'inputData/common/pekko.conf' for 'CsvGridData' configuration is invalid! Please correct the path!" } @@ -850,7 +850,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { noException shouldBe thrownBy { CsvConfigUtil.checkBaseCsvParams( csvParams, - "CsvGridData" + "CsvGridData", ) } } @@ -863,7 +863,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { Some( BaseCsvParams(",", "inputData/vn_simona", isHierarchic = false) ), - id = "" + id = "", ) intercept[InvalidConfigParameterException] { @@ -874,7 +874,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { "identify unsupported id" in { val gridDataSource = SimonaConfig.Simona.Input.Grid.Datasource( None, - id = "someWhereUndefined" + id = "someWhereUndefined", ) intercept[InvalidConfigParameterException] { @@ -885,7 +885,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { "identify missing csv parameters" in { val gridDataSource = SimonaConfig.Simona.Input.Grid.Datasource( None, - id = "csv" + id = "csv", ) intercept[InvalidConfigParameterException] { @@ -900,10 +900,10 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { BaseCsvParams( ",", "input/samples/vn_simona", - isHierarchic = false + isHierarchic = false, ) ), - id = "csv" + id = "csv", ) noException shouldBe thrownBy { @@ -929,7 +929,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { SimonaConfig.Simona.Input.Weather.Datasource.CoordinateSource .SampleParams(true) ), - None + None, ), None, None, @@ -941,7 +941,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData { ), "this won't work", None, - Some("yyyy-MM-dd HH:mm") + Some("yyyy-MM-dd HH:mm"), ) intercept[InvalidConfigParameterException] { ConfigFailFast invokePrivate checkWeatherDataSource( diff --git a/src/test/scala/edu/ie3/simona/config/RefSystemParserSpec.scala b/src/test/scala/edu/ie3/simona/config/RefSystemParserSpec.scala index be5d9b95c4..13dfc0c5d1 100644 --- a/src/test/scala/edu/ie3/simona/config/RefSystemParserSpec.scala +++ b/src/test/scala/edu/ie3/simona/config/RefSystemParserSpec.scala @@ -24,7 +24,7 @@ class RefSystemParserSpec extends UnitSpec { vNom = "10 kV", voltLvls = Some( List(VoltLvlConfig("MS", "10 kV"), VoltLvlConfig("MS", "20 kV")) - ) + ), ), new RefSystemConfig( gridIds = Some(List("100")), @@ -33,16 +33,16 @@ class RefSystemParserSpec extends UnitSpec { voltLvls = Some( List( VoltLvlConfig("HS", "110 kV"), - VoltLvlConfig("HoeS", "380 kV") + VoltLvlConfig("HoeS", "380 kV"), ) - ) + ), ), new RefSystemConfig( gridIds = None, sNom = "5000 MVA", vNom = "110 kV", - voltLvls = None - ) + voltLvls = None, + ), ) val configRefSystems = RefSystemParser.parse(validRefSystems) @@ -71,7 +71,7 @@ class RefSystemParserSpec extends UnitSpec { 18 -> configRefSystemOne, 19 -> configRefSystemOne, 20 -> configRefSystemOne, - 100 -> configRefSystemTwo + 100 -> configRefSystemTwo, ) // check internal voltLvLRefSystems @@ -81,7 +81,7 @@ class RefSystemParserSpec extends UnitSpec { GermanVoltageLevelUtils.MV_10KV -> configRefSystemOne, GermanVoltageLevelUtils.MV_20KV -> configRefSystemOne, GermanVoltageLevelUtils.HV -> configRefSystemTwo, - GermanVoltageLevelUtils.EHV_380KV -> configRefSystemTwo + GermanVoltageLevelUtils.EHV_380KV -> configRefSystemTwo, ) } @@ -96,7 +96,7 @@ class RefSystemParserSpec extends UnitSpec { vNom = "10 kV", voltLvls = Some( List(VoltLvlConfig("MS", "10 kV"), VoltLvlConfig("MS", "20 kV")) - ) + ), ) ) intercept[InvalidConfigParameterException] { @@ -115,7 +115,7 @@ class RefSystemParserSpec extends UnitSpec { vNom = "10 kV", voltLvls = Some( List(VoltLvlConfig("MS", "10 kV"), VoltLvlConfig("MS", "20 kV")) - ) + ), ), new RefSystemConfig( gridIds = None, @@ -123,8 +123,8 @@ class RefSystemParserSpec extends UnitSpec { vNom = "10 kV", voltLvls = Some( List(VoltLvlConfig("MS", "10 kV"), VoltLvlConfig("MS", "20 kV")) - ) - ) + ), + ), ) intercept[InvalidConfigParameterException] { RefSystemParser.parse(validRefSystems) @@ -142,7 +142,7 @@ class RefSystemParserSpec extends UnitSpec { vNom = "10 kV", voltLvls = Some( List(VoltLvlConfig("MS", "10 kV"), VoltLvlConfig("MS", "20 kV")) - ) + ), ), new RefSystemConfig( gridIds = None, @@ -150,8 +150,8 @@ class RefSystemParserSpec extends UnitSpec { vNom = "10 kV", voltLvls = Some( List(VoltLvlConfig("MS", "10 kV"), VoltLvlConfig("MS", "20 kV")) - ) - ) + ), + ), ) intercept[InvalidConfigParameterException] { RefSystemParser.parse(validRefSystems) @@ -171,7 +171,7 @@ class RefSystemParserSpec extends UnitSpec { vNom = "10 kV", voltLvls = Some( List(VoltLvlConfig("MS", "10 kV"), VoltLvlConfig("MS", "20 kV")) - ) + ), ), new RefSystemConfig( gridIds = Some(List("100")), @@ -179,8 +179,8 @@ class RefSystemParserSpec extends UnitSpec { vNom = "110 kV", voltLvls = Some( List(VoltLvlConfig("HS", "110 kV"), VoltLvlConfig("HoeS", "380 kV")) - ) - ) + ), + ), ) val configRefSystems = RefSystemParser.parse(validRefSystems) @@ -199,7 +199,7 @@ class RefSystemParserSpec extends UnitSpec { configRefSystems.find( 1, - Some(GermanVoltageLevelUtils.MV_10KV) + Some(GermanVoltageLevelUtils.MV_10KV), ) shouldBe Some( configRefSystemOne ) @@ -210,7 +210,7 @@ class RefSystemParserSpec extends UnitSpec { configRefSystems.find( 1000, - Some(GermanVoltageLevelUtils.HV) + Some(GermanVoltageLevelUtils.HV), ) shouldBe Some( configRefSystemTwo ) @@ -227,7 +227,7 @@ class RefSystemParserSpec extends UnitSpec { configRefSystems.find( 1000, - Some(GermanVoltageLevelUtils.EHV_220KV) + Some(GermanVoltageLevelUtils.EHV_220KV), ) shouldBe None } diff --git a/src/test/scala/edu/ie3/simona/deploy/DeploySpec.scala b/src/test/scala/edu/ie3/simona/deploy/DeploySpec.scala index f329122b50..82f2c349db 100644 --- a/src/test/scala/edu/ie3/simona/deploy/DeploySpec.scala +++ b/src/test/scala/edu/ie3/simona/deploy/DeploySpec.scala @@ -77,7 +77,7 @@ class DeploySpec extends UnitSpec { case Failure(exception) => fail( s"Cannot build class from execution class '$classString' in run-simona-cmd.sh!", - exception + exception, ) case Success(clazz) => clazz } diff --git a/src/test/scala/edu/ie3/simona/event/NotifierSpec.scala b/src/test/scala/edu/ie3/simona/event/NotifierSpec.scala index a2a72a34ce..654e6ff8d4 100644 --- a/src/test/scala/edu/ie3/simona/event/NotifierSpec.scala +++ b/src/test/scala/edu/ie3/simona/event/NotifierSpec.scala @@ -30,7 +30,7 @@ class NotifierSpec .parseString(""" |pekko.loggers =["org.apache.pekko.testkit.TestEventListener"] |pekko.loglevel="OFF" - |""".stripMargin) + |""".stripMargin), ) ) with Matchers @@ -88,7 +88,7 @@ class NotifierSpec Storage -> classOf[StorageResult], Ev -> - classOf[EvResult] + classOf[EvResult], ) // TODO: Grid results are not covered, yet. @@ -106,7 +106,7 @@ object NotifierSpec { final case class TestEventEnvelope( testEvent: TestEvent, - msg: String = "Please notify others of this!" + msg: String = "Please notify others of this!", ) } diff --git a/src/test/scala/edu/ie3/simona/event/SimonaListenerSpec.scala b/src/test/scala/edu/ie3/simona/event/SimonaListenerSpec.scala index 538a4732f4..c9c6b0238c 100644 --- a/src/test/scala/edu/ie3/simona/event/SimonaListenerSpec.scala +++ b/src/test/scala/edu/ie3/simona/event/SimonaListenerSpec.scala @@ -36,7 +36,7 @@ class SimonaListenerSpec |pekko.loggers =["edu.ie3.simona.test.common.SilentTestEventListener"] |pekko.loglevel="debug" |""".stripMargin - ) + ), ) ) with Matchers { @@ -78,7 +78,7 @@ class SimonaListenerSpec EventFilter .debug( message = s"$logPrefix Received '$msg' from date $msgDate", - occurrences = 1 + occurrences = 1, ) .intercept { listener ! TestEvent(msg, msgDate) @@ -91,7 +91,7 @@ class SimonaListenerSpec EventFilter .warning( message = s"$logPrefix Received unknown event", - occurrences = 1 + occurrences = 1, ) .intercept { listener ! UnknownEvent @@ -100,7 +100,7 @@ class SimonaListenerSpec EventFilter .warning( message = s"$logPrefix Received unknown message: $unknownMessage", - occurrences = 1 + occurrences = 1, ) .intercept { listener ! unknownMessage diff --git a/src/test/scala/edu/ie3/simona/event/listener/ResultEventListenerSpec.scala b/src/test/scala/edu/ie3/simona/event/listener/ResultEventListenerSpec.scala index 6f7aba992e..067162f30b 100644 --- a/src/test/scala/edu/ie3/simona/event/listener/ResultEventListenerSpec.scala +++ b/src/test/scala/edu/ie3/simona/event/listener/ResultEventListenerSpec.scala @@ -11,14 +11,14 @@ import edu.ie3.datamodel.models.result.connector.{ LineResult, SwitchResult, Transformer2WResult, - Transformer3WResult + Transformer3WResult, } import edu.ie3.datamodel.models.result.system.PvResult import edu.ie3.datamodel.models.result.{NodeResult, ResultEntity} import edu.ie3.simona.agent.grid.GridResultsSupport.PartialTransformer3wResult import edu.ie3.simona.event.ResultEvent.{ ParticipantResultEvent, - PowerFlowResultEvent + PowerFlowResultEvent, } import edu.ie3.simona.io.result.{ResultEntitySink, ResultSinkType} import edu.ie3.simona.ontology.messages.StopMessage @@ -29,7 +29,7 @@ import edu.ie3.simona.util.ResultFileHierarchy.ResultEntityPathConfig import edu.ie3.util.io.FileIOUtils import org.apache.pekko.actor.testkit.typed.scaladsl.{ ActorTestKit, - ScalaTestWithActorTestKit + ScalaTestWithActorTestKit, } import org.apache.pekko.testkit.TestKit.awaitCond import org.apache.pekko.testkit.TestProbe @@ -47,7 +47,7 @@ class ResultEventListenerSpec extends ScalaTestWithActorTestKit( ActorTestKit.ApplicationTestConfig.withValue( "org.apache.pekko.actor.testkit.typed.filter-leeway", - ConfigValueFactory.fromAnyRef("10s") + ConfigValueFactory.fromAnyRef("10s"), ) ) with UnitSpec @@ -62,7 +62,7 @@ class ResultEventListenerSpec classOf[Transformer2WResult], classOf[Transformer3WResult], classOf[SwitchResult], - classOf[LineResult] + classOf[LineResult], ) private val timeoutDuration: Duration = 30.seconds @@ -71,16 +71,16 @@ class ResultEventListenerSpec private def resultFileHierarchy( runId: Int, fileFormat: String, - classes: Set[Class[_ <: ResultEntity]] = resultEntitiesToBeWritten + classes: Set[Class[_ <: ResultEntity]] = resultEntitiesToBeWritten, ): ResultFileHierarchy = ResultFileHierarchy( outputDir = testTmpDir + File.separator + runId, simulationName, ResultEntityPathConfig( classes, - ResultSinkType.Csv(fileFormat = fileFormat) + ResultSinkType.Csv(fileFormat = fileFormat), ), - createDirs = true + createDirs = true, ) def createDir( @@ -113,7 +113,7 @@ class ResultEventListenerSpec val fileHierarchy = resultFileHierarchy(1, ".csv") Await.ready( Future.sequence(createDir(fileHierarchy)), - 60 seconds + 60 seconds, ) // after the creation of the listener, it is expected that a corresponding raw result data file is present @@ -122,7 +122,7 @@ class ResultEventListenerSpec classOf[PvResult], fail( s"Cannot get filepath for raw result file of class '${classOf[PvResult].getSimpleName}' from outputFileHierarchy!'" - ) + ), ) ) @@ -162,7 +162,7 @@ class ResultEventListenerSpec classOf[PvResult], fail( s"Cannot get filepath for raw result file of class '${classOf[PvResult].getSimpleName}' from outputFileHierarchy!'" - ) + ), ) ) @@ -170,7 +170,7 @@ class ResultEventListenerSpec awaitCond( outputFile.exists(), interval = 500.millis, - max = timeoutDuration + max = timeoutDuration, ) // stop listener so that result is flushed out @@ -180,7 +180,7 @@ class ResultEventListenerSpec awaitCond( getFileLinesLength(outputFile) == 2, interval = 500.millis, - max = timeoutDuration + max = timeoutDuration, ) val resultFileSource = Source.fromFile(outputFile) @@ -210,7 +210,7 @@ class ResultEventListenerSpec Iterable(dummySwitchResult), Iterable(dummyLineResult), Iterable(dummyTrafo2wResult), - Iterable.empty[PartialTransformer3wResult] + Iterable.empty[PartialTransformer3wResult], ) val outputFiles = Map( @@ -219,7 +219,7 @@ class ResultEventListenerSpec classOf[NodeResult], fail( s"Cannot get filepath for raw result file of class '${classOf[NodeResult].getSimpleName}' from outputFileHierarchy!'" - ) + ), ) ), dummySwitchResultString -> new File( @@ -227,7 +227,7 @@ class ResultEventListenerSpec classOf[SwitchResult], fail( s"Cannot get filepath for raw result file of class '${classOf[SwitchResult].getSimpleName}' from outputFileHierarchy!'" - ) + ), ) ), dummyLineResultDataString -> new File( @@ -235,7 +235,7 @@ class ResultEventListenerSpec classOf[LineResult], fail( s"Cannot get filepath for raw result file of class '${classOf[LineResult].getSimpleName}' from outputFileHierarchy!'" - ) + ), ) ), dummyTrafo2wResultDataString -> new File( @@ -243,16 +243,16 @@ class ResultEventListenerSpec classOf[Transformer2WResult], fail( s"Cannot get filepath for raw result file of class '${classOf[Transformer2WResult].getSimpleName}' from outputFileHierarchy!'" - ) + ), ) - ) + ), ) // wait until all output files exist (headers are flushed out immediately): awaitCond( outputFiles.values.map(_.exists()).forall(identity), interval = 500.millis, - max = timeoutDuration + max = timeoutDuration, ) // stop listener so that result is flushed out @@ -262,7 +262,7 @@ class ResultEventListenerSpec awaitCond( !outputFiles.values.exists(file => getFileLinesLength(file) < 2), interval = 500.millis, - max = timeoutDuration + max = timeoutDuration, ) outputFiles.foreach { case (resultRowString, outputFile) => @@ -291,7 +291,7 @@ class ResultEventListenerSpec Iterable.empty[SwitchResult], Iterable.empty[LineResult], Iterable.empty[Transformer2WResult], - Iterable(partialResult) + Iterable(partialResult), ) "correctly reacts on received results" in { @@ -308,14 +308,14 @@ class ResultEventListenerSpec classOf[Transformer3WResult], fail( s"Cannot get filepath for raw result file of class '${classOf[Transformer3WResult].getSimpleName}' from outputFileHierarchy!'" - ) + ), ) ) /* The result file is created at start up and only contains a head line. */ awaitCond( outputFile.exists(), interval = 500.millis, - max = timeoutDuration + max = timeoutDuration, ) getFileLinesLength(outputFile) shouldBe 1 @@ -346,7 +346,7 @@ class ResultEventListenerSpec awaitCond( getFileLinesLength(outputFile) == 2, interval = 500.millis, - max = timeoutDuration + max = timeoutDuration, ) /* Check the result */ val resultFileSource = Source.fromFile(outputFile) @@ -387,16 +387,16 @@ class ResultEventListenerSpec classOf[PvResult], fail( s"Cannot get filepath for raw result file of class '${classOf[PvResult].getSimpleName}' from outputFileHierarchy!'" - ) + ), ), - "" + "", ) ) awaitCond( outputFile.exists(), interval = 500.millis, - max = timeoutDuration + max = timeoutDuration, ) // stopping the actor should wait until existing messages within an actor are fully processed @@ -415,10 +415,10 @@ class ResultEventListenerSpec classOf[PvResult], fail( s"Cannot get filepath for raw result file of class '${classOf[PvResult].getSimpleName}' from outputFileHierarchy!'" - ) + ), ) ).exists, - timeoutDuration + timeoutDuration, ) val resultFileSource = Source.fromInputStream( @@ -428,7 +428,7 @@ class ResultEventListenerSpec classOf[PvResult], fail( s"Cannot get filepath for raw result file of class '${classOf[PvResult].getSimpleName}' from outputFileHierarchy!'" - ) + ), ) ) ) diff --git a/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerKafkaSpec.scala b/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerKafkaSpec.scala index 1cfda26aa6..47b14f6aee 100644 --- a/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerKafkaSpec.scala +++ b/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerKafkaSpec.scala @@ -57,19 +57,19 @@ class RuntimeEventListenerKafkaSpec deserializer.configure( Map(SCHEMA_REGISTRY_URL_CONFIG -> mockSchemaRegistryUrl).asJava, - false + false, ) override def beforeAll(): Unit = { super.beforeAll() val config = Map[String, AnyRef]( "group.id" -> "test", - "bootstrap.servers" -> kafka.bootstrapServers + "bootstrap.servers" -> kafka.bootstrapServers, ) testConsumer = new KafkaConsumer[Bytes, SimonaEndMessage]( config.asJava, Serdes.Bytes().deserializer(), - deserializer + deserializer, ) testConsumer.assign(topicPartitions.asJava) @@ -93,12 +93,12 @@ class RuntimeEventListenerKafkaSpec linger = 0, runId = runId.toString, schemaRegistryUrl = mockSchemaRegistryUrl, - topic = testTopic.name + topic = testTopic.name, ) - ) + ), ), None, - startDateTimeString + startDateTimeString, ) ) @@ -109,13 +109,13 @@ class RuntimeEventListenerKafkaSpec ("event", "expectedMsg"), ( Done(1800L, 3L, errorInSim = false), - SimonaEndMessage(runId, 1, error = false) + SimonaEndMessage(runId, 1, error = false), ), ( Done(3600L, 3L, errorInSim = true), - SimonaEndMessage(runId, 1, error = true) + SimonaEndMessage(runId, 1, error = true), ), - (Error(errMsg), SimonaEndMessage(runId, -1, error = true)) + (Error(errMsg), SimonaEndMessage(runId, -1, error = true)), ) Then("records can be fetched from Kafka") diff --git a/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerSpec.scala b/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerSpec.scala index 22ef952a8a..a1bad16bde 100644 --- a/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerSpec.scala +++ b/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerSpec.scala @@ -9,7 +9,7 @@ package edu.ie3.simona.event.listener import org.apache.pekko.actor.testkit.typed.scaladsl.{ ActorTestKit, LoggingTestKit, - ScalaTestWithActorTestKit + ScalaTestWithActorTestKit, } import com.typesafe.config.ConfigValueFactory import edu.ie3.simona.config.SimonaConfig @@ -22,7 +22,7 @@ import edu.ie3.simona.event.RuntimeEvent.{ Initializing, PowerFlowFailed, Ready, - Simulating + Simulating, } import edu.ie3.simona.util.TickUtil._ import edu.ie3.util.TimeUtil @@ -39,7 +39,7 @@ class RuntimeEventListenerSpec // Timeout for LoggingTestKit via TestKitSettings // Log message sometimes seem to take a while until caught by the test kit "org.apache.pekko.actor.testkit.typed.filter-leeway", - ConfigValueFactory.fromAnyRef("30s") + ConfigValueFactory.fromAnyRef("30s"), ) ) with AnyWordSpecLike @@ -62,10 +62,10 @@ class RuntimeEventListenerSpec RuntimeEventListener( SimonaConfig.Simona.Runtime.Listener( None, - None + None, ), Some(eventQueue), - startDateTimeString + startDateTimeString, ) ) @@ -78,7 +78,7 @@ class RuntimeEventListenerSpec Ready(currentTick, duration), Simulating(currentTick, 0), Done(endTick, duration, errorInSim = false), - Error(errMsg) + Error(errMsg), ) for (event <- eventsToQueue) { @@ -113,38 +113,38 @@ class RuntimeEventListenerSpec ( Initializing, Level.INFO, - "Initializing Agents and Services for Simulation ... " + "Initializing Agents and Services for Simulation ... ", ), ( InitComplete(0L), Level.INFO, - s"Initialization complete. (duration: 0h : 0m : 0s )" + s"Initialization complete. (duration: 0h : 0m : 0s )", ), ( Ready(currentTick, 0L), Level.INFO, - s"Switched from 'Simulating' to 'Ready'. Last simulated time: ${calcTime(currentTick)}." + s"Switched from 'Simulating' to 'Ready'. Last simulated time: ${calcTime(currentTick)}.", ), ( Simulating(currentTick, endTick), Level.INFO, - s"Simulating from ${calcTime(currentTick)} until ${calcTime(endTick)}." + s"Simulating from ${calcTime(currentTick)} until ${calcTime(endTick)}.", ), ( CheckWindowPassed(currentTick, 0L), Level.INFO, - s"Simulation until ${calcTime(currentTick)} completed." + s"Simulation until ${calcTime(currentTick)} completed.", ), ( Done(endTick, duration, errorInSim = false), Level.INFO, - s"Simulation completed with \u001b[0;32mSUCCESS (Failed PF: 2)\u001b[0;30m in time step ${calcTime(endTick)}. Total runtime: 3h : 0m : 5s " + s"Simulation completed with \u001b[0;32mSUCCESS (Failed PF: 2)\u001b[0;30m in time step ${calcTime(endTick)}. Total runtime: 3h : 0m : 5s ", ), ( Error(errMsg), Level.ERROR, - errMsg - ) + errMsg, + ), ) events.foreach { case (event, level, msg) => diff --git a/src/test/scala/edu/ie3/simona/event/listener/ThreeWindingResultHandlingSpec.scala b/src/test/scala/edu/ie3/simona/event/listener/ThreeWindingResultHandlingSpec.scala index 87a13e05e7..997cef986b 100644 --- a/src/test/scala/edu/ie3/simona/event/listener/ThreeWindingResultHandlingSpec.scala +++ b/src/test/scala/edu/ie3/simona/event/listener/ThreeWindingResultHandlingSpec.scala @@ -28,19 +28,19 @@ class ThreeWindingResultHandlingSpec UUID.randomUUID(), Amperes(1d), Degrees(2d), - -5 + -5, ) val mockBResult = PartialTransformer3wResult.PortB( TimeUtil.withDefaults.toZonedDateTime("2021-06-23 20:51:00"), UUID.randomUUID(), Amperes(3d), - Degrees(4d) + Degrees(4d), ) val mockCResult = PartialTransformer3wResult.PortC( TimeUtil.withDefaults.toZonedDateTime("2021-06-23 20:51:00"), UUID.randomUUID(), Amperes(5d), - Degrees(6d) + Degrees(6d), ) "correctly indicate readiness" in { @@ -53,7 +53,7 @@ class ThreeWindingResultHandlingSpec (Some(mockAResult), Some(mockBResult), None, false), (None, Some(mockBResult), Some(mockCResult), false), (Some(mockAResult), None, Some(mockCResult), false), - (Some(mockAResult), Some(mockBResult), Some(mockCResult), true) + (Some(mockAResult), Some(mockBResult), Some(mockCResult), true), ) forAll(cases) { @@ -61,7 +61,7 @@ class ThreeWindingResultHandlingSpec a: Option[PartialTransformer3wResult.PortA], b: Option[PartialTransformer3wResult.PortB], c: Option[PartialTransformer3wResult.PortC], - expected: Boolean + expected: Boolean, ) => val dut = AggregatedTransformer3wResult(a, b, c) @@ -78,14 +78,14 @@ class ThreeWindingResultHandlingSpec (None, None, Some(mockCResult)), (Some(mockAResult), Some(mockBResult), None), (None, Some(mockBResult), Some(mockCResult)), - (Some(mockAResult), None, Some(mockCResult)) + (Some(mockAResult), None, Some(mockCResult)), ) forAll(cases) { ( a: Option[PartialTransformer3wResult.PortA], b: Option[PartialTransformer3wResult.PortB], - c: Option[PartialTransformer3wResult.PortC] + c: Option[PartialTransformer3wResult.PortC], ) => val dut = AggregatedTransformer3wResult(a, b, c) @@ -106,7 +106,7 @@ class ThreeWindingResultHandlingSpec AggregatedTransformer3wResult( Some(resultA), Some(resultB), - Some(resultC) + Some(resultC), ).consolidate match { case Success(consolidated) => consolidated.getTime shouldBe expected.getTime diff --git a/src/test/scala/edu/ie3/simona/event/listener/ThreeWindingResultTestData.scala b/src/test/scala/edu/ie3/simona/event/listener/ThreeWindingResultTestData.scala index 579efe228f..d02ab4e5ac 100644 --- a/src/test/scala/edu/ie3/simona/event/listener/ThreeWindingResultTestData.scala +++ b/src/test/scala/edu/ie3/simona/event/listener/ThreeWindingResultTestData.scala @@ -27,21 +27,21 @@ trait ThreeWindingResultTestData { inputModel, Amperes(1d), Degrees(2d), - -5 + -5, ) val resultB: PartialTransformer3wResult.PortB = PartialTransformer3wResult.PortB( time, inputModel, Amperes(3d), - Degrees(4d) + Degrees(4d), ) val resultC: PartialTransformer3wResult.PortC = PartialTransformer3wResult.PortC( time, inputModel, Amperes(5d), - Degrees(6d) + Degrees(6d), ) val expected = new Transformer3WResult( time, @@ -52,6 +52,6 @@ trait ThreeWindingResultTestData { Quantities.getQuantity(4d, StandardUnits.ELECTRIC_CURRENT_ANGLE), Quantities.getQuantity(5d, StandardUnits.ELECTRIC_CURRENT_MAGNITUDE), Quantities.getQuantity(6d, StandardUnits.ELECTRIC_CURRENT_ANGLE), - -5 + -5, ) } diff --git a/src/test/scala/edu/ie3/simona/integration/RunSimonaStandaloneIT.scala b/src/test/scala/edu/ie3/simona/integration/RunSimonaStandaloneIT.scala index 39e6aaa368..bbb75ab499 100644 --- a/src/test/scala/edu/ie3/simona/integration/RunSimonaStandaloneIT.scala +++ b/src/test/scala/edu/ie3/simona/integration/RunSimonaStandaloneIT.scala @@ -45,15 +45,15 @@ class RunSimonaStandaloneIT .empty() .withValue( "simona.output.base.dir", - ConfigValueFactory.fromAnyRef(testTmpDir) + ConfigValueFactory.fromAnyRef(testTmpDir), ) .withValue( "simona.time.startDateTime", - ConfigValueFactory.fromAnyRef("2011-01-01 00:00:00") + ConfigValueFactory.fromAnyRef("2011-01-01 00:00:00"), ) .withValue( "simona.time.endDateTime", - ConfigValueFactory.fromAnyRef("2011-01-01 02:00:00") + ConfigValueFactory.fromAnyRef("2011-01-01 02:00:00"), ) .withFallback( ConfigFactory @@ -78,7 +78,7 @@ class RunSimonaStandaloneIT val simonaStandaloneSetup = SimonaStandaloneSetup( parsedConfig, resultFileHierarchy, - Some(runtimeEventQueue) + Some(runtimeEventQueue), ) /* run simulation */ @@ -100,7 +100,7 @@ class RunSimonaStandaloneIT // todo implement if valid result handling is implemented val pvResultFileContent = getFileSource( resultFileHierarchy, - classOf[PvResult] + classOf[PvResult], ).getLines().toVector pvResultFileContent.size shouldBe 190 pvResultFileContent.headOption.map( @@ -113,12 +113,12 @@ class RunSimonaStandaloneIT private def getFileSource( resultFileHierarchy: ResultFileHierarchy, - entityClass: Class[_ <: ResultEntity] + entityClass: Class[_ <: ResultEntity], ): BufferedSource = { Source.fromFile( resultFileHierarchy.rawOutputDataFilePaths.getOrElse( entityClass, - fail(s"Unable to get output path for result entity: $entityClass") + fail(s"Unable to get output path for result entity: $entityClass"), ) ) } diff --git a/src/test/scala/edu/ie3/simona/io/file/ResultFileHierarchySpec.scala b/src/test/scala/edu/ie3/simona/io/file/ResultFileHierarchySpec.scala index e871b4ffb7..3b89d418f2 100644 --- a/src/test/scala/edu/ie3/simona/io/file/ResultFileHierarchySpec.scala +++ b/src/test/scala/edu/ie3/simona/io/file/ResultFileHierarchySpec.scala @@ -47,8 +47,8 @@ class ResultFileHierarchySpec runOutputDir, ResultEntityPathConfig( Set(classOf[PvResult]), - ResultSinkType.Csv("csv", "pref", "suff") - ) + ResultSinkType.Csv("csv", "pref", "suff"), + ), ) val runOutputDirWithDate = @@ -95,9 +95,9 @@ class ResultFileHierarchySpec runOutputDir, ResultEntityPathConfig( Set(classOf[PvResult]), - ResultSinkType.Csv("csv", "pref", "suff") + ResultSinkType.Csv("csv", "pref", "suff"), ), - createDirs = true + createDirs = true, ) // check for existence of run output dir diff --git a/src/test/scala/edu/ie3/simona/io/result/ResultEntityCsvSinkSpec.scala b/src/test/scala/edu/ie3/simona/io/result/ResultEntityCsvSinkSpec.scala index 61e5175ebb..aaed7c1d76 100644 --- a/src/test/scala/edu/ie3/simona/io/result/ResultEntityCsvSinkSpec.scala +++ b/src/test/scala/edu/ie3/simona/io/result/ResultEntityCsvSinkSpec.scala @@ -40,7 +40,7 @@ class ResultEntityCsvSinkSpec |pekko.loglevel="DEBUG" |pekko.coordinated-shutdown.phases.actor-system-terminate.timeout = 500s """.stripMargin - ) + ), ) ) with UnitSpec @@ -58,7 +58,7 @@ class ResultEntityCsvSinkSpec ResultEntityCsvSink( outFileName, resultEntityProcessor, - outFileName.endsWith(".gz") + outFileName.endsWith(".gz"), ) resultEntitySink.outfileName shouldBe outFileName @@ -103,7 +103,7 @@ class ResultEntityCsvSinkSpec .single(testText) .map(t => ByteString(t)) .runWith(FileIO.toPath(path, Set(WRITE, TRUNCATE_EXISTING, CREATE))), - 5.seconds + 5.seconds, ) val resultEntityProcessor = new ResultEntityProcessor(classOf[PvResult]) @@ -111,7 +111,7 @@ class ResultEntityCsvSinkSpec val resultEntitySink = ResultEntityCsvSink( outFileName, resultEntityProcessor, - outFileName.endsWith(".gz") + outFileName.endsWith(".gz"), ) // close sink to ensure that everything is written out @@ -152,14 +152,14 @@ class ResultEntityCsvSinkSpec TimeUtil.withDefaults.toZonedDateTime("2020-01-30 17:26:44"), UUID.fromString("e5ac84d3-c7a5-4870-a42d-837920aec9bb"), Quantities.getQuantity(10, StandardUnits.ACTIVE_POWER_IN), - Quantities.getQuantity(10, StandardUnits.REACTIVE_POWER_IN) + Quantities.getQuantity(10, StandardUnits.REACTIVE_POWER_IN), ) val resultEntitySink = ResultEntityCsvSink( outFileName, resultEntityProcessor, - outFileName.endsWith(".gz") + outFileName.endsWith(".gz"), ) resultEntitySink.handleResultEntity(dummyPvResult) @@ -197,14 +197,14 @@ class ResultEntityCsvSinkSpec TimeUtil.withDefaults.toZonedDateTime("2020-01-30 17:26:44"), UUID.fromString("e5ac84d3-c7a5-4870-a42d-837920aec9bb"), Quantities.getQuantity(10, StandardUnits.ACTIVE_POWER_IN), - Quantities.getQuantity(10, StandardUnits.REACTIVE_POWER_IN) + Quantities.getQuantity(10, StandardUnits.REACTIVE_POWER_IN), ) val resultEntitySink = ResultEntityCsvSink( outFileName, resultEntityProcessor, - outFileName.endsWith(".gz") + outFileName.endsWith(".gz"), ) val exception = intercept[ProcessResultEventException] { diff --git a/src/test/scala/edu/ie3/simona/io/result/ResultEntityKafkaSpec.scala b/src/test/scala/edu/ie3/simona/io/result/ResultEntityKafkaSpec.scala index 9edf05b5ee..ed88041bc0 100644 --- a/src/test/scala/edu/ie3/simona/io/result/ResultEntityKafkaSpec.scala +++ b/src/test/scala/edu/ie3/simona/io/result/ResultEntityKafkaSpec.scala @@ -65,19 +65,19 @@ class ResultEntityKafkaSpec deserializer.configure( Map(SCHEMA_REGISTRY_URL_CONFIG -> mockSchemaRegistryUrl).asJava, - false + false, ) override def beforeAll(): Unit = { super.beforeAll() val config = Map[String, AnyRef]( "group.id" -> "test", - "bootstrap.servers" -> kafka.bootstrapServers + "bootstrap.servers" -> kafka.bootstrapServers, ) testConsumer = new KafkaConsumer[Bytes, PlainNodeResult]( config.asJava, Serdes.Bytes().deserializer(), - deserializer + deserializer, ) testConsumer.assign(topicPartitions.asJava) @@ -103,9 +103,9 @@ class ResultEntityKafkaSpec runId, kafka.bootstrapServers, mockSchemaRegistryUrl, - 20 - ) - ) + 20, + ), + ), ) ) ) @@ -115,19 +115,19 @@ class ResultEntityKafkaSpec ZonedDateTime.parse("2021-01-01T00:00:00+01:00[Europe/Berlin]"), UUID.randomUUID(), Quantities.getQuantity(1d, PowerSystemUnits.PU), - Quantities.getQuantity(0d, PowerSystemUnits.DEGREE_GEOM) + Quantities.getQuantity(0d, PowerSystemUnits.DEGREE_GEOM), ) val nodeRes2 = new NodeResult( ZonedDateTime.parse("2021-01-01T00:00:00+01:00[Europe/Berlin]"), UUID.randomUUID(), Quantities.getQuantity(0.8d, PowerSystemUnits.PU), - Quantities.getQuantity(15d, PowerSystemUnits.DEGREE_GEOM) + Quantities.getQuantity(15d, PowerSystemUnits.DEGREE_GEOM), ) val nodeRes3 = new NodeResult( ZonedDateTime.parse("2021-01-10T00:00:00+01:00[Europe/Berlin]"), UUID.randomUUID(), Quantities.getQuantity(0.75d, PowerSystemUnits.PU), - Quantities.getQuantity(90d, PowerSystemUnits.DEGREE_GEOM) + Quantities.getQuantity(90d, PowerSystemUnits.DEGREE_GEOM), ) When("receiving the NodeResults") @@ -136,7 +136,7 @@ class ResultEntityKafkaSpec Iterable.empty, Iterable.empty, Iterable.empty, - Iterable.empty + Iterable.empty, ) Then("records can be fetched from Kafka") @@ -155,7 +155,7 @@ class ResultEntityKafkaSpec nodeRes1.getUuid, nodeRes1.getInputModel, nodeRes1.getvMag().getValue.doubleValue(), - nodeRes1.getvAng().getValue.doubleValue() + nodeRes1.getvAng().getValue.doubleValue(), ) ) records should contain( @@ -165,7 +165,7 @@ class ResultEntityKafkaSpec nodeRes2.getUuid, nodeRes2.getInputModel, nodeRes2.getvMag().getValue.doubleValue(), - nodeRes2.getvAng().getValue.doubleValue() + nodeRes2.getvAng().getValue.doubleValue(), ) ) records should contain( @@ -175,7 +175,7 @@ class ResultEntityKafkaSpec nodeRes3.getUuid, nodeRes3.getInputModel, nodeRes3.getvMag().getValue.doubleValue(), - nodeRes3.getvAng().getValue.doubleValue() + nodeRes3.getvAng().getValue.doubleValue(), ) ) } diff --git a/src/test/scala/edu/ie3/simona/io/result/ResultSinkTypeSpec.scala b/src/test/scala/edu/ie3/simona/io/result/ResultSinkTypeSpec.scala index 66b6986c47..2c93aced13 100644 --- a/src/test/scala/edu/ie3/simona/io/result/ResultSinkTypeSpec.scala +++ b/src/test/scala/edu/ie3/simona/io/result/ResultSinkTypeSpec.scala @@ -22,11 +22,11 @@ class ResultSinkTypeSpec extends UnitSpec { fileFormat = ".csv", filePrefix = "", fileSuffix = "", - isHierarchic = false + isHierarchic = false, ) ), influxDb1x = None, - kafka = None + kafka = None, ) inside(ResultSinkType(conf, "testRun")) { @@ -46,10 +46,10 @@ class ResultSinkTypeSpec extends UnitSpec { SimonaConfig.Simona.Output.Sink.InfluxDb1x( database = "test", port = 1, - url = "localhost/" + url = "localhost/", ) ), - kafka = None + kafka = None, ) val runName = "testRun" @@ -73,9 +73,9 @@ class ResultSinkTypeSpec extends UnitSpec { 12, "00000000-0000-0000-0000-000000000000", "https://reg:123", - "topic" + "topic", ) - ) + ), ) val runName = "testRun" @@ -85,7 +85,7 @@ class ResultSinkTypeSpec extends UnitSpec { runId, bootstrapServers, schemaRegistryUrl, - linger + linger, ) => topicNodeRes shouldBe "topic" runId shouldBe UUID.fromString("00000000-0000-0000-0000-000000000000") @@ -104,17 +104,17 @@ class ResultSinkTypeSpec extends UnitSpec { fileFormat = ".csv", filePrefix = "", fileSuffix = "", - isHierarchic = false + isHierarchic = false, ) ), influxDb1x = Some( SimonaConfig.Simona.Output.Sink.InfluxDb1x( database = "test", port = 1, - url = "localhost" + url = "localhost", ) ), - kafka = None + kafka = None, ) assertThrows[IllegalArgumentException](ResultSinkType(conf, "testRun")) @@ -124,7 +124,7 @@ class ResultSinkTypeSpec extends UnitSpec { val conf = SimonaConfig.Simona.Output.Sink( csv = None, influxDb1x = None, - kafka = None + kafka = None, ) assertThrows[IllegalArgumentException](ResultSinkType(conf, "testRun")) diff --git a/src/test/scala/edu/ie3/simona/io/result/plain/PlainWriterSpec.scala b/src/test/scala/edu/ie3/simona/io/result/plain/PlainWriterSpec.scala index ab3c7a8390..14554d60a5 100644 --- a/src/test/scala/edu/ie3/simona/io/result/plain/PlainWriterSpec.scala +++ b/src/test/scala/edu/ie3/simona/io/result/plain/PlainWriterSpec.scala @@ -43,7 +43,7 @@ class PlainWriterSpec extends UnitSpec with GivenWhenThen { time, inputModelId, vMag, - vAng + vAng, ) When("converting to a plain result") @@ -77,7 +77,7 @@ class PlainWriterSpec extends UnitSpec with GivenWhenThen { eventId, inputModelId, vMag, - vAng + vAng, ) When("converting to a full NodeResult") @@ -91,7 +91,7 @@ class PlainWriterSpec extends UnitSpec with GivenWhenThen { .getvMag() shouldBe Quantities.getQuantity(vMag, PowerSystemUnits.PU) plainResult.getvAng() shouldBe Quantities.getQuantity( vAng, - PowerSystemUnits.DEGREE_GEOM + PowerSystemUnits.DEGREE_GEOM, ) } } diff --git a/src/test/scala/edu/ie3/simona/model/assets/control/QControlSpec.scala b/src/test/scala/edu/ie3/simona/model/assets/control/QControlSpec.scala index 0540ed770a..d3a77f3c4a 100644 --- a/src/test/scala/edu/ie3/simona/model/assets/control/QControlSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/assets/control/QControlSpec.scala @@ -10,14 +10,14 @@ import edu.ie3.datamodel.models.input.system.characteristic import edu.ie3.datamodel.models.input.system.characteristic.{ CharacteristicPoint, CosPhiP => CosPhiPInput, - QV => QVInput + QV => QVInput, } import edu.ie3.simona.exceptions.QControlException import edu.ie3.simona.model.participant.control.QControl import edu.ie3.simona.model.participant.control.QControl.{ CosPhiFixed, CosPhiP, - QV + QV, } import edu.ie3.simona.model.system.Characteristic.XYPair import edu.ie3.simona.test.common.UnitSpec @@ -47,7 +47,7 @@ class QControlSpec extends UnitSpec with TableDrivenPropertyChecks { def createXYPair( d1: Double, - d2: Double + d2: Double, ): XYPair[squants.Dimensionless, squants.Dimensionless] = { XYPair(Each(d1), Each(d2)) } @@ -59,12 +59,12 @@ class QControlSpec extends UnitSpec with TableDrivenPropertyChecks { util.Arrays.asList( new CharacteristicPoint[Dimensionless, Dimensionless]( getQuantity(1d, PU), - getQuantity(2d, PU) + getQuantity(2d, PU), ), new CharacteristicPoint[Dimensionless, Dimensionless]( getQuantity(3d, PU), - getQuantity(4d, PU) - ) + getQuantity(4d, PU), + ), ) ) val invalidInput = @@ -90,7 +90,7 @@ class QControlSpec extends UnitSpec with TableDrivenPropertyChecks { Vector( createXYPair(0.0, -1.0), createXYPair(0.5, -0.8), - createXYPair(1.0, -0.2) + createXYPair(1.0, -0.2), ) ) ) @@ -103,7 +103,7 @@ class QControlSpec extends UnitSpec with TableDrivenPropertyChecks { createXYPair(0.9, -1.0), createXYPair(0.95, 0.0), createXYPair(1.05, 0.0), - createXYPair(1.1, 1.0) + createXYPair(1.1, 1.0), ) ) ) @@ -158,7 +158,7 @@ class QControlSpec extends UnitSpec with TableDrivenPropertyChecks { (1.03, 0.375), (1.04, 0.5), (1.05, 0.625), - (1.10, 0.625) + (1.10, 0.625), ) forAll(testingPoints) { (v: Double, scaleExpected: Double) => @@ -196,7 +196,7 @@ class QControlSpec extends UnitSpec with TableDrivenPropertyChecks { (1.08, 0.6), (1.09, 0.8), (1.1, 1.0), - (1.12, 1.0) + (1.12, 1.0), ) forAll(testingPoints) { (v: Double, scaleExpected: Double) => diff --git a/src/test/scala/edu/ie3/simona/model/grid/GridSpec.scala b/src/test/scala/edu/ie3/simona/model/grid/GridSpec.scala index 3b73c59dfd..7a86895f74 100644 --- a/src/test/scala/edu/ie3/simona/model/grid/GridSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/grid/GridSpec.scala @@ -16,7 +16,7 @@ import edu.ie3.simona.test.common.input.{GridInputTestData, LineInputTestData} import edu.ie3.simona.test.common.model.grid.{ BasicGrid, BasicGridWithSwitches, - FiveLinesWithNodes + FiveLinesWithNodes, } import edu.ie3.simona.test.common.{DefaultTestData, UnitSpec} @@ -66,12 +66,12 @@ class GridSpec extends UnitSpec with LineInputTestData with DefaultTestData { ) val getLinesAdmittance: ( Map[UUID, Int], - LineModel + LineModel, ) => (Int, Int, Complex, Complex, Complex) = (nodeUuidToIndexMap, line) => GridModel invokePrivate getLinesAdmittanceMethod( nodeUuidToIndexMap, - line + line, ) // result of method call @@ -79,7 +79,7 @@ class GridSpec extends UnitSpec with LineInputTestData with DefaultTestData { GridModel invokePrivate buildAssetAdmittanceMatrix( nodeUuidToIndexMap, lines, - getLinesAdmittance + getLinesAdmittance, ) _printAdmittanceMatrixOnMismatch(actualResult, lineAdmittanceMatrix) @@ -94,7 +94,7 @@ class GridSpec extends UnitSpec with LineInputTestData with DefaultTestData { GridModel.updateUuidToIndexMap(withClosedSwitches) private val admittanceMatixClosed = GridModel.composeAdmittanceMatrix( withClosedSwitches.nodeUuidToIndexMap, - withClosedSwitches.gridComponents + withClosedSwitches.gridComponents, ) private val withOpenSwitches = createGridCopy() @@ -102,7 +102,7 @@ class GridSpec extends UnitSpec with LineInputTestData with DefaultTestData { GridModel.updateUuidToIndexMap(withOpenSwitches) private val admittanceMatrixOpen = GridModel.composeAdmittanceMatrix( withOpenSwitches.nodeUuidToIndexMap, - withOpenSwitches.gridComponents + withOpenSwitches.gridComponents, ) // dimension of admittance matrix with closed switches should be the dimension @@ -120,7 +120,7 @@ class GridSpec extends UnitSpec with LineInputTestData with DefaultTestData { .flatMap { switch => Iterable( switch.nodeAUuid -> switch.nodeBUuid, - switch.nodeBUuid -> switch.nodeAUuid + switch.nodeBUuid -> switch.nodeAUuid, ) } .groupMap { case (key, _) => key } { case (_, value) => value } @@ -168,7 +168,7 @@ class GridSpec extends UnitSpec with LineInputTestData with DefaultTestData { admittanceMatixClosed.valueAt( iClosed, - jClosed + jClosed, ) shouldBe sumOfAdmittancesOpenSwitches withClue s" at \n\tposition ($iClosed, $jClosed) of the grid with closed switches/" + s"\n\tpositions (${iOpenAll.mkString(",")}) x (${jOpenAll.mkString(",")}) of the grid with open switches" @@ -203,8 +203,8 @@ class GridSpec extends UnitSpec with LineInputTestData with DefaultTestData { lines, Set(transformer2wModel), Set.empty[Transformer3wModel], - switches - ) + switches, + ), ) // get the private method for validation val validateConnectivity: PrivateMethod[Unit] = @@ -231,8 +231,8 @@ class GridSpec extends UnitSpec with LineInputTestData with DefaultTestData { adaptedLines, Set(transformer2wModel), Set.empty[Transformer3wModel], - Set.empty[SwitchModel] - ) + Set.empty[SwitchModel], + ), ) // get the private method for validation @@ -259,7 +259,7 @@ class GridSpec extends UnitSpec with LineInputTestData with DefaultTestData { "SecondSwitch1", defaultOperationInterval, node1.uuid, - node13.uuid + node13.uuid, ) // add the second switch + enable switches override val switches: Set[SwitchModel] = super.switches + secondSwitch @@ -276,8 +276,8 @@ class GridSpec extends UnitSpec with LineInputTestData with DefaultTestData { lines, Set(transformer2wModel), Set.empty[Transformer3wModel], - switches - ) + switches, + ), ) // get the private method for validation @@ -380,8 +380,8 @@ class GridSpec extends UnitSpec with LineInputTestData with DefaultTestData { lines, Set(transformer2wModel), Set.empty[Transformer3wModel], - switches - ) + switches, + ), ) // update the uuidToIndexMap @@ -431,8 +431,8 @@ class GridSpec extends UnitSpec with LineInputTestData with DefaultTestData { lines, Set(transformer2wModel), Set.empty[Transformer3wModel], - Set.empty[SwitchModel] - ) + Set.empty[SwitchModel], + ), ) // update the uuidToIndexMap @@ -463,7 +463,7 @@ class GridSpec extends UnitSpec with LineInputTestData with DefaultTestData { validTestGridInputModel, gridInputModelTestDataRefSystem, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) } diff --git a/src/test/scala/edu/ie3/simona/model/grid/LineSpec.scala b/src/test/scala/edu/ie3/simona/model/grid/LineSpec.scala index 33d068ed65..c1a3fe9ebf 100644 --- a/src/test/scala/edu/ie3/simona/model/grid/LineSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/grid/LineSpec.scala @@ -41,7 +41,7 @@ class LineSpec extends UnitSpec with LineInputTestData { Each(0.0013109999999999999d), Each(0.0010680000000000002d), Each(0d), - Each(0.60375d) + Each(0.60375d), ) } @@ -63,7 +63,7 @@ class LineSpec extends UnitSpec with LineInputTestData { lineInputMs10Kv, refSystem, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) inside(validLineModel) { @@ -78,7 +78,7 @@ class LineSpec extends UnitSpec with LineInputTestData { r, x, g, - b + b, ) => uuid shouldBe lineInputMs10Kv.getUuid id shouldBe lineInputMs10Kv.getId @@ -136,7 +136,7 @@ class LineSpec extends UnitSpec with LineInputTestData { "calculate the branch admittance Y_ij of a given line model correctly" in new ValidLineModel { LineModel.yij(validLineModel) shouldBe Complex( 1375.489841204891, - -1120.5363466108497 + -1120.5363466108497, ) } diff --git a/src/test/scala/edu/ie3/simona/model/grid/NodeInputModelSpec.scala b/src/test/scala/edu/ie3/simona/model/grid/NodeInputModelSpec.scala index 87532ffa3d..140ecec17f 100644 --- a/src/test/scala/edu/ie3/simona/model/grid/NodeInputModelSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/grid/NodeInputModelSpec.scala @@ -27,7 +27,7 @@ class NodeInputModelSpec extends UnitSpec with NodeInputTestData { NodeModel( nodeInputNoSlackNs04KvA, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) inside(validNodeModel) { @@ -37,7 +37,7 @@ class NodeInputModelSpec extends UnitSpec with NodeInputTestData { operationInterval, isSlack, vTarget, - voltLvl + voltLvl, ) => uuid shouldBe nodeInputNoSlackNs04KvA.getUuid id shouldBe nodeInputNoSlackNs04KvA.getId diff --git a/src/test/scala/edu/ie3/simona/model/grid/SwitchModelSpec.scala b/src/test/scala/edu/ie3/simona/model/grid/SwitchModelSpec.scala index 8ed9db9023..be7814fc23 100644 --- a/src/test/scala/edu/ie3/simona/model/grid/SwitchModelSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/grid/SwitchModelSpec.scala @@ -21,7 +21,7 @@ class SwitchModelSpec extends UnitSpec with DefaultTestData { val switchModel: SwitchModel = SwitchModel( switchInput, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) inside(switchModel) { @@ -30,7 +30,7 @@ class SwitchModelSpec extends UnitSpec with DefaultTestData { id, operationInterval, nodeAUuid, - nodeBUuid + nodeBUuid, ) => uuid should be(switchInput.getUuid) id should be(switchInput.getId) diff --git a/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala b/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala index 4ff98b2b02..c9668e16d2 100644 --- a/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala @@ -70,10 +70,10 @@ object SystemComponentSpec { final case class SystemComponentMock( uuid: UUID = UUID.fromString("94b633a2-dfc0-4c28-acf5-d756150e5cde"), id: String = "SystemComponentMock", - operationInterval: OperationInterval + operationInterval: OperationInterval, ) extends SystemComponent( uuid, id, - operationInterval + operationInterval, ) // concrete implementation for testing } diff --git a/src/test/scala/edu/ie3/simona/model/grid/Transformer3wModelSpec.scala b/src/test/scala/edu/ie3/simona/model/grid/Transformer3wModelSpec.scala index 3fe005b09c..4f865f58af 100644 --- a/src/test/scala/edu/ie3/simona/model/grid/Transformer3wModelSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/grid/Transformer3wModelSpec.scala @@ -11,7 +11,7 @@ import edu.ie3.simona.exceptions.InvalidActionRequestException import edu.ie3.simona.model.grid.Transformer3wPowerFlowCase.{ PowerFlowCaseA, PowerFlowCaseB, - PowerFlowCaseC + PowerFlowCaseC, } import edu.ie3.simona.test.common.UnitSpec import edu.ie3.simona.test.common.input.Transformer3wTestData @@ -42,7 +42,7 @@ class Transformer3wModelSpec transformer3wInput.getType.getTapMax, transformer3wInput.getType.getTapMin, transformer3wInput.getType.getTapNeutr, - transformer3wInput.isAutoTap + transformer3wInput.isAutoTap, ) val transformerModel: Transformer3wModel = @@ -51,7 +51,7 @@ class Transformer3wModelSpec mainRefSystemEhv, 1, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) inside(transformerModel) { @@ -70,7 +70,7 @@ class Transformer3wModelSpec r, x, g, - b + b, ) => uuid shouldBe transformer3wInput.getUuid id shouldBe transformer3wInput.getId @@ -93,13 +93,13 @@ class Transformer3wModelSpec val yii: Complex = Transformer3wModel.y0( transformerModel, - Transformer3wModel.Transformer3wPort.A + Transformer3wModel.Transformer3wPort.A, ) yii shouldBe Complex.zero val yjj: Complex = Transformer3wModel.y0( transformerModel, - Transformer3wModel.Transformer3wPort.INTERNAL + Transformer3wModel.Transformer3wPort.INTERNAL, ) implicit val doubleTolerance: Double = 1e-11 yjj.real shouldBe 1.874312e-6 +- doubleTolerance @@ -117,7 +117,7 @@ class Transformer3wModelSpec transformer3wInput.getType.getTapMax, transformer3wInput.getType.getTapMin, transformer3wInput.getType.getTapNeutr, - transformer3wInput.isAutoTap + transformer3wInput.isAutoTap, ) val transformerModel: Transformer3wModel = @@ -126,7 +126,7 @@ class Transformer3wModelSpec mainRefSystemHv, 2, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) inside(transformerModel) { @@ -145,7 +145,7 @@ class Transformer3wModelSpec r, x, g, - b + b, ) => uuid shouldBe transformer3wInput.getUuid id shouldBe transformer3wInput.getId @@ -168,13 +168,13 @@ class Transformer3wModelSpec val yii: Complex = Transformer3wModel.y0( transformerModel, - Transformer3wModel.Transformer3wPort.A + Transformer3wModel.Transformer3wPort.A, ) yii shouldBe Complex.zero val yjj: Complex = Transformer3wModel.y0( transformerModel, - Transformer3wModel.Transformer3wPort.INTERNAL + Transformer3wModel.Transformer3wPort.INTERNAL, ) yjj shouldBe Complex.zero @@ -192,7 +192,7 @@ class Transformer3wModelSpec transformer3wInput.getType.getTapMax, transformer3wInput.getType.getTapMin, transformer3wInput.getType.getTapNeutr, - transformer3wInput.isAutoTap + transformer3wInput.isAutoTap, ) val transformerModel: Transformer3wModel = @@ -201,7 +201,7 @@ class Transformer3wModelSpec mainRefSystemLv, 3, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) inside(transformerModel) { @@ -220,7 +220,7 @@ class Transformer3wModelSpec r, x, g, - b + b, ) => uuid shouldBe transformer3wInput.getUuid id shouldBe transformer3wInput.getId @@ -243,13 +243,13 @@ class Transformer3wModelSpec val yii: Complex = Transformer3wModel.y0( transformerModel, - Transformer3wModel.Transformer3wPort.A + Transformer3wModel.Transformer3wPort.A, ) yii shouldBe Complex.zero val yjj: Complex = Transformer3wModel.y0( transformerModel, - Transformer3wModel.Transformer3wPort.INTERNAL + Transformer3wModel.Transformer3wPort.INTERNAL, ) yjj shouldBe Complex.zero val yij: Complex = Transformer3wModel.yij(transformerModel) @@ -265,7 +265,7 @@ class Transformer3wModelSpec mainRefSystemEhv, 1, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) val transformerModelHvTemp: Transformer3wModel = Transformer3wModel( @@ -273,7 +273,7 @@ class Transformer3wModelSpec mainRefSystemHv, 2, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) val transformerModelLvTemp: Transformer3wModel = Transformer3wModel( @@ -281,7 +281,7 @@ class Transformer3wModelSpec mainRefSystemLv, 3, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) transformerModelEhvTemp.isInOperation shouldBe true @@ -296,7 +296,7 @@ class Transformer3wModelSpec mainRefSystemEhv, 1, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) val transformerModelHvTemp: Transformer3wModel = Transformer3wModel( @@ -304,7 +304,7 @@ class Transformer3wModelSpec mainRefSystemHv, 2, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) val transformerModelLvTemp: Transformer3wModel = Transformer3wModel( @@ -312,7 +312,7 @@ class Transformer3wModelSpec mainRefSystemLv, 3, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) transformerModelEhvTemp.isInOperation shouldBe false @@ -330,7 +330,7 @@ class Transformer3wModelSpec mainRefSystemEhv, 1, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) val transformerModelHvTemp: Transformer3wModel = Transformer3wModel( @@ -338,7 +338,7 @@ class Transformer3wModelSpec mainRefSystemHv, 2, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) val transformerModelLvTemp: Transformer3wModel = Transformer3wModel( @@ -346,7 +346,7 @@ class Transformer3wModelSpec mainRefSystemLv, 3, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) transformerModelEhvTemp invokePrivate tapRatio() shouldBe 1.15 @@ -363,7 +363,7 @@ class Transformer3wModelSpec mainRefSystemEhv, 1, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) transformerModel.disable().isSuccess shouldBe true @@ -462,8 +462,8 @@ class Transformer3wModelSpec -8, -0.05d, 0.75d, - -2 - ) /* Limit to min tap (should be -3 limited to -2) */ + -2, + ), /* Limit to min tap (should be -3 limited to -2) */ ) val transformerModel: Transformer3wModel = transformerModelEhv @@ -473,7 +473,7 @@ class Transformer3wModelSpec currentTapPos: Int, vChangeVal: Double, deadBandVal: Double, - expected: Int + expected: Int, ) => { val vChange = Quantities.getQuantity(vChangeVal, PU) @@ -493,19 +493,19 @@ class Transformer3wModelSpec tapPos: Int, yijExpected: Complex, yiiExpected: Complex, - yjjExpected: Complex + yjjExpected: Complex, ) => { transformer.updateTapPos(tapPos) val yijActual = Transformer3wModel.yij(transformer) val yiiActual = Transformer3wModel.y0( transformer, - Transformer3wModel.Transformer3wPort.A + Transformer3wModel.Transformer3wPort.A, ) val yjjActual = Transformer3wModel.y0( transformer, - Transformer3wModel.Transformer3wPort.INTERNAL + Transformer3wModel.Transformer3wPort.INTERNAL, ) /* Remark: This is not really precise. At the moment, double-based calculations do diff --git a/src/test/scala/edu/ie3/simona/model/grid/TransformerModelSpec.scala b/src/test/scala/edu/ie3/simona/model/grid/TransformerModelSpec.scala index ecaa55b2e5..d7fd3025ff 100644 --- a/src/test/scala/edu/ie3/simona/model/grid/TransformerModelSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/grid/TransformerModelSpec.scala @@ -11,7 +11,7 @@ import breeze.numerics.abs import edu.ie3.datamodel.exceptions.InvalidGridException import edu.ie3.datamodel.models.input.connector.{ ConnectorPort, - Transformer2WInput + Transformer2WInput, } import edu.ie3.powerflow.NewtonRaphsonPF import edu.ie3.powerflow.model.NodeData.{PresetData, StateData} @@ -22,7 +22,7 @@ import edu.ie3.simona.test.common.UnitSpec import edu.ie3.simona.test.common.model.grid.{ TapTestData, TransformerTestData, - TransformerTestGrid + TransformerTestGrid, } import edu.ie3.util.quantities.PowerSystemUnits._ import org.scalatest.prop.{TableDrivenPropertyChecks, TableFor4} @@ -51,7 +51,7 @@ class TransformerModelSpec extends UnitSpec with TableDrivenPropertyChecks { noException shouldBe thrownBy { TransformerModel.validateInputModel( unmodifiedTransformerInputModel, - mainRefSystem + mainRefSystem, ) } } @@ -70,7 +70,7 @@ class TransformerModelSpec extends UnitSpec with TableDrivenPropertyChecks { ConnectorPort.B else ConnectorPort.A - } + }, ) val dut: TransformerModel = @@ -78,7 +78,7 @@ class TransformerModelSpec extends UnitSpec with TableDrivenPropertyChecks { inputModel, mainRefSystem, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) inside(dut) { @@ -96,7 +96,7 @@ class TransformerModelSpec extends UnitSpec with TableDrivenPropertyChecks { r, x, g, - b + b, ) => uuid should be(inputModel.getUuid) id should be(inputModel.getId) @@ -114,7 +114,7 @@ class TransformerModelSpec extends UnitSpec with TableDrivenPropertyChecks { _, _, _, - tapSide + tapSide, ) => _currentTapPos shouldBe 0 tapSide shouldBe ConnectorPort.A @@ -159,7 +159,7 @@ class TransformerModelSpec extends UnitSpec with TableDrivenPropertyChecks { transformerInputTapHv, mainRefSystem, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) transformer2w.isInOperation shouldBe true @@ -173,7 +173,7 @@ class TransformerModelSpec extends UnitSpec with TableDrivenPropertyChecks { transformerInputTapHv, mainRefSystem, earlySimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) transformer2w.isInOperation shouldBe false @@ -188,7 +188,7 @@ class TransformerModelSpec extends UnitSpec with TableDrivenPropertyChecks { transformerInputTapHv, mainRefSystem, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) dut invokePrivate tapRatio() shouldBe 1.0 @@ -260,8 +260,8 @@ class TransformerModelSpec extends UnitSpec with TableDrivenPropertyChecks { -8, -0.08d, 0.75d, - -2 - ) /* Limit to min tap (should be -3 limited to -2) */ + -2, + ), /* Limit to min tap (should be -3 limited to -2) */ ) forAll(cases) { @@ -269,7 +269,7 @@ class TransformerModelSpec extends UnitSpec with TableDrivenPropertyChecks { currentTapPos: Int, vChangeVal: Double, deadBandVal: Double, - expected: Int + expected: Int, ) => { val vChange = Quantities.getQuantity(vChangeVal, PU) @@ -278,7 +278,7 @@ class TransformerModelSpec extends UnitSpec with TableDrivenPropertyChecks { transformerModelTapHv.updateTapPos(currentTapPos) transformerModelTapHv.computeDeltaTap( vChange, - deadBand + deadBand, ) shouldBe expected } } @@ -291,7 +291,7 @@ class TransformerModelSpec extends UnitSpec with TableDrivenPropertyChecks { tapPos: Int, yijExpected: Complex, yiiExpected: Complex, - yjjExpected: Complex + yjjExpected: Complex, ) => { val transformer = tapSide match { @@ -355,7 +355,7 @@ class TransformerModelSpec extends UnitSpec with TableDrivenPropertyChecks { tapPos: Int, p: BigDecimal, e: Double, - f: Double + f: Double, ) => { logger.debug( @@ -377,7 +377,7 @@ class TransformerModelSpec extends UnitSpec with TableDrivenPropertyChecks { grid, refSystem, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) gridModel.gridComponents.transformers @@ -386,20 +386,20 @@ class TransformerModelSpec extends UnitSpec with TableDrivenPropertyChecks { val admittanceMatrix = GridModel.composeAdmittanceMatrix( nodeUuidToIndexMap, - gridModel.gridComponents + gridModel.gridComponents, ) val operationPoint = Array( PresetData(0, NodeType.SL, Complex.zero), - PresetData(1, NodeType.PQ, Complex(p.doubleValue, 0d)) + PresetData(1, NodeType.PQ, Complex(p.doubleValue, 0d)), ) val powerFlow = new NewtonRaphsonPF( epsilon, maxIterations, admittanceMatrix, - Option.apply(Vector(0, 1)) + Option.apply(Vector(0, 1)), ) val result = powerFlow.calculate(operationPoint, startData) diff --git a/src/test/scala/edu/ie3/simona/model/participant/ApparentPowerAndHeatSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/ApparentPowerAndHeatSpec.scala index ae62893e12..43f4ef8baa 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/ApparentPowerAndHeatSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/ApparentPowerAndHeatSpec.scala @@ -31,7 +31,7 @@ class ApparentPowerAndHeatSpec extends UnitSpec { 50L, Each(1.0d), ConstantState, - FixedRelevantData + FixedRelevantData, ) match { case ApparentPowerAndHeat(p, q, qDot) => p should approximate(Megawatts(0d)) @@ -46,7 +46,7 @@ class ApparentPowerAndHeatSpec extends UnitSpec { 10L, Each(1.0d), ConstantState, - FixedRelevantData + FixedRelevantData, ) match { case ApparentPowerAndHeat(p, q, qDot) => p should approximate(Megawatts(43d)) @@ -63,7 +63,7 @@ object ApparentPowerAndHeatSpec { extends SystemParticipant[ FixedRelevantData.type, ApparentPowerAndHeat, - ConstantState.type + ConstantState.type, ]( UUID.randomUUID(), "ParticipantMock", @@ -71,11 +71,11 @@ object ApparentPowerAndHeatSpec { 1.0, CosPhiFixed(0.97), Kilowatts(42d), - 0.97 + 0.97, ) with ApparentPowerAndHeatParticipant[ FixedRelevantData.type, - ConstantState.type + ConstantState.type, ] { this.enable() @@ -92,7 +92,7 @@ object ApparentPowerAndHeatSpec { override def calculateHeat( tick: Long, modelState: ConstantState.type, - data: CalcRelevantData.FixedRelevantData.type + data: CalcRelevantData.FixedRelevantData.type, ): Power = Megawatts(42d) /** Calculate the active power behaviour of the model @@ -104,7 +104,7 @@ object ApparentPowerAndHeatSpec { */ override protected def calculateActivePower( modelState: ConstantState.type, - data: CalcRelevantData.FixedRelevantData.type + data: CalcRelevantData.FixedRelevantData.type, ): Power = Megawatts(43d) /** @param data @@ -114,11 +114,11 @@ object ApparentPowerAndHeatSpec { */ override def determineFlexOptions( data: CalcRelevantData.FixedRelevantData.type, - lastState: ModelState.ConstantState.type + lastState: ModelState.ConstantState.type, ): FlexibilityMessage.ProvideFlexOptions = ProvideMinMaxFlexOptions.noFlexOption( this.getUuid, - calculateActivePower(ConstantState, data) + calculateActivePower(ConstantState, data), ) /** @param data @@ -132,7 +132,7 @@ object ApparentPowerAndHeatSpec { override def handleControlledPowerChange( data: CalcRelevantData.FixedRelevantData.type, lastState: ModelState.ConstantState.type, - setPower: Power + setPower: Power, ): (ModelState.ConstantState.type, FlexChangeIndicator) = (lastState, FlexChangeIndicator()) } diff --git a/src/test/scala/edu/ie3/simona/model/participant/FixedFeedInModelSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/FixedFeedInModelSpec.scala index b2f153e850..16665692f6 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/FixedFeedInModelSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/FixedFeedInModelSpec.scala @@ -35,7 +35,7 @@ class FixedFeedInModelSpec val simonaConfig: SimonaConfig = createSimonaConfig( LoadModelBehaviour.FIX, - LoadReference.ActivePower(Kilowatts(0.0)) + LoadReference.ActivePower(Kilowatts(0.0)), ) val modelConfig = ConfigUtil .ParticipantConfigUtil( @@ -47,7 +47,7 @@ class FixedFeedInModelSpec fixedFeedInput, modelConfig, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) inside(actualModel) { @@ -58,7 +58,7 @@ class FixedFeedInModelSpec scalingFactor, qControl, sRated, - cosPhiRated + cosPhiRated, ) => uuid shouldBe fixedFeedInput.getUuid id shouldBe fixedFeedInput.getId diff --git a/src/test/scala/edu/ie3/simona/model/participant/HpModelSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/HpModelSpec.scala index 3ac1dd56bb..ef2e082265 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/HpModelSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/HpModelSpec.scala @@ -11,7 +11,7 @@ import edu.ie3.simona.model.thermal.ThermalGrid.ThermalGridState import edu.ie3.simona.model.thermal.ThermalHouse.ThermalHouseState import edu.ie3.simona.model.thermal.ThermalHouse.ThermalHouseThreshold.{ HouseTemperatureLowerBoundaryReached, - HouseTemperatureUpperBoundaryReached + HouseTemperatureUpperBoundaryReached, } import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageState import edu.ie3.simona.ontology.messages.flex.MinMaxFlexibilityMessage.ProvideMinMaxFlexOptions @@ -39,7 +39,7 @@ class HpModelSpec "expectedRunningState", "expectedActivePower", "expectedInnerTemperature", - "expectedNextThreshold" + "expectedNextThreshold", ), ( HpState( @@ -49,12 +49,12 @@ class HpModelSpec Kilowatts(0d), Kilowatts(0d), thermalState(Celsius(17d)), - None + None, ), true, 95, 15.6, - Some(HouseTemperatureUpperBoundaryReached(31711L)) + Some(HouseTemperatureUpperBoundaryReached(31711L)), ), ( HpState( @@ -64,12 +64,12 @@ class HpModelSpec Kilowatts(0d), Kilowatts(0d), thermalState(Celsius(18)), - None + None, ), true, 95, 16.4, - Some(HouseTemperatureUpperBoundaryReached(30642L)) + Some(HouseTemperatureUpperBoundaryReached(30642L)), ), ( HpState( @@ -79,12 +79,12 @@ class HpModelSpec Kilowatts(0d), Kilowatts(0d), thermalState(Celsius(20)), - None + None, ), true, 95, 18.0, - Some(HouseTemperatureUpperBoundaryReached(27771L)) + Some(HouseTemperatureUpperBoundaryReached(27771L)), ), ( HpState( @@ -94,12 +94,12 @@ class HpModelSpec Kilowatts(0d), Kilowatts(0d), thermalState(Celsius(22)), - None + None, ), false, 0, 19.6, - Some(HouseTemperatureLowerBoundaryReached(13200L)) + Some(HouseTemperatureLowerBoundaryReached(13200L)), ), ( HpState( @@ -109,12 +109,12 @@ class HpModelSpec Kilowatts(0d), Kilowatts(0d), thermalState(Celsius(23)), - None + None, ), false, 0, 20.4, - Some(HouseTemperatureLowerBoundaryReached(15508L)) + Some(HouseTemperatureLowerBoundaryReached(15508L)), ), ( HpState( @@ -124,12 +124,12 @@ class HpModelSpec Kilowatts(95d), Kilowatts(80d), thermalState(Celsius(17)), - None + None, ), true, 95, 15.6, - Some(HouseTemperatureUpperBoundaryReached(31711L)) + Some(HouseTemperatureUpperBoundaryReached(31711L)), ), ( HpState( @@ -139,12 +139,12 @@ class HpModelSpec Kilowatts(95d), Kilowatts(80d), thermalState(Celsius(18)), - None + None, ), true, 95, 16.4, - Some(HouseTemperatureUpperBoundaryReached(30642L)) + Some(HouseTemperatureUpperBoundaryReached(30642L)), ), ( HpState( @@ -154,12 +154,12 @@ class HpModelSpec Kilowatts(95d), Kilowatts(80d), thermalState(Celsius(20)), - None + None, ), true, 95, 18.0, - Some(HouseTemperatureUpperBoundaryReached(27771L)) + Some(HouseTemperatureUpperBoundaryReached(27771L)), ), ( HpState( @@ -169,12 +169,12 @@ class HpModelSpec Kilowatts(95d), Kilowatts(80d), thermalState(Celsius(22)), - None + None, ), true, 95, 19.6, - Some(HouseTemperatureUpperBoundaryReached(23200L)) + Some(HouseTemperatureUpperBoundaryReached(23200L)), ), ( HpState( @@ -184,13 +184,13 @@ class HpModelSpec Kilowatts(95d), Kilowatts(80d), thermalState(Celsius(25)), - None + None, ), false, 0, 22.0, - Some(HouseTemperatureLowerBoundaryReached(19200L)) - ) + Some(HouseTemperatureLowerBoundaryReached(19200L)), + ), ) forAll(cases) { @@ -199,7 +199,7 @@ class HpModelSpec expectedRunningState, expectedActivePower, expectedInnerTemperature, - expectedNextThreshold + expectedNextThreshold, ) => val data = hpData val house = thermalHouse(18, 22) @@ -214,7 +214,7 @@ class HpModelSpec activePower, _, ThermalGridState(Some(thermalHouseState), _), - maybeThreshold + maybeThreshold, ) => isRunning shouldBe expectedRunningState activePower should approximate(Kilowatts(expectedActivePower)) @@ -245,16 +245,16 @@ class HpModelSpec ThermalHouseState( 0L, Celsius(21), - Kilowatts(80) + Kilowatts(80), ) ), Some( ThermalStorageState( 0L, KilowattHours(20), - Kilowatts(0) + Kilowatts(0), ) - ) + ), ) val lastState = HpState( isRunning = true, @@ -263,7 +263,7 @@ class HpModelSpec Kilowatts(95.0), Kilowatts(80.0), thermalState, - Some(HouseTemperatureUpperBoundaryReached(7995L)) + Some(HouseTemperatureUpperBoundaryReached(7995L)), ) hp.determineFlexOptions(relevantData, lastState) match { @@ -271,7 +271,7 @@ class HpModelSpec modelUuid, referencePower, minPower, - maxPower + maxPower, ) => modelUuid shouldBe hp.uuid referencePower should approximate(Kilowatts(95.0)) diff --git a/src/test/scala/edu/ie3/simona/model/participant/HpModelTestData.scala b/src/test/scala/edu/ie3/simona/model/participant/HpModelTestData.scala index 0f4569ada4..561b6a6074 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/HpModelTestData.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/HpModelTestData.scala @@ -11,7 +11,7 @@ import edu.ie3.datamodel.models.input.system.`type`.HpTypeInput import edu.ie3.datamodel.models.input.system.characteristic.CosPhiFixed import edu.ie3.datamodel.models.input.thermal.{ ThermalBusInput, - ThermalHouseInput + ThermalHouseInput, } import edu.ie3.datamodel.models.input.{NodeInput, OperatorInput} import edu.ie3.datamodel.models.voltagelevels.GermanVoltageLevelUtils @@ -24,7 +24,7 @@ import edu.ie3.simona.model.thermal.{ CylindricalThermalStorage, ThermalGrid, ThermalHouse, - ThermalStorage + ThermalStorage, } import edu.ie3.util.quantities.PowerSystemUnits import edu.ie3.util.scala.OperationInterval @@ -48,7 +48,7 @@ trait HpModelTestData { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.LV, - 2 + 2, ) protected val hpTypeInput = new HpTypeInput( @@ -58,7 +58,7 @@ trait HpModelTestData { Quantities.getQuantity(200d, PowerSystemUnits.EURO_PER_MEGAWATTHOUR), Quantities.getQuantity(100, PowerSystemUnits.KILOVOLTAMPERE), 0.95, - Quantities.getQuantity(15, PowerSystemUnits.KILOWATT) + Quantities.getQuantity(15, PowerSystemUnits.KILOWATT), ) protected val hpInputModel = new HpInput( @@ -69,7 +69,7 @@ trait HpModelTestData { nodeInput, thermalBus, new CosPhiFixed("cosPhiFixed:{(0.0,0.95)}"), - hpTypeInput + hpTypeInput, ) protected def hpModel(thermalGrid: ThermalGrid) = new HpModel( @@ -81,16 +81,16 @@ trait HpModelTestData { Kilowatts(100d), 0.95, Kilowatts(15d), - thermalGrid + thermalGrid, ) protected def thermalGrid( thermalHouse: ThermalHouse, - thermalStorage: Option[ThermalStorage] = None + thermalStorage: Option[ThermalStorage] = None, ): ThermalGrid = ThermalGrid( Some(thermalHouse), - thermalStorage + thermalStorage, ) private val thermHouseUuid: UUID = @@ -101,7 +101,7 @@ trait HpModelTestData { protected def thermalHouse( lowerTemperatureBoundary: Double, - upperTemperatureBoundary: Double + upperTemperatureBoundary: Double, ): ThermalHouse = ThermalHouse( new ThermalHouseInput( thermHouseUuid, @@ -111,10 +111,10 @@ trait HpModelTestData { Quantities.getQuantity(10.0, StandardUnits.HEAT_CAPACITY), Quantities.getQuantity( (lowerTemperatureBoundary + upperTemperatureBoundary) / 2.0, - Units.CELSIUS + Units.CELSIUS, ), Quantities.getQuantity(upperTemperatureBoundary, Units.CELSIUS), - Quantities.getQuantity(lowerTemperatureBoundary, Units.CELSIUS) + Quantities.getQuantity(lowerTemperatureBoundary, Units.CELSIUS), ) ) @@ -127,21 +127,21 @@ trait HpModelTestData { KilowattHours(20d), KilowattHours(500d), Kilowatts(10d), - KilowattHours(0d) + KilowattHours(0d), ) protected def thermalState( temperature: Temperature, - qDot: Power = Kilowatts(0d) + qDot: Power = Kilowatts(0d), ): ThermalGridState = ThermalGridState( Some( ThermalHouseState( 0L, temperature, - qDot + qDot, ) ), - None + None, ) protected def hpData: HpRelevantData = diff --git a/src/test/scala/edu/ie3/simona/model/participant/evcs/EvcsModelSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/evcs/EvcsModelSpec.scala index 3d83e05bec..358090b0a3 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/evcs/EvcsModelSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/evcs/EvcsModelSpec.scala @@ -11,7 +11,7 @@ import edu.ie3.simona.model.participant.FlexChangeIndicator import edu.ie3.simona.model.participant.evcs.EvcsModel.{ EvcsRelevantData, EvcsState, - ScheduleEntry + ScheduleEntry, } import edu.ie3.simona.ontology.messages.flex.MinMaxFlexibilityMessage.ProvideMinMaxFlexOptions import edu.ie3.simona.test.common.UnitSpec @@ -45,7 +45,7 @@ class EvcsModelSpec "configured as a charging hub" in { val evcsModel = evcsStandardModel.copy( strategy = ChargingStrategy.CONSTANT_POWER, - locationType = EvcsLocationType.CHARGING_HUB_TOWN + locationType = EvcsLocationType.CHARGING_HUB_TOWN, ) val evModel = EvModelWrapper( @@ -56,16 +56,16 @@ class EvcsModelSpec 20.0.asKiloWatt, // DC is not 20.0.asKiloWattHour, 5.0.asKiloWattHour, - 10800L + 10800L, ) ) val actualSchedule = evcsModel.calculateNewScheduling( EvcsRelevantData( 3600L, - Seq.empty + Seq.empty, ), - Seq(evModel) + Seq(evModel), ) actualSchedule shouldBe Map( @@ -78,7 +78,7 @@ class EvcsModelSpec "configured as a home cs with constant power strategy" in { val evcsModel = evcsStandardModel.copy( strategy = ChargingStrategy.CONSTANT_POWER, - locationType = EvcsLocationType.HOME + locationType = EvcsLocationType.HOME, ) val evModel = EvModelWrapper( @@ -89,16 +89,16 @@ class EvcsModelSpec 20.0.asKiloWatt, // DC is not 20.0.asKiloWattHour, 15.0.asKiloWattHour, - 10800L + 10800L, ) ) val actualSchedule = evcsModel.calculateNewScheduling( EvcsRelevantData( 3600L, - Seq.empty + Seq.empty, ), - Seq(evModel) + Seq(evModel), ) actualSchedule shouldBe Map( @@ -123,7 +123,7 @@ class EvcsModelSpec "chargeEnd", "lastCalcTick", "power", - "expectedStored" + "expectedStored", ), // charging ends before currentTick (0.0, 0L, 2700L, 0L, 5.0, 3.75), @@ -142,7 +142,7 @@ class EvcsModelSpec (0.0, 0L, 7200L, 0L, 2.5, 2.5), (0.0, 900L, 7200L, 0L, 5.0, 3.75), (2.5, 0L, 7200L, 1800L, 5.0, 5.0), - (2.5, 0L, 7200L, 2700L, 5.0, 3.75) + (2.5, 0L, 7200L, 2700L, 5.0, 3.75), ) forAll(cases) { @@ -152,7 +152,7 @@ class EvcsModelSpec chargeEnd, lastCalcTick, power, - expectedStored + expectedStored, ) => val ev = EvModelWrapper( new MockEvModel( @@ -162,7 +162,7 @@ class EvcsModelSpec 10.0.asKiloWatt, 10.0.asKiloWattHour, storedEnergy.asKiloWattHour, - 7200L // is ignored here + 7200L, // is ignored here ) ) @@ -172,12 +172,12 @@ class EvcsModelSpec val state = EvcsState( Seq(ev), Map(ev.uuid -> entry), - lastCalcTick + lastCalcTick, ) val actualOutput = evcsModel.applySchedule( state, - currentTick + currentTick, ) actualOutput should have size 1 @@ -213,13 +213,13 @@ class EvcsModelSpec 10.0.asKiloWatt, 10.0.asKiloWattHour, 0d.asKiloWattHour, - 10800L + 10800L, ) ) val schedule = SortedSet( ScheduleEntry(3600L, 5400L, Kilowatts(2d)), - ScheduleEntry(7200L, 9000L, Kilowatts(4d)) + ScheduleEntry(7200L, 9000L, Kilowatts(4d)), ) // tick, p in kW @@ -229,7 +229,7 @@ class EvcsModelSpec (3600L, 2d), (5400L, 0d), (7200L, 4d), - (9000L, 0d) + (9000L, 0d), ) val cases = Table( @@ -237,7 +237,7 @@ class EvcsModelSpec "lastTick", "currentTick", "firstResultIndex", - "lastResultIndex" + "lastResultIndex", ), (1800L, 10800L, 0, 5), (3600L, 10000L, 1, 5), @@ -247,7 +247,7 @@ class EvcsModelSpec (5400L, 9001L, 2, 5), (5400L, 8999L, 2, 4), (8999L, 9000L, 3, 4), - (8999L, 9060L, 3, 5) + (8999L, 9060L, 3, 5), ) forAll(cases) { @@ -255,19 +255,19 @@ class EvcsModelSpec lastTick, currentTick, firstResultIndex, - lastResultIndex + lastResultIndex, ) => val lastState = EvcsState( Seq(ev), Map(ev.uuid -> schedule), - lastTick + lastTick, ) val (actualEvResults, actualEvcsResults) = evcsStandardModel.createResults( lastState, currentTick, - Each(1d) + Each(1d), ) val (_, firstPower) = generalEvResults(firstResultIndex) @@ -307,7 +307,7 @@ class EvcsModelSpec 10.0.asKiloWatt, 10.0.asKiloWattHour, 0d.asKiloWattHour, - 18000L + 18000L, ) ) @@ -319,14 +319,14 @@ class EvcsModelSpec 10.0.asKiloWatt, 10.0.asKiloWattHour, 0d.asKiloWattHour, - 18000L + 18000L, ) ) val schedule1 = SortedSet( ScheduleEntry(3600L, 7200L, Kilowatts(2d)), - ScheduleEntry(9000L, 14400L, Kilowatts(3d)) + ScheduleEntry(9000L, 14400L, Kilowatts(3d)), ) val schedule2 = SortedSet( @@ -339,14 +339,14 @@ class EvcsModelSpec val lastState = EvcsState( Seq(ev1, ev2), Map(ev1.uuid -> schedule1, ev2.uuid -> schedule2), - lastTick + lastTick, ) val (actualEvResults, actualEvcsResults) = evcsStandardModel.createResults( lastState, currentTick, - Each(1d) + Each(1d), ) // tick, p in kW, soc in % @@ -355,7 +355,7 @@ class EvcsModelSpec (1800L, 0d, 0d), (3600L, 2d, 0d), (7200L, 0d, 20d), - (9000L, 3d, 20d) + (9000L, 3d, 20d), ) // tick, p in kW, soc in % @@ -363,7 +363,7 @@ class EvcsModelSpec Seq( (1800L, 0d, 0d), (5400L, 2d, 0d), - (9000L, 0d, 20d) + (9000L, 0d, 20d), ) // tick, p in kW @@ -373,7 +373,7 @@ class EvcsModelSpec (3600L, 2d), (5400L, 4d), (7200L, 2d), - (9000L, 3d) + (9000L, 3d), ) actualEvResults should have size expectedEv1Results.size + expectedEv2Results.size @@ -420,7 +420,7 @@ class EvcsModelSpec 10.0.asKiloWatt, 10.0.asKiloWattHour, 0d.asKiloWattHour, - 7200L // equals the current tick + 7200L, // equals the current tick ) ) @@ -434,14 +434,14 @@ class EvcsModelSpec val lastState = EvcsState( Seq(ev), Map(ev.uuid -> schedule), - lastTick + lastTick, ) val (actualEvResults, actualEvcsResults) = evcsStandardModel.createResults( lastState, currentTick, - Each(1d) + Each(1d), ) // tick, p in kW, soc in % @@ -451,14 +451,14 @@ class EvcsModelSpec (3600L, 2d, 0d), // this result normally does not appear // if EV does not depart at current tick - (7200L, 0d, 20d) + (7200L, 0d, 20d), ) // tick, p in kW val expectedEvcsResults = Seq( (1800L, 0d), - (3600L, 2d) + (3600L, 2d), ) actualEvResults should have size expectedEvResults.size @@ -494,7 +494,7 @@ class EvcsModelSpec val data = EvcsRelevantData( currentTick, - Seq.empty + Seq.empty, ) val cases = Table( @@ -504,7 +504,7 @@ class EvcsModelSpec "lastPower2", "expectedPRef", "expectedPMin", - "expectedPMax" + "expectedPMax", ), /* 1: empty */ @@ -557,7 +557,7 @@ class EvcsModelSpec // 2: almost full (12.5 kWh) (10.0, 5.0, 5.0, 1.25, -15.0, 5.0), // 2: full (set) - (10.0, 15.0, 0.0, 0.0, -15.0, 0.0) + (10.0, 15.0, 0.0, 0.0, -15.0, 0.0), ) forAll(cases) { @@ -567,7 +567,7 @@ class EvcsModelSpec lastPower2, expectedPRef, expectedPMin, - expectedPMax + expectedPMax, ) => // stays one more hour val ev1 = EvModelWrapper( @@ -578,7 +578,7 @@ class EvcsModelSpec 20.0.asKiloWatt, // DC is not 10.0.asKiloWattHour, lastStored1.asKiloWattHour, - 10800L + 10800L, ) ) @@ -596,7 +596,7 @@ class EvcsModelSpec 10.0.asKiloWatt, // DC is not 15.0.asKiloWattHour, lastStored2.asKiloWattHour, - 14400L + 14400L, ) ) @@ -610,14 +610,14 @@ class EvcsModelSpec EvcsState( Seq(ev1, ev2), Map(ev1.uuid -> schedule1, ev2.uuid -> schedule2), - 0L - ) + 0L, + ), ) match { case ProvideMinMaxFlexOptions( modelUuid, refPower, minPower, - maxPower + maxPower, ) => modelUuid shouldBe evcsModel.getUuid refPower should approximate(Kilowatts(expectedPRef)) @@ -636,7 +636,7 @@ class EvcsModelSpec val data = EvcsRelevantData( currentTick, - Seq.empty + Seq.empty, ) val cases = Table( @@ -646,7 +646,7 @@ class EvcsModelSpec "lastPower2", "expectedPRef", "expectedPMin", - "expectedPMax" + "expectedPMax", ), /* 1: empty */ @@ -699,7 +699,7 @@ class EvcsModelSpec // 2: almost full (charged to 12.5 kWh) (10.0, 5.0, 5.0, 5.0, -15.0, 5.0), // 2: full (set to 15 kWh) - (10.0, 15.0, 0.0, 0.0, -15.0, 0.0) + (10.0, 15.0, 0.0, 0.0, -15.0, 0.0), ) forAll(cases) { @@ -709,7 +709,7 @@ class EvcsModelSpec lastPower2, expectedPRef, expectedPMin, - expectedPMax + expectedPMax, ) => val ev1 = EvModelWrapper( new MockEvModel( @@ -719,7 +719,7 @@ class EvcsModelSpec 20.0.asKiloWatt, // DC is not 10.0.asKiloWattHour, lastStored1.asKiloWattHour, - 10800L + 10800L, ) ) @@ -735,7 +735,7 @@ class EvcsModelSpec 10.0.asKiloWatt, // DC is not 15.0.asKiloWattHour, lastStored2.asKiloWattHour, - 10800L + 10800L, ) ) @@ -748,14 +748,14 @@ class EvcsModelSpec EvcsState( Seq(ev1, ev2), Map(ev1.uuid -> schedule1, ev2.uuid -> schedule2), - 0L - ) + 0L, + ), ) match { case ProvideMinMaxFlexOptions( modelUuid, refPower, minPower, - maxPower + maxPower, ) => modelUuid shouldBe evcsModel.getUuid refPower should approximate(Kilowatts(expectedPRef)) @@ -769,14 +769,14 @@ class EvcsModelSpec "disallowing v2g" in { val evcsModel = evcsStandardModel.copy( vehicle2grid = false, - strategy = ChargingStrategy.CONSTANT_POWER + strategy = ChargingStrategy.CONSTANT_POWER, ) val currentTick = 7200L val data = EvcsRelevantData( currentTick, - Seq.empty + Seq.empty, ) val ev1 = EvModelWrapper( @@ -787,7 +787,7 @@ class EvcsModelSpec 20.0.asKiloWatt, // DC is not 10.0.asKiloWattHour, 0.0.asKiloWattHour, - 10800L + 10800L, ) ) @@ -800,14 +800,14 @@ class EvcsModelSpec EvcsState( Seq(ev1), Map(ev1.uuid -> schedule1), - 0L - ) + 0L, + ), ) match { case ProvideMinMaxFlexOptions( modelUuid, refPower, minPower, - maxPower + maxPower, ) => modelUuid shouldBe evcsModel.getUuid refPower should approximate(Kilowatts(5.0)) // one hour left @@ -828,7 +828,7 @@ class EvcsModelSpec val data = EvcsRelevantData( currentTick, - Seq.empty + Seq.empty, ) val cases = Table( @@ -839,7 +839,7 @@ class EvcsModelSpec "expPowerAndTick1", "expPowerAndTick2", "expNextActivation", - "expNextTick" + "expNextTick", ), /* setPower is 0 kWh */ @@ -882,7 +882,7 @@ class EvcsModelSpec (10.0, 8.0, -15.0, S(-10.0, 6480L), S(-5.0, 7200L), true, S(6480L)), (10.0, 5.5, -15.0, S(-10.0, 6480L), S(-5.0, 5400L), true, S(5400L)), (10.0, 15.0, -15.0, S(-10.0, 6480L), S(-5.0, 10800L), true, S(6480L)), - (7.0, 10.5, -15.0, S(-10.0, 5400L), S(-5.0, 9000L), false, S(5400L)) + (7.0, 10.5, -15.0, S(-10.0, 5400L), S(-5.0, 9000L), false, S(5400L)), ) forAll(cases) { @@ -893,7 +893,7 @@ class EvcsModelSpec expPowerAndTick1: Option[(Double, Long)], expPowerAndTick2: Option[(Double, Long)], expNextActivation: Boolean, - expNextTick: Option[Long] + expNextTick: Option[Long], ) => val ev1 = EvModelWrapper( new MockEvModel( @@ -903,7 +903,7 @@ class EvcsModelSpec 20.0.asKiloWatt, // DC is not 10.0.asKiloWattHour, stored1.asKiloWattHour, - 7200L + 7200L, ) ) @@ -915,7 +915,7 @@ class EvcsModelSpec 10.0.asKiloWatt, // DC is not 15.0.asKiloWattHour, stored2.asKiloWattHour, - 10800L + 10800L, ) ) @@ -924,13 +924,13 @@ class EvcsModelSpec EvcsState( Seq(ev1, ev2), Map.empty, - 0L + 0L, ), - Kilowatts(setPower) + Kilowatts(setPower), ) match { case ( EvcsState(actualEvs, actualSchedules, actualTick), - FlexChangeIndicator(actualNextActivation, actualNextTick) + FlexChangeIndicator(actualNextActivation, actualNextTick), ) => // evs have not changed here since no schedules were given as input actualEvs should have size 2 @@ -944,7 +944,7 @@ class EvcsModelSpec ( entry.chargingPower.toKilowatts, - entry.tickStop + entry.tickStop, ) } shouldBe expPowerAndTick1 actualSchedules.get(ev2.uuid).map { entries => @@ -955,7 +955,7 @@ class EvcsModelSpec ( entry.chargingPower.toKilowatts, - entry.tickStop + entry.tickStop, ) } shouldBe expPowerAndTick2 diff --git a/src/test/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/ConstantPowerChargingSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/ConstantPowerChargingSpec.scala index 6b8612ae00..59209ce259 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/ConstantPowerChargingSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/ConstantPowerChargingSpec.scala @@ -35,13 +35,13 @@ class ConstantPowerChargingSpec 10.0.asKiloWatt, 20.0.asKiloWattHour, 20.0.asKiloWattHour, - 3600L + 3600L, ) ) val actualSchedule = evcsModel.chargeWithConstantPower( 1800L, - Seq(ev) + Seq(ev), ) actualSchedule shouldBe Map.empty @@ -61,7 +61,7 @@ class ConstantPowerChargingSpec (1800L, 5.0, 5.0), // more than max power, limited (3600L, 5.0, 5.0), // exactly max power (7200L, 5.0, 2.5), // less than max power - (180000L, 5.0, 0.1) // long stay: 100 hours + (180000L, 5.0, 0.1), // long stay: 100 hours ) forAll(cases) { (stayingTicks, storedEnergy, expectedPower) => @@ -73,13 +73,13 @@ class ConstantPowerChargingSpec 10.0.asKiloWatt, 10.0.asKiloWattHour, storedEnergy.asKiloWattHour, - offset + stayingTicks + offset + stayingTicks, ) ) val chargingMap = evcsModel.chargeWithConstantPower( offset, - Seq(ev) + Seq(ev), ) chargingMap shouldBe Map( @@ -87,7 +87,7 @@ class ConstantPowerChargingSpec ScheduleEntry( offset, offset + stayingTicks, - Kilowatts(expectedPower) + Kilowatts(expectedPower), ) ) ) @@ -109,7 +109,7 @@ class ConstantPowerChargingSpec (1800L, 5.0, 5.0), // more than max power, limited (3600L, 5.0, 5.0), // exactly max power (7200L, 5.0, 2.5), // less than max power - (180000L, 5.0, 0.1) // long stay: 100 hours + (180000L, 5.0, 0.1), // long stay: 100 hours ) forAll(cases) { (stayingTicks, storedEnergy, expectedPower) => @@ -121,7 +121,7 @@ class ConstantPowerChargingSpec 10.0.asKiloWatt, 10.0.asKiloWattHour, 5.0.asKiloWattHour, - offset + 3600L + offset + 3600L, ) ) @@ -133,13 +133,13 @@ class ConstantPowerChargingSpec 10.0.asKiloWatt, 10.0.asKiloWattHour, storedEnergy.asKiloWattHour, - offset + stayingTicks + offset + stayingTicks, ) ) val chargingMap = evcsModel.chargeWithConstantPower( offset, - Seq(givenEv, ev) + Seq(givenEv, ev), ) chargingMap shouldBe Map( @@ -147,16 +147,16 @@ class ConstantPowerChargingSpec ScheduleEntry( offset, offset + 3600L, - Kilowatts(5.0) + Kilowatts(5.0), ) ), ev.uuid -> SortedSet( ScheduleEntry( offset, offset + stayingTicks, - Kilowatts(expectedPower) + Kilowatts(expectedPower), ) - ) + ), ) } diff --git a/src/test/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/MaximumPowerChargingSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/MaximumPowerChargingSpec.scala index af1dbf6000..a53b82981e 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/MaximumPowerChargingSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/evcs/uncontrolled/MaximumPowerChargingSpec.scala @@ -35,13 +35,13 @@ class MaximumPowerChargingSpec 10.0.asKiloWatt, 20.0.asKiloWattHour, 20.0.asKiloWattHour, - 3600 + 3600, ) ) val actualSchedule = evcsModel.chargeWithMaximumPower( 1800L, - Seq(ev) + Seq(ev), ) actualSchedule shouldBe Map.empty @@ -59,7 +59,7 @@ class MaximumPowerChargingSpec // half full battery (1800L, 5.0, 1800L), // stay shorter than full (3600L, 5.0, 3600L), // exactly full - (14400L, 5.0, 3600L) // full before end of stay + (14400L, 5.0, 3600L), // full before end of stay ) forAll(cases) { (stayingTicks, storedEnergy, expectedDuration) => @@ -71,13 +71,13 @@ class MaximumPowerChargingSpec 10.0.asKiloWatt, 10.0.asKiloWattHour, storedEnergy.asKiloWattHour, - offset + stayingTicks + offset + stayingTicks, ) ) val chargingMap = evcsModel.chargeWithMaximumPower( offset, - Seq(ev) + Seq(ev), ) chargingMap shouldBe Map( @@ -85,7 +85,7 @@ class MaximumPowerChargingSpec ScheduleEntry( offset, offset + expectedDuration, - ev.sRatedAc + ev.sRatedAc, ) ) ) @@ -105,7 +105,7 @@ class MaximumPowerChargingSpec // half full battery (1800L, 5.0, 1800L), // stay shorter than full (3600L, 5.0, 3600L), // exactly full - (14400L, 5.0, 3600L) // full before end of stay + (14400L, 5.0, 3600L), // full before end of stay ) forAll(cases) { (stayingTicks, storedEnergy, expectedDuration) => @@ -117,7 +117,7 @@ class MaximumPowerChargingSpec 10.0.asKiloWatt, 10.0.asKiloWattHour, 5.0.asKiloWattHour, - offset + 3600L + offset + 3600L, ) ) @@ -129,13 +129,13 @@ class MaximumPowerChargingSpec 10.0.asKiloWatt, 10.0.asKiloWattHour, storedEnergy.asKiloWattHour, - offset + stayingTicks + offset + stayingTicks, ) ) val chargingMap = evcsModel.chargeWithMaximumPower( offset, - Seq(givenEv, ev) + Seq(givenEv, ev), ) chargingMap shouldBe Map( @@ -143,16 +143,16 @@ class MaximumPowerChargingSpec ScheduleEntry( offset, offset + 3600L, - Kilowatts(5.0) + Kilowatts(5.0), ) ), ev.uuid -> SortedSet( ScheduleEntry( offset, offset + expectedDuration, - Kilowatts(5.0) + Kilowatts(5.0), ) - ) + ), ) } diff --git a/src/test/scala/edu/ie3/simona/model/participant/load/LoadModelScalingSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/load/LoadModelScalingSpec.scala index c419b884cf..351cb6630d 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/load/LoadModelScalingSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/load/LoadModelScalingSpec.scala @@ -18,7 +18,7 @@ import edu.ie3.simona.model.participant.ModelState.ConstantState import edu.ie3.simona.model.participant.control.QControl import edu.ie3.simona.model.participant.load.LoadReference.{ ActivePower, - EnergyConsumption + EnergyConsumption, } import edu.ie3.simona.model.participant.load.profile.ProfileLoadModel import edu.ie3.simona.model.participant.load.random.RandomLoadModel @@ -59,20 +59,20 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.LV, - -1 + -1, ), new CosPhiFixed("cosPhiFixed:{(0.0,0.95)}"), BdewStandardLoadProfile.H0, false, Quantities.getQuantity(3000d, PowerSystemUnits.KILOWATTHOUR), Quantities.getQuantity(282.74d, PowerSystemUnits.VOLTAMPERE), - 0.95 + 0.95, ) val foreSeenOperationInterval = SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - profileLoadInput.getOperationTime + profileLoadInput.getOperationTime, ) val targetEnergyConsumption = KilowattHours(3000d) @@ -83,7 +83,7 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { "profile", BdewStandardLoadProfile.H0, BdewStandardLoadProfile.L0, - BdewStandardLoadProfile.G0 + BdewStandardLoadProfile.G0, ) ) { profile => val model = ProfileLoadModel( @@ -101,7 +101,7 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { ), profileLoadInput.getCosPhiRated, profile, - EnergyConsumption(targetEnergyConsumption) + EnergyConsumption(targetEnergyConsumption), ) model.enable() @@ -113,7 +113,7 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { calculateEnergyDiffForYear( model, simulationStartDate, - targetEnergyConsumption + targetEnergyConsumption, ) should be < Percent(2d) } } @@ -137,14 +137,14 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { ), profileLoadInput.getCosPhiRated, BdewStandardLoadProfile.H0, - EnergyConsumption(targetEnergyConsumption) + EnergyConsumption(targetEnergyConsumption), ) model.enable() calculateEnergyDiffForYear( model, simulationStartDate, - expectedEnergy + expectedEnergy, ) should be < Percent(2d) } @@ -156,7 +156,7 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { "profile", BdewStandardLoadProfile.H0, BdewStandardLoadProfile.L0, - BdewStandardLoadProfile.G0 + BdewStandardLoadProfile.G0, ) ) { profile => val model = ProfileLoadModel( @@ -174,13 +174,13 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { ), profileLoadInput.getCosPhiRated, profile, - ActivePower(targetMaximumPower) + ActivePower(targetMaximumPower), ) model.enable() val maximumPower = calculatePowerForYear( model, - simulationStartDate + simulationStartDate, ).maxOption.value implicit val tolerance: Power = Watts(1d) @@ -207,13 +207,13 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { ), profileLoadInput.getCosPhiRated, BdewStandardLoadProfile.H0, - ActivePower(targetMaximumPower) + ActivePower(targetMaximumPower), ) model.enable() val maximumPower = calculatePowerForYear( model, - simulationStartDate + simulationStartDate, ).maxOption.value implicit val tolerance: Power = Watts(1.5d) @@ -237,20 +237,20 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.LV, - -1 + -1, ), new CosPhiFixed("cosPhiFixed:{(0.0,0.95)}"), BdewStandardLoadProfile.H0, false, Quantities.getQuantity(3000d, PowerSystemUnits.KILOWATTHOUR), Quantities.getQuantity(282.74d, PowerSystemUnits.VOLTAMPERE), - 0.95 + 0.95, ) val foreSeenOperationInterval = SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - randomLoadInput.getOperationTime + randomLoadInput.getOperationTime, ) val targetEnergyConsumption = KilowattHours(3000d) @@ -270,14 +270,14 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { .doubleValue ), randomLoadInput.getCosPhiRated, - EnergyConsumption(targetEnergyConsumption) + EnergyConsumption(targetEnergyConsumption), ) model.enable() calculateEnergyDiffForYear( model, simulationStartDate, - targetEnergyConsumption + targetEnergyConsumption, ) should be < Percent(1d) } @@ -299,14 +299,14 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { .doubleValue ), randomLoadInput.getCosPhiRated, - EnergyConsumption(targetEnergyConsumption) + EnergyConsumption(targetEnergyConsumption), ) model.enable() calculateEnergyDiffForYear( model, simulationStartDate, - expectedEnergy + expectedEnergy, ) should be < Percent(2d) } @@ -326,20 +326,20 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { .doubleValue ), randomLoadInput.getCosPhiRated, - ActivePower(targetMaximumPower) + ActivePower(targetMaximumPower), ) model.enable() val powers = calculatePowerForYear( model, - simulationStartDate + simulationStartDate, ).toIndexedSeq.sorted.toArray val quantile95 = RandomLoadModelSpec.get95Quantile(powers) getRelativeDifference( quantile95, - targetMaximumPower + targetMaximumPower, ) should be < Percent(1d) } @@ -361,13 +361,13 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { .doubleValue ), randomLoadInput.getCosPhiRated, - ActivePower(targetMaximumPower) + ActivePower(targetMaximumPower), ) model.enable() val powers = calculatePowerForYear( model, - simulationStartDate + simulationStartDate, ).toIndexedSeq.sorted.toArray /* Tolerance is equivalent to 10 W difference between the 95%-percentile of the obtained random results and the @@ -382,26 +382,26 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { def calculateEnergyDiffForYear[C <: LoadRelevantData]( model: LoadModel[C], simulationStartDate: ZonedDateTime, - expectedEnergy: Energy + expectedEnergy: Energy, ): Dimensionless = { val duration = Minutes(15d) val avgEnergy = calculatePowerForYear( model: LoadModel[C], - simulationStartDate: ZonedDateTime + simulationStartDate: ZonedDateTime, ).foldLeft(KilowattHours(0)) { case (energySum, power) => energySum + (power * duration) } getRelativeDifference( avgEnergy, - expectedEnergy + expectedEnergy, ) } def calculatePowerForYear[C <: LoadRelevantData]( model: LoadModel[C], - simulationStartDate: ZonedDateTime + simulationStartDate: ZonedDateTime, ): Iterable[Power] = { val quarterHoursInYear = 365L * 96L @@ -417,7 +417,7 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { tick, Each(0d), ConstantState, - relevantData + relevantData, ) .p } @@ -433,7 +433,7 @@ class LoadModelScalingSpec extends UnitSpec with TableDrivenPropertyChecks { def getRelativeDifference[Q <: Quantity[Q]]( actualResult: Q, - expectedResult: Q + expectedResult: Q, ): Dimensionless = Each((expectedResult - actualResult).abs / expectedResult) diff --git a/src/test/scala/edu/ie3/simona/model/participant/load/LoadModelSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/load/LoadModelSpec.scala index d22eb65b07..8129394a54 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/load/LoadModelSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/load/LoadModelSpec.scala @@ -33,12 +33,12 @@ class LoadModelSpec ("reference", "sRated"), ( LoadReference.ActivePower(Watts(268.6)), - Watts(282.7368421052632) + Watts(282.7368421052632), ), ( LoadReference.EnergyConsumption(KilowattHours(3000.0)), - Watts(848.2105263157896) - ) + Watts(848.2105263157896), + ), ) forAll(params) { @@ -48,7 +48,7 @@ class LoadModelSpec loadInput, defaultOperationInterval, foreSeenScalingFactor, - foreSeenReference + foreSeenReference, ) inside(actual) { case ProfileLoadModel( @@ -60,7 +60,7 @@ class LoadModelSpec sRated, cosPhiRated, loadProfile, - reference + reference, ) => uuid shouldBe loadInput.getUuid id shouldBe loadInput.getId @@ -82,12 +82,12 @@ class LoadModelSpec ("reference", "sRated"), ( LoadReference.ActivePower(Watts(268.6)), - Watts(311.0105263157895) + Watts(311.0105263157895), ), ( LoadReference.EnergyConsumption(KilowattHours(3000.0)), - Watts(770.8076055515501) - ) + Watts(770.8076055515501), + ), ) forAll(params) { @@ -97,7 +97,7 @@ class LoadModelSpec loadInput, defaultOperationInterval, foreSeenScalingFactor, - foreSeenReference + foreSeenReference, ) inside(actual) { case RandomLoadModel( @@ -108,7 +108,7 @@ class LoadModelSpec qControl, sRated, cosPhiRated, - reference + reference, ) => uuid shouldBe loadInput.getUuid id shouldBe loadInput.getId diff --git a/src/test/scala/edu/ie3/simona/model/participant/load/LoadProfileStoreSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/load/LoadProfileStoreSpec.scala index 5b20449de8..d8ca0da750 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/load/LoadProfileStoreSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/load/LoadProfileStoreSpec.scala @@ -12,7 +12,7 @@ import edu.ie3.datamodel.models.profile.StandardLoadProfile import edu.ie3.simona.model.participant.load.profile.{ LoadProfileKey, LoadProfileStore, - TypeDayProfile + TypeDayProfile, } import edu.ie3.simona.test.common.UnitSpec import edu.ie3.util.TimeUtil @@ -48,30 +48,30 @@ class LoadProfileStoreSpec ( "2019-04-01T05:00:00+02:00[Europe/Berlin]", L0, - 55.6d + 55.6d, ), // Weekday, transitional, 20th quarter hour ( "2019-06-02T00:00:00+02:00[Europe/Berlin]", G0, - 68.8d + 68.8d, ), // Sunday, summer, 0th quarter hour ( "2019-01-05T02:15:00+01:00[Europe/Berlin]", H0, - 52.8d + 52.8d, ), // Saturday, winter, 9th quarter hour, 5th day -> dynamization factor 1.2473 ( "2019-07-21T01:00:00+02:00[Europe/Berlin]", H0, - 58.1d - ) // Sunday, summer, 4th quarter hour, 202nd day -> dynamization factor 0.7847 + 58.1d, + ), // Sunday, summer, 4th quarter hour, 202nd day -> dynamization factor 0.7847 ) forAll(params) { ( timestamp: String, loadProfile: StandardLoadProfile, - paramValue: Double + paramValue: Double, ) => val time = ZonedDateTime.parse(timestamp) val param = Watts(paramValue) @@ -86,7 +86,7 @@ class LoadProfileStoreSpec ("profile", "maxParamValue"), (H0, 268.6d), (L0, 240.4d), - (G0, 240.4d) + (G0, 240.4d), ) forAll(maxParams) { @@ -110,7 +110,7 @@ class LoadProfileStoreSpec H0 -> KilowattHours(1000.0), L0 -> KilowattHours(1002.0), /* TODO: Check, if this is correct */ - G0 -> KilowattHours(1022.0) + G0 -> KilowattHours(1022.0), ) /* Collect all available time steps in 2020 */ diff --git a/src/test/scala/edu/ie3/simona/model/participant/load/ProfileLoadModelSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/load/ProfileLoadModelSpec.scala index 948ec4ce80..a66aac0a78 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/load/ProfileLoadModelSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/load/ProfileLoadModelSpec.scala @@ -15,7 +15,7 @@ import edu.ie3.datamodel.models.voltagelevels.GermanVoltageLevelUtils import edu.ie3.simona.model.SystemComponent import edu.ie3.simona.model.participant.load.LoadReference.{ ActivePower, - EnergyConsumption + EnergyConsumption, } import edu.ie3.simona.model.participant.load.profile.ProfileLoadModel import edu.ie3.simona.test.common.UnitSpec @@ -48,14 +48,14 @@ class ProfileLoadModelSpec extends UnitSpec with TableDrivenPropertyChecks { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.LV, - -1 + -1, ), new CosPhiFixed("cosPhiFixed:{(0.0,0.95)}"), BdewStandardLoadProfile.H0, false, Quantities.getQuantity(3000d, PowerSystemUnits.KILOWATTHOUR), Quantities.getQuantity(282.74d, PowerSystemUnits.VOLTAMPERE), - 0.95 + 0.95, ) val simulationStartDate = @@ -66,7 +66,7 @@ class ProfileLoadModelSpec extends UnitSpec with TableDrivenPropertyChecks { SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - loadInput.getOperationTime + loadInput.getOperationTime, ) "instantiating it" should { @@ -77,46 +77,46 @@ class ProfileLoadModelSpec extends UnitSpec with TableDrivenPropertyChecks { ( BdewStandardLoadProfile.H0, ActivePower(Watts(268.6)), - Watts(282.74d) + Watts(282.74d), ), ( BdewStandardLoadProfile.H0, EnergyConsumption( KilowattHours(3000d) ), - Watts(848.22d) + Watts(848.22d), ), ( BdewStandardLoadProfile.L0, ActivePower(Watts(268.6)), - Watts(282.74d) + Watts(282.74d), ), ( BdewStandardLoadProfile.L0, EnergyConsumption( KilowattHours(3000d) ), - Watts(759.158d) + Watts(759.158d), ), ( BdewStandardLoadProfile.G0, ActivePower(Watts(268.6)), - Watts(282.74d) + Watts(282.74d), ), ( BdewStandardLoadProfile.G0, EnergyConsumption( KilowattHours(3000d) ), - Watts(759.158d) - ) + Watts(759.158d), + ), ) ) { (profile, reference, expectedSRated) => val actual = ProfileLoadModel( loadInput.copy().loadprofile(profile).build(), foreSeenOperationInterval, 1.0, - reference + reference, ) actual.sRated should approximate(expectedSRated) diff --git a/src/test/scala/edu/ie3/simona/model/participant/load/RandomLoadModelSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/load/RandomLoadModelSpec.scala index 497812c662..393657f9d8 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/load/RandomLoadModelSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/load/RandomLoadModelSpec.scala @@ -17,11 +17,11 @@ import edu.ie3.simona.model.SystemComponent import edu.ie3.simona.model.participant.control.QControl import edu.ie3.simona.model.participant.load.LoadReference.{ ActivePower, - EnergyConsumption + EnergyConsumption, } import edu.ie3.simona.model.participant.load.random.{ RandomLoadModel, - RandomLoadParameters + RandomLoadParameters, } import edu.ie3.simona.test.common.UnitSpec import edu.ie3.util.TimeUtil @@ -51,14 +51,14 @@ class RandomLoadModelSpec extends UnitSpec with TableDrivenPropertyChecks { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.LV, - -1 + -1, ), new CosPhiFixed("cosPhiFixed:{(0.0,0.95)}"), BdewStandardLoadProfile.H0, false, Quantities.getQuantity(3000d, PowerSystemUnits.KILOWATTHOUR), Quantities.getQuantity(282.74d, PowerSystemUnits.VOLTAMPERE), - 0.95 + 0.95, ) val simulationStartDate = @@ -69,7 +69,7 @@ class RandomLoadModelSpec extends UnitSpec with TableDrivenPropertyChecks { SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - loadInput.getOperationTime + loadInput.getOperationTime, ) "instantiating it" should { @@ -78,7 +78,7 @@ class RandomLoadModelSpec extends UnitSpec with TableDrivenPropertyChecks { val testData = Table( ("reference", "expectedSRated"), (ActivePower(Watts(268.6)), Watts(311.0105263157895d)), - (EnergyConsumption(KilowattHours(2000d)), Watts(513.871737d)) + (EnergyConsumption(KilowattHours(2000d)), Watts(513.871737d)), ) forAll(testData) { (reference, expectedSRated: Power) => @@ -86,7 +86,7 @@ class RandomLoadModelSpec extends UnitSpec with TableDrivenPropertyChecks { loadInput, foreSeenOperationInterval, 1.0, - reference + reference, ) actual.sRated should approximate(expectedSRated) @@ -110,7 +110,7 @@ class RandomLoadModelSpec extends UnitSpec with TableDrivenPropertyChecks { .doubleValue() ), loadInput.getCosPhiRated, - ActivePower(Watts(268.6)) + ActivePower(Watts(268.6)), ) /* Working day, 61th quarter hour */ val queryDate = @@ -118,7 +118,7 @@ class RandomLoadModelSpec extends UnitSpec with TableDrivenPropertyChecks { val expectedParams = new RandomLoadParameters( 0.405802458524704, 0.0671483352780342, - 0.0417016632854939 + 0.0417016632854939, ) /* First query leeds to generation of distribution */ diff --git a/src/test/scala/edu/ie3/simona/model/participant/load/RandomLoadParamStoreSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/load/RandomLoadParamStoreSpec.scala index 2bbe997702..7af564121a 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/load/RandomLoadParamStoreSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/load/RandomLoadParamStoreSpec.scala @@ -11,7 +11,7 @@ import java.io.InputStreamReader import edu.ie3.simona.model.participant.load.random.{ RandomLoadParamStore, RandomLoadParameters, - TypeDayParameters + TypeDayParameters, } import edu.ie3.simona.test.common.UnitSpec import edu.ie3.util.TimeUtil @@ -40,25 +40,25 @@ class RandomLoadParamStoreSpec "sigmaSa", "sigmaSu", "sigmaWd", - "quarterHour" + "quarterHour", ) ) val expected = Map( DayType.weekday -> Map( RandomLoadParameters.K -> 2, RandomLoadParameters.MY -> 5, - RandomLoadParameters.SIGMA -> 8 + RandomLoadParameters.SIGMA -> 8, ), DayType.saturday -> Map( RandomLoadParameters.K -> 0, RandomLoadParameters.MY -> 3, - RandomLoadParameters.SIGMA -> 6 + RandomLoadParameters.SIGMA -> 6, ), DayType.sunday -> Map( RandomLoadParameters.K -> 1, RandomLoadParameters.MY -> 4, - RandomLoadParameters.SIGMA -> 7 - ) + RandomLoadParameters.SIGMA -> 7, + ), ) actual shouldBe expected @@ -91,31 +91,31 @@ class RandomLoadParamStoreSpec RandomLoadParameters( 0.146539300680161, 0.0430354326963425, - 0.0201929099857807 - ) + 0.0201929099857807, + ), ), // Weekday ( "2019-06-02 00:00:00", RandomLoadParameters( 0.295997023582459, 0.0630703344941139, - 0.0370676517486572 - ) + 0.0370676517486572, + ), ), // Sunday ( "2019-01-05 02:15:00", RandomLoadParameters( 0.132398754358292, 0.0439879409968853, - 0.0208074823021889 - ) - ) // Saturday + 0.0208074823021889, + ), + ), // Saturday ) forAll(params) { ( timestamp: String, - expected: RandomLoadParameters + expected: RandomLoadParameters, ) => val time = TimeUtil.withDefaults.toZonedDateTime(timestamp) randomParameterStore.parameters(time) shouldBe expected diff --git a/src/test/scala/edu/ie3/simona/model/participant/load/TypeDayParametersSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/load/TypeDayParametersSpec.scala index e8af1101ba..4f0a119297 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/load/TypeDayParametersSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/load/TypeDayParametersSpec.scala @@ -8,7 +8,7 @@ package edu.ie3.simona.model.participant.load import edu.ie3.simona.model.participant.load.random.{ RandomLoadParameters, - TypeDayParameters + TypeDayParameters, } import edu.ie3.simona.test.common.UnitSpec import edu.ie3.util.TimeUtil @@ -21,7 +21,7 @@ class TypeDayParametersSpec extends UnitSpec { RandomLoadParameters( cnt.toDouble, (cnt + 1).toDouble, - (cnt + 2).toDouble + (cnt + 2).toDouble, ) ) .toArray @@ -37,7 +37,7 @@ class TypeDayParametersSpec extends UnitSpec { RandomLoadParameters( cnt.toDouble, (cnt + 1).toDouble, - (cnt + 2).toDouble + (cnt + 2).toDouble, ) ) .toArray diff --git a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridSpec.scala b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridSpec.scala index efe070abae..e4c1c14c70 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridSpec.scala @@ -83,11 +83,11 @@ class ThermalGridSpec extends UnitSpec { "deliver proper results" in { val energyDemand1 = ThermalEnergyDemand( MegawattHours(45d), - MegawattHours(47d) + MegawattHours(47d), ) val energyDemand2 = ThermalEnergyDemand( MegawattHours(23d), - MegawattHours(28d) + MegawattHours(28d), ) val totalDemand = energyDemand1 + energyDemand2 diff --git a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridTestData.scala b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridTestData.scala index bbcaa52207..a7af090fb6 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridTestData.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridTestData.scala @@ -19,7 +19,7 @@ trait ThermalGridTestData { UUID.randomUUID(), "Thermal Bus", OperatorInput.NO_OPERATOR_ASSIGNED, - OperationTime.notLimited() + OperationTime.notLimited(), ) protected val testGridambientTemperature: Temperature = Celsius(12d) protected val testGridQDotInfeed: Power = Kilowatts(15d) diff --git a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala index 5a09e20c34..6955b3c705 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala @@ -11,12 +11,12 @@ import edu.ie3.simona.model.thermal.ThermalGrid.ThermalGridState import edu.ie3.simona.model.thermal.ThermalHouse.ThermalHouseState import edu.ie3.simona.model.thermal.ThermalHouse.ThermalHouseThreshold.{ HouseTemperatureLowerBoundaryReached, - HouseTemperatureUpperBoundaryReached + HouseTemperatureUpperBoundaryReached, } import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageState import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageThreshold.{ StorageEmpty, - StorageFull + StorageFull, } import edu.ie3.simona.test.common.UnitSpec import squants.energy._ @@ -41,13 +41,13 @@ class ThermalGridWithHouseAndStorageSpec new edu.ie3.datamodel.models.input.container.ThermalGrid( thermalBusInput, Set(thermalHouseInput).asJava, - Set[ThermalStorageInput](thermalStorageInput).asJava + Set[ThermalStorageInput](thermalStorageInput).asJava, ) ThermalGrid(thermalGridInput) match { case ThermalGrid( Some(thermalHouseGenerated), - Some(thermalStorageGenerated) + Some(thermalStorageGenerated), ) => thermalHouseGenerated shouldBe thermalHouse thermalStorageGenerated shouldBe thermalStorage @@ -62,7 +62,7 @@ class ThermalGridWithHouseAndStorageSpec new edu.ie3.datamodel.models.input.container.ThermalGrid( thermalBusInput, Set(thermalHouseInput).asJava, - Set[ThermalStorageInput](thermalStorageInput).asJava + Set[ThermalStorageInput](thermalStorageInput).asJava, ) ) @@ -73,7 +73,7 @@ class ThermalGridWithHouseAndStorageSpec Some(ThermalHouseState(houseTick, innerTemperature, qDotHouse)), Some( ThermalStorageState(storageTick, storedEnergy, qDotStorage) - ) + ), ) => houseTick shouldBe expectedHouseStartingState.tick storageTick shouldBe expectedHouseStartingState.tick @@ -99,7 +99,7 @@ class ThermalGridWithHouseAndStorageSpec val gridDemand = thermalGrid.energyDemand( tick, testGridambientTemperature, - ThermalGrid.startingState(thermalGrid) + ThermalGrid.startingState(thermalGrid), ) gridDemand.required should approximate(KilowattHours(0d)) @@ -119,7 +119,7 @@ class ThermalGridWithHouseAndStorageSpec startingState.houseState.map( _.copy(innerTemperature = Celsius(16d)) ) - ) + ), ) gridDemand.required should approximate(KilowattHours(0d)) @@ -137,7 +137,7 @@ class ThermalGridWithHouseAndStorageSpec startingState.houseState.map( _.copy(innerTemperature = Celsius(3d)) ) - ) + ), ) gridDemand.required should approximate(KilowattHours(8.64987499999)) gridDemand.possible should approximate(KilowattHours(1418.64987499999)) @@ -166,7 +166,7 @@ class ThermalGridWithHouseAndStorageSpec tick, testGridambientTemperature, gridState, - externalQDot + externalQDot, ) updatedGridState match { @@ -174,7 +174,7 @@ class ThermalGridWithHouseAndStorageSpec _, Some( ThermalStorageState(storageTick, storedEnergy, qDotStorage) - ) + ), ) => storageTick shouldBe 0L storedEnergy should approximate(initialLoading) @@ -202,7 +202,7 @@ class ThermalGridWithHouseAndStorageSpec tick, testGridambientTemperature, gridState, - externalQDot + externalQDot, ) updatedGridState match { @@ -210,7 +210,7 @@ class ThermalGridWithHouseAndStorageSpec Some(ThermalHouseState(houseTick, innerTemperature, qDotHouse)), Some( ThermalStorageState(storageTick, storedEnergy, qDotStorage) - ) + ), ) => houseTick shouldBe 0L innerTemperature should approximate(Celsius(18.9999d)) @@ -240,9 +240,9 @@ class ThermalGridWithHouseAndStorageSpec .getValue .doubleValue ), - zeroInflux + zeroInflux, ), - None + None, ) ) val maybeStorageState = None @@ -254,7 +254,7 @@ class ThermalGridWithHouseAndStorageSpec maybeHouseState.map(_._1), None, testGridambientTemperature, - testGridQDotConsumption + testGridQDotConsumption, ) match { case (maybeRevisedHouseState, maybeRevisedStorageState) => maybeRevisedHouseState shouldBe maybeHouseState @@ -273,9 +273,9 @@ class ThermalGridWithHouseAndStorageSpec .getValue .doubleValue ), - zeroInflux + zeroInflux, ), - None + None, ) ) val maybeStorageState = Some( @@ -283,9 +283,9 @@ class ThermalGridWithHouseAndStorageSpec ThermalStorageState( tick, KilowattHours(50d), - zeroInflux + zeroInflux, ), - None + None, ) ) @@ -296,7 +296,7 @@ class ThermalGridWithHouseAndStorageSpec maybeHouseState.map(_._1), maybeStorageState.map(_._1), ambientTemperature, - zeroInflux + zeroInflux, ) match { case (maybeRevisedHouseState, maybeRevisedStorageState) => maybeRevisedHouseState shouldBe maybeHouseState @@ -315,9 +315,9 @@ class ThermalGridWithHouseAndStorageSpec .getValue .doubleValue ), - testGridQDotInfeed + testGridQDotInfeed, ), - Some(HouseTemperatureUpperBoundaryReached(3600L)) + Some(HouseTemperatureUpperBoundaryReached(3600L)), ) ) val maybeStorageState = Some( @@ -325,9 +325,9 @@ class ThermalGridWithHouseAndStorageSpec ThermalStorageState( tick, KilowattHours(50d), - zeroInflux + zeroInflux, ), - None + None, ) ) @@ -338,7 +338,7 @@ class ThermalGridWithHouseAndStorageSpec maybeHouseState.map(_._1), maybeStorageState.map(_._1), ambientTemperature, - testGridQDotInfeed + testGridQDotInfeed, ) match { case (maybeRevisedHouseState, maybeRevisedStorageState) => maybeRevisedHouseState shouldBe maybeHouseState @@ -357,9 +357,9 @@ class ThermalGridWithHouseAndStorageSpec .getValue .doubleValue ), - zeroInflux + zeroInflux, ), - Some(HouseTemperatureLowerBoundaryReached(tick)) + Some(HouseTemperatureLowerBoundaryReached(tick)), ) ) val maybeStorageState = Some( @@ -367,9 +367,9 @@ class ThermalGridWithHouseAndStorageSpec ThermalStorageState( tick, KilowattHours(50d), - testGridQDotInfeed + testGridQDotInfeed, ), - Some(StorageEmpty(tick)) + Some(StorageEmpty(tick)), ) ) @@ -380,7 +380,7 @@ class ThermalGridWithHouseAndStorageSpec maybeHouseState.map(_._1), maybeStorageState.map(_._1), ambientTemperature, - zeroInflux + zeroInflux, ) match { case (maybeRevisedHouseState, maybeRevisedStorageState) => maybeRevisedHouseState shouldBe maybeHouseState @@ -399,9 +399,9 @@ class ThermalGridWithHouseAndStorageSpec .getValue .doubleValue ), - zeroInflux + zeroInflux, ), - Some(HouseTemperatureLowerBoundaryReached(tick)) + Some(HouseTemperatureLowerBoundaryReached(tick)), ) ) val maybeStorageState = Some( @@ -409,9 +409,9 @@ class ThermalGridWithHouseAndStorageSpec ThermalStorageState( tick, KilowattHours(250d), - testGridQDotInfeed + testGridQDotInfeed, ), - None + None, ) ) val formerHouseState = Some( @@ -423,14 +423,14 @@ class ThermalGridWithHouseAndStorageSpec .getValue .doubleValue ), - zeroInflux + zeroInflux, ) ) val formerStorageState = Some( ThermalStorageState( 0L, KilowattHours(300d), - Kilowatts(-50d) + Kilowatts(-50d), ) ) @@ -441,21 +441,21 @@ class ThermalGridWithHouseAndStorageSpec formerHouseState, formerStorageState, ambientTemperature, - zeroInflux + zeroInflux, ) match { case ( Some( ( ThermalHouseState(houseTick, _, revisedQDotHouse), - Some(HouseTemperatureUpperBoundaryReached(houseColdTick)) + Some(HouseTemperatureUpperBoundaryReached(houseColdTick)), ) ), Some( ( ThermalStorageState(storageTick, _, revisedQDotStorage), - Some(StorageEmpty(storageEmptyTick)) + Some(StorageEmpty(storageEmptyTick)), ) - ) + ), ) => houseTick shouldBe tick storageTick shouldBe tick @@ -488,7 +488,7 @@ class ThermalGridWithHouseAndStorageSpec tick, testGridambientTemperature, initialGridState, - externalQDot + externalQDot, ) updatedGridState match { @@ -496,7 +496,7 @@ class ThermalGridWithHouseAndStorageSpec Some(ThermalHouseState(houseTick, innerTemperature, qDotHouse)), Some( ThermalStorageState(storageTick, storedEnergy, qDotStorage) - ) + ), ) => houseTick shouldBe 0L innerTemperature should approximate(Celsius(18.9999d)) @@ -533,7 +533,7 @@ class ThermalGridWithHouseAndStorageSpec tick, testGridambientTemperature, gridState, - externalQDot + externalQDot, ) updatedGridState match { @@ -541,7 +541,7 @@ class ThermalGridWithHouseAndStorageSpec Some(ThermalHouseState(houseTick, innerTemperature, qDotHouse)), Some( ThermalStorageState(storageTick, storedEnergy, qDotStorage) - ) + ), ) => houseTick shouldBe 0L innerTemperature should approximate(Celsius(20.99999167d)) diff --git a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala index 4869a65df2..ac96c4c541 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala @@ -11,7 +11,7 @@ import edu.ie3.simona.model.thermal.ThermalGrid.ThermalGridState import edu.ie3.simona.model.thermal.ThermalHouse.ThermalHouseState import edu.ie3.simona.model.thermal.ThermalHouse.ThermalHouseThreshold.{ HouseTemperatureLowerBoundaryReached, - HouseTemperatureUpperBoundaryReached + HouseTemperatureUpperBoundaryReached, } import edu.ie3.simona.test.common.UnitSpec import squants.energy.{Kilowatts, Megawatts, WattHours, Watts} @@ -32,7 +32,7 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { new edu.ie3.datamodel.models.input.container.ThermalGrid( thermalBusInput, Set(thermalHouseInput).asJava, - Set.empty[ThermalStorageInput].asJava + Set.empty[ThermalStorageInput].asJava, ) ThermalGrid(thermalGridInput) match { @@ -49,7 +49,7 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { new edu.ie3.datamodel.models.input.container.ThermalGrid( thermalBusInput, Set(thermalHouseInput).asJava, - Set.empty[ThermalStorageInput].asJava + Set.empty[ThermalStorageInput].asJava, ) ) @@ -58,7 +58,7 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { ThermalGrid.startingState(thermalGrid) match { case ThermalGridState( Some(ThermalHouseState(tick, innerTemperature, thermalInfeed)), - None + None, ) => tick shouldBe expectedHouseStartingState.tick innerTemperature should approximate( @@ -77,13 +77,13 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { val houseDemand = thermalHouse.energyDemand( tick, testGridambientTemperature, - expectedHouseStartingState + expectedHouseStartingState, ) val gridDemand = thermalGrid.energyDemand( tick, testGridambientTemperature, - ThermalGrid.startingState(thermalGrid) + ThermalGrid.startingState(thermalGrid), ) gridDemand.required should approximate(houseDemand.required) @@ -107,13 +107,13 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { tick, testGridambientTemperature, gridState, - externalQDot + externalQDot, ) updatedGridState match { case ThermalGridState( Some(ThermalHouseState(tick, innerTemperature, qDot)), - None + None, ) => tick shouldBe 0L innerTemperature should approximate(Celsius(18.9999d)) @@ -134,13 +134,13 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { tick, testGridambientTemperature, gridState, - testGridQDotConsumption + testGridQDotConsumption, ) updatedGridState match { case ThermalGridState( Some(ThermalHouseState(tick, innerTemperature, qDot)), - None + None, ) => tick shouldBe 0L innerTemperature should approximate(Celsius(18.9999d)) @@ -168,13 +168,13 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { tick, testGridambientTemperature, gridState, - testGridQDotInfeed + testGridQDotInfeed, ) updatedGridState match { case ThermalGridState( Some(ThermalHouseState(tick, innerTemperature, qDot)), - None + None, ) => tick shouldBe 0L innerTemperature should approximate(Celsius(18.9999d)) @@ -193,14 +193,14 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { 0L, ThermalGrid.startingState(thermalGrid), testGridambientTemperature, - testGridQDotInfeed + testGridQDotInfeed, ) match { case ( ThermalGridState( Some(ThermalHouseState(tick, innerTemperature, qDot)), - None + None, ), - Some(HouseTemperatureUpperBoundaryReached(thresholdTick)) + Some(HouseTemperatureUpperBoundaryReached(thresholdTick)), ) => tick shouldBe 0L innerTemperature should approximate(Celsius(18.9999d)) @@ -215,14 +215,14 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { 0L, ThermalGrid.startingState(thermalGrid), testGridambientTemperature, - testGridQDotConsumption + testGridQDotConsumption, ) match { case ( ThermalGridState( Some(ThermalHouseState(tick, innerTemperature, qDot)), - None + None, ), - Some(HouseTemperatureLowerBoundaryReached(thresholdTick)) + Some(HouseTemperatureLowerBoundaryReached(thresholdTick)), ) => tick shouldBe 0L innerTemperature should approximate(Celsius(18.9999d)) @@ -237,14 +237,14 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { 0L, ThermalGrid.startingState(thermalGrid), testGridambientTemperature, - Megawatts(0d) + Megawatts(0d), ) match { case ( ThermalGridState( Some(ThermalHouseState(tick, innerTemperature, qDot)), - None + None, ), - Some(HouseTemperatureLowerBoundaryReached(thresholdTick)) + Some(HouseTemperatureLowerBoundaryReached(thresholdTick)), ) => tick shouldBe 0L innerTemperature should approximate(Celsius(18.9999d)) diff --git a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithStorageOnlySpec.scala b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithStorageOnlySpec.scala index 5476321e2d..fe4276909f 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithStorageOnlySpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithStorageOnlySpec.scala @@ -8,13 +8,13 @@ package edu.ie3.simona.model.thermal import edu.ie3.datamodel.models.input.thermal.{ ThermalHouseInput, - ThermalStorageInput + ThermalStorageInput, } import edu.ie3.simona.model.thermal.ThermalGrid.ThermalGridState import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageState import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageThreshold.{ StorageEmpty, - StorageFull + StorageFull, } import edu.ie3.simona.test.common.UnitSpec import squants.energy._ @@ -37,7 +37,7 @@ class ThermalGridWithStorageOnlySpec new edu.ie3.datamodel.models.input.container.ThermalGrid( thermalBusInput, Set.empty[ThermalHouseInput].asJava, - Set[ThermalStorageInput](thermalStorageInput).asJava + Set[ThermalStorageInput](thermalStorageInput).asJava, ) ThermalGrid(thermalGridInput) match { @@ -54,7 +54,7 @@ class ThermalGridWithStorageOnlySpec new edu.ie3.datamodel.models.input.container.ThermalGrid( thermalBusInput, Set.empty[ThermalHouseInput].asJava, - Set[ThermalStorageInput](thermalStorageInput).asJava + Set[ThermalStorageInput](thermalStorageInput).asJava, ) ) @@ -63,7 +63,7 @@ class ThermalGridWithStorageOnlySpec ThermalGrid.startingState(thermalGrid) match { case ThermalGridState( None, - Some(ThermalStorageState(tick, storedEnergy, qDot)) + Some(ThermalStorageState(tick, storedEnergy, qDot)), ) => tick shouldBe expectedStorageStartingState.tick storedEnergy should approximate( @@ -83,7 +83,7 @@ class ThermalGridWithStorageOnlySpec val gridDemand = thermalGrid.energyDemand( tick, testGridambientTemperature, - ThermalGrid.startingState(thermalGrid) + ThermalGrid.startingState(thermalGrid), ) gridDemand.required should approximate(MegawattHours(0d)) @@ -106,7 +106,7 @@ class ThermalGridWithStorageOnlySpec ThermalStorageState( 0L, KilowattHours(430d), - Kilowatts(0d) + Kilowatts(0d), ) ) ) @@ -116,13 +116,13 @@ class ThermalGridWithStorageOnlySpec tick, testGridambientTemperature, gridState, - testGridQDotConsumptionHigh + testGridQDotConsumptionHigh, ) updatedGridState match { case ThermalGridState( None, - Some(ThermalStorageState(tick, storedEnergy, qDot)) + Some(ThermalStorageState(tick, storedEnergy, qDot)), ) => tick shouldBe 0L storedEnergy should approximate(KilowattHours(430d)) @@ -148,13 +148,13 @@ class ThermalGridWithStorageOnlySpec tick, testGridambientTemperature, gridState, - testGridQDotInfeed + testGridQDotInfeed, ) updatedGridState match { case ThermalGridState( None, - Some(ThermalStorageState(tick, storedEnergy, qDot)) + Some(ThermalStorageState(tick, storedEnergy, qDot)), ) => tick shouldBe 0L storedEnergy should approximate(KilowattHours(230d)) @@ -171,7 +171,7 @@ class ThermalGridWithStorageOnlySpec 0L, ThermalGrid.startingState(thermalGrid), testGridambientTemperature, - testGridQDotInfeed + testGridQDotInfeed, ) nextThreshold shouldBe Some(StorageFull(220800L)) @@ -179,7 +179,7 @@ class ThermalGridWithStorageOnlySpec updatedState match { case ThermalGridState( None, - Some(ThermalStorageState(tick, storedEnergy, qDot)) + Some(ThermalStorageState(tick, storedEnergy, qDot)), ) => tick shouldBe 0L storedEnergy should approximate(KilowattHours(230d)) @@ -198,19 +198,19 @@ class ThermalGridWithStorageOnlySpec ThermalStorageState( 0L, KilowattHours(430d), - Kilowatts(0d) + Kilowatts(0d), ) ) ), testGridambientTemperature, - testGridQDotConsumptionHigh + testGridQDotConsumptionHigh, ) match { case ( ThermalGridState( None, - Some(ThermalStorageState(tick, storedEnergy, qDot)) + Some(ThermalStorageState(tick, storedEnergy, qDot)), ), - Some(StorageEmpty(thresholdTick)) + Some(StorageEmpty(thresholdTick)), ) => tick shouldBe 0L storedEnergy should approximate(KilowattHours(430d)) @@ -225,15 +225,15 @@ class ThermalGridWithStorageOnlySpec 0L, ThermalGrid.startingState(thermalGrid), testGridambientTemperature, - Kilowatts(0d) + Kilowatts(0d), ) updatedState match { case ( ThermalGridState( None, - Some(ThermalStorageState(tick, storedEnergy, qDot)) + Some(ThermalStorageState(tick, storedEnergy, qDot)), ), - None + None, ) => tick shouldBe 0L storedEnergy should approximate(KilowattHours(230d)) diff --git a/src/test/scala/edu/ie3/simona/model/thermal/ThermalHouseTestData.scala b/src/test/scala/edu/ie3/simona/model/thermal/ThermalHouseTestData.scala index 78b186296d..2b12dab681 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalHouseTestData.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalHouseTestData.scala @@ -25,7 +25,7 @@ trait ThermalHouseTestData extends ThermalGridTestData { getQuantity(15.0, StandardUnits.HEAT_CAPACITY), getQuantity(19d, Units.CELSIUS), getQuantity(21d, Units.CELSIUS), - getQuantity(18d, Units.CELSIUS) + getQuantity(18d, Units.CELSIUS), ) protected val thermalHouse: ThermalHouse = ThermalHouse(thermalHouseInput) @@ -34,6 +34,6 @@ trait ThermalHouseTestData extends ThermalGridTestData { ThermalHouseState( -1L, Celsius(19d), - Megawatts(0d) + Megawatts(0d), ) } diff --git a/src/test/scala/edu/ie3/simona/model/thermal/ThermalStorageTestData.scala b/src/test/scala/edu/ie3/simona/model/thermal/ThermalStorageTestData.scala index 582ff025cb..b5434bbb17 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalStorageTestData.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalStorageTestData.scala @@ -9,7 +9,7 @@ package edu.ie3.simona.model.thermal import edu.ie3.datamodel.models.StandardUnits import edu.ie3.datamodel.models.input.thermal.{ CylindricalStorageInput, - ThermalBusInput + ThermalBusInput, } import tech.units.indriya.quantity.Quantities.getQuantity @@ -22,13 +22,13 @@ trait ThermalStorageTestData extends ThermalGridTestData { "ThermalStorage", new ThermalBusInput( UUID.fromString("ad2db5ab-8f90-4bc1-aa2c-30b31b843ab2"), - "TestThermalBus" + "TestThermalBus", ), getQuantity(100, StandardUnits.VOLUME), getQuantity(20, StandardUnits.VOLUME), getQuantity(30, StandardUnits.TEMPERATURE), getQuantity(40, StandardUnits.TEMPERATURE), - getQuantity(1.15, StandardUnits.SPECIFIC_HEAT_CAPACITY) + getQuantity(1.15, StandardUnits.SPECIFIC_HEAT_CAPACITY), ) protected val thermalStorage: CylindricalThermalStorage = diff --git a/src/test/scala/edu/ie3/simona/ontology/messages/flex/MinMaxFlexibilityMessageTest.scala b/src/test/scala/edu/ie3/simona/ontology/messages/flex/MinMaxFlexibilityMessageTest.scala index 6602614262..63da1cbfa2 100644 --- a/src/test/scala/edu/ie3/simona/ontology/messages/flex/MinMaxFlexibilityMessageTest.scala +++ b/src/test/scala/edu/ie3/simona/ontology/messages/flex/MinMaxFlexibilityMessageTest.scala @@ -20,7 +20,7 @@ class MinMaxFlexibilityMessageTest extends UnitSpec { "succeed if there is no flexibility" in { val res = ProvideMinMaxFlexOptions.noFlexOption( modelUuid = UUID.randomUUID(), - power = Watts(1) + power = Watts(1), ) res.ref shouldBe Watts(1) @@ -33,7 +33,7 @@ class MinMaxFlexibilityMessageTest extends UnitSpec { modelUuid = UUID.randomUUID(), ref = Watts(1), min = Watts(0), - max = Watts(2) + max = Watts(2), ) res.ref shouldBe Watts(1) @@ -47,7 +47,7 @@ class MinMaxFlexibilityMessageTest extends UnitSpec { modelUuid = UUID.randomUUID(), ref = Watts(1), min = Watts(2), - max = Watts(2) + max = Watts(2), ) }.getMessage should include("is greater than reference power") } @@ -58,7 +58,7 @@ class MinMaxFlexibilityMessageTest extends UnitSpec { modelUuid = UUID.randomUUID(), ref = Watts(1), min = Watts(1), - max = Watts(0) + max = Watts(0), ) }.getMessage should include("is greater than maximum power") } diff --git a/src/test/scala/edu/ie3/simona/scheduler/PhaseSwitchSchedulerSpec.scala b/src/test/scala/edu/ie3/simona/scheduler/PhaseSwitchSchedulerSpec.scala index b2c6dae582..9adb5a707e 100644 --- a/src/test/scala/edu/ie3/simona/scheduler/PhaseSwitchSchedulerSpec.scala +++ b/src/test/scala/edu/ie3/simona/scheduler/PhaseSwitchSchedulerSpec.scala @@ -8,7 +8,7 @@ package edu.ie3.simona.scheduler import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.{Activation, SchedulerMessage} import edu.ie3.simona.scheduler.core.PhaseSwitchCore @@ -16,7 +16,7 @@ import edu.ie3.simona.util.ActorUtils.RichActivatedActor import edu.ie3.simona.util.SimonaConstants.INIT_SIM_TICK import org.apache.pekko.actor.testkit.typed.scaladsl.{ ScalaTestWithActorTestKit, - TestProbe + TestProbe, } import org.scalatest.matchers.should import org.scalatest.wordspec.AnyWordSpecLike @@ -145,7 +145,7 @@ class PhaseSwitchSchedulerSpec scheduler ! ScheduleActivation( agent2.ref, - INIT_SIM_TICK + INIT_SIM_TICK, ) // waiting for next phase @@ -221,7 +221,7 @@ class PhaseSwitchSchedulerSpec scheduler ! ScheduleActivation( agent1.ref, - INIT_SIM_TICK + INIT_SIM_TICK, ) val sa1 = parent.expectMessageType[ScheduleActivation] @@ -230,7 +230,7 @@ class PhaseSwitchSchedulerSpec scheduler ! ScheduleActivation( agent2.ref, - INIT_SIM_TICK + INIT_SIM_TICK, ) // TICK -1 @@ -240,7 +240,7 @@ class PhaseSwitchSchedulerSpec agent1.expectActivationAndComplete( scheduler, INIT_SIM_TICK, - Some(0) + Some(0), ) parent.expectNoMessage() @@ -248,7 +248,7 @@ class PhaseSwitchSchedulerSpec agent2.expectActivationAndComplete( scheduler, INIT_SIM_TICK, - Some(0) + Some(0), ) parent.expectMessage(Completion(schedulerActivation, Some(0))) @@ -262,7 +262,7 @@ class PhaseSwitchSchedulerSpec agent1.expectActivationAndComplete( scheduler, 0, - Some(900) + Some(900), ) parent.expectNoMessage() @@ -270,7 +270,7 @@ class PhaseSwitchSchedulerSpec agent2.expectActivationAndComplete( scheduler, 0, - Some(300) + Some(300), ) parent.expectMessage(Completion(schedulerActivation, Some(300))) @@ -281,7 +281,7 @@ class PhaseSwitchSchedulerSpec agent2.expectActivationAndComplete( scheduler, 300, - Some(900) + Some(900), ) parent.expectMessage(Completion(schedulerActivation, Some(900))) @@ -295,7 +295,7 @@ class PhaseSwitchSchedulerSpec agent1.expectActivationAndComplete( scheduler, 900, - Some(3600) + Some(3600), ) parent.expectNoMessage() @@ -303,7 +303,7 @@ class PhaseSwitchSchedulerSpec agent2.expectActivationAndComplete( scheduler, 900, - Some(1800) + Some(1800), ) parent.expectMessage(Completion(schedulerActivation, Some(1800))) @@ -362,7 +362,7 @@ class PhaseSwitchSchedulerSpec agent1.expectActivationAndComplete( scheduler, 900, - Some(1800) + Some(1800), ) parent.expectMessage(Completion(schedulerActivation, Some(1800))) diff --git a/src/test/scala/edu/ie3/simona/scheduler/ScheduleLockIT.scala b/src/test/scala/edu/ie3/simona/scheduler/ScheduleLockIT.scala index af4586e56e..e001a45a8b 100644 --- a/src/test/scala/edu/ie3/simona/scheduler/ScheduleLockIT.scala +++ b/src/test/scala/edu/ie3/simona/scheduler/ScheduleLockIT.scala @@ -8,11 +8,11 @@ package edu.ie3.simona.scheduler import org.apache.pekko.actor.testkit.typed.scaladsl.{ ScalaTestWithActorTestKit, - TestProbe + TestProbe, } import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.{Activation, SchedulerMessage} import edu.ie3.simona.test.common.TestSpawnerTyped @@ -35,17 +35,17 @@ class ScheduleLockIT val parentScheduler = spawn( Scheduler(timeAdvancer.ref), - "parentScheduler" + "parentScheduler", ) val childScheduler = spawn( Scheduler(parentScheduler), - "childScheduler" + "childScheduler", ) // first, we normally schedule some activation for our agent1 childScheduler ! ScheduleActivation( agent1.ref, - 30 + 30, ) val sa1 = timeAdvancer.expectMessageType[ScheduleActivation] sa1.tick shouldBe 30 @@ -63,7 +63,7 @@ class ScheduleLockIT childScheduler ! ScheduleActivation( agent2.ref, 30, - Some(scheduleKey) + Some(scheduleKey), ) // because of activated agents, child/parentScheduler should not be able to complete yet @@ -72,11 +72,11 @@ class ScheduleLockIT // completing agent activations agent1.expectActivationAndComplete( childScheduler, - 30 + 30, ) agent2.expectActivationAndComplete( childScheduler, - 30 + 30, ) timeAdvancer.expectMessage(Completion(lockActivation)) @@ -96,7 +96,7 @@ class ScheduleLockIT // first, we normally schedule some activation childScheduler ! ScheduleActivation( agent.ref, - 30 + 30, ) val sa1 = timeAdvancer.expectMessageType[ScheduleActivation] sa1.tick shouldBe 30 @@ -112,7 +112,7 @@ class ScheduleLockIT // completing the agent activation agent.expectActivationAndComplete( childScheduler, - 30 + 30, ) // because of the lock, parentScheduler should not be able to complete yet @@ -122,7 +122,7 @@ class ScheduleLockIT childScheduler ! ScheduleActivation( agent.ref, 40, - Some(scheduleKey) + Some(scheduleKey), ) timeAdvancer.expectMessage(Completion(lockActivation, Some(40))) diff --git a/src/test/scala/edu/ie3/simona/scheduler/ScheduleLockSpec.scala b/src/test/scala/edu/ie3/simona/scheduler/ScheduleLockSpec.scala index e79a4c8c6e..b075c077dd 100644 --- a/src/test/scala/edu/ie3/simona/scheduler/ScheduleLockSpec.scala +++ b/src/test/scala/edu/ie3/simona/scheduler/ScheduleLockSpec.scala @@ -8,12 +8,12 @@ package edu.ie3.simona.scheduler import org.apache.pekko.actor.testkit.typed.scaladsl.{ ScalaTestWithActorTestKit, - TestProbe + TestProbe, } import edu.ie3.simona.ontology.messages.{Activation, SchedulerMessage} import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.test.common.TestSpawnerTyped import org.scalatest.matchers.should diff --git a/src/test/scala/edu/ie3/simona/scheduler/SchedulerSpec.scala b/src/test/scala/edu/ie3/simona/scheduler/SchedulerSpec.scala index 072fc80f32..5c610eb18d 100644 --- a/src/test/scala/edu/ie3/simona/scheduler/SchedulerSpec.scala +++ b/src/test/scala/edu/ie3/simona/scheduler/SchedulerSpec.scala @@ -8,11 +8,11 @@ package edu.ie3.simona.scheduler import org.apache.pekko.actor.testkit.typed.scaladsl.{ ScalaTestWithActorTestKit, - TestProbe + TestProbe, } import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.{Activation, SchedulerMessage} import edu.ie3.simona.scheduler.ScheduleLock.{LockMsg, ScheduleKey, Unlock} @@ -90,7 +90,7 @@ class SchedulerSpec scheduler ! ScheduleActivation( agent2.ref, - INIT_SIM_TICK + INIT_SIM_TICK, ) // activation is sent right away @@ -159,7 +159,7 @@ class SchedulerSpec scheduler ! ScheduleActivation( agent1.ref, - INIT_SIM_TICK + INIT_SIM_TICK, ) val sa1 = parent.expectMessageType[ScheduleActivation] @@ -168,7 +168,7 @@ class SchedulerSpec scheduler ! ScheduleActivation( agent2.ref, - INIT_SIM_TICK + INIT_SIM_TICK, ) // TICK -1 @@ -177,7 +177,7 @@ class SchedulerSpec agent1.expectActivationAndComplete( scheduler, INIT_SIM_TICK, - Some(0) + Some(0), ) parent.expectNoMessage() @@ -185,7 +185,7 @@ class SchedulerSpec agent2.expectActivationAndComplete( scheduler, INIT_SIM_TICK, - Some(0) + Some(0), ) parent.expectMessage(Completion(schedulerActivation, Some(0))) @@ -199,7 +199,7 @@ class SchedulerSpec agent1.expectActivationAndComplete( scheduler, 0, - Some(300) + Some(300), ) parent.expectNoMessage() @@ -207,7 +207,7 @@ class SchedulerSpec agent2.expectActivationAndComplete( scheduler, 0, - Some(900) + Some(900), ) parent.expectMessage(Completion(schedulerActivation, Some(300))) @@ -218,7 +218,7 @@ class SchedulerSpec agent1.expectActivationAndComplete( scheduler, 300, - Some(900) + Some(900), ) parent.expectMessage(Completion(schedulerActivation, Some(900))) @@ -232,7 +232,7 @@ class SchedulerSpec agent1.expectActivationAndComplete( scheduler, 900, - Some(3600) + Some(3600), ) parent.expectNoMessage() @@ -240,7 +240,7 @@ class SchedulerSpec agent2.expectActivationAndComplete( scheduler, 900, - Some(1800) + Some(1800), ) parent.expectMessage(Completion(schedulerActivation, Some(1800))) @@ -263,7 +263,7 @@ class SchedulerSpec // send to init activation to scheduler scheduler ! ScheduleActivation( actor.ref, - INIT_SIM_TICK + INIT_SIM_TICK, ) ) @@ -278,7 +278,7 @@ class SchedulerSpec _.expectActivationAndComplete( scheduler, tick, - Some(tick + 1) + Some(tick + 1), ) } @@ -310,7 +310,7 @@ class SchedulerSpec scheduler ! ScheduleActivation( agent2.ref, 120, - Some(ScheduleKey(lock.ref, key)) + Some(ScheduleKey(lock.ref, key)), ) // no new scheduling when active @@ -338,7 +338,7 @@ class SchedulerSpec scheduler ! ScheduleActivation( agent1.ref, 60, - Some(ScheduleKey(lock.ref, key)) + Some(ScheduleKey(lock.ref, key)), ) // no new scheduling for same tick @@ -367,7 +367,7 @@ class SchedulerSpec scheduler ! ScheduleActivation( agent1.ref, 59, - Some(ScheduleKey(lock.ref, key)) + Some(ScheduleKey(lock.ref, key)), ) // lock should not receive unlock message by scheduler @@ -378,7 +378,7 @@ class SchedulerSpec ScheduleActivation( schedulerActivation, 59, - Some(ScheduleKey(lock.ref, key)) + Some(ScheduleKey(lock.ref, key)), ) ) } @@ -432,7 +432,7 @@ class SchedulerSpec agent1.expectActivationAndComplete( scheduler, 900, - Some(1800) + Some(1800), ) parent.expectMessage(Completion(schedulerActivation, Some(1800))) @@ -553,7 +553,7 @@ class SchedulerSpec agent1.expectActivationAndComplete( scheduler, INIT_SIM_TICK, - Some(0) + Some(0), ) parent.expectMessage(Completion(schedulerActivation.ref, Some(0))) diff --git a/src/test/scala/edu/ie3/simona/scheduler/TimeAdvancerSpec.scala b/src/test/scala/edu/ie3/simona/scheduler/TimeAdvancerSpec.scala index d85cf910e5..3ad6cda04a 100644 --- a/src/test/scala/edu/ie3/simona/scheduler/TimeAdvancerSpec.scala +++ b/src/test/scala/edu/ie3/simona/scheduler/TimeAdvancerSpec.scala @@ -8,7 +8,7 @@ package edu.ie3.simona.scheduler import org.apache.pekko.actor.testkit.typed.scaladsl.{ ScalaTestWithActorTestKit, - TestProbe + TestProbe, } import org.apache.pekko.actor.typed.scaladsl.adapter.TypedActorRefOps import edu.ie3.simona.event.RuntimeEvent @@ -16,7 +16,7 @@ import edu.ie3.simona.event.RuntimeEvent._ import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.scheduler.TimeAdvancer.{StartSimMessage, Stop} import edu.ie3.simona.sim.SimMessage @@ -49,7 +49,7 @@ class TimeAdvancerSpec simulation.ref.toClassic, Some(listener.ref), Some(900), - 7200 + 7200, ) ) @@ -199,7 +199,7 @@ class TimeAdvancerSpec simulation.ref.toClassic, Some(listener.ref), Some(900), - 3600 + 3600, ) ) @@ -273,7 +273,7 @@ class TimeAdvancerSpec simulation.ref.toClassic, Some(listener.ref), Some(900), - 5400 + 5400, ) ) timeAdvancer ! ScheduleActivation(scheduler.ref, INIT_SIM_TICK) @@ -361,7 +361,7 @@ class TimeAdvancerSpec simulation.ref.toClassic, Some(listener.ref), Some(900), - 3600 + 3600, ) ) timeAdvancer ! ScheduleActivation(scheduler.ref, INIT_SIM_TICK) @@ -439,7 +439,7 @@ class TimeAdvancerSpec simulation.ref.toClassic, Some(listener.ref), Some(1800), - 3600 + 3600, ) ) timeAdvancer ! ScheduleActivation(scheduler.ref, 0) @@ -489,7 +489,7 @@ class TimeAdvancerSpec simulation.ref.toClassic, Some(listener.ref), Some(900), - 3600 + 3600, ) ) timeAdvancer ! ScheduleActivation(scheduler.ref, 0) @@ -549,7 +549,7 @@ class TimeAdvancerSpec simulation.ref.toClassic, Some(listener.ref), Some(1800), - 3600 + 3600, ) ) timeAdvancer ! ScheduleActivation(scheduler.ref, 0) @@ -599,7 +599,7 @@ class TimeAdvancerSpec simulation.ref.toClassic, Some(listener.ref), Some(900), - 1800 + 1800, ) ) timeAdvancer ! ScheduleActivation(scheduler.ref, 0) @@ -652,7 +652,7 @@ class TimeAdvancerSpec simulation.ref.toClassic, Some(listener.ref), Some(900), - 1800 + 1800, ) ) timeAdvancer ! ScheduleActivation(scheduler.ref, 0) @@ -739,7 +739,7 @@ class TimeAdvancerSpec simulation.ref.toClassic, Some(listener.ref), Some(900), - 1800 + 1800, ) ) timeAdvancer ! ScheduleActivation(scheduler.ref, 0) diff --git a/src/test/scala/edu/ie3/simona/service/ev/ExtEvDataServiceSpec.scala b/src/test/scala/edu/ie3/simona/service/ev/ExtEvDataServiceSpec.scala index 10a1be82c7..5eed45eb46 100644 --- a/src/test/scala/edu/ie3/simona/service/ev/ExtEvDataServiceSpec.scala +++ b/src/test/scala/edu/ie3/simona/service/ev/ExtEvDataServiceSpec.scala @@ -19,7 +19,7 @@ import edu.ie3.simona.model.participant.evcs.EvModelWrapper import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.services.EvMessage._ import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResponseMessage.RegistrationSuccessfulMessage @@ -29,7 +29,7 @@ import edu.ie3.simona.service.ev.ExtEvDataService.InitExtEvData import edu.ie3.simona.test.common.{ EvTestData, TestKitWithShutdown, - TestSpawnerClassic + TestSpawnerClassic, } import edu.ie3.simona.util.SimonaConstants.INIT_SIM_TICK import edu.ie3.util.quantities.PowerSystemUnits @@ -48,7 +48,7 @@ class ExtEvDataServiceSpec .parseString(""" |pekko.loggers = ["org.apache.pekko.testkit.TestEventListener"] |pekko.loglevel = "INFO" - |""".stripMargin) + |""".stripMargin), ) ) with AnyWordSpecLike @@ -61,7 +61,7 @@ class ExtEvDataServiceSpec private val extEvData = (dataService: ActorRef) => new ExtEvData( dataService, - extSimAdapter.ref + extSimAdapter.ref, ) private val evcs1UUID = @@ -79,7 +79,7 @@ class ExtEvDataServiceSpec scheduler.send( evService, - SimonaService.Create(InitExtEvData(extEvData(evService)), key) + SimonaService.Create(InitExtEvData(extEvData(evService)), key), ) scheduler.expectMsg( ScheduleActivation(evService.toTyped, INIT_SIM_TICK, Some(key)) @@ -106,7 +106,7 @@ class ExtEvDataServiceSpec scheduler.send( evService, - SimonaService.Create(InitExtEvData(extEvData(evService)), key) + SimonaService.Create(InitExtEvData(extEvData(evService)), key), ) scheduler.expectMsg( ScheduleActivation(evService.toTyped, INIT_SIM_TICK, Some(key)) @@ -130,7 +130,7 @@ class ExtEvDataServiceSpec scheduler.send( evService, - SimonaService.Create(InitExtEvData(extEvData(evService)), key) + SimonaService.Create(InitExtEvData(extEvData(evService)), key), ) scheduler.expectMsgType[ScheduleActivation] @@ -161,7 +161,7 @@ class ExtEvDataServiceSpec scheduler.send( evService, - SimonaService.Create(InitExtEvData(extEvData(evService)), key) + SimonaService.Create(InitExtEvData(extEvData(evService)), key), ) scheduler.expectMsg( ScheduleActivation(evService.toTyped, INIT_SIM_TICK, Some(key)) @@ -174,7 +174,7 @@ class ExtEvDataServiceSpec assertThrows[ServiceException] { evService.receive( Activation(0), - scheduler.ref + scheduler.ref, ) } @@ -192,7 +192,7 @@ class ExtEvDataServiceSpec scheduler.send( evService, - SimonaService.Create(InitExtEvData(extData), key) + SimonaService.Create(InitExtEvData(extData), key), ) scheduler.expectMsgType[ScheduleActivation] @@ -238,8 +238,8 @@ class ExtEvDataServiceSpec evService, FreeLotsResponse( evcs1UUID, - 2 - ) + 2, + ), ) // nothing should happen yet, waiting for second departed ev @@ -249,8 +249,8 @@ class ExtEvDataServiceSpec evService, FreeLotsResponse( evcs2UUID, - 0 - ) + 0, + ), ) // ev service should recognize that all evcs that are expected are returned, @@ -258,7 +258,7 @@ class ExtEvDataServiceSpec awaitCond( !extData.receiveTriggerQueue.isEmpty, max = 3.seconds, - message = "No message received" + message = "No message received", ) extData.receiveTriggerQueue.size() shouldBe 1 // only evcs 1 should be included, the other one is full @@ -278,7 +278,7 @@ class ExtEvDataServiceSpec scheduler.send( evService, - SimonaService.Create(InitExtEvData(extData), key) + SimonaService.Create(InitExtEvData(extData), key), ) scheduler.expectMsgType[ScheduleActivation] @@ -302,7 +302,7 @@ class ExtEvDataServiceSpec awaitCond( !extData.receiveTriggerQueue.isEmpty, max = 3.seconds, - message = "No message received" + message = "No message received", ) extData.receiveTriggerQueue.size() shouldBe 1 extData.receiveTriggerQueue.take() shouldBe new ProvideEvcsFreeLots() @@ -319,7 +319,7 @@ class ExtEvDataServiceSpec scheduler.send( evService, - SimonaService.Create(InitExtEvData(extData), key) + SimonaService.Create(InitExtEvData(extData), key), ) scheduler.expectMsgType[ScheduleActivation] @@ -337,7 +337,7 @@ class ExtEvDataServiceSpec val departures = Map( evcs1UUID -> List(evA.getUuid).asJava, - evcs2UUID -> List(evB.getUuid).asJava + evcs2UUID -> List(evB.getUuid).asJava, ).asJava extData.sendExtMsg( @@ -369,7 +369,7 @@ class ExtEvDataServiceSpec evcs1.send( evService, - DepartingEvsResponse(evcs1UUID, Seq(EvModelWrapper(updatedEvA))) + DepartingEvsResponse(evcs1UUID, Seq(EvModelWrapper(updatedEvA))), ) // nothing should happen yet, waiting for second departed ev @@ -381,7 +381,7 @@ class ExtEvDataServiceSpec evcs2.send( evService, - DepartingEvsResponse(evcs2UUID, Seq(EvModelWrapper(updatedEvB))) + DepartingEvsResponse(evcs2UUID, Seq(EvModelWrapper(updatedEvB))), ) // ev service should recognize that all evs that are expected are returned, @@ -389,7 +389,7 @@ class ExtEvDataServiceSpec awaitCond( !extData.receiveTriggerQueue.isEmpty, max = 3.seconds, - message = "No message received" + message = "No message received", ) extData.receiveTriggerQueue.size() shouldBe 1 extData.receiveTriggerQueue.take() shouldBe new ProvideDepartingEvs( @@ -408,7 +408,7 @@ class ExtEvDataServiceSpec scheduler.send( evService, - SimonaService.Create(InitExtEvData(extData), key) + SimonaService.Create(InitExtEvData(extData), key), ) scheduler.expectMsgType[ScheduleActivation] @@ -434,7 +434,7 @@ class ExtEvDataServiceSpec awaitCond( !extData.receiveTriggerQueue.isEmpty, max = 3.seconds, - message = "No message received" + message = "No message received", ) extData.receiveTriggerQueue.size() shouldBe 1 extData.receiveTriggerQueue.take() shouldBe new ProvideDepartingEvs( @@ -453,7 +453,7 @@ class ExtEvDataServiceSpec scheduler.send( evService, - SimonaService.Create(InitExtEvData(extData), key) + SimonaService.Create(InitExtEvData(extData), key), ) scheduler.expectMsgType[ScheduleActivation] @@ -471,7 +471,7 @@ class ExtEvDataServiceSpec val arrivals = Map( evcs1UUID -> List[EvModel](evA).asJava, - evcs2UUID -> List[EvModel](evB).asJava + evcs2UUID -> List[EvModel](evB).asJava, ).asJava extData.sendExtMsg( @@ -516,7 +516,7 @@ class ExtEvDataServiceSpec scheduler.send( evService, - SimonaService.Create(InitExtEvData(extData), key) + SimonaService.Create(InitExtEvData(extData), key), ) scheduler.expectMsgType[ScheduleActivation] @@ -530,7 +530,7 @@ class ExtEvDataServiceSpec val arrivals = Map( evcs1UUID -> List[EvModel](evA).asJava, - evcs2UUID -> List[EvModel](evB).asJava + evcs2UUID -> List[EvModel](evB).asJava, ).asJava extData.sendExtMsg( diff --git a/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceProxySpec.scala b/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceProxySpec.scala index 008cc0c1fc..43a64da1ce 100644 --- a/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceProxySpec.scala +++ b/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceProxySpec.scala @@ -20,34 +20,34 @@ import edu.ie3.datamodel.models.value.{SValue, Value} import edu.ie3.simona.config.SimonaConfig.PrimaryDataCsvParams import edu.ie3.simona.config.SimonaConfig.Simona.Input.Primary.{ CouchbaseParams, - InfluxDb1xParams + InfluxDb1xParams, } import edu.ie3.simona.config.SimonaConfig.Simona.Input.{ Primary => PrimaryConfig } import edu.ie3.simona.exceptions.{ InitializationException, - InvalidConfigParameterException + InvalidConfigParameterException, } import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResponseMessage.RegistrationFailedMessage import edu.ie3.simona.ontology.messages.services.ServiceMessage.{ PrimaryServiceRegistrationMessage, - WorkerRegistrationMessage + WorkerRegistrationMessage, } import edu.ie3.simona.service.SimonaService import edu.ie3.simona.service.primary.PrimaryServiceProxy.{ InitPrimaryServiceProxyStateData, PrimaryServiceStateData, - SourceRef + SourceRef, } import edu.ie3.simona.service.primary.PrimaryServiceWorker.{ CsvInitPrimaryServiceStateData, - InitPrimaryServiceStateData + InitPrimaryServiceStateData, } import edu.ie3.simona.test.common.input.TimeSeriesTestData import edu.ie3.simona.test.common.{AgentSpec, TestSpawnerClassic} @@ -71,7 +71,7 @@ class PrimaryServiceProxySpec .parseString(""" |pekko.loggers = ["org.apache.pekko.testkit.TestEventListener"] |pekko.loglevel="OFF" - """.stripMargin) + """.stripMargin), ) ) with TableDrivenPropertyChecks @@ -97,16 +97,16 @@ class PrimaryServiceProxySpec csvSep, baseDirectoryPath.toString, isHierarchic = false, - TimeUtil.withDefaults.getDtfPattern + TimeUtil.withDefaults.getDtfPattern, ) ), None, - None + None, ) val mappingSource = new CsvTimeSeriesMappingSource( csvSep, baseDirectoryPath, - fileNamingStrategy + fileNamingStrategy, ) val workerId: String = "PrimaryService_" + uuidPq val modelUuid: UUID = UUID.fromString("c7ebcc6c-55fc-479b-aa6b-6fa82ccac6b8") @@ -116,15 +116,15 @@ class PrimaryServiceProxySpec Map( UUID.fromString("b86e95b0-e579-4a80-a534-37c7a470a409") -> uuidP, modelUuid -> uuidPq, - UUID.fromString("90a96daa-012b-4fea-82dc-24ba7a7ab81c") -> uuidPq + UUID.fromString("90a96daa-012b-4fea-82dc-24ba7a7ab81c") -> uuidPq, ), Map( uuidP -> SourceRef(metaP, None), - uuidPq -> SourceRef(metaPq, None) + uuidPq -> SourceRef(metaPq, None), ), simulationStart, validPrimaryConfig, - mappingSource + mappingSource, ) private val scheduler: TestProbe = TestProbe("scheduler") @@ -135,7 +135,7 @@ class PrimaryServiceProxySpec Some(CouchbaseParams("", "", "", "", "", "", "")), Some(PrimaryDataCsvParams("", "", isHierarchic = false, "")), None, - None + None, ) val exception = intercept[InvalidConfigParameterException]( @@ -149,7 +149,7 @@ class PrimaryServiceProxySpec None, None, None, - None + None, ) val exception = intercept[InvalidConfigParameterException]( @@ -163,7 +163,7 @@ class PrimaryServiceProxySpec Some(CouchbaseParams("", "", "", "", "", "", "")), None, None, - None + None, ) val exception = intercept[InvalidConfigParameterException]( @@ -177,7 +177,7 @@ class PrimaryServiceProxySpec None, Some(PrimaryDataCsvParams("", "", isHierarchic = false, "")), None, - None + None, ) noException shouldBe thrownBy { @@ -190,7 +190,7 @@ class PrimaryServiceProxySpec None, None, Some(InfluxDb1xParams("", 0, "", "")), - None + None, ) val exception = intercept[InvalidConfigParameterException]( @@ -204,7 +204,7 @@ class PrimaryServiceProxySpec None, Some(PrimaryDataCsvParams("", "", isHierarchic = false, "xYz")), None, - None + None, ) intercept[InvalidConfigParameterException]( @@ -222,11 +222,11 @@ class PrimaryServiceProxySpec "", "", isHierarchic = false, - "yyyy-MM-dd'T'HH:mm'Z[UTC]'" + "yyyy-MM-dd'T'HH:mm'Z[UTC]'", ) ), None, - None + None, ) noException shouldBe thrownBy { @@ -238,7 +238,7 @@ class PrimaryServiceProxySpec val initStateData: InitPrimaryServiceProxyStateData = InitPrimaryServiceProxyStateData( validPrimaryConfig, - simulationStart + simulationStart, ) val proxyRef: TestActorRef[PrimaryServiceProxy] = TestActorRef( new PrimaryServiceProxy(scheduler.ref, initStateData, simulationStart) @@ -254,12 +254,12 @@ class PrimaryServiceProxySpec None, None, None, - None + None, ) proxy invokePrivate prepareStateData( maliciousConfig, - simulationStart + simulationStart, ) match { case Success(_) => fail("Building state data with missing config should fail") @@ -274,12 +274,12 @@ class PrimaryServiceProxySpec None, None, Some(InfluxDb1xParams("", -1, "", "")), - None + None, ) proxy invokePrivate prepareStateData( maliciousConfig, - simulationStart + simulationStart, ) match { case Success(_) => fail("Building state data with missing config should fail") @@ -292,7 +292,7 @@ class PrimaryServiceProxySpec "result in correct data" in { proxy invokePrivate prepareStateData( validPrimaryConfig, - simulationStart + simulationStart, ) match { case Success( PrimaryServiceStateData( @@ -300,13 +300,13 @@ class PrimaryServiceProxySpec timeSeriesToSourceRef, simulationStart, primaryConfig, - mappingSource + mappingSource, ) ) => modelToTimeSeries shouldBe Map( UUID.fromString("b86e95b0-e579-4a80-a534-37c7a470a409") -> uuidP, UUID.fromString("c7ebcc6c-55fc-479b-aa6b-6fa82ccac6b8") -> uuidPq, - UUID.fromString("90a96daa-012b-4fea-82dc-24ba7a7ab81c") -> uuidPq + UUID.fromString("90a96daa-012b-4fea-82dc-24ba7a7ab81c") -> uuidPq, ) timeSeriesToSourceRef.get(uuidP) match { case Some(SourceRef(metaInformation, worker)) => @@ -334,7 +334,7 @@ class PrimaryServiceProxySpec case Failure(failure) => fail( "Building state data with correct config should not fail, but failed with:", - failure + failure, ) } } @@ -363,7 +363,7 @@ class PrimaryServiceProxySpec val workerRef = proxy invokePrivate classToWorkerRef( testClass, - workerId + workerId, ) Objects.nonNull(workerRef) shouldBe true @@ -377,13 +377,13 @@ class PrimaryServiceProxySpec ) val metaInformation = new CsvIndividualTimeSeriesMetaInformation( metaPq, - Paths.get("its_pq_" + uuidPq) + Paths.get("its_pq_" + uuidPq), ) proxy invokePrivate toInitData( metaInformation, simulationStart, - validPrimaryConfig + validPrimaryConfig, ) match { case Success( CsvInitPrimaryServiceStateData( @@ -393,7 +393,7 @@ class PrimaryServiceProxySpec directoryPath, filePath, fileNamingStrategy, - timePattern + timePattern, ) ) => actualTimeSeriesUuid shouldBe uuidPq @@ -410,7 +410,7 @@ class PrimaryServiceProxySpec case Failure(exception) => fail( "Creation of init data failed, although it was meant to succeed.", - exception + exception, ) } } @@ -420,12 +420,12 @@ class PrimaryServiceProxySpec Some(CouchbaseParams("", "", "", "", "", "", "")), None, None, - None + None, ) proxy invokePrivate initializeWorker( metaPq, simulationStart, - maliciousPrimaryConfig + maliciousPrimaryConfig, ) match { case Failure(exception) => /* Check the exception */ @@ -459,11 +459,11 @@ class PrimaryServiceProxySpec new PrimaryServiceProxy( scheduler.ref, initStateData, - simulationStart + simulationStart, ) { override protected def classToWorkerRef[V <: Value]( valueClass: Class[V], - timeSeriesUuid: String + timeSeriesUuid: String, ): ActorRef = worker.ref // needs to be overwritten as to make it available to the private method tester @@ -471,19 +471,19 @@ class PrimaryServiceProxySpec override protected def initializeWorker( metaInformation: IndividualTimeSeriesMetaInformation, simulationStart: ZonedDateTime, - primaryConfig: PrimaryConfig + primaryConfig: PrimaryConfig, ): Try[ActorRef] = super.initializeWorker( metaInformation, simulationStart, - primaryConfig + primaryConfig, ) } ) val fakeProxy: PrimaryServiceProxy = fakeProxyRef.underlyingActor val metaInformation = new CsvIndividualTimeSeriesMetaInformation( metaPq, - Paths.get("its_pq_" + uuidPq) + Paths.get("its_pq_" + uuidPq), ) scheduler.expectNoMessage() @@ -491,7 +491,7 @@ class PrimaryServiceProxySpec fakeProxy invokePrivate initializeWorker( metaInformation, simulationStart, - validPrimaryConfig + validPrimaryConfig, ) match { case Success(workerRef) => /* Check, if expected init message has been sent */ @@ -506,9 +506,9 @@ class PrimaryServiceProxySpec directoryPath, filePath, fileNamingStrategy, - timePattern + timePattern, ), - _ + _, ) => actualTimeSeriesUuid shouldBe uuidPq actualSimulationStart shouldBe simulationStart @@ -530,7 +530,7 @@ class PrimaryServiceProxySpec case Failure(exception) => fail( "Spinning off a worker with correct input data should be successful, but failed with:", - exception + exception, ) } } @@ -544,7 +544,7 @@ class PrimaryServiceProxySpec proxy invokePrivate updateStateData( proxyStateData, UUID.fromString("394fd072-832c-4c36-869b-c574ee37afe1"), - self + self, ) } exception.getMessage shouldBe "Cannot update entry for time series '394fd072-832c-4c36-869b-c574ee37afe1', as it hasn't been part of it before." @@ -554,19 +554,19 @@ class PrimaryServiceProxySpec proxy invokePrivate updateStateData( proxyStateData, uuidPq, - self + self, ) match { case PrimaryServiceStateData( modelToTimeSeries, timeSeriesToSourceRef, simulationStart, primaryConfig, - mappingSource + mappingSource, ) => modelToTimeSeries shouldBe proxyStateData.modelToTimeSeries timeSeriesToSourceRef shouldBe Map( uuidP -> SourceRef(metaP, None), - uuidPq -> SourceRef(metaPq, Some(self)) + uuidPq -> SourceRef(metaPq, Some(self)), ) simulationStart shouldBe proxyStateData.simulationStart primaryConfig shouldBe proxyStateData.primaryConfig @@ -586,7 +586,7 @@ class PrimaryServiceProxySpec modelUuid, uuidPq, maliciousStateData, - self + self, ) expectMsg(RegistrationFailedMessage(proxyRef)) } @@ -602,7 +602,7 @@ class PrimaryServiceProxySpec modelUuid, uuidPq, adaptedStateData, - self + self, ) expectMsg(WorkerRegistrationMessage(self)) } @@ -613,7 +613,7 @@ class PrimaryServiceProxySpec Some(CouchbaseParams("", "", "", "", "", "", "")), None, None, - None + None, ) ) @@ -621,7 +621,7 @@ class PrimaryServiceProxySpec modelUuid, uuidPq, maliciousStateData, - self + self, ) expectMsg(RegistrationFailedMessage(proxyRef)) } @@ -634,12 +634,12 @@ class PrimaryServiceProxySpec new PrimaryServiceProxy( scheduler.ref, initStateData, - simulationStart + simulationStart, ) { override protected def initializeWorker( metaInformation: IndividualTimeSeriesMetaInformation, simulationStart: ZonedDateTime, - primaryConfig: PrimaryConfig + primaryConfig: PrimaryConfig, ): Try[ActorRef] = Success(worker.ref) // needs to be overwritten as to make it available to the private method tester @@ -648,13 +648,13 @@ class PrimaryServiceProxySpec modelUuid: UUID, timeSeriesUuid: UUID, stateData: PrimaryServiceStateData, - requestingActor: ActorRef + requestingActor: ActorRef, ): Unit = super.handleCoveredModel( modelUuid, timeSeriesUuid, stateData, - requestingActor + requestingActor, ) } ) @@ -664,7 +664,7 @@ class PrimaryServiceProxySpec modelUuid, uuidPq, proxyStateData, - self + self, ) worker.expectMsg(WorkerRegistrationMessage(self)) } @@ -688,12 +688,12 @@ class PrimaryServiceProxySpec new PrimaryServiceProxy( scheduler.ref, initStateData, - simulationStart + simulationStart, ) { override protected def initializeWorker( metaInformation: IndividualTimeSeriesMetaInformation, simulationStart: ZonedDateTime, - primaryConfig: PrimaryConfig + primaryConfig: PrimaryConfig, ): Try[ActorRef] = Success(worker.ref) } ) @@ -701,7 +701,7 @@ class PrimaryServiceProxySpec /* Initialize the fake proxy */ scheduler.send( fakeProxyRef, - Activation(INIT_SIM_TICK) + Activation(INIT_SIM_TICK), ) scheduler.expectMsg(Completion(fakeProxyRef.toTyped)) diff --git a/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceProxySqlIT.scala b/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceProxySqlIT.scala index 91d3ccb5a5..b451036391 100644 --- a/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceProxySqlIT.scala +++ b/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceProxySqlIT.scala @@ -9,7 +9,7 @@ package edu.ie3.simona.service.primary import org.apache.pekko.actor.ActorSystem import org.apache.pekko.actor.typed.scaladsl.adapter.{ ClassicActorRefOps, - TypedActorRefOps + TypedActorRefOps, } import org.apache.pekko.testkit.{TestActorRef, TestProbe} import com.dimafeng.testcontainers.{ForAllTestContainer, PostgreSQLContainer} @@ -19,12 +19,12 @@ import edu.ie3.simona.config.SimonaConfig.Simona.Input.Primary.SqlParams import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.services.ServiceMessage.PrimaryServiceRegistrationMessage import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResponseMessage.{ RegistrationFailedMessage, - RegistrationSuccessfulMessage + RegistrationSuccessfulMessage, } import edu.ie3.simona.service.primary.PrimaryServiceProxy.InitPrimaryServiceProxyStateData import edu.ie3.simona.test.common.{AgentSpec, TestSpawnerClassic} @@ -43,7 +43,7 @@ class PrimaryServiceProxySqlIT ConfigFactory .parseString(""" |pekko.loglevel="OFF" - """.stripMargin) + """.stripMargin), ) ) with ForAllTestContainer @@ -68,7 +68,7 @@ class PrimaryServiceProxySqlIT Iterable( "time_series_p.sql", "time_series_pqh.sql", - "time_series_mapping.sql" + "time_series_mapping.sql", ).foreach { file => val res = container.execInContainer("psql", "-Utest", "-f/home/" + file) res.getStderr shouldBe empty @@ -88,7 +88,7 @@ class PrimaryServiceProxySqlIT userName = container.username, password = container.password, schemaName = schemaName, - timePattern = "yyyy-MM-dd HH:mm:ss" + timePattern = "yyyy-MM-dd HH:mm:ss", ) private def createProxy(): TestActorRef[PrimaryServiceProxy] = { @@ -97,16 +97,16 @@ class PrimaryServiceProxySqlIT None, None, None, - sqlParams = Some(sqlParams) + sqlParams = Some(sqlParams), ), - simulationStart + simulationStart, ) TestActorRef( PrimaryServiceProxy.props( scheduler.ref, initData, - simulationStart + simulationStart, ) ) } @@ -132,7 +132,7 @@ class PrimaryServiceProxySqlIT proxyRef, PrimaryServiceRegistrationMessage( UUID.fromString("b86e95b0-e579-4a80-a534-37c7a470a409") - ) + ), ) scheduler.expectMsgType[ScheduleActivation] // lock activation scheduled @@ -144,7 +144,7 @@ class PrimaryServiceProxySqlIT val workerRef = initActivation.actor scheduler.send( workerRef.toClassic, - Activation(INIT_SIM_TICK) + Activation(INIT_SIM_TICK), ) scheduler.expectMsg(Completion(workerRef, Some(0))) @@ -166,7 +166,7 @@ class PrimaryServiceProxySqlIT proxyRef, PrimaryServiceRegistrationMessage( UUID.fromString("db958617-e49d-44d3-b546-5f7b62776afd") - ) + ), ) scheduler.expectNoMessage() diff --git a/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceWorkerSpec.scala b/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceWorkerSpec.scala index a185b1edf1..b54fa8a41f 100644 --- a/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceWorkerSpec.scala +++ b/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceWorkerSpec.scala @@ -19,7 +19,7 @@ import edu.ie3.simona.agent.participant.data.Data.PrimaryData.ActivePower import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResponseMessage.RegistrationSuccessfulMessage import edu.ie3.simona.ontology.messages.services.ServiceMessage.WorkerRegistrationMessage @@ -30,7 +30,7 @@ import edu.ie3.simona.service.primary.PrimaryServiceWorker.{ CsvInitPrimaryServiceStateData, InitPrimaryServiceStateData, PrimaryServiceInitializedStateData, - ProvidePrimaryDataMessage + ProvidePrimaryDataMessage, } import edu.ie3.simona.service.primary.PrimaryServiceWorkerSpec.WrongInitPrimaryServiceStateData import edu.ie3.simona.test.common.{AgentSpec, TestSpawnerClassic} @@ -54,7 +54,7 @@ class PrimaryServiceWorkerSpec ConfigFactory .parseString(""" |pekko.loglevel="OFF" - """.stripMargin) + """.stripMargin), ) ) with TimeSeriesTestData @@ -78,7 +78,7 @@ class PrimaryServiceWorkerSpec fileNamingStrategy = new FileNamingStrategy(), simulationStart = TimeUtil.withDefaults.toZonedDateTime("2020-01-01 00:00:00"), - timePattern = "yyyy-MM-dd'T'HH:mm:ss'Z'" + timePattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", ) private implicit val powerTolerance: squants.Power = Watts(0.1) @@ -90,7 +90,7 @@ class PrimaryServiceWorkerSpec TestActorRef( new PrimaryServiceWorker[PValue]( scheduler.ref, - classOf[PValue] + classOf[PValue], ) ) val service = serviceRef.underlyingActor @@ -114,7 +114,7 @@ class PrimaryServiceWorkerSpec directoryPath = baseDirectoryPath, filePath = Paths.get("its_pq_" + uuidPq), fileNamingStrategy = new FileNamingStrategy(), - timePattern = TimeUtil.withDefaults.getDtfPattern + timePattern = TimeUtil.withDefaults.getDtfPattern, ) service.init(maliciousInitData) match { case Failure(exception) => @@ -135,12 +135,12 @@ class PrimaryServiceWorkerSpec activationTicks, simulationStart, source, - subscribers + subscribers, ) => nextActivationTick shouldBe Some(0L) activationTicks.toVector shouldBe Vector( 900L, - 1800L + 1800L, ) // The first tick should already been popped simulationStart shouldBe validInitData.simulationStart source.getClass shouldBe classOf[CsvTimeSeriesSource[PValue]] @@ -160,7 +160,7 @@ class PrimaryServiceWorkerSpec scheduler.send( serviceRef, - SimonaService.Create(validInitData, key) + SimonaService.Create(validInitData, key), ) scheduler.expectMsg( ScheduleActivation(serviceRef.toTyped, INIT_SIM_TICK, Some(key)) @@ -204,16 +204,16 @@ class PrimaryServiceWorkerSpec uuidP, Paths.get("its_p_" + uuidP), classOf[PValue], - new TimeBasedSimpleValueFactory[PValue](classOf[PValue]) + new TimeBasedSimpleValueFactory[PValue](classOf[PValue]), ), - Vector(self) + Vector(self), ) "correctly distribute proper primary data" in { val announcePrimaryData = PrivateMethod[ ( PrimaryServiceInitializedStateData[PValue], - Option[Long] + Option[Long], ) ](Symbol("announcePrimaryData")) val tick = 0L @@ -223,7 +223,7 @@ class PrimaryServiceWorkerSpec service invokePrivate announcePrimaryData( tick, primaryData, - serviceStateData + serviceStateData, ) match { case (updatedStateData, maybeNextTick) => /* Check updated state data */ @@ -233,7 +233,7 @@ class PrimaryServiceWorkerSpec activationTicks, _, _, - _ + _, ) => nextActivationTick shouldBe Some(900L) activationTicks.size shouldBe 0 @@ -248,7 +248,7 @@ class PrimaryServiceWorkerSpec actualServiceRef, actualData, actualNextDataTick, - unlockKey + unlockKey, ) => actualTick shouldBe 0L actualServiceRef shouldBe serviceRef @@ -261,7 +261,7 @@ class PrimaryServiceWorkerSpec val processDataAndAnnounce = PrivateMethod[ ( PrimaryServiceInitializedStateData[PValue], - Option[Long] + Option[Long], ) ](Symbol("processDataAndAnnounce")) @@ -277,7 +277,7 @@ class PrimaryServiceWorkerSpec service invokePrivate processDataAndAnnounce( tick, maliciousValue, - stateData + stateData, ) match { case ( PrimaryServiceInitializedStateData( @@ -285,9 +285,9 @@ class PrimaryServiceWorkerSpec _, _, _, - _ + _, ), - maybeNextTick + maybeNextTick, ) => nextActivationTick shouldBe Some(900L) maybeNextTick shouldBe Some(900L) @@ -306,7 +306,7 @@ class PrimaryServiceWorkerSpec service invokePrivate processDataAndAnnounce( tick, value, - serviceStateData + serviceStateData, ) match { case (updatedStateData, _) => inside(updatedStateData) { @@ -315,7 +315,7 @@ class PrimaryServiceWorkerSpec activationTicks, _, _, - _ + _, ) => nextActivationTick shouldBe Some(900L) activationTicks.size shouldBe 0 @@ -328,7 +328,7 @@ class PrimaryServiceWorkerSpec tick, serviceRef, ActivePower(Kilowatts(50.0)), - Some(900L) + Some(900L), ) ) } @@ -353,7 +353,7 @@ class PrimaryServiceWorkerSpec actualServiceRef, data, nextDataTick, - unlockKey + unlockKey, ) => tick shouldBe 900L actualServiceRef shouldBe serviceRef @@ -372,14 +372,14 @@ class PrimaryServiceWorkerSpec object PrimaryServiceWorkerSpec { final case class WrongInitPrimaryServiceStateData( override val simulationStart: ZonedDateTime, - override val timeSeriesUuid: UUID + override val timeSeriesUuid: UUID, ) extends InitPrimaryServiceStateData object WrongInitPrimaryServiceStateData { def apply(): WrongInitPrimaryServiceStateData = new WrongInitPrimaryServiceStateData( ZonedDateTime.now(), - UUID.randomUUID() + UUID.randomUUID(), ) } } diff --git a/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceWorkerSqlIT.scala b/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceWorkerSqlIT.scala index fd79c2fc9d..f85def148c 100644 --- a/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceWorkerSqlIT.scala +++ b/src/test/scala/edu/ie3/simona/service/primary/PrimaryServiceWorkerSqlIT.scala @@ -15,13 +15,13 @@ import edu.ie3.datamodel.io.naming.DatabaseNamingStrategy import edu.ie3.datamodel.models.value.{HeatAndSValue, PValue} import edu.ie3.simona.agent.participant.data.Data.PrimaryData.{ ActivePower, - ApparentPowerAndHeat + ApparentPowerAndHeat, } import edu.ie3.simona.config.SimonaConfig.Simona.Input.Primary.SqlParams import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResponseMessage.RegistrationSuccessfulMessage import edu.ie3.simona.ontology.messages.services.ServiceMessage.WorkerRegistrationMessage @@ -29,7 +29,7 @@ import edu.ie3.simona.scheduler.ScheduleLock.ScheduleKey import edu.ie3.simona.service.SimonaService import edu.ie3.simona.service.primary.PrimaryServiceWorker.{ ProvidePrimaryDataMessage, - SqlInitPrimaryServiceStateData + SqlInitPrimaryServiceStateData, } import edu.ie3.simona.test.common.input.TimeSeriesTestData import edu.ie3.simona.test.common.{AgentSpec, TestSpawnerClassic} @@ -51,7 +51,7 @@ class PrimaryServiceWorkerSqlIT ConfigFactory .parseString(""" |pekko.loglevel="OFF" - """.stripMargin) + """.stripMargin), ) ) with ForAllTestContainer @@ -98,34 +98,34 @@ class PrimaryServiceWorkerSqlIT "uuid", "firstTick", "firstData", - "maybeNextTick" + "maybeNextTick", ), ( PrimaryServiceWorker.props( scheduler.ref, - classOf[HeatAndSValue] + classOf[HeatAndSValue], ), uuidPqh, 0L, ApparentPowerAndHeat( Kilowatts(1000.0), Kilovars(329.0), - Kilowatts(8000.0) + Kilowatts(8000.0), ), - Some(900L) + Some(900L), ), ( PrimaryServiceWorker.props( scheduler.ref, - classOf[PValue] + classOf[PValue], ), uuidP, 0L, ActivePower( Kilowatts(1000.0) ), - Some(900L) - ) + Some(900L), + ), ) forAll(cases) { @@ -134,7 +134,7 @@ class PrimaryServiceWorkerSqlIT uuid, firstTick, firstData, - maybeNextTick + maybeNextTick, ) => val serviceRef = TestActorRef(service) @@ -146,15 +146,15 @@ class PrimaryServiceWorkerSqlIT userName = container.username, password = container.password, schemaName = schemaName, - timePattern = "yyyy-MM-dd HH:mm:ss" + timePattern = "yyyy-MM-dd HH:mm:ss", ), - new DatabaseNamingStrategy() + new DatabaseNamingStrategy(), ) val key1 = ScheduleKey(lock.ref.toTyped, UUID.randomUUID()) scheduler.send( serviceRef, - SimonaService.Create(initData, key1) + SimonaService.Create(initData, key1), ) scheduler.expectMsg( ScheduleActivation(serviceRef.toTyped, INIT_SIM_TICK, Some(key1)) @@ -167,7 +167,7 @@ class PrimaryServiceWorkerSqlIT participant.send( serviceRef, - WorkerRegistrationMessage(participant.ref) + WorkerRegistrationMessage(participant.ref), ) participant.expectMsg( RegistrationSuccessfulMessage(serviceRef, Some(firstTick)) diff --git a/src/test/scala/edu/ie3/simona/service/weather/SampleWeatherSourceSpec.scala b/src/test/scala/edu/ie3/simona/service/weather/SampleWeatherSourceSpec.scala index 36ad06427c..0d61932603 100644 --- a/src/test/scala/edu/ie3/simona/service/weather/SampleWeatherSourceSpec.scala +++ b/src/test/scala/edu/ie3/simona/service/weather/SampleWeatherSourceSpec.scala @@ -10,7 +10,7 @@ import edu.ie3.datamodel.models.input.NodeInput import edu.ie3.simona.ontology.messages.services.WeatherMessage.WeatherData import edu.ie3.simona.service.weather.WeatherSource.{ AgentCoordinates, - WeightedCoordinates + WeightedCoordinates, } import edu.ie3.simona.test.common.UnitSpec import edu.ie3.simona.util.TickUtil._ @@ -40,12 +40,12 @@ class SampleWeatherSourceSpec "always return the queried coordinate itself as nearest coordinate" in { val queryCoordinate = AgentCoordinates( NodeInput.DEFAULT_GEO_POSITION.getY, - NodeInput.DEFAULT_GEO_POSITION.getX + NodeInput.DEFAULT_GEO_POSITION.getX, ) source.getWeightedCoordinates( queryCoordinate, - 4 + 4, ) match { case Success(WeightedCoordinates(weighting)) => weighting.corresponds( @@ -58,7 +58,7 @@ class SampleWeatherSourceSpec case Failure(exception) => fail( "Querying the nearest coordinates was supposed to pass.", - exception + exception, ) } } @@ -69,7 +69,7 @@ class SampleWeatherSourceSpec (0L, 86400L, (0L to 86400L by 3600L).toArray), (1L, 86400L, (3600L to 86400L by 3600L).toArray), (0L, 86399L, (0L to 82800L by 3600L).toArray), - (1L, 86399L, (3600L to 82800L by 3600L).toArray) + (1L, 86399L, (3600L to 82800L by 3600L).toArray), ) testData.forEvery { diff --git a/src/test/scala/edu/ie3/simona/service/weather/WeatherServiceSpec.scala b/src/test/scala/edu/ie3/simona/service/weather/WeatherServiceSpec.scala index 1f5c0ddc12..ea38f702cf 100644 --- a/src/test/scala/edu/ie3/simona/service/weather/WeatherServiceSpec.scala +++ b/src/test/scala/edu/ie3/simona/service/weather/WeatherServiceSpec.scala @@ -12,11 +12,11 @@ import edu.ie3.simona.config.SimonaConfig import edu.ie3.simona.ontology.messages.Activation import edu.ie3.simona.ontology.messages.SchedulerMessage.{ Completion, - ScheduleActivation + ScheduleActivation, } import edu.ie3.simona.ontology.messages.services.ServiceMessage.RegistrationResponseMessage.{ RegistrationFailedMessage, - RegistrationSuccessfulMessage + RegistrationSuccessfulMessage, } import edu.ie3.simona.ontology.messages.services.WeatherMessage._ import edu.ie3.simona.scheduler.ScheduleLock @@ -26,7 +26,7 @@ import edu.ie3.simona.service.weather.WeatherSource.AgentCoordinates import edu.ie3.simona.test.common.{ ConfigTestData, TestKitWithShutdown, - TestSpawnerClassic + TestSpawnerClassic, } import edu.ie3.simona.util.SimonaConstants.INIT_SIM_TICK import edu.ie3.util.TimeUtil @@ -37,7 +37,7 @@ import org.apache.pekko.testkit.{ EventFilter, ImplicitSender, TestActorRef, - TestProbe + TestProbe, } import org.scalatest.PrivateMethodTester import org.scalatest.wordspec.AnyWordSpecLike @@ -52,7 +52,7 @@ class WeatherServiceSpec .parseString(""" |pekko.loggers = ["org.apache.pekko.testkit.TestEventListener"] |pekko.loglevel = "INFO" - """.stripMargin) + """.stripMargin), ) ) with ImplicitSender @@ -105,7 +105,7 @@ class WeatherServiceSpec TimeUtil.withDefaults.toZonedDateTime( simonaConfig.simona.time.endDateTime ), - 4 + 4, ) ) @@ -121,8 +121,8 @@ class WeatherServiceSpec InitWeatherServiceStateData( simonaConfig.simona.input.weather.datasource ), - key - ) + key, + ), ) scheduler.expectMsg( ScheduleActivation(weatherActor.toTyped, INIT_SIM_TICK, Some(key)) @@ -137,12 +137,12 @@ class WeatherServiceSpec .error( pattern = "\\[.*] Unable to obtain necessary information to register for coordinate AgentCoordinates\\(180\\.5,90\\.5\\)\\.", - occurrences = 1 + occurrences = 1, ) .intercept { weatherActor ! RegisterForWeatherMessage( invalidCoordinate.latitude, - invalidCoordinate.longitude + invalidCoordinate.longitude, ) } @@ -153,7 +153,7 @@ class WeatherServiceSpec /* The successful registration stems from the test above */ weatherActor ! RegisterForWeatherMessage( validCoordinate.latitude, - validCoordinate.longitude + validCoordinate.longitude, ) expectMsg(RegistrationSuccessfulMessage(weatherActor.ref, Some(0L))) @@ -164,12 +164,12 @@ class WeatherServiceSpec EventFilter .warning( pattern = "Sending actor Actor\\[.*] is already registered", - occurrences = 1 + occurrences = 1, ) .intercept { weatherActor ! RegisterForWeatherMessage( validCoordinate.latitude, - validCoordinate.longitude + validCoordinate.longitude, ) } expectNoMessage() @@ -189,9 +189,9 @@ class WeatherServiceSpec WattsPerSquareMeter(0d), WattsPerSquareMeter(0d), Celsius(-2.3719999999999573), - MetersPerSecond(4.16474) + MetersPerSecond(4.16474), ), - Some(3600L) + Some(3600L), ) ) @@ -211,9 +211,9 @@ class WeatherServiceSpec WattsPerSquareMeter(0d), WattsPerSquareMeter(0d), Celsius(-2.5259999999999536), - MetersPerSecond(4.918092) + MetersPerSecond(4.918092), ), - None + None, ) ) } diff --git a/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceSpec.scala b/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceSpec.scala index 063e46d1f7..5490e26ea1 100644 --- a/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceSpec.scala +++ b/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceSpec.scala @@ -9,17 +9,17 @@ package edu.ie3.simona.service.weather import edu.ie3.datamodel.io.factory.timeseries.{ CosmoIdCoordinateFactory, IconIdCoordinateFactory, - IdCoordinateFactory + IdCoordinateFactory, } import edu.ie3.datamodel.io.source.IdCoordinateSource import edu.ie3.simona.exceptions.{ InvalidConfigParameterException, - ServiceException + ServiceException, } import edu.ie3.simona.ontology.messages.services.WeatherMessage import edu.ie3.simona.service.weather.WeatherSource.{ AgentCoordinates, - WeightedCoordinates + WeightedCoordinates, } import edu.ie3.simona.service.weather.WeatherSourceSpec._ import edu.ie3.simona.test.common.UnitSpec @@ -44,7 +44,7 @@ class WeatherSourceSpec extends UnitSpec { "issue a ServiceException, if there are not enough coordinates available" in { DummyWeatherSource.getNearestCoordinatesWithDistances( AgentCoordinates(coordinate0.getY, coordinate0.getX), - 9 + 9, ) match { case Failure(exception: ServiceException) => exception.getMessage shouldBe "There are not enough coordinates for averaging. Found 8 within the given distance of 400000 m but need 9. Please make sure that there are enough coordinates within the given distance." @@ -54,7 +54,7 @@ class WeatherSourceSpec extends UnitSpec { "issue a ServiceException, if there are not enough coordinates in max distance available" in { DummyWeatherSource.getNearestCoordinatesWithDistances( AgentCoordinates(coordinate0.getY, coordinate0.getX), - 9 + 9, ) match { case Failure(exception: ServiceException) => exception.getMessage shouldBe "There are not enough coordinates for averaging. Found 8 within the given distance of 400000 m but need 9. Please make sure that there are enough coordinates within the given distance." @@ -66,7 +66,7 @@ class WeatherSourceSpec extends UnitSpec { val agentCoordinates = AgentCoordinates(51.3, 7.3) DummyWeatherSource.getNearestCoordinatesWithDistances( agentCoordinates, - 4 + 4, ) match { case Failure(exception: ServiceException) => exception.getMessage shouldBe "The queried point shall be surrounded by 4 weather coordinates, which are in each quadrant. This is not the case." @@ -80,12 +80,12 @@ class WeatherSourceSpec extends UnitSpec { agentCoordinates.latitude, agentCoordinates.longitude, coordinate551525.getY, - coordinate551525.getX + coordinate551525.getX, ) DummyWeatherSource.getNearestCoordinatesWithDistances( agentCoordinates, - 4 + 4, ) match { case Success(coordinateDistances) => coordinateDistances.size shouldBe 1 @@ -95,14 +95,14 @@ class WeatherSourceSpec extends UnitSpec { coordinateDistance.getCoordinateB shouldBe coordinate551525 QuantityUtil.isEquivalentAbs( coordinateDistance.getDistance, - distance + distance, ) shouldBe true case None => fail("Somebody stole the first result >:-(") } case Failure(exception) => fail( "Determining the nearest coordinates was meant to succeed.", - exception + exception, ) } } @@ -113,25 +113,25 @@ class WeatherSourceSpec extends UnitSpec { val expectedCoordinateDistances = Vector( new CoordinateDistance( coordinate0, - coordinate67775 + coordinate67775, ), new CoordinateDistance( coordinate0, - coordinate551525 + coordinate551525, ), new CoordinateDistance( coordinate0, - coordinate531137 + coordinate531137, ), new CoordinateDistance( coordinate0, - coordinate278150 - ) + coordinate278150, + ), ) DummyWeatherSource.getNearestCoordinatesWithDistances( agentCoordinates, - 4 + 4, ) match { case Success(coordinateDistances) => coordinateDistances.size shouldBe 4 @@ -144,7 +144,7 @@ class WeatherSourceSpec extends UnitSpec { case Failure(exception) => fail( "Determining the nearest coordinates was meant to succeed.", - exception + exception, ) } } @@ -153,7 +153,7 @@ class WeatherSourceSpec extends UnitSpec { val coordinates = Vector( new CoordinateDistance( coordinate0, - coordinate67775 + coordinate67775, ) ) @@ -165,7 +165,7 @@ class WeatherSourceSpec extends UnitSpec { case Failure(exception) => fail( "Determining the weight of coordinates was meant to succeed.", - exception + exception, ) } } @@ -174,12 +174,12 @@ class WeatherSourceSpec extends UnitSpec { val coordinates = Vector( new CoordinateDistance( coordinate0, - coordinate0 + coordinate0, ), new CoordinateDistance( coordinate0, - coordinate0 - ) + coordinate0, + ), ) DummyWeatherSource.determineWeights(coordinates) match { @@ -198,26 +198,26 @@ class WeatherSourceSpec extends UnitSpec { val coordinates = Vector( new CoordinateDistance( coordinate0, - coordinate67775 + coordinate67775, ), new CoordinateDistance( coordinate0, - coordinate531137 + coordinate531137, ), new CoordinateDistance( coordinate0, - coordinate551525 + coordinate551525, ), new CoordinateDistance( coordinate0, - coordinate278150 - ) + coordinate278150, + ), ) val expectedWeights = Map( coordinate67775 -> 0.254626046882988, coordinate531137 -> 0.249222038996929, coordinate551525 -> 0.250659514620527, - coordinate278150 -> 0.245492399499556 + coordinate278150 -> 0.245492399499556, ) DummyWeatherSource.determineWeights(coordinates) match { @@ -230,7 +230,7 @@ class WeatherSourceSpec extends UnitSpec { case Failure(exception) => fail( "Determining the weight of coordinates was meant to succeed.", - exception + exception, ) } } @@ -239,7 +239,7 @@ class WeatherSourceSpec extends UnitSpec { /* Query more coordinates, than are apparent */ DummyWeatherSource.getWeightedCoordinates( AgentCoordinates(coordinate0.getY, coordinate0.getX), - 9 + 9, ) match { case Failure(exception: ServiceException) => exception.getMessage shouldBe "Determination of coordinate weights failed." @@ -255,18 +255,18 @@ class WeatherSourceSpec extends UnitSpec { DummyWeatherSource.getWeightedCoordinates( agentCoordinates, - 4 + 4, ) match { case Success(WeightedCoordinates(weighting)) => weighting.size shouldBe 1 weighting.getOrElse( coordinate551525, - fail("Expected coordinate wasn't found") + fail("Expected coordinate wasn't found"), ) shouldBe 1d case Failure(exception) => fail( "Determining the nearest weighted coordinates was meant to succeed.", - exception + exception, ) } } @@ -278,12 +278,12 @@ class WeatherSourceSpec extends UnitSpec { coordinate67775 -> 0.254626046882988, coordinate531137 -> 0.249222038996929, coordinate551525 -> 0.250659514620527, - coordinate278150 -> 0.245492399499556 + coordinate278150 -> 0.245492399499556, ) DummyWeatherSource.getWeightedCoordinates( agentCoordinates, - 4 + 4, ) match { case Success(WeightedCoordinates(weighting)) => weighting.corresponds(expectedWeighting) { @@ -295,7 +295,7 @@ class WeatherSourceSpec extends UnitSpec { case Failure(exception) => fail( "Determining the nearest weighted coordinates was meant to succeed.", - exception + exception, ) } } @@ -309,15 +309,15 @@ class WeatherSourceSpec extends UnitSpec { ( "", classOf[InvalidConfigParameterException], - "No grid model defined!" + "No grid model defined!", ), ("icon", classOf[IconIdCoordinateFactory], ""), ("cosmo", classOf[CosmoIdCoordinateFactory], ""), ( "else", classOf[InvalidConfigParameterException], - "Grid model 'else' is not supported!" - ) + "Grid model 'else' is not supported!", + ), ) forAll(cases) { (gridModel, expectedClass, failureMessage) => @@ -365,7 +365,7 @@ case object WeatherSourceSpec { */ override def getWeather( tick: Long, - weightedCoordinates: WeightedCoordinates + weightedCoordinates: WeightedCoordinates, ): WeatherMessage.WeatherData = throw new UnsupportedOperationException( "This is not supported by the dummy source." @@ -384,7 +384,7 @@ case object WeatherSourceSpec { */ override def getDataTicks( requestFrameStart: Long, - requestFrameEnd: Long + requestFrameEnd: Long, ): Array[Long] = throw new UnsupportedOperationException( "This is not supported by the dummy source." @@ -400,7 +400,7 @@ case object WeatherSourceSpec { 477295 -> coordinate477295, 537947 -> coordinate537947, 144112 -> coordinate144112, - 165125 -> coordinate165125 + 165125 -> coordinate165125, ) private val coordinateToId = idToCoordinate.map { case (key, value) => @@ -422,7 +422,7 @@ case object WeatherSourceSpec { def getClosestCoordinates( coordinate: Point, n: Int, - distance: ComparableQuantity[Length] + distance: ComparableQuantity[Length], ): util.List[CoordinateDistance] = { val points: Set[Point] = coordinateToId.keySet @@ -442,7 +442,7 @@ case object WeatherSourceSpec { override def getNearestCoordinates( coordinate: Point, - n: Int + n: Int, ): util.List[CoordinateDistance] = { calculateCoordinateDistances(coordinate, n, coordinateToId.keySet.asJava) } diff --git a/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceWrapperSpec.scala b/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceWrapperSpec.scala index a6fe3b9dab..96eb6df6ee 100644 --- a/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceWrapperSpec.scala +++ b/src/test/scala/edu/ie3/simona/service/weather/WeatherSourceWrapperSpec.scala @@ -9,18 +9,18 @@ package edu.ie3.simona.service.weather import edu.ie3.datamodel.io.factory.timeseries.IconTimeBasedWeatherValueFactory import edu.ie3.datamodel.io.source.{ IdCoordinateSource, - WeatherSource => PsdmWeatherSource + WeatherSource => PsdmWeatherSource, } import edu.ie3.datamodel.models.StandardUnits import edu.ie3.datamodel.models.timeseries.individual.{ IndividualTimeSeries, - TimeBasedValue + TimeBasedValue, } import edu.ie3.datamodel.models.value.WeatherValue import edu.ie3.simona.ontology.messages.services.WeatherMessage.WeatherData import edu.ie3.simona.service.weather.WeatherSource.{ EMPTY_WEATHER_DATA, - WeightedCoordinates + WeightedCoordinates, } import edu.ie3.simona.service.weather.WeatherSourceSpec.DummyIdCoordinateSource import edu.ie3.simona.service.weather.WeatherSourceWrapper.WeightSum @@ -55,7 +55,7 @@ class WeatherSourceWrapperSpec extends UnitSpec { classOf[IdCoordinateSource], classOf[Long], classOf[ComparableQuantity[Length]], - classOf[ZonedDateTime] + classOf[ZonedDateTime], ) actor.setAccessible(true) val source = actor.newInstance( @@ -63,7 +63,7 @@ class WeatherSourceWrapperSpec extends UnitSpec { DummyIdCoordinateSource, 360L, Quantities.getQuantity(10000, Units.METRE), - ZonedDateTime.now() + ZonedDateTime.now(), ) val date = ZonedDateTime.of(2021, 1, 15, 18, 0, 0, 0, ZoneId.of("UTC")) @@ -73,7 +73,7 @@ class WeatherSourceWrapperSpec extends UnitSpec { coordinate1a -> 0.25, coordinate1b -> 0.25, coordinate1c -> 0.25, - coordinate13 -> 0.25 + coordinate13 -> 0.25, ) ) val result = source.getWeather(date.toEpochSecond, weightedCoordinates) @@ -91,7 +91,7 @@ class WeatherSourceWrapperSpec extends UnitSpec { coordinate1a -> 0.25, coordinate1b -> 0.25, coordinate1c -> 0.25, - coordinate13NoTemp -> 0.25 + coordinate13NoTemp -> 0.25, ) ) val result = source.getWeather(date.toEpochSecond, weightedCoordinates) @@ -108,7 +108,7 @@ class WeatherSourceWrapperSpec extends UnitSpec { coordinate1a -> 0.25, coordinate1b -> 0.25, coordinate1c -> 0.25, - coordinateEmpty -> 0.25 + coordinateEmpty -> 0.25, ) ) val result = source.getWeather(date.toEpochSecond, weightedCoordinates) @@ -155,13 +155,13 @@ class WeatherSourceWrapperSpec extends UnitSpec { (0.5, 0.75, 291d, 10d), (12.3, 1.2, 293d, 12d), (25.0, 5.7, 290d, 9d), - (26.3, 1.7, 289d, 11d) + (26.3, 1.7, 289d, 11d), ) val weights = Seq( (0.1, 0.2, 0.3, 0.4), (0.25, 0.2, 0.25, 0.1), (0.3, 0.4, 0.15, 0.05), - (0.35, 0.2, 0.3, 0.45) + (0.35, 0.2, 0.3, 0.45), ) val (weightedWeather, weightSum) = @@ -182,13 +182,13 @@ class WeatherSourceWrapperSpec extends UnitSpec { (0.5, 0.75, 291d, 10d), (12.3, 1.2, 293d, 12d), (25.0, 5.7, 290d, 9d), - (26.3, 1.7, 289d, 11d) + (26.3, 1.7, 289d, 11d), ) val weights = Seq( (0.1, 0.2, 0d, 0.4), (0.25, 0.2, 0d, 0.1), (0.3, 0.4, 0d, 0.05), - (0.35, 0.2, 0d, 0.45) + (0.35, 0.2, 0d, 0.45), ) val (weightedWeather, weightSum) = @@ -205,13 +205,13 @@ class WeatherSourceWrapperSpec extends UnitSpec { (0.5, 0.75, 291d, 10d), (12.3, 1.2, 0d, 12d), (25.0, 5.7, 290d, 9d), - (26.3, 1.7, 289d, 11d) + (26.3, 1.7, 289d, 11d), ) val weights = Seq( (0.1, 0.2, 0.3, 0.4), (0.25, 0.2, 0d, 0.1), (0.3, 0.4, 0.15, 0.05), - (0.35, 0.2, 0.3, 0.45) + (0.35, 0.2, 0.3, 0.45), ) val (weightedWeather, weightSum) = @@ -228,7 +228,7 @@ class WeatherSourceWrapperSpec extends UnitSpec { WattsPerSquareMeter(1.0), WattsPerSquareMeter(1.0), Kelvin(1.0d), - MetersPerSecond(1.0d) + MetersPerSecond(1.0d), ) val weightSum = WeightSum(0.25, 0.5, 0.8, 1.0) @@ -256,7 +256,7 @@ object WeatherSourceWrapperSpec { case object DummyPsdmWeatherSource extends PsdmWeatherSource( DummyIdCoordinateSource, - new IconTimeBasedWeatherValueFactory() + new IconTimeBasedWeatherValueFactory(), ) { private val dummyValues = Map( @@ -266,7 +266,7 @@ object WeatherSourceWrapperSpec { Quantities.getQuantity(1d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(1d, StandardUnits.TEMPERATURE), Quantities.getQuantity(1d, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(1d, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(1d, StandardUnits.WIND_VELOCITY), ), coordinate1b -> new WeatherValue( coordinate1b, @@ -274,7 +274,7 @@ object WeatherSourceWrapperSpec { Quantities.getQuantity(1d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(1d, StandardUnits.TEMPERATURE), Quantities.getQuantity(1d, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(1d, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(1d, StandardUnits.WIND_VELOCITY), ), coordinate1c -> new WeatherValue( coordinate1c, @@ -282,7 +282,7 @@ object WeatherSourceWrapperSpec { Quantities.getQuantity(1d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(1d, StandardUnits.TEMPERATURE), Quantities.getQuantity(1d, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(1d, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(1d, StandardUnits.WIND_VELOCITY), ), coordinate1d -> new WeatherValue( coordinate1d, @@ -290,7 +290,7 @@ object WeatherSourceWrapperSpec { Quantities.getQuantity(1d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(1d, StandardUnits.TEMPERATURE), Quantities.getQuantity(1d, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(1d, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(1d, StandardUnits.WIND_VELOCITY), ), coordinate13 -> new WeatherValue( coordinate13, @@ -298,7 +298,7 @@ object WeatherSourceWrapperSpec { Quantities.getQuantity(13d, StandardUnits.SOLAR_IRRADIANCE), Quantities.getQuantity(13d, StandardUnits.TEMPERATURE), Quantities.getQuantity(13d, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(13d, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(13d, StandardUnits.WIND_VELOCITY), ), coordinate13NoTemp -> new WeatherValue( coordinate13NoTemp, @@ -306,7 +306,7 @@ object WeatherSourceWrapperSpec { Quantities.getQuantity(13d, StandardUnits.SOLAR_IRRADIANCE), null, Quantities.getQuantity(13d, StandardUnits.WIND_DIRECTION), - Quantities.getQuantity(13d, StandardUnits.WIND_VELOCITY) + Quantities.getQuantity(13d, StandardUnits.WIND_VELOCITY), ), coordinateEmpty -> new WeatherValue( coordinateEmpty, @@ -314,8 +314,8 @@ object WeatherSourceWrapperSpec { null, null, null, - null - ) + null, + ), ) override def getWeather( @@ -330,15 +330,15 @@ object WeatherSourceWrapperSpec { point, new IndividualTimeSeries[WeatherValue]( UUID.randomUUID(), - ticks.map(tick => new TimeBasedValue(tick, data)).toSet.asJava - ) + ticks.map(tick => new TimeBasedValue(tick, data)).toSet.asJava, + ), ) }.asJava } override def getWeather( timeInterval: ClosedInterval[ZonedDateTime], - coordinates: util.Collection[Point] + coordinates: util.Collection[Point], ): util.Map[Point, IndividualTimeSeries[WeatherValue]] = { val ticks = LazyList .iterate(timeInterval.getLower)(_.plusHours(1)) @@ -351,8 +351,8 @@ object WeatherSourceWrapperSpec { point, new IndividualTimeSeries[WeatherValue]( UUID.randomUUID(), - ticks.map(tick => new TimeBasedValue(tick, data)).toSet.asJava - ) + ticks.map(tick => new TimeBasedValue(tick, data)).toSet.asJava, + ), ) } .asJava @@ -360,7 +360,7 @@ object WeatherSourceWrapperSpec { override def getWeather( date: ZonedDateTime, - coordinate: Point + coordinate: Point, ): Optional[TimeBasedValue[WeatherValue]] = { dummyValues.get(coordinate) match { case Some(value) => Optional.of(new TimeBasedValue(date, value)) @@ -381,14 +381,14 @@ object WeatherSourceWrapperSpec { */ private def prepareWeightTestData( weatherSeq: Seq[(Double, Double, Double, Double)], - weights: Seq[(Double, Double, Double, Double)] + weights: Seq[(Double, Double, Double, Double)], ): (WeatherData, WeightSum) = { val weatherData = weatherSeq.map { case (diff, dir, temp, wVel) => WeatherData( WattsPerSquareMeter(diff), WattsPerSquareMeter(dir), Kelvin(temp), - MetersPerSecond(wVel) + MetersPerSecond(wVel), ) } @@ -398,14 +398,14 @@ object WeatherSourceWrapperSpec { currentSum, ( WeatherData(diffIrr, dirIrr, temp, windVel), - (diffWeight, dirWeight, tempWeight, wVelWeight) - ) + (diffWeight, dirWeight, tempWeight, wVelWeight), + ), ) => currentSum.copy( diffIrr = currentSum.diffIrr + (diffIrr * diffWeight), dirIrr = currentSum.dirIrr + (dirIrr * dirWeight), temp = currentSum.temp + temp * tempWeight, - windVel = currentSum.windVel + windVel * wVelWeight + windVel = currentSum.windVel + windVel * wVelWeight, ) } val weightSum = weights.foldLeft(WeightSum.EMPTY_WEIGHT_SUM) { @@ -414,7 +414,7 @@ object WeatherSourceWrapperSpec { currentWeight._1, currentWeight._2, currentWeight._3, - currentWeight._4 + currentWeight._4, ) } diff --git a/src/test/scala/edu/ie3/simona/sim/SimonaSimFailSpec.scala b/src/test/scala/edu/ie3/simona/sim/SimonaSimFailSpec.scala index 27c6c80fae..e9ad87efff 100644 --- a/src/test/scala/edu/ie3/simona/sim/SimonaSimFailSpec.scala +++ b/src/test/scala/edu/ie3/simona/sim/SimonaSimFailSpec.scala @@ -8,14 +8,14 @@ package edu.ie3.simona.sim import org.apache.pekko.actor.typed.scaladsl.adapter.{ ClassicActorRefOps, - ClassicActorSystemOps + ClassicActorSystemOps, } import org.apache.pekko.actor.{ Actor, ActorContext, ActorRef, ActorSystem, - Props + Props, } import org.apache.pekko.testkit.{TestActorRef, TestProbe} import com.typesafe.config.ConfigFactory @@ -36,7 +36,7 @@ class SimonaSimFailSpec .parseString(""" |pekko.loggers = ["org.apache.pekko.testkit.TestEventListener"] |pekko.loglevel="OFF" - """.stripMargin) + """.stripMargin), ) ) { "A SimonaSim" should { @@ -48,9 +48,9 @@ class SimonaSimFailSpec Props( new FailSim( system, - timeAdvancer.ref.toTyped + timeAdvancer.ref.toTyped, ) - ) + ), ) /* Init the simulation */ @@ -70,11 +70,11 @@ class SimonaSimFailSpec object SimonaSimFailSpec { class FailSim( actorSystem: ActorSystem, - timeAdvancer: org.apache.pekko.actor.typed.ActorRef[TimeAdvancer.Incoming] + timeAdvancer: org.apache.pekko.actor.typed.ActorRef[TimeAdvancer.Incoming], ) extends SimonaSim( new DummySetup( actorSystem, - timeAdvancer + timeAdvancer, ) ) { val child: ActorRef = context.actorOf(Props(new Loser)) @@ -94,7 +94,7 @@ object SimonaSimFailSpec { timeAdvancer: org.apache.pekko.actor.typed.ActorRef[ TimeAdvancer.Incoming ], - override val args: Array[String] = Array.empty[String] + override val args: Array[String] = Array.empty[String], ) extends SimonaSetup { override val buildActorSystem: () => ActorSystem = () => actorSystem @@ -112,13 +112,13 @@ object SimonaSimFailSpec { override def primaryServiceProxy( context: ActorContext, - scheduler: ActorRef + scheduler: ActorRef, ): ActorRef = TestProbe("primaryService")(actorSystem).ref override def weatherService( context: ActorContext, - scheduler: ActorRef + scheduler: ActorRef, ): ActorRef = TestProbe("weatherService")(actorSystem).ref @@ -127,7 +127,7 @@ object SimonaSimFailSpec { simulation: ActorRef, runtimeEventListener: org.apache.pekko.actor.typed.ActorRef[ RuntimeEvent - ] + ], ): org.apache.pekko.actor.typed.ActorRef[TimeAdvancer.Incoming] = timeAdvancer @@ -135,18 +135,18 @@ object SimonaSimFailSpec { context: ActorContext, timeAdvancer: org.apache.pekko.actor.typed.ActorRef[ TimeAdvancer.Incoming - ] + ], ): ActorRef = TestProbe("scheduler")(actorSystem).ref override def gridAgents( context: ActorContext, environmentRefs: EnvironmentRefs, - systemParticipantListener: Seq[ActorRef] + systemParticipantListener: Seq[ActorRef], ): Iterable[ActorRef] = Iterable.empty override def extSimulations( context: ActorContext, - scheduler: ActorRef + scheduler: ActorRef, ): ExtSimSetupData = ExtSimSetupData(Iterable.empty, Map.empty) } diff --git a/src/test/scala/edu/ie3/simona/sim/setup/SetupHelperSpec.scala b/src/test/scala/edu/ie3/simona/sim/setup/SetupHelperSpec.scala index 93ae23d06b..d0bbcf39b3 100644 --- a/src/test/scala/edu/ie3/simona/sim/setup/SetupHelperSpec.scala +++ b/src/test/scala/edu/ie3/simona/sim/setup/SetupHelperSpec.scala @@ -13,11 +13,11 @@ import org.apache.pekko.testkit.TestException import edu.ie3.datamodel.models.input.MeasurementUnitInput import edu.ie3.datamodel.models.input.connector.{ Transformer2WInput, - Transformer3WInput + Transformer3WInput, } import edu.ie3.datamodel.models.input.container.{ JointGridContainer, - RawGridElements + RawGridElements, } import edu.ie3.simona.test.common.UnitSpec import edu.ie3.simona.test.common.input.GridInputTestData @@ -42,7 +42,7 @@ class SetupHelperSpec extends UnitSpec with GridInputTestData { adaptedTransformerInputModel.getParallelDevices, adaptedTransformerInputModel.getType, adaptedTransformerInputModel.getTapPos, - adaptedTransformerInputModel.isAutoTap + adaptedTransformerInputModel.isAutoTap, ) val adaptedTransformers = transformers + secondTransformer @@ -52,14 +52,14 @@ class SetupHelperSpec extends UnitSpec with GridInputTestData { adaptedTransformers.asJava, Set.empty[Transformer3WInput].asJava, switches.asJava, - Set.empty[MeasurementUnitInput].asJava + Set.empty[MeasurementUnitInput].asJava, ) val gridModel = new JointGridContainer( "TestGrid", rawGridElements, validTestGridInputModel.getSystemParticipants, - validTestGridInputModel.getGraphics + validTestGridInputModel.getGraphics, ) val subGrids = gridModel.getSubGridTopologyGraph @@ -73,13 +73,13 @@ class SetupHelperSpec extends UnitSpec with GridInputTestData { val superiorGrid = subGrids .getOrElse( 1, - throw TestException("Cannot get subGrid with id 1 from test data!") + throw TestException("Cannot get subGrid with id 1 from test data!"), ) val inferiorGrid = subGrids .getOrElse( 100, - throw TestException("Cannot get subGrid with id 100 from test data!") + throw TestException("Cannot get subGrid with id 100 from test data!"), ) val subGridToActorRefMap = @@ -102,14 +102,14 @@ class SetupHelperSpec extends UnitSpec with GridInputTestData { .buildGateToActorRef( subGridToActorRefMap, subGridGates, - superiorGrid.getSubnet + superiorGrid.getSubnet, ) .size shouldBe 1 SetupHelperInstance .buildGateToActorRef( subGridToActorRefMap, subGridGates, - inferiorGrid.getSubnet + inferiorGrid.getSubnet, ) .size shouldBe 1 diff --git a/src/test/scala/edu/ie3/simona/sim/setup/SimonaSetupSpec.scala b/src/test/scala/edu/ie3/simona/sim/setup/SimonaSetupSpec.scala index 26b6246e42..671ebad4e9 100644 --- a/src/test/scala/edu/ie3/simona/sim/setup/SimonaSetupSpec.scala +++ b/src/test/scala/edu/ie3/simona/sim/setup/SimonaSetupSpec.scala @@ -10,7 +10,7 @@ import org.apache.pekko.actor.{ActorContext, ActorRef, ActorSystem} import edu.ie3.datamodel.exceptions.NotImplementedException import edu.ie3.datamodel.models.input.connector.{ ConnectorPort, - Transformer3WInput + Transformer3WInput, } import edu.ie3.simona.agent.EnvironmentRefs import edu.ie3.simona.event.RuntimeEvent @@ -38,38 +38,38 @@ class SimonaSetupSpec extends UnitSpec with SimonaSetup with SubGridGateMokka { override def primaryServiceProxy( context: ActorContext, - scheduler: ActorRef + scheduler: ActorRef, ): ActorRef = throw new NotImplementedException("This is a dummy setup") override def weatherService( context: ActorContext, - scheduler: ActorRef + scheduler: ActorRef, ): ActorRef = throw new NotImplementedException("This is a dummy setup") override def extSimulations( context: ActorContext, - scheduler: ActorRef + scheduler: ActorRef, ): ExtSimSetupData = throw new NotImplementedException("This is a dummy setup") override def timeAdvancer( context: ActorContext, simulation: ActorRef, - runtimeEventListener: org.apache.pekko.actor.typed.ActorRef[RuntimeEvent] + runtimeEventListener: org.apache.pekko.actor.typed.ActorRef[RuntimeEvent], ): org.apache.pekko.actor.typed.ActorRef[TimeAdvancer.Incoming] = throw new NotImplementedException("This is a dummy setup") override def scheduler( context: ActorContext, - timeAdvancer: org.apache.pekko.actor.typed.ActorRef[TimeAdvancer.Incoming] + timeAdvancer: org.apache.pekko.actor.typed.ActorRef[TimeAdvancer.Incoming], ): ActorRef = throw new NotImplementedException("This is a dummy setup") override def gridAgents( context: ActorContext, environmentRefs: EnvironmentRefs, - systemParticipantListener: Seq[ActorRef] + systemParticipantListener: Seq[ActorRef], ): Iterable[ActorRef] = throw new NotImplementedException("This is a dummy setup") @@ -94,7 +94,7 @@ class SimonaSetupSpec extends UnitSpec with SimonaSetup with SubGridGateMokka { 2, nodeCUuid, 3, - ConnectorPort.C + ConnectorPort.C, ) val internalNode = subGridGate.link match { case input: Transformer3WInput => input.getNodeInternal diff --git a/src/test/scala/edu/ie3/simona/test/KafkaSpecLike.scala b/src/test/scala/edu/ie3/simona/test/KafkaSpecLike.scala index d228185517..15962057cf 100644 --- a/src/test/scala/edu/ie3/simona/test/KafkaSpecLike.scala +++ b/src/test/scala/edu/ie3/simona/test/KafkaSpecLike.scala @@ -38,7 +38,7 @@ trait KafkaSpecLike extends BeforeAndAfterAll { new NewTopic( topic.name, topic.partitions, - topic.replicationFactor + topic.replicationFactor, ) }.asJava ) @@ -58,6 +58,6 @@ object KafkaSpecLike { final case class Topic( name: String, partitions: Int, - replicationFactor: Short + replicationFactor: Short, ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/DefaultTestData.scala b/src/test/scala/edu/ie3/simona/test/common/DefaultTestData.scala index 4334c91c59..f989f9082b 100644 --- a/src/test/scala/edu/ie3/simona/test/common/DefaultTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/DefaultTestData.scala @@ -46,7 +46,7 @@ trait DefaultTestData { SystemComponent.determineOperationInterval( defaultSimulationStart, defaultSimulationEnd, - defaultOperationTime + defaultOperationTime, ) // default Lat/Long @@ -60,7 +60,7 @@ trait DefaultTestData { protected val default400Kva10KvRefSystem: RefSystem = RefSystem( Kilowatts(400d), - Kilovolts(10d) + Kilovolts(10d), ) /** Creates a [[SimonaConfig]], that provides the desired participant model @@ -75,7 +75,7 @@ trait DefaultTestData { */ def createSimonaConfig( modelBehaviour: LoadModelBehaviour.Value, - reference: LoadReference + reference: LoadReference, ): SimonaConfig = { val typesafeConfig: Config = ConfigFactory.parseString( s""" diff --git a/src/test/scala/edu/ie3/simona/test/common/EvTestData.scala b/src/test/scala/edu/ie3/simona/test/common/EvTestData.scala index a339890968..ca77f35553 100644 --- a/src/test/scala/edu/ie3/simona/test/common/EvTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/EvTestData.scala @@ -19,7 +19,7 @@ trait EvTestData { Quantities.getQuantity(11d, PowerSystemUnits.KILOWATT), Quantities.getQuantity(11d, PowerSystemUnits.KILOWATT), Quantities.getQuantity(58d, PowerSystemUnits.KILOWATTHOUR), - 200 + 200, ) protected val evB: MockEvModel = new MockEvModel( UUID.fromString("6d7d27a1-5cbb-4b73-aecb-dfcc5a6fb22e"), @@ -27,6 +27,6 @@ trait EvTestData { Quantities.getQuantity(11d, PowerSystemUnits.KILOWATT), Quantities.getQuantity(11d, PowerSystemUnits.KILOWATT), Quantities.getQuantity(80d, PowerSystemUnits.KILOWATTHOUR), - 200 + 200, ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/SilentTestEventListener.scala b/src/test/scala/edu/ie3/simona/test/common/SilentTestEventListener.scala index f3acaeeddd..0c960b230c 100644 --- a/src/test/scala/edu/ie3/simona/test/common/SilentTestEventListener.scala +++ b/src/test/scala/edu/ie3/simona/test/common/SilentTestEventListener.scala @@ -28,7 +28,7 @@ class SilentTestEventListener extends TestEventListener with LazyLogging { Warning( simpleName(this), this.getClass, - "received unexpected event of class " + e.getClass + ": " + e + "received unexpected event of class " + e.getClass + ": " + e, ) ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/ThreeWindingTestData.scala b/src/test/scala/edu/ie3/simona/test/common/ThreeWindingTestData.scala index 075ad05670..ad497696ba 100644 --- a/src/test/scala/edu/ie3/simona/test/common/ThreeWindingTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/ThreeWindingTestData.scala @@ -12,16 +12,16 @@ import edu.ie3.datamodel.models.input.connector.{ LineInput, SwitchInput, Transformer2WInput, - Transformer3WInput + Transformer3WInput, } import edu.ie3.datamodel.models.input.container.{ JointGridContainer, - RawGridElements + RawGridElements, } import edu.ie3.datamodel.models.input.{ MeasurementUnitInput, NodeInput, - OperatorInput + OperatorInput, } import edu.ie3.datamodel.models.voltagelevels.GermanVoltageLevelUtils import edu.ie3.simona.util.TestGridFactory @@ -44,7 +44,7 @@ trait ThreeWindingTestData extends DefaultTestData { true, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.EHV_380KV, - 1 + 1, ) private val nodeB = new NodeInput( UUID.fromString("3d4c66a3-dc11-4ec8-857a-53d77beb15ee"), @@ -55,7 +55,7 @@ trait ThreeWindingTestData extends DefaultTestData { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.HV, - 2 + 2, ) private val nodeC = new NodeInput( UUID.fromString("a865a429-615e-44be-9d00-d384298986f6"), @@ -66,7 +66,7 @@ trait ThreeWindingTestData extends DefaultTestData { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.MV_10KV, - 3 + 3, ) private val transformerType = new Transformer3WTypeInput( @@ -90,7 +90,7 @@ trait ThreeWindingTestData extends DefaultTestData { Quantities.getQuantity(0d, DEGREE_GEOM), 0, -10, - 10 + 10, ) private val transformer = new Transformer3WInput( @@ -104,7 +104,7 @@ trait ThreeWindingTestData extends DefaultTestData { 1, transformerType, 0, - true + true, ) protected val threeWindingTestGrid: JointGridContainer = { @@ -114,11 +114,11 @@ trait ThreeWindingTestData extends DefaultTestData { Set.empty[Transformer2WInput].asJava, Set(transformer).asJava, Set.empty[SwitchInput].asJava, - Set.empty[MeasurementUnitInput].asJava + Set.empty[MeasurementUnitInput].asJava, ) TestGridFactory.createJointGrid( gridName = "threeWindingTestGrid", - rawGridElements = rawGridElements + rawGridElements = rawGridElements, ) } } diff --git a/src/test/scala/edu/ie3/simona/test/common/input/CylindricalStorageInputTestData.scala b/src/test/scala/edu/ie3/simona/test/common/input/CylindricalStorageInputTestData.scala index a1483310a5..b7c0f678ce 100644 --- a/src/test/scala/edu/ie3/simona/test/common/input/CylindricalStorageInputTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/input/CylindricalStorageInputTestData.scala @@ -11,7 +11,7 @@ import java.util.UUID import edu.ie3.datamodel.models.StandardUnits import edu.ie3.datamodel.models.input.thermal.{ CylindricalStorageInput, - ThermalBusInput + ThermalBusInput, } import tech.units.indriya.quantity.Quantities.getQuantity @@ -25,6 +25,6 @@ trait CylindricalStorageInputTestData { getQuantity(20, StandardUnits.VOLUME), getQuantity(30, StandardUnits.TEMPERATURE), getQuantity(40, StandardUnits.TEMPERATURE), - getQuantity(1.15, StandardUnits.SPECIFIC_HEAT_CAPACITY) + getQuantity(1.15, StandardUnits.SPECIFIC_HEAT_CAPACITY), ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/input/EvcsInputTestData.scala b/src/test/scala/edu/ie3/simona/test/common/input/EvcsInputTestData.scala index 4100d2041d..1ed1312d92 100644 --- a/src/test/scala/edu/ie3/simona/test/common/input/EvcsInputTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/input/EvcsInputTestData.scala @@ -30,7 +30,7 @@ trait EvcsInputTestData extends DefaultTestData with NodeInputTestData { 2, 0.95, EvcsLocationType.HOME, - true + true, ) protected val evcsStandardModel: EvcsModel = EvcsModel( @@ -39,7 +39,7 @@ trait EvcsInputTestData extends DefaultTestData with NodeInputTestData { defaultSimulationStart, defaultSimulationEnd, "maxPower", - lowestEvSoc = 0.2 + lowestEvSoc = 0.2, ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/input/FixedFeedInputTestData.scala b/src/test/scala/edu/ie3/simona/test/common/input/FixedFeedInputTestData.scala index 7fc9e2d6f3..6c86b34869 100644 --- a/src/test/scala/edu/ie3/simona/test/common/input/FixedFeedInputTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/input/FixedFeedInputTestData.scala @@ -30,6 +30,6 @@ trait FixedFeedInputTestData extends NodeInputTestData { nodeInputNoSlackNs04KvA, new CosPhiFixed("cosPhiFixed:{(0.0,0.95)}"), Quantities.getQuantity(282.74d, VOLTAMPERE), - 0.95 + 0.95, ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/input/GridInputTestData.scala b/src/test/scala/edu/ie3/simona/test/common/input/GridInputTestData.scala index 5095730cba..d9cdbb2681 100644 --- a/src/test/scala/edu/ie3/simona/test/common/input/GridInputTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/input/GridInputTestData.scala @@ -10,16 +10,16 @@ import edu.ie3.datamodel.models.input.connector.{ LineInput, SwitchInput, Transformer2WInput, - Transformer3WInput + Transformer3WInput, } import edu.ie3.datamodel.models.input.container.{ RawGridElements, - SubGridContainer + SubGridContainer, } import edu.ie3.datamodel.models.input.{MeasurementUnitInput, NodeInput} import edu.ie3.datamodel.models.voltagelevels.GermanVoltageLevelUtils.{ HV, - MV_10KV + MV_10KV, } import edu.ie3.simona.model.grid.RefSystem import edu.ie3.simona.test.common.DefaultTestData @@ -90,7 +90,7 @@ trait GridInputTestData inputNode15, inputNode16, inputNode17, - inputNode18 + inputNode18, ) // create the lines @@ -120,7 +120,7 @@ trait GridInputTestData line1_13, line14_2, line0_15, - line16_3 + line16_3, ) // create the switches @@ -144,7 +144,7 @@ trait GridInputTestData transformerInput.getParallelDevices, transformerInput.getType, transformerInput.getTapPos, - transformerInput.isAutoTap + transformerInput.isAutoTap, ) val transformers: Set[Transformer2WInput] = Set(adaptedTransformerInputModel) @@ -163,7 +163,7 @@ trait GridInputTestData transformers.asJava, Set.empty[Transformer3WInput].asJava, switches.asJava, - Set.empty[MeasurementUnitInput].asJava + Set.empty[MeasurementUnitInput].asJava, ) TestGridFactory.createSubGrid( rawGridElements = rawGridElements diff --git a/src/test/scala/edu/ie3/simona/test/common/input/LineInputTestData.scala b/src/test/scala/edu/ie3/simona/test/common/input/LineInputTestData.scala index 621516d2a7..cd011673f3 100644 --- a/src/test/scala/edu/ie3/simona/test/common/input/LineInputTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/input/LineInputTestData.scala @@ -18,7 +18,7 @@ import edu.ie3.util.quantities.PowerSystemUnits.{ KILOMETRE, KILOVOLT, OHM_PER_KILOMETRE, - SIEMENS_PER_KILOMETRE + SIEMENS_PER_KILOMETRE, } import tech.units.indriya.quantity.Quantities import tech.units.indriya.unit.Units.AMPERE @@ -40,7 +40,7 @@ trait LineInputTestData extends DefaultTestData with NodeInputTestData { Quantities.getQuantity(0.437, OHM_PER_KILOMETRE), Quantities.getQuantity(0.356, OHM_PER_KILOMETRE), Quantities.getQuantity(300d, AMPERE), - Quantities.getQuantity(10, KILOVOLT) + Quantities.getQuantity(10, KILOVOLT), ) // / 10 kV line models @@ -56,9 +56,9 @@ trait LineInputTestData extends DefaultTestData with NodeInputTestData { Quantities.getQuantity(0.75, KILOMETRE), GridAndGeoUtils.buildSafeLineStringBetweenNodes( nodeInputNoSlackMs10Kv, - nodeInputNoSlackMs10Kv + nodeInputNoSlackMs10Kv, ), - OlmCharacteristicInput.CONSTANT_CHARACTERISTIC + OlmCharacteristicInput.CONSTANT_CHARACTERISTIC, ) // 20 kV line input models @@ -71,7 +71,7 @@ trait LineInputTestData extends DefaultTestData with NodeInputTestData { Quantities.getQuantity(0.207000002264977, OHM_PER_KILOMETRE), Quantities.getQuantity(0.0691149979829788, OHM_PER_KILOMETRE), Quantities.getQuantity(300, AMPERE), - Quantities.getQuantity(20, KILOVOLT) + Quantities.getQuantity(20, KILOVOLT), ) // / 20 kV line models @@ -87,9 +87,9 @@ trait LineInputTestData extends DefaultTestData with NodeInputTestData { Quantities.getQuantity(20, KILOMETRE), GridAndGeoUtils.buildSafeLineStringBetweenNodes( nodeInputNoSlackMs20Kv, - nodeInputNoSlackMs20Kv + nodeInputNoSlackMs20Kv, ), - OlmCharacteristicInput.CONSTANT_CHARACTERISTIC + OlmCharacteristicInput.CONSTANT_CHARACTERISTIC, ) protected val lineInputWithTooHighVoltLvlA = new LineInput( UUID.fromString("da55ed58-e3b1-4cc3-b9e7-997082a2a624"), @@ -103,9 +103,9 @@ trait LineInputTestData extends DefaultTestData with NodeInputTestData { Quantities.getQuantity(20, KILOMETRE), GridAndGeoUtils.buildSafeLineStringBetweenNodes( nodeInputNoSlackNs04KvA, - nodeInputNoSlackMs20Kv + nodeInputNoSlackMs20Kv, ), - OlmCharacteristicInput.CONSTANT_CHARACTERISTIC + OlmCharacteristicInput.CONSTANT_CHARACTERISTIC, ) protected val lineInputWithTooLowVoltLvlA = new LineInput( UUID.fromString("8c712c17-2f6f-4ae3-beb9-eb66563ffd32"), @@ -119,9 +119,9 @@ trait LineInputTestData extends DefaultTestData with NodeInputTestData { Quantities.getQuantity(20, KILOMETRE), GridAndGeoUtils.buildSafeLineStringBetweenNodes( nodeInputNoSlackNs04KvA, - nodeInputNoSlackMs20Kv + nodeInputNoSlackMs20Kv, ), - OlmCharacteristicInput.CONSTANT_CHARACTERISTIC + OlmCharacteristicInput.CONSTANT_CHARACTERISTIC, ) protected val lineInputWithTooHighVoltLvlB = new LineInput( UUID.fromString("cc9d9547-42ab-4613-93c0-17e6ac11cd9c"), @@ -135,9 +135,9 @@ trait LineInputTestData extends DefaultTestData with NodeInputTestData { Quantities.getQuantity(20, KILOMETRE), GridAndGeoUtils.buildSafeLineStringBetweenNodes( nodeInputNoSlackMs20Kv, - nodeInputNoSlackNs04KvA + nodeInputNoSlackNs04KvA, ), - OlmCharacteristicInput.CONSTANT_CHARACTERISTIC + OlmCharacteristicInput.CONSTANT_CHARACTERISTIC, ) protected val lineInputWithTooLowVoltLvlB = new LineInput( UUID.fromString("cb910fee-b7cb-4b14-8609-f85e83c6973b"), @@ -151,8 +151,8 @@ trait LineInputTestData extends DefaultTestData with NodeInputTestData { Quantities.getQuantity(20, KILOMETRE), GridAndGeoUtils.buildSafeLineStringBetweenNodes( nodeInputNoSlackMs20Kv, - nodeInputNoSlackNs04KvA + nodeInputNoSlackNs04KvA, ), - OlmCharacteristicInput.CONSTANT_CHARACTERISTIC + OlmCharacteristicInput.CONSTANT_CHARACTERISTIC, ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/input/LoadInputTestData.scala b/src/test/scala/edu/ie3/simona/test/common/input/LoadInputTestData.scala index b99c09fc8f..d77a6762e7 100644 --- a/src/test/scala/edu/ie3/simona/test/common/input/LoadInputTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/input/LoadInputTestData.scala @@ -33,6 +33,6 @@ trait LoadInputTestData extends NodeInputTestData { false, Quantities.getQuantity(3000d, KILOWATTHOUR), Quantities.getQuantity(282.74d, VOLTAMPERE), - 0.95 + 0.95, ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/input/NodeInputTestData.scala b/src/test/scala/edu/ie3/simona/test/common/input/NodeInputTestData.scala index 4d63805474..27ace499de 100644 --- a/src/test/scala/edu/ie3/simona/test/common/input/NodeInputTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/input/NodeInputTestData.scala @@ -31,7 +31,7 @@ trait NodeInputTestData extends DefaultTestData { false, defaultLatLong, GermanVoltageLevelUtils.LV, - -1 + -1, ) protected val nodeInputNoSlackNs04KvB = new NodeInput( UUID.fromString("ad39d0b9-5ad6-4588-8d92-74c7d7de9ace"), @@ -42,7 +42,7 @@ trait NodeInputTestData extends DefaultTestData { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.LV, - -1 + -1, ) protected val nodeInputNoSlackNs04KvWrongVTarget = new NodeInput( UUID.fromString("7be605eb-fc14-4fdc-a580-a2c2a9abd5f7"), @@ -53,7 +53,7 @@ trait NodeInputTestData extends DefaultTestData { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.LV, - -1 + -1, ) // 10 kV node input models @@ -66,7 +66,7 @@ trait NodeInputTestData extends DefaultTestData { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.MV_10KV, - -1 + -1, ) // 20 kV node input models @@ -80,7 +80,7 @@ trait NodeInputTestData extends DefaultTestData { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.MV_20KV, - 1 + 1, ) // 110 kV node input models @@ -94,6 +94,6 @@ trait NodeInputTestData extends DefaultTestData { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.HV, - 1 + 1, ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/input/PvInputTestData.scala b/src/test/scala/edu/ie3/simona/test/common/input/PvInputTestData.scala index 431bb33135..28769ee202 100644 --- a/src/test/scala/edu/ie3/simona/test/common/input/PvInputTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/input/PvInputTestData.scala @@ -51,6 +51,6 @@ trait PvInputTestData 11, false, Quantities.getQuantity(10, StandardUnits.S_RATED), - 0.95 + 0.95, ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/input/SwitchInputTestData.scala b/src/test/scala/edu/ie3/simona/test/common/input/SwitchInputTestData.scala index 3bd7d0990a..138edf8219 100644 --- a/src/test/scala/edu/ie3/simona/test/common/input/SwitchInputTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/input/SwitchInputTestData.scala @@ -26,7 +26,7 @@ trait SwitchInputTestData extends NodeInputTestData with DefaultTestData { defaultOperationTime, nodeInputNoSlackNs04KvA, nodeInputNoSlackNs04KvB, - true + true, ) protected val loopSwitchInput: SwitchInput = new SwitchInput( @@ -36,7 +36,7 @@ trait SwitchInputTestData extends NodeInputTestData with DefaultTestData { defaultOperationTime, nodeInputNoSlackNs04KvA, nodeInputNoSlackNs04KvA, - true + true, ) protected val invalidSwitchInput: SwitchInput = new SwitchInput( @@ -46,6 +46,6 @@ trait SwitchInputTestData extends NodeInputTestData with DefaultTestData { defaultOperationTime, nodeInputNoSlackNs04KvA, nodeInputNoSlackMs10Kv, - true + true, ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/input/TimeSeriesTestData.scala b/src/test/scala/edu/ie3/simona/test/common/input/TimeSeriesTestData.scala index ecbced6214..026d92c4be 100644 --- a/src/test/scala/edu/ie3/simona/test/common/input/TimeSeriesTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/input/TimeSeriesTestData.scala @@ -24,18 +24,18 @@ trait TimeSeriesTestData { new CsvIndividualTimeSeriesMetaInformation( uuidP, ColumnScheme.ACTIVE_POWER, - Paths.get("its_p_" + uuidP) + Paths.get("its_p_" + uuidP), ) protected val metaPq: CsvIndividualTimeSeriesMetaInformation = new CsvIndividualTimeSeriesMetaInformation( uuidPq, ColumnScheme.APPARENT_POWER, - Paths.get("its_pq_" + uuidPq) + Paths.get("its_pq_" + uuidPq), ) protected val metaPqh: CsvIndividualTimeSeriesMetaInformation = new CsvIndividualTimeSeriesMetaInformation( uuidPqh, ColumnScheme.APPARENT_POWER_AND_HEAT_DEMAND, - Paths.get("its_pqh_" + uuidPqh) + Paths.get("its_pqh_" + uuidPqh), ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/input/Transformer3wTestData.scala b/src/test/scala/edu/ie3/simona/test/common/input/Transformer3wTestData.scala index 91da9daba4..9c14017bc7 100644 --- a/src/test/scala/edu/ie3/simona/test/common/input/Transformer3wTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/input/Transformer3wTestData.scala @@ -12,16 +12,16 @@ import edu.ie3.datamodel.models.input.connector.{ LineInput, SwitchInput, Transformer2WInput, - Transformer3WInput + Transformer3WInput, } import edu.ie3.datamodel.models.input.container.{ JointGridContainer, - RawGridElements + RawGridElements, } import edu.ie3.datamodel.models.input.{ MeasurementUnitInput, NodeInput, - OperatorInput + OperatorInput, } import edu.ie3.datamodel.models.voltagelevels.GermanVoltageLevelUtils import edu.ie3.simona.model.grid.{RefSystem, Transformer3wModel} @@ -67,7 +67,7 @@ trait Transformer3wTestData extends DefaultTestData { true, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.EHV_380KV, - 1 + 1, ) private val nodeB = new NodeInput( UUID.fromString("dd037896-d2e0-4cdd-a4a1-c9e2b5e8366a"), @@ -78,7 +78,7 @@ trait Transformer3wTestData extends DefaultTestData { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.HV, - 2 + 2, ) private val nodeC = new NodeInput( UUID.fromString("c838f8a5-03d4-40d3-94fa-815e1bcd0aa0"), @@ -89,7 +89,7 @@ trait Transformer3wTestData extends DefaultTestData { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.MV_20KV, - 3 + 3, ) protected val transformer3wType = new Transformer3WTypeInput( @@ -113,7 +113,7 @@ trait Transformer3wTestData extends DefaultTestData { Quantities.getQuantity(0d, DEGREE_GEOM), 0, -10, - 10 + 10, ) protected val transformer3wInput: Transformer3WInput = new Transformer3WInput( @@ -127,7 +127,7 @@ trait Transformer3wTestData extends DefaultTestData { 1, transformer3wType, 0, - false + false, ) protected val transformer3wInputPostponed: Transformer3WInput = @@ -142,7 +142,7 @@ trait Transformer3wTestData extends DefaultTestData { 1, transformer3wType, 0, - false + false, ) protected val transformer3wInputTapped: Transformer3WInput = @@ -157,7 +157,7 @@ trait Transformer3wTestData extends DefaultTestData { 1, transformer3wType, 10, - false + false, ) protected def transformerModelEhv: Transformer3wModel = @@ -166,7 +166,7 @@ trait Transformer3wTestData extends DefaultTestData { mainRefSystemEhv, 1, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) protected def transformerModelHv: Transformer3wModel = @@ -175,7 +175,7 @@ trait Transformer3wTestData extends DefaultTestData { mainRefSystemHv, 2, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) protected def transformerModelLv: Transformer3wModel = @@ -184,7 +184,7 @@ trait Transformer3wTestData extends DefaultTestData { mainRefSystemHv, 3, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) protected val transformer3wTestGrid: JointGridContainer = { @@ -194,11 +194,11 @@ trait Transformer3wTestData extends DefaultTestData { Set.empty[Transformer2WInput].asJava, Set(transformer3wInput).asJava, Set.empty[SwitchInput].asJava, - Set.empty[MeasurementUnitInput].asJava + Set.empty[MeasurementUnitInput].asJava, ) TestGridFactory.createJointGrid( gridName = "transformer3WTestGrid", - rawGridElements = rawGridElements + rawGridElements = rawGridElements, ) } @@ -209,128 +209,128 @@ trait Transformer3wTestData extends DefaultTestData { -10, Complex(0.0441648321658824, -7.07226179085529), Complex.zero, - Complex(-0.00662285051288235, 1.06076425571629) + Complex(-0.00662285051288235, 1.06076425571629), ), ( -9, Complex(0.0433989680242775, -6.94962141297919), Complex.zero, - Complex(-0.00585698637127746, 0.938123877840191) + Complex(-0.00585698637127746, 0.938123877840191), ), ( -8, Complex(0.0426592128875, -6.83116195707614), Complex.zero, - Complex(-0.0051172312345, 0.819664421937137) + Complex(-0.0051172312345, 0.819664421937137), ), ( -7, Complex(0.0419442540122905, -6.71667320919218), Complex.zero, - Complex(-0.0044022723592905, 0.705175674053178) + Complex(-0.0044022723592905, 0.705175674053178), ), ( -6, Complex(0.0412528652098901, -6.60595881563407), Complex.zero, - Complex(-0.00371088355689011, 0.594461280495065) + Complex(-0.00371088355689011, 0.594461280495065), ), ( -5, Complex(0.0405838998281081, -6.49883515916432), Complex.zero, - Complex(-0.0030419181751081, 0.487337624025323) + Complex(-0.0030419181751081, 0.487337624025323), ), ( -4, Complex(0.0399362844053192, -6.39513034279468), Complex.zero, - Complex(-0.00239430275231915, 0.383632807655681) + Complex(-0.00239430275231915, 0.383632807655681), ), ( -3, Complex(0.0393090129225131, -6.29468326934764), Complex.zero, - Complex(-0.00176703126951309, 0.283185734208644) + Complex(-0.00176703126951309, 0.283185734208644), ), ( -2, Complex(0.0387011415886598, -6.19734280641959), Complex.zero, - Complex(-0.0011591599356598, 0.185845271280588) + Complex(-0.0011591599356598, 0.185845271280588), ), ( -1, Complex(0.0381117841025381, -6.10296702764162), Complex.zero, - Complex(-0.000569802449538069, 0.091469492502624) + Complex(-0.000569802449538069, 0.091469492502624), ), ( 0, Complex(0.037540107341, -6.011422522227), Complex.zero, - Complex(0.000001874312, -0.000075012912) + Complex(0.000001874312, -0.000075012912), ), ( 1, Complex(0.0369853274295567, -5.92258376574089), Complex.zero, - Complex(0.000556654223443345, -0.0889137693981125) + Complex(0.000556654223443345, -0.0889137693981125), ), ( 2, Complex(0.0364467061563107, -5.83633254585146), Complex.zero, - Complex(0.00109527549668932, -0.175164989287544) + Complex(0.00109527549668932, -0.175164989287544), ), ( 3, Complex(0.0359235476947368, -5.7525574375378), Complex.zero, - Complex(0.00161843395826315, -0.2589400976012) + Complex(0.00161843395826315, -0.2589400976012), ), ( 4, Complex(0.035415195604717, -5.67115332285566), Complex.zero, - Complex(0.00212678604828302, -0.34034421228334) + Complex(0.00212678604828302, -0.34034421228334), ), ( 5, Complex(0.0349210300846512, -5.59202095090884), Complex.zero, - Complex(0.00262095156834884, -0.419476584230163) + Complex(0.00262095156834884, -0.419476584230163), ), ( 6, Complex(0.0344404654504587, -5.51506653415321), Complex.zero, - Complex(0.00310151620254129, -0.496431000985789) + Complex(0.00310151620254129, -0.496431000985789), ), ( 7, Complex(0.0339729478199095, -5.440201377581), Complex.zero, - Complex(0.0035690338330905, -0.571296157558004) + Complex(0.0035690338330905, -0.571296157558004), ), ( 8, Complex(0.0335179529830357, -5.36734153770268), Complex.zero, - Complex(0.00402402866996429, -0.644155997436322) + Complex(0.00402402866996429, -0.644155997436322), ), ( 9, Complex(0.0330749844414097, -5.29640750857004), Complex.zero, - Complex(0.00446699721159031, -0.715090026568956) + Complex(0.00446699721159031, -0.715090026568956), ), ( 10, Complex(0.0326435716008696, -5.22732393237131), Complex.zero, - Complex(0.00489841005213043, -0.784173602767695) - ) + Complex(0.00489841005213043, -0.784173602767695), + ), ) val tapDependentVoltRatioEhv: TableFor2[Int, String] = Table( @@ -355,6 +355,6 @@ trait Transformer3wTestData extends DefaultTestData { (7, "1.105"), (8, "1.12"), (9, "1.135"), - (10, "1.15") + (10, "1.15"), ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/input/TransformerInputTestData.scala b/src/test/scala/edu/ie3/simona/test/common/input/TransformerInputTestData.scala index a99035aaca..0ddd591c9e 100644 --- a/src/test/scala/edu/ie3/simona/test/common/input/TransformerInputTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/input/TransformerInputTestData.scala @@ -12,16 +12,16 @@ import edu.ie3.datamodel.models.input.connector.{ LineInput, SwitchInput, Transformer2WInput, - Transformer3WInput + Transformer3WInput, } import edu.ie3.datamodel.models.input.container.{ JointGridContainer, - RawGridElements + RawGridElements, } import edu.ie3.datamodel.models.input.{ MeasurementUnitInput, NodeInput, - OperatorInput + OperatorInput, } import edu.ie3.datamodel.models.voltagelevels.GermanVoltageLevelUtils import edu.ie3.simona.test.common.DefaultTestData @@ -55,7 +55,7 @@ trait TransformerInputTestData extends DefaultTestData { true, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.HV, - 1 + 1, ) private val nodeB = new NodeInput( UUID.fromString("d46ac046-70c0-478f-8ab1-92d70f0ba172"), @@ -66,7 +66,7 @@ trait TransformerInputTestData extends DefaultTestData { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.MV_10KV, - 2 + 2, ) protected val transformerType = new Transformer2WTypeInput( @@ -84,7 +84,7 @@ trait TransformerInputTestData extends DefaultTestData { false, 0, -13, - 13 + 13, ) val transformerInput = new Transformer2WInput( @@ -97,7 +97,7 @@ trait TransformerInputTestData extends DefaultTestData { 1, transformerType, 10, - false + false, ) protected val gridContainer: JointGridContainer = { @@ -107,11 +107,11 @@ trait TransformerInputTestData extends DefaultTestData { Set(transformerInput).asJava, Set.empty[Transformer3WInput].asJava, Set.empty[SwitchInput].asJava, - Set.empty[MeasurementUnitInput].asJava + Set.empty[MeasurementUnitInput].asJava, ) TestGridFactory.createJointGrid( gridName = "twoWindingTestGrid", - rawGridElements = rawGridElements + rawGridElements = rawGridElements, ) } } diff --git a/src/test/scala/edu/ie3/simona/test/common/input/WecInputTestData.scala b/src/test/scala/edu/ie3/simona/test/common/input/WecInputTestData.scala index f3923c370d..f5b41a9a5e 100644 --- a/src/test/scala/edu/ie3/simona/test/common/input/WecInputTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/input/WecInputTestData.scala @@ -26,7 +26,7 @@ trait WecInputTestData extends WecTypeInputTestData { nodeInputNoSlackNs04KvB, CosPhiFixed.CONSTANT_CHARACTERISTIC, wecTypeInputEnerconE82, - false + false, ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/input/WecTypeInputTestData.scala b/src/test/scala/edu/ie3/simona/test/common/input/WecTypeInputTestData.scala index 1f2a1a54bf..7e272db12d 100644 --- a/src/test/scala/edu/ie3/simona/test/common/input/WecTypeInputTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/input/WecTypeInputTestData.scala @@ -40,7 +40,7 @@ trait WecTypeInputTestData extends DefaultTestData with NodeInputTestData { ), Quantities.getQuantity(15, StandardUnits.EFFICIENCY), Quantities.getQuantity(5281, StandardUnits.ROTOR_AREA), - Quantities.getQuantity(98, StandardUnits.HUB_HEIGHT) + Quantities.getQuantity(98, StandardUnits.HUB_HEIGHT), ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/model/grid/BasicGrid.scala b/src/test/scala/edu/ie3/simona/test/common/model/grid/BasicGrid.scala index dc05ed3cda..959a3074f7 100644 --- a/src/test/scala/edu/ie3/simona/test/common/model/grid/BasicGrid.scala +++ b/src/test/scala/edu/ie3/simona/test/common/model/grid/BasicGrid.scala @@ -9,7 +9,7 @@ package edu.ie3.simona.test.common.model.grid import edu.ie3.simona.model.grid.{ NodeModel, TransformerModel, - TransformerTappingModel + TransformerTappingModel, } import edu.ie3.simona.test.common.DefaultTestData import edu.ie3.util.quantities.PowerSystemUnits._ @@ -67,7 +67,7 @@ trait BasicGrid extends FiveLinesWithNodes with DefaultTestData { "node0", "5f2b9b3e-faa6-493b-a6ee-22a4a516ad0e", false, - linesRatedVoltage + linesRatedVoltage, ) // / create transformer HV node @ 110kV def node6: NodeModel = @@ -75,7 +75,7 @@ trait BasicGrid extends FiveLinesWithNodes with DefaultTestData { "node6", "3d2d3626-5043-4ec7-892d-cead983c046e", true, - transformerHvVoltLvl + transformerHvVoltLvl, ) override protected def nodes: Seq[NodeModel] = @@ -95,7 +95,7 @@ trait BasicGrid extends FiveLinesWithNodes with DefaultTestData { 13, -13, 0, - autoTap = true + autoTap = true, ) // / electric params in pu @@ -129,7 +129,7 @@ trait BasicGrid extends FiveLinesWithNodes with DefaultTestData { transformerRInPu, transformerXInPu, transformerGInPu, - transformerBInPu + transformerBInPu, ) // init transformer tapping diff --git a/src/test/scala/edu/ie3/simona/test/common/model/grid/BasicGridWithSwitches.scala b/src/test/scala/edu/ie3/simona/test/common/model/grid/BasicGridWithSwitches.scala index c9270e0888..f8e5bb2a03 100644 --- a/src/test/scala/edu/ie3/simona/test/common/model/grid/BasicGridWithSwitches.scala +++ b/src/test/scala/edu/ie3/simona/test/common/model/grid/BasicGridWithSwitches.scala @@ -12,7 +12,7 @@ import edu.ie3.simona.model.grid.{ LineModel, NodeModel, SwitchModel, - Transformer3wModel + Transformer3wModel, } import edu.ie3.util.quantities.PowerSystemUnits._ import tech.units.indriya.quantity.Quantities @@ -47,42 +47,42 @@ trait BasicGridWithSwitches extends BasicGrid { "node13", "69f08e1d-725d-4bae-80c3-5b5a472493c9", false, - linesRatedVoltage + linesRatedVoltage, ) def node14: NodeModel = _nodeCreator( "node14", "c09cb11f-4e2c-4871-84c6-a22dc6702679", false, - linesRatedVoltage + linesRatedVoltage, ) def node15: NodeModel = _nodeCreator( "node15", "2b45e1e2-591e-49c1-bcbe-0e4ceed79c9b", false, - linesRatedVoltage + linesRatedVoltage, ) def node16: NodeModel = _nodeCreator( "node16", "8aec5998-9c8a-453d-8556-e8630f4c053a", false, - linesRatedVoltage + linesRatedVoltage, ) def node17: NodeModel = _nodeCreator( "node17", "e1002827-0430-4ba0-950f-8107fefc09fa", false, - linesRatedVoltage + linesRatedVoltage, ) def node18: NodeModel = _nodeCreator( "node18", "4ab4904e-dde3-4591-8eb5-3e0ca4fd8e3d", false, - linesRatedVoltage + linesRatedVoltage, ) // add nodes to nodes list @@ -97,7 +97,7 @@ trait BasicGridWithSwitches extends BasicGrid { node15.uuid -> 9, node16.uuid -> 10, node17.uuid -> 11, - node18.uuid -> 12 + node18.uuid -> 12, ) // rebuild lines @@ -109,7 +109,7 @@ trait BasicGridWithSwitches extends BasicGrid { Quantities.getQuantity(0.0013109999999999999, PU), Quantities.getQuantity(0.0010680000000000002, PU), Quantities.getQuantity(0, PU), - Quantities.getQuantity(0.0000048375, PU) + Quantities.getQuantity(0.0000048375, PU), ) def line18To1: LineModel = _lineCreator( "line18To1", @@ -119,7 +119,7 @@ trait BasicGridWithSwitches extends BasicGrid { Quantities.getQuantity(0.0013109999999999999, PU), Quantities.getQuantity(0.0010680000000000002, PU), Quantities.getQuantity(0, PU), - Quantities.getQuantity(0.0000048375, PU) + Quantities.getQuantity(0.0000048375, PU), ) def line1To13: LineModel = _lineCreator( "line1To13", @@ -129,7 +129,7 @@ trait BasicGridWithSwitches extends BasicGrid { Quantities.getQuantity(0.001748, PU), Quantities.getQuantity(0.001424, PU), Quantities.getQuantity(0, PU), - Quantities.getQuantity(0.00000645, PU) + Quantities.getQuantity(0.00000645, PU), ) def line14To2: LineModel = _lineCreator( "line14To2", @@ -139,7 +139,7 @@ trait BasicGridWithSwitches extends BasicGrid { Quantities.getQuantity(0.001748, PU), Quantities.getQuantity(0.001424, PU), Quantities.getQuantity(0, PU), - Quantities.getQuantity(0.00000645, PU) + Quantities.getQuantity(0.00000645, PU), ) def line0To15: LineModel = _lineCreator( "line0To15", @@ -149,7 +149,7 @@ trait BasicGridWithSwitches extends BasicGrid { Quantities.getQuantity(0.000874, PU), Quantities.getQuantity(0.000712, PU), Quantities.getQuantity(0, PU), - Quantities.getQuantity(0.000003225, PU) + Quantities.getQuantity(0.000003225, PU), ) def line16To3: LineModel = _lineCreator( "line16To3", @@ -159,7 +159,7 @@ trait BasicGridWithSwitches extends BasicGrid { Quantities.getQuantity(0.000874, PU), Quantities.getQuantity(0.000712, PU), Quantities.getQuantity(0, PU), - Quantities.getQuantity(0.000003225, PU) + Quantities.getQuantity(0.000003225, PU), ) def line2To3: LineModel = _lineCreator( @@ -170,7 +170,7 @@ trait BasicGridWithSwitches extends BasicGrid { Quantities.getQuantity(0.0013109999999999999, PU), Quantities.getQuantity(0.0010680000000000002, PU), Quantities.getQuantity(0, PU), - Quantities.getQuantity(0.0000048375, PU) + Quantities.getQuantity(0.0000048375, PU), ) override protected val lines: Set[LineModel] = Set( @@ -182,7 +182,7 @@ trait BasicGridWithSwitches extends BasicGrid { line16To3, line3To4, line3To5, - line2To3 + line2To3, ) // switches @@ -191,21 +191,21 @@ trait BasicGridWithSwitches extends BasicGrid { "TestSwitch1", defaultOperationInterval, node13.uuid, - node14.uuid + node14.uuid, ) val switch2 = new SwitchModel( UUID.fromString("e9eb5598-1611-46ad-a44f-fde689c3f558"), "TestSwitch2", defaultOperationInterval, node15.uuid, - node16.uuid + node16.uuid, ) val switch3 = new SwitchModel( UUID.fromString("01731a4a-7801-4656-96c9-26d002ff52da"), "TestSwitch3", defaultOperationInterval, node17.uuid, - node18.uuid + node18.uuid, ) def switches: Set[SwitchModel] = Set(switch1, switch2, switch3) @@ -228,8 +228,8 @@ trait BasicGridWithSwitches extends BasicGrid { gridLines, Set(transformer2wModel), Set.empty[Transformer3wModel], - gridSwitches - ) + gridSwitches, + ), ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/model/grid/DbfsTestGrid.scala b/src/test/scala/edu/ie3/simona/test/common/model/grid/DbfsTestGrid.scala index 6a91877773..07a2ef7f8f 100644 --- a/src/test/scala/edu/ie3/simona/test/common/model/grid/DbfsTestGrid.scala +++ b/src/test/scala/edu/ie3/simona/test/common/model/grid/DbfsTestGrid.scala @@ -11,14 +11,14 @@ import edu.ie3.datamodel.models.OperationTime import edu.ie3.datamodel.models.input.connector._ import edu.ie3.datamodel.models.input.connector.`type`.{ LineTypeInput, - Transformer2WTypeInput + Transformer2WTypeInput, } import edu.ie3.datamodel.models.input.container.RawGridElements import edu.ie3.datamodel.models.input.system.characteristic.OlmCharacteristicInput import edu.ie3.datamodel.models.input.{ MeasurementUnitInput, NodeInput, - OperatorInput + OperatorInput, } import edu.ie3.datamodel.models.voltagelevels.GermanVoltageLevelUtils import edu.ie3.datamodel.utils.GridAndGeoUtils @@ -58,7 +58,7 @@ trait DbfsTestGrid extends SubGridGateMokka { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.HV, - 1 + 1, ) protected val node2 = new NodeInput( UUID.fromString("e364ef00-e6ca-46b1-ba2b-bb73c0c6fee0"), @@ -69,7 +69,7 @@ trait DbfsTestGrid extends SubGridGateMokka { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.HV, - 1 + 1, ) protected val node3 = new NodeInput( UUID.fromString("47ef9983-8fcf-4713-be90-093fc27864ae"), @@ -80,7 +80,7 @@ trait DbfsTestGrid extends SubGridGateMokka { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.HV, - 1 + 1, ) protected val node4 = new NodeInput( UUID.fromString("d44ba8ed-81db-4a22-a40d-f7c0d0808a75"), @@ -91,7 +91,7 @@ trait DbfsTestGrid extends SubGridGateMokka { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.HV, - 1 + 1, ) protected val supNodeA = new NodeInput( UUID.fromString("9fe5fa33-6d3b-4153-a829-a16f4347bc4e"), @@ -102,7 +102,7 @@ trait DbfsTestGrid extends SubGridGateMokka { true, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.EHV_380KV, - 1000 + 1000, ) protected val supNodeB = new NodeInput( UUID.fromString("fb4272fa-5a31-4218-9a46-0a37ac5b34a4"), @@ -113,7 +113,7 @@ trait DbfsTestGrid extends SubGridGateMokka { true, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.EHV_380KV, - 1000 + 1000, ) /* Mocking table of nodes of underlying grids @@ -133,7 +133,7 @@ trait DbfsTestGrid extends SubGridGateMokka { Quantities.getQuantity(0.1094, OHM_PER_KILOMETRE), Quantities.getQuantity(0.4, OHM_PER_KILOMETRE), Quantities.getQuantity(680.0, AMPERE), - Quantities.getQuantity(110.0, KILOVOLT) + Quantities.getQuantity(110.0, KILOVOLT), ) protected val lineType2 = new LineTypeInput( @@ -144,7 +144,7 @@ trait DbfsTestGrid extends SubGridGateMokka { Quantities.getQuantity(0.0283, OHM_PER_KILOMETRE), Quantities.getQuantity(0.11, OHM_PER_KILOMETRE), Quantities.getQuantity(800.0, AMPERE), - Quantities.getQuantity(110.0, KILOVOLT) + Quantities.getQuantity(110.0, KILOVOLT), ) protected val lineType3 = new LineTypeInput( @@ -155,7 +155,7 @@ trait DbfsTestGrid extends SubGridGateMokka { Quantities.getQuantity(0.0547, OHM_PER_KILOMETRE), Quantities.getQuantity(0.4, OHM_PER_KILOMETRE), Quantities.getQuantity(1360.0, AMPERE), - Quantities.getQuantity(110.0, KILOVOLT) + Quantities.getQuantity(110.0, KILOVOLT), ) protected val lineType4 = new LineTypeInput( @@ -166,7 +166,7 @@ trait DbfsTestGrid extends SubGridGateMokka { Quantities.getQuantity(0.109999999403954, OHM_PER_KILOMETRE), Quantities.getQuantity(0.379999995231628, OHM_PER_KILOMETRE), Quantities.getQuantity(550.0, AMPERE), - Quantities.getQuantity(110.0, KILOVOLT) + Quantities.getQuantity(110.0, KILOVOLT), ) protected val line3To4 = new LineInput( @@ -180,7 +180,7 @@ trait DbfsTestGrid extends SubGridGateMokka { lineType1, Quantities.getQuantity(20, KILOMETRE), GridAndGeoUtils.buildSafeLineStringBetweenNodes(node3, node4), - OlmCharacteristicInput.CONSTANT_CHARACTERISTIC + OlmCharacteristicInput.CONSTANT_CHARACTERISTIC, ) protected val line2To3 = new LineInput( @@ -194,7 +194,7 @@ trait DbfsTestGrid extends SubGridGateMokka { lineType2, Quantities.getQuantity(20.0, KILOMETRE), GridAndGeoUtils.buildSafeLineStringBetweenNodes(node3, node2), - OlmCharacteristicInput.CONSTANT_CHARACTERISTIC + OlmCharacteristicInput.CONSTANT_CHARACTERISTIC, ) protected val line1To2 = new LineInput( @@ -208,7 +208,7 @@ trait DbfsTestGrid extends SubGridGateMokka { lineType3, Quantities.getQuantity(24.0, KILOMETRE), GridAndGeoUtils.buildSafeLineStringBetweenNodes(node1, node2), - OlmCharacteristicInput.CONSTANT_CHARACTERISTIC + OlmCharacteristicInput.CONSTANT_CHARACTERISTIC, ) protected val line1To3 = new LineInput( @@ -222,7 +222,7 @@ trait DbfsTestGrid extends SubGridGateMokka { lineType4, Quantities.getQuantity(40, KILOMETRE), GridAndGeoUtils.buildSafeLineStringBetweenNodes(node1, node3), - OlmCharacteristicInput.CONSTANT_CHARACTERISTIC + OlmCharacteristicInput.CONSTANT_CHARACTERISTIC, ) protected val line1To4 = new LineInput( @@ -236,7 +236,7 @@ trait DbfsTestGrid extends SubGridGateMokka { lineType2, Quantities.getQuantity(30, KILOMETRE), GridAndGeoUtils.buildSafeLineStringBetweenNodes(node4, node1), - OlmCharacteristicInput.CONSTANT_CHARACTERISTIC + OlmCharacteristicInput.CONSTANT_CHARACTERISTIC, ) // 1 transformer from HS to HöS @@ -255,7 +255,7 @@ trait DbfsTestGrid extends SubGridGateMokka { false, 0, -5, - 5 + 5, ) protected val transformer1 = new Transformer2WInput( @@ -268,7 +268,7 @@ trait DbfsTestGrid extends SubGridGateMokka { 1, trafoType, 0, - false + false, ) protected val transformer2 = new Transformer2WInput( UUID.fromString("ceccd8cb-29dc-45d6-8a13-4b0033c5f1ef"), @@ -280,7 +280,7 @@ trait DbfsTestGrid extends SubGridGateMokka { 1, trafoType, 0, - false + false, ) protected val (hvGridContainer, hvSubGridGates) = { @@ -296,7 +296,7 @@ trait DbfsTestGrid extends SubGridGateMokka { transformers.asJava, Set.empty[Transformer3WInput].asJava, Set.empty[SwitchInput].asJava, - Set.empty[MeasurementUnitInput].asJava + Set.empty[MeasurementUnitInput].asJava, ) /* Sub grid gates are the apparent gates to superior grids + artificial one to underlying grids */ @@ -306,42 +306,42 @@ trait DbfsTestGrid extends SubGridGateMokka { ) ++ rawGridElements.getTransformer3Ws.asScala.flatMap(transformer => Seq( SubGridGate.fromTransformer3W(transformer, ConnectorPort.B), - SubGridGate.fromTransformer3W(transformer, ConnectorPort.C) + SubGridGate.fromTransformer3W(transformer, ConnectorPort.C), ) ) ++ Seq( build2wSubGridGate( node4.getUuid, 1, UUID.fromString("1129b00d-3d89-4a4a-8ae1-2a56041b95aa"), - 13 + 13, ), build2wSubGridGate( node2.getUuid, 1, UUID.fromString("139c435d-e550-48d8-b590-ee897621f42a"), - 12 + 12, ), build2wSubGridGate( node1.getUuid, 1, UUID.fromString("1676e48c-5353-4f06-b671-c579cf6a7072"), - 11 + 11, ), build2wSubGridGate( node3.getUuid, 1, UUID.fromString("9237e237-01e9-446f-899f-c3b5cf69d288"), - 13 - ) + 13, + ), ) ( TestGridFactory.createSubGrid( gridName = "centerGrid", subgrid = 1, - rawGridElements = rawGridElements + rawGridElements = rawGridElements, ), - subGridGates + subGridGates, ) } @@ -357,7 +357,7 @@ trait DbfsTestGrid extends SubGridGateMokka { transformers.asJava, Set.empty[Transformer3WInput].asJava, Set.empty[SwitchInput].asJava, - Set.empty[MeasurementUnitInput].asJava + Set.empty[MeasurementUnitInput].asJava, ) /* Sub grid gates are the apparent gates to superior grids + artificial one to underlying grids */ @@ -367,14 +367,14 @@ trait DbfsTestGrid extends SubGridGateMokka { ) ++ rawGridElements.getTransformer3Ws.asScala.flatMap(transformer => Seq( SubGridGate.fromTransformer3W(transformer, ConnectorPort.B), - SubGridGate.fromTransformer3W(transformer, ConnectorPort.C) + SubGridGate.fromTransformer3W(transformer, ConnectorPort.C), ) ) ++ Seq( build2wSubGridGate( node1.getUuid, 1, UUID.fromString("1676e48c-5353-4f06-b671-c579cf6a7072"), - 11 + 11, ) ) @@ -382,9 +382,9 @@ trait DbfsTestGrid extends SubGridGateMokka { TestGridFactory.createSubGrid( gridName = "centerGrid", subgrid = 1, - rawGridElements = rawGridElements + rawGridElements = rawGridElements, ), - subGridGates + subGridGates, ) } @@ -396,7 +396,7 @@ trait DbfsTestGrid extends SubGridGateMokka { Set.empty[Transformer2WInput].asJava, Set.empty[Transformer3WInput].asJava, Set.empty[SwitchInput].asJava, - Set.empty[MeasurementUnitInput].asJava + Set.empty[MeasurementUnitInput].asJava, ) val subGridGates: Seq[SubGridGate] = @@ -408,9 +408,9 @@ trait DbfsTestGrid extends SubGridGateMokka { TestGridFactory.createSubGrid( gridName = "superiorGrid", subgrid = 1000, - rawGridElements = rawGridElements + rawGridElements = rawGridElements, ), - subGridGates + subGridGates, ) } } diff --git a/src/test/scala/edu/ie3/simona/test/common/model/grid/DbfsTestGridWithParticipants.scala b/src/test/scala/edu/ie3/simona/test/common/model/grid/DbfsTestGridWithParticipants.scala index eb0208adbd..3e2445ecc1 100644 --- a/src/test/scala/edu/ie3/simona/test/common/model/grid/DbfsTestGridWithParticipants.scala +++ b/src/test/scala/edu/ie3/simona/test/common/model/grid/DbfsTestGridWithParticipants.scala @@ -12,14 +12,14 @@ import edu.ie3.datamodel.models.input.connector._ import edu.ie3.datamodel.models.input.connector.`type`.Transformer2WTypeInput import edu.ie3.datamodel.models.input.container.{ RawGridElements, - SystemParticipants + SystemParticipants, } import edu.ie3.datamodel.models.input.system.characteristic.CosPhiFixed import edu.ie3.datamodel.models.input.system._ import edu.ie3.datamodel.models.input.{ MeasurementUnitInput, NodeInput, - OperatorInput + OperatorInput, } import edu.ie3.datamodel.models.profile.LoadProfile import edu.ie3.datamodel.models.voltagelevels.GermanVoltageLevelUtils @@ -48,7 +48,7 @@ trait DbfsTestGridWithParticipants extends SubGridGateMokka { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.HV, - 1 + 1, ) protected val supNodeA = new NodeInput( @@ -60,7 +60,7 @@ trait DbfsTestGridWithParticipants extends SubGridGateMokka { true, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.EHV_380KV, - 1000 + 1000, ) // 1 transformer from hv to ehv @@ -79,7 +79,7 @@ trait DbfsTestGridWithParticipants extends SubGridGateMokka { false, 0, -5, - 5 + 5, ) private val transformer1 = new Transformer2WInput( @@ -92,7 +92,7 @@ trait DbfsTestGridWithParticipants extends SubGridGateMokka { 1, trafoType, 0, - false + false, ) protected val load1 = new LoadInput( @@ -106,7 +106,7 @@ trait DbfsTestGridWithParticipants extends SubGridGateMokka { false, Quantities.getQuantity(300000, KILOWATTHOUR): ComparableQuantity[Energy], Quantities.getQuantity(150, MEGAVOLTAMPERE): ComparableQuantity[Power], - 0.9 + 0.9, ) protected val (hvGridContainer, hvSubGridGates) = { @@ -121,7 +121,7 @@ trait DbfsTestGridWithParticipants extends SubGridGateMokka { transformers.asJava, Set.empty[Transformer3WInput].asJava, Set.empty[SwitchInput].asJava, - Set.empty[MeasurementUnitInput].asJava + Set.empty[MeasurementUnitInput].asJava, ) val systemParticipants = new SystemParticipants( @@ -135,7 +135,7 @@ trait DbfsTestGridWithParticipants extends SubGridGateMokka { Set.empty[PvInput].asJava, Set.empty[StorageInput].asJava, Set.empty[WecInput].asJava, - Set.empty[EmInput].asJava + Set.empty[EmInput].asJava, ) /* Sub grid gates are the apparent gates to superior grids + artificial one to underlying grids */ @@ -145,7 +145,7 @@ trait DbfsTestGridWithParticipants extends SubGridGateMokka { ) ++ rawGridElements.getTransformer3Ws.asScala.flatMap(transformer => Seq( SubGridGate.fromTransformer3W(transformer, ConnectorPort.B), - SubGridGate.fromTransformer3W(transformer, ConnectorPort.C) + SubGridGate.fromTransformer3W(transformer, ConnectorPort.C), ) ) @@ -154,9 +154,9 @@ trait DbfsTestGridWithParticipants extends SubGridGateMokka { gridName = "gridAgentWithParticipants", subgrid = 1, rawGridElements = rawGridElements, - systemParticipants = systemParticipants + systemParticipants = systemParticipants, ), - subGridGates + subGridGates, ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/model/grid/FiveLinesWithNodes.scala b/src/test/scala/edu/ie3/simona/test/common/model/grid/FiveLinesWithNodes.scala index d76bd254fe..830b77f7f7 100644 --- a/src/test/scala/edu/ie3/simona/test/common/model/grid/FiveLinesWithNodes.scala +++ b/src/test/scala/edu/ie3/simona/test/common/model/grid/FiveLinesWithNodes.scala @@ -51,7 +51,7 @@ trait FiveLinesWithNodes { String, String, Boolean, - ComparableQuantity[ElectricPotential] + ComparableQuantity[ElectricPotential], ) => NodeModel = { (nodeId, uuid, isSlack, vNominal) => new NodeModel( UUID.fromString(uuid), @@ -59,7 +59,7 @@ trait FiveLinesWithNodes { OperationInterval(0L, 7200L), isSlack, Each(1.0d), - GermanVoltageLevelUtils.parse(vNominal) + GermanVoltageLevelUtils.parse(vNominal), ) } @@ -71,7 +71,7 @@ trait FiveLinesWithNodes { Quantity[Dimensionless], Quantity[Dimensionless], Quantity[Dimensionless], - Quantity[Dimensionless] + Quantity[Dimensionless], ) => LineModel = { (lineId, uuid, nodeA, nodeB, r, x, g, b) => new LineModel( UUID.fromString(uuid), @@ -84,7 +84,7 @@ trait FiveLinesWithNodes { Each(r.getValue.doubleValue()), Each(x.getValue.doubleValue()), Each(g.getValue.doubleValue()), - Each(b.getValue.doubleValue()) + Each(b.getValue.doubleValue()), ) } @@ -93,42 +93,42 @@ trait FiveLinesWithNodes { "node0", "51c03963-f28b-4892-9053-c6bb58d20a45", true, - linesRatedVoltage + linesRatedVoltage, ) def node1: NodeModel = _nodeCreator( "node1", "890fb76c-2c6c-4eea-a47d-cf0244750718", false, - linesRatedVoltage + linesRatedVoltage, ) def node2: NodeModel = _nodeCreator( "node2", "be77fa50-613e-4fc9-854a-cfb694443e2f", false, - linesRatedVoltage + linesRatedVoltage, ) def node3: NodeModel = _nodeCreator( "node3", "9a41fd03-fb9a-4966-925e-d847a28ca97d", false, - linesRatedVoltage + linesRatedVoltage, ) def node4: NodeModel = _nodeCreator( "node4", "7f058275-476a-4d84-b1fa-12381204ac4f", false, - linesRatedVoltage + linesRatedVoltage, ) def node5: NodeModel = _nodeCreator( "node5", "ea93feca-0947-4869-a961-9cf942143feb", false, - linesRatedVoltage + linesRatedVoltage, ) protected def nodes: Seq[NodeModel] = @@ -142,7 +142,7 @@ trait FiveLinesWithNodes { Quantities.getQuantity(0.0013109999999999999, PU), Quantities.getQuantity(0.0010680000000000002, PU), Quantities.getQuantity(0, PU), - Quantities.getQuantity(0.0000048375, PU) + Quantities.getQuantity(0.0000048375, PU), ) val line1To2: LineModel = _lineCreator( @@ -153,7 +153,7 @@ trait FiveLinesWithNodes { Quantities.getQuantity(0.001748, PU), Quantities.getQuantity(0.001424, PU), Quantities.getQuantity(0, PU), - Quantities.getQuantity(0.00000645, PU) + Quantities.getQuantity(0.00000645, PU), ) val line0To3: LineModel = _lineCreator( @@ -164,7 +164,7 @@ trait FiveLinesWithNodes { Quantities.getQuantity(0.000874, PU), Quantities.getQuantity(0.000712, PU), Quantities.getQuantity(0, PU), - Quantities.getQuantity(0.000003225, PU) + Quantities.getQuantity(0.000003225, PU), ) val line3To4: LineModel = _lineCreator( @@ -175,7 +175,7 @@ trait FiveLinesWithNodes { Quantities.getQuantity(0.000437, PU), Quantities.getQuantity(0.000356, PU), Quantities.getQuantity(0, PU), - Quantities.getQuantity(0.0000016125, PU) + Quantities.getQuantity(0.0000016125, PU), ) val line3To5: LineModel = _lineCreator( @@ -186,7 +186,7 @@ trait FiveLinesWithNodes { Quantities.getQuantity(0.002185, PU), Quantities.getQuantity(0.00178, PU), Quantities.getQuantity(0, PU), - Quantities.getQuantity(0.0000080625, PU) + Quantities.getQuantity(0.0000080625, PU), ) protected val lines: Set[LineModel] = @@ -200,7 +200,7 @@ trait FiveLinesWithNodes { node2.uuid -> 2, node3.uuid -> 3, node4.uuid -> 4, - node5.uuid -> 5 + node5.uuid -> 5, ) // corresponding admittance matrix @@ -211,7 +211,7 @@ trait FiveLinesWithNodes { C.zero, C(-687.7449206024457, 560.2681733054249), C.zero, - C.zero + C.zero, ), ( C(-458.4966137349637, 373.5121155369499), @@ -219,7 +219,7 @@ trait FiveLinesWithNodes { C(-343.8724603012229, 280.1340866527124), C.zero, C.zero, - C.zero + C.zero, ), ( C.zero, @@ -227,7 +227,7 @@ trait FiveLinesWithNodes { C(343.8724603012229, -280.1340834277124), C.zero, C.zero, - C.zero + C.zero, ), ( C(-687.7449206024457, 560.2681733054249), @@ -235,7 +235,7 @@ trait FiveLinesWithNodes { C.zero, C(2338.3327300483156, -1904.9117827884445), C(-1375.4898412048915, 1120.5363466108497), - C(-275.0979682409783, 224.10726932216994) + C(-275.0979682409783, 224.10726932216994), ), ( C.zero, @@ -243,7 +243,7 @@ trait FiveLinesWithNodes { C.zero, C(-1375.4898412048915, 1120.5363466108497), C(1375.4898412048915, -1120.5363458045997), - C.zero + C.zero, ), ( C.zero, @@ -251,8 +251,8 @@ trait FiveLinesWithNodes { C.zero, C(-275.0979682409783, 224.10726932216994), C.zero, - C(275.0979682409783, -224.10726529091994) - ) + C(275.0979682409783, -224.10726529091994), + ), ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/model/grid/SubGridGateMokka.scala b/src/test/scala/edu/ie3/simona/test/common/model/grid/SubGridGateMokka.scala index 19f3966a23..6cf1b682d4 100644 --- a/src/test/scala/edu/ie3/simona/test/common/model/grid/SubGridGateMokka.scala +++ b/src/test/scala/edu/ie3/simona/test/common/model/grid/SubGridGateMokka.scala @@ -12,7 +12,7 @@ import edu.ie3.datamodel.models.input.NodeInput import edu.ie3.datamodel.models.input.connector.{ ConnectorPort, Transformer2WInput, - Transformer3WInput + Transformer3WInput, } import org.mockito.Mockito._ import org.scalatestplus.mockito.MockitoSugar @@ -49,7 +49,7 @@ trait SubGridGateMokka extends MockitoSugar { */ protected def mockTransformer2w( nodeA: NodeInput, - nodeB: NodeInput + nodeB: NodeInput, ): Transformer2WInput = { val transformer = mock[Transformer2WInput] when(transformer.getNodeA).thenReturn(nodeA) @@ -75,7 +75,7 @@ trait SubGridGateMokka extends MockitoSugar { nodeA: NodeInput, nodeASubnet: Int, nodeB: NodeInput, - nodeC: NodeInput + nodeC: NodeInput, ): Transformer3WInput = { val internalNode = mock[NodeInput] when(internalNode.getUuid).thenReturn(UUID.randomUUID()) @@ -106,7 +106,7 @@ trait SubGridGateMokka extends MockitoSugar { nodeAUuid: UUID, subGridA: Int, nodeBUuud: UUID, - subGridB: Int + subGridB: Int, ): SubGridGate = { val nodeA = mockNode(nodeAUuid, subGridA) val nodeB = mockNode(nodeBUuud, subGridB) @@ -140,7 +140,7 @@ trait SubGridGateMokka extends MockitoSugar { subGridB: Int, nodeCUuid: UUID, subGridC: Int, - inferiorPort: ConnectorPort + inferiorPort: ConnectorPort, ): SubGridGate = { val nodeA = mockNode(nodeAUuid, subGridA) val nodeB = mockNode(nodeBUuid, subGridB) diff --git a/src/test/scala/edu/ie3/simona/test/common/model/grid/TapTestData.scala b/src/test/scala/edu/ie3/simona/test/common/model/grid/TapTestData.scala index b8949dda1a..b2ede4ea43 100644 --- a/src/test/scala/edu/ie3/simona/test/common/model/grid/TapTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/model/grid/TapTestData.scala @@ -20,295 +20,295 @@ trait TapTestData extends TransformerTestGrid { -10, Complex(15.208258743, -50.248897222), Complex(5.069419581, -16.752965741), - Complex(-3.802064686, 12.560349306) + Complex(-3.802064686, 12.560349306), ), ( ConnectorPort.A, -9, Complex(14.717669751, -48.627965054), Complex(4.272871863, -14.120918054), - Complex(-3.311475694, 10.939417137) + Complex(-3.311475694, 10.939417137), ), ( ConnectorPort.A, -8, Complex(14.257742572, -47.108341146), Complex(3.564435643, -11.780014974), - Complex(-2.851548514, 9.419793229) + Complex(-2.851548514, 9.419793229), ), ( ConnectorPort.A, -7, Complex(13.825689766, -45.680815656), Complex(2.932722072, -9.692624809), - Complex(-2.419495709, 7.992267740) + Complex(-2.419495709, 7.992267740), ), ( ConnectorPort.A, -6, Complex(13.419051832, -44.337262255), Complex(2.368067970, -7.826817907), - Complex(-2.012857775, 6.648714338) + Complex(-2.012857775, 6.648714338), ), ( ConnectorPort.A, -5, Complex(13.035650351, -43.070483333), Complex(1.862235764, -6.155375170), - Complex(-1.629456294, 5.381935417) + Complex(-1.629456294, 5.381935417), ), ( ConnectorPort.A, -4, Complex(12.673548952, -41.874081018), Complex(1.408172106, -4.654990484), - Complex(-1.267354895, 4.185533102) + Complex(-1.267354895, 4.185533102), ), ( ConnectorPort.A, -3, Complex(12.331020602, -40.742349099), Complex(0.999812481, -3.305625091), - Complex(-0.924826545, 3.053801182) + Complex(-0.924826545, 3.053801182), ), ( ConnectorPort.A, -2, Complex(12.006520060, -39.670182017), Complex(0.631922108, -2.089981879), - Complex(-0.600326003, 1.981634101) + Complex(-0.600326003, 1.981634101), ), ( ConnectorPort.A, -1, Complex(11.698660571, -38.652997863), Complex(0.299965656, -0.993074896), - Complex(-0.292466514, 0.964449947) + Complex(-0.292466514, 0.964449947), ), ( ConnectorPort.A, 0, Complex(11.406194057, -37.686672917), Complex(0.000000000, -0.001875000), - Complex(0.000000000, -0.001875000) + Complex(0.000000000, -0.001875000), ), ( ConnectorPort.A, 1, Complex(11.127994202, -36.767485772), Complex(-0.271414493, 0.894983294), - Complex(0.278199855, -0.921062144) + Complex(0.278199855, -0.921062144), ), ( ConnectorPort.A, 2, Complex(10.863041959, -35.892069444), Complex(-0.517287712, 1.707445484), - Complex(0.543152098, -1.796478472) + Complex(0.543152098, -1.796478472), ), ( ConnectorPort.A, 3, Complex(10.610413076, -35.057370155), Complex(-0.740261377, 2.444240535), - Complex(0.795780981, -2.631177762) + Complex(0.795780981, -2.631177762), ), ( ConnectorPort.A, 4, Complex(10.369267325, -34.260611742), Complex(-0.942660666, 3.113051481), - Complex(1.036926732, -3.427936174) + Complex(1.036926732, -3.427936174), ), ( ConnectorPort.A, 5, Complex(10.138839162, -33.499264815), Complex(-1.126537685, 3.720659053), - Complex(1.267354895, -4.189283102) + Complex(1.267354895, -4.189283102), ), ( ConnectorPort.A, 6, Complex(9.918429615, -32.771019927), Complex(-1.293708211, 4.273063091), - Complex(1.487764442, -4.917527989) + Complex(1.487764442, -4.917527989), ), ( ConnectorPort.A, 7, Complex(9.707399198, -32.073764184), Complex(-1.445782859, 4.775585521), - Complex(1.698794860, -5.614783732) + Complex(1.698794860, -5.614783732), ), ( ConnectorPort.A, 8, Complex(9.505161714, -31.405560764), Complex(-1.584193619, 5.232958044), - Complex(1.901032343, -6.282987153) + Complex(1.901032343, -6.282987153), ), ( ConnectorPort.A, 9, Complex(9.311178822, -30.764630952), Complex(-1.710216518, 5.649397022), - Complex(2.095015235, -6.923916964) + Complex(2.095015235, -6.923916964), ), ( ConnectorPort.A, 10, Complex(9.124955246, -30.149338333), Complex(-1.824991049, 6.028667667), - Complex(2.281238811, -7.539209583) + Complex(2.281238811, -7.539209583), ), ( ConnectorPort.B, -10, Complex(15.208258743, -50.248897222), Complex(-3.802064686, 12.560349306), - Complex(5.069419581, -16.752965741) + Complex(5.069419581, -16.752965741), ), ( ConnectorPort.B, -9, Complex(14.717669751, -48.627965054), Complex(-3.311475694, 10.939417137), - Complex(4.272871863, -14.120918054) + Complex(4.272871863, -14.120918054), ), ( ConnectorPort.B, -8, Complex(14.257742572, -47.108341146), Complex(-2.851548514, 9.419793229), - Complex(3.564435643, -11.780014974) + Complex(3.564435643, -11.780014974), ), ( ConnectorPort.B, -7, Complex(13.825689766, -45.680815656), Complex(-2.419495709, 7.992267740), - Complex(2.932722072, -9.692624809) + Complex(2.932722072, -9.692624809), ), ( ConnectorPort.B, -6, Complex(13.419051832, -44.337262255), Complex(-2.012857775, 6.648714338), - Complex(2.368067970, -7.826817907) + Complex(2.368067970, -7.826817907), ), ( ConnectorPort.B, -5, Complex(13.035650351, -43.070483333), Complex(-1.629456294, 5.381935417), - Complex(1.862235764, -6.155375170) + Complex(1.862235764, -6.155375170), ), ( ConnectorPort.B, -4, Complex(12.673548952, -41.874081018), Complex(-1.267354895, 4.185533102), - Complex(1.408172106, -4.654990484) + Complex(1.408172106, -4.654990484), ), ( ConnectorPort.B, -3, Complex(12.331020602, -40.742349099), Complex(-0.924826545, 3.053801182), - Complex(0.999812481, -3.305625091) + Complex(0.999812481, -3.305625091), ), ( ConnectorPort.B, -2, Complex(12.006520060, -39.670182017), Complex(-0.600326003, 1.981634101), - Complex(0.631922108, -2.089981879) + Complex(0.631922108, -2.089981879), ), ( ConnectorPort.B, -1, Complex(11.698660571, -38.652997863), Complex(-0.292466514, 0.964449947), - Complex(0.299965656, -0.993074896) + Complex(0.299965656, -0.993074896), ), ( ConnectorPort.B, 0, Complex(11.406194057, -37.686672917), Complex(0.000000000, -0.001875000), - Complex(0.000000000, -0.001875000) + Complex(0.000000000, -0.001875000), ), ( ConnectorPort.B, 1, Complex(11.127994202, -36.767485772), Complex(0.278199855, -0.921062144), - Complex(-0.271414493, 0.894983294) + Complex(-0.271414493, 0.894983294), ), ( ConnectorPort.B, 2, Complex(10.863041959, -35.892069444), Complex(0.543152098, -1.796478472), - Complex(-0.517287712, 1.707445484) + Complex(-0.517287712, 1.707445484), ), ( ConnectorPort.B, 3, Complex(10.610413076, -35.057370155), Complex(0.795780981, -2.631177762), - Complex(-0.740261377, 2.444240535) + Complex(-0.740261377, 2.444240535), ), ( ConnectorPort.B, 4, Complex(10.369267325, -34.260611742), Complex(1.036926732, -3.427936174), - Complex(-0.942660666, 3.113051481) + Complex(-0.942660666, 3.113051481), ), ( ConnectorPort.B, 5, Complex(10.138839162, -33.499264815), Complex(1.267354895, -4.189283102), - Complex(-1.126537685, 3.720659053) + Complex(-1.126537685, 3.720659053), ), ( ConnectorPort.B, 6, Complex(9.918429615, -32.771019927), Complex(1.487764442, -4.917527989), - Complex(-1.293708211, 4.273063091) + Complex(-1.293708211, 4.273063091), ), ( ConnectorPort.B, 7, Complex(9.707399198, -32.073764184), Complex(1.698794860, -5.614783732), - Complex(-1.445782859, 4.775585521) + Complex(-1.445782859, 4.775585521), ), ( ConnectorPort.B, 8, Complex(9.505161714, -31.405560764), Complex(1.901032343, -6.282987153), - Complex(-1.584193619, 5.232958044) + Complex(-1.584193619, 5.232958044), ), ( ConnectorPort.B, 9, Complex(9.311178822, -30.764630952), Complex(2.095015235, -6.923916964), - Complex(-1.710216518, 5.649397022) + Complex(-1.710216518, 5.649397022), ), ( ConnectorPort.B, 10, Complex(9.124955246, -30.149338333), Complex(2.281238811, -7.539209583), - Complex(-1.824991049, 6.028667667) - ) + Complex(-1.824991049, 6.028667667), + ), ) val tapDependentVoltRatio: TableFor2[Int, String] = Table( @@ -339,6 +339,6 @@ trait TapTestData extends TransformerTestGrid { (10, "12.65000"), (11, "12.81500"), (12, "12.98000"), - (13, "13.14500") + (13, "13.14500"), ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/model/grid/TransformerTestData.scala b/src/test/scala/edu/ie3/simona/test/common/model/grid/TransformerTestData.scala index c5211f1b19..26f26cc141 100644 --- a/src/test/scala/edu/ie3/simona/test/common/model/grid/TransformerTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/model/grid/TransformerTestData.scala @@ -31,7 +31,7 @@ trait TransformerTestData extends TransformerTestGrid { val refSystem: RefSystem = RefSystem( Kilowatts(400d), - Kilovolts(0.4d) + Kilovolts(0.4d), ) val nodeUuidToIndexMap: Map[UUID, Int] = gridTapHv.getRawGrid.getNodes.asScala @@ -46,581 +46,581 @@ trait TransformerTestData extends TransformerTestGrid { -10, BigDecimal("-1"), 1.33851987070328, - 0.0182494793139813 + 0.0182494793139813, ), ( ConnectorPort.A, -10, BigDecimal("-0.9"), 1.33801926371388, - 0.0164263707976911 + 0.0164263707976911, ), ( ConnectorPort.A, -10, BigDecimal("-0.8"), 1.3375133288976, - 0.0146032622079102 + 0.0146032622079102, ), ( ConnectorPort.A, -10, BigDecimal("-0.7"), 1.33700205419089, - 0.0127801535444722 + 0.0127801535444722, ), ( ConnectorPort.A, -10, BigDecimal("-0.6"), 1.33648542736584, - 0.0109570448072086 + 0.0109570448072086, ), ( ConnectorPort.A, -10, BigDecimal("-0.5"), 1.33596343602858, - 0.00913393599594799 + 0.00913393599594799, ), ( ConnectorPort.A, -10, BigDecimal("-0.4"), 1.33543606761768, - 0.00731082711051762 + 0.00731082711051762, ), ( ConnectorPort.A, -10, BigDecimal("-0.3"), 1.33490330940244, - 0.00548771815074156 + 0.00548771815074156, ), ( ConnectorPort.A, -10, BigDecimal("-0.2"), 1.33436514848123, - 0.00366460911644194 + 0.00366460911644194, ), ( ConnectorPort.A, -10, BigDecimal("-0.1"), 1.33382157177974, - 0.00184150000743841 + 0.00184150000743841, ), ( ConnectorPort.A, -10, BigDecimal("0"), 1.33327256604926, - 0.0000183908235482318 + 0.0000183908235482318, ), ( ConnectorPort.A, -10, BigDecimal("0.1"), 1.33271811786481, - -0.00180471843541367 + -0.00180471843541367, ), ( ConnectorPort.A, -10, BigDecimal("0.2"), 1.33215821362343, - -0.0036278277696351 + -0.0036278277696351, ), ( ConnectorPort.A, -10, BigDecimal("0.3"), 1.33159283954222, - -0.00545093717930617 + -0.00545093717930617, ), ( ConnectorPort.A, -10, BigDecimal("0.4"), 1.33102198165651, - -0.00727404666461941 + -0.00727404666461941, ), ( ConnectorPort.A, -10, BigDecimal("0.5"), 1.3304456258179, - -0.00909715622576998 + -0.00909715622576998, ), ( ConnectorPort.A, -10, BigDecimal("0.6"), 1.32986375769233, - -0.0109202658629557 + -0.0109202658629557, ), ( ConnectorPort.A, -10, BigDecimal("0.7"), 1.32927636275805, - -0.0127433755763768 + -0.0127433755763768, ), ( ConnectorPort.A, -10, BigDecimal("0.8"), 1.3286834263036, - -0.0145664853662362 + -0.0145664853662362, ), ( ConnectorPort.A, -10, BigDecimal("0.9"), 1.32808493342574, - -0.0163895952327395 + -0.0163895952327395, ), ( ConnectorPort.A, -10, BigDecimal("1"), 1.32748086902734, - -0.0182127051760949 + -0.0182127051760949, ), ( ConnectorPort.A, -9, BigDecimal("-1"), 1.29566723975357, - 0.0188565887526757 + 0.0188565887526757, ), ( ConnectorPort.A, -9, BigDecimal("-0.9"), 1.29515348415399, - 0.0169727100013154 + 0.0169727100013154, ), ( ConnectorPort.A, -9, BigDecimal("-0.8"), 1.29463385801716, - 0.0150888311689785 + 0.0150888311689785, ), ( ConnectorPort.A, -9, BigDecimal("-0.7"), 1.29410834724102, - 0.0132049522554703 + 0.0132049522554703, ), ( ConnectorPort.A, -9, BigDecimal("-0.6"), 1.29357693751783, - 0.0113210732605935 + 0.0113210732605935, ), ( ConnectorPort.A, -9, BigDecimal("-0.5"), 1.29303961433205, - 0.00943719418414793 + 0.00943719418414793, ), ( ConnectorPort.A, -9, BigDecimal("-0.4"), 1.29249636295816, - 0.00755331502593053 + 0.00755331502593053, ), ( ConnectorPort.A, -9, BigDecimal("-0.3"), 1.29194716845844, - 0.00566943578573499 + 0.00566943578573499, ), ( ConnectorPort.A, -9, BigDecimal("-0.2"), 1.29139201568068, - 0.00378555646335253 + 0.00378555646335253, ), ( ConnectorPort.A, -9, BigDecimal("-0.1"), 1.29083088925591, - 0.00190167705857116 + 0.00190167705857116, ), ( ConnectorPort.A, -9, BigDecimal("0"), 1.29026377359605, - 0.0000177975711757692 + 0.0000177975711757692, ), ( ConnectorPort.A, -9, BigDecimal("0.1"), 1.28969065289147, - -0.00186608199905174 + -0.00186608199905174, ), ( ConnectorPort.A, -9, BigDecimal("0.2"), 1.28911151110854, - -0.00374996165233242 + -0.00374996165233242, ), ( ConnectorPort.A, -9, BigDecimal("0.3"), 1.28852633198721, - -0.00563384138889061 + -0.00563384138889061, ), ( ConnectorPort.A, -9, BigDecimal("0.4"), 1.28793509903837, - -0.00751772120895373 + -0.00751772120895373, ), ( ConnectorPort.A, -9, BigDecimal("0.5"), 1.2873377955413, - -0.00940160111275256 + -0.00940160111275256, ), ( ConnectorPort.A, -9, BigDecimal("0.6"), 1.28673440454104, - -0.0112854811005208 + -0.0112854811005208, ), ( ConnectorPort.A, -9, BigDecimal("0.7"), 1.28612490884563, - -0.0131693611724957 + -0.0131693611724957, ), ( ConnectorPort.A, -9, BigDecimal("0.8"), 1.28550929102345, - -0.0150532413289176 + -0.0150532413289176, ), ( ConnectorPort.A, -9, BigDecimal("0.9"), 1.2848875334003, - -0.0169371215700303 + -0.0169371215700303, ), ( ConnectorPort.A, -9, BigDecimal("1"), 1.28425961805663, - -0.0188210018960812 + -0.0188210018960812, ), ( ConnectorPort.A, -8, BigDecimal("-1"), 1.25550083502857, - 0.0194637352444932 + 0.0194637352444932, ), ( ConnectorPort.A, -8, BigDecimal("-0.9"), 1.25497427336787, - 0.0175190862627879 + 0.0175190862627879, ), ( ConnectorPort.A, -8, BigDecimal("-0.8"), 1.25444126357415, - 0.0155744371921388 + 0.0155744371921388, ), ( ConnectorPort.A, -8, BigDecimal("-0.7"), 1.25390178925247, - 0.0136297880323194 + 0.0136297880323194, ), ( ConnectorPort.A, -8, BigDecimal("-0.6"), 1.25335583375242, - 0.0116851387831005 + 0.0116851387831005, ), ( ConnectorPort.A, -8, BigDecimal("-0.5"), 1.2528033801653, - 0.00974048944424847 + 0.00974048944424847, ), ( ConnectorPort.A, -8, BigDecimal("-0.4"), 1.25224441132123, - 0.00779584001552676 + 0.00779584001552676, ), ( ConnectorPort.A, -8, BigDecimal("-0.3"), 1.25167890978624, - 0.00585119049669465 + 0.00585119049669465, ), ( ConnectorPort.A, -8, BigDecimal("-0.2"), 1.25110685785927, - 0.00390654088750816 + 0.00390654088750816, ), ( ConnectorPort.A, -8, BigDecimal("-0.1"), 1.25052823756908, - 0.00196189118771932 + 0.00196189118771932, ), ( ConnectorPort.A, -8, BigDecimal("0"), 1.24994303067118, - 0.0000172413970765007 + 0.0000172413970765007, ), ( ConnectorPort.A, -8, BigDecimal("0.1"), 1.2493512186446, - -0.00192740848467577 + -0.00192740848467577, ), ( ConnectorPort.A, -8, BigDecimal("0.2"), 1.24875278268866, - -0.00387205845779691 + -0.00387205845779691, ), ( ConnectorPort.A, -8, BigDecimal("0.3"), 1.24814770371962, - -0.00581670852255001 + -0.00581670852255001, ), ( ConnectorPort.A, -8, BigDecimal("0.4"), 1.24753596236732, - -0.00776135867920239 + -0.00776135867920239, ), ( ConnectorPort.A, -8, BigDecimal("0.5"), 1.24691753897167, - -0.00970600892802513 + -0.00970600892802513, ), ( ConnectorPort.A, -8, BigDecimal("0.6"), 1.24629241357918, - -0.0116506592692935 + -0.0116506592692935, ), ( ConnectorPort.A, -8, BigDecimal("0.7"), 1.24566056593925, - -0.0135953097032869 + -0.0135953097032869, ), ( ConnectorPort.A, -8, BigDecimal("0.8"), 1.24502197550058, - -0.0155399602302888 + -0.0155399602302888, ), ( ConnectorPort.A, -8, BigDecimal("0.9"), 1.24437662140734, - -0.0174846108505867 + -0.0174846108505867, ), ( ConnectorPort.A, -8, BigDecimal("1"), 1.24372448249533, - -0.0194292615644728 + -0.0194292615644728, ), ( ConnectorPort.A, -7, BigDecimal("-1"), 1.21777623277092, - 0.0200709154179146 + 0.0200709154179146, ), ( ConnectorPort.A, -7, BigDecimal("-0.9"), 1.21723721781891, - 0.0180654962107302 + 0.0180654962107302, ), ( ConnectorPort.A, -7, BigDecimal("-0.8"), 1.21669114127808, - 0.0160600769061402 + 0.0160600769061402, ), ( ConnectorPort.A, -7, BigDecimal("-0.7"), 1.21613798418596, - 0.0140546575038827 + 0.0140546575038827, ), ( ConnectorPort.A, -7, BigDecimal("-0.6"), 1.21557772726497, - 0.0120492380036921 + 0.0120492380036921, ), ( ConnectorPort.A, -7, BigDecimal("-0.5"), 1.21501035091869, - 0.0100438184052979 + 0.0100438184052979, ), ( ConnectorPort.A, -7, BigDecimal("-0.4"), 1.21443583522813, - 0.00803839870842536 + 0.00803839870842536, ), ( ConnectorPort.A, -7, BigDecimal("-0.3"), 1.2138541599479, - 0.00603297891279538 + 0.00603297891279538, ), ( ConnectorPort.A, -7, BigDecimal("-0.2"), 1.21326530450224, - 0.00402755901812385 + 0.00402755901812385, ), ( ConnectorPort.A, -7, BigDecimal("-0.1"), 1.21266924798103, - 0.00202213902412263 + 0.00202213902412263, ), ( ConnectorPort.A, -7, BigDecimal("0"), 1.21206596913569, - 0.0000167189304984079 + 0.0000167189304984079, ), ( ConnectorPort.A, -7, BigDecimal("0.1"), 1.21145544637497, - -0.00198870126304644 + -0.00198870126304644, ), ( ConnectorPort.A, -7, BigDecimal("0.2"), 1.21083765776068, - -0.00399412155681467 + -0.00399412155681467, ), ( ConnectorPort.A, -7, BigDecimal("0.3"), 1.21021258100326, - -0.00599954195111372 + -0.00599954195111372, ), ( ConnectorPort.A, -7, BigDecimal("0.4"), 1.20958019345734, - -0.00800496244625593 + -0.00800496244625593, ), ( ConnectorPort.A, -7, BigDecimal("0.5"), 1.20894047211713, - -0.0100103830425586 + -0.0100103830425586, ), ( ConnectorPort.A, -7, BigDecimal("0.6"), 1.20829339361172, - -0.0120158037403442 + -0.0120158037403442, ), ( ConnectorPort.A, -7, BigDecimal("0.7"), 1.20763893420033, - -0.0140212245399401 + -0.0140212245399401, ), ( ConnectorPort.A, -7, BigDecimal("0.8"), 1.20697706976735, - -0.016026645441679 + -0.016026645441679, ), ( ConnectorPort.A, -7, BigDecimal("0.9"), 1.20630777581736, - -0.0180320664458987 + -0.0180320664458987, ), (ConnectorPort.A, -7, BigDecimal("1"), 1.20563102747, -0.0200374875529425), ( @@ -628,147 +628,147 @@ trait TransformerTestData extends TransformerTestGrid { -6, BigDecimal("-1"), 1.18227775868577, - 0.0206781262979832 + 0.0206781262979832, ), ( ConnectorPort.A, -6, BigDecimal("-0.9"), 1.18172665336576, - 0.0186119368703259 + 0.0186119368703259, ), ( ConnectorPort.A, -6, BigDecimal("-0.8"), 1.18116783617761, - 0.0165457473362931 + 0.0165457473362931, ), ( ConnectorPort.A, -6, BigDecimal("-0.7"), 1.18060128529589, - 0.0144795576955837 + 0.0144795576955837, ), ( ConnectorPort.A, -6, BigDecimal("-0.6"), 1.18002697850897, - 0.0124133679478913 + 0.0124133679478913, ), ( ConnectorPort.A, -6, BigDecimal("-0.5"), 1.17944489321428, - 0.010347178092904 + 0.010347178092904, ), ( ConnectorPort.A, -6, BigDecimal("-0.4"), 1.17885500641342, - 0.00828098813030484 + 0.00828098813030484, ), ( ConnectorPort.A, -6, BigDecimal("-0.3"), 1.17825729470715, - 0.00621479805977096 + 0.00621479805977096, ), ( ConnectorPort.A, -6, BigDecimal("-0.2"), 1.17765173429035, - 0.00414860788097387 + 0.00414860788097387, ), ( ConnectorPort.A, -6, BigDecimal("-0.1"), 1.17703830094672, - 0.00208241759357962 + 0.00208241759357962, ), ( ConnectorPort.A, -6, BigDecimal("0"), 1.17641697004346, - 0.0000162271972485072 + 0.0000162271972485072, ), ( ConnectorPort.A, -6, BigDecimal("0.1"), 1.17578771652579, - -0.00204996330836518 + -0.00204996330836518, ), ( ConnectorPort.A, -6, BigDecimal("0.2"), 1.17515051491134, - -0.00411615392361289 + -0.00411615392361289, ), ( ConnectorPort.A, -6, BigDecimal("0.3"), 1.17450533928438, - -0.00618234464885208 + -0.00618234464885208, ), ( ConnectorPort.A, -6, BigDecimal("0.4"), 1.17385216328999, - -0.00824853548444636 + -0.00824853548444636, ), ( ConnectorPort.A, -6, BigDecimal("0.5"), 1.173190960128, - -0.0103147264307653 + -0.0103147264307653, ), ( ConnectorPort.A, -6, BigDecimal("0.6"), 1.17252170254683, - -0.0123809174881849 + -0.0123809174881849, ), ( ConnectorPort.A, -6, BigDecimal("0.7"), 1.17184436283718, - -0.0144471086570874 + -0.0144471086570874, ), ( ConnectorPort.A, -6, BigDecimal("0.8"), 1.17115891282558, - -0.0165132999378612 + -0.0165132999378612, ), ( ConnectorPort.A, -6, BigDecimal("0.9"), 1.17046532386777, - -0.0185794913309016 + -0.0185794913309016, ), ( ConnectorPort.A, -6, BigDecimal("1"), 1.16976356684192, - -0.0206456828366103 + -0.0206456828366103, ), (ConnectorPort.A, -5, BigDecimal("-1"), 1.1488143809165, 0.021285365249654), ( @@ -776,280 +776,280 @@ trait TransformerTestData extends TransformerTestGrid { -5, BigDecimal("-0.9"), 1.14825155823767, - 0.0191584056066691 + 0.0191584056066691, ), ( ConnectorPort.A, -5, BigDecimal("-0.8"), 1.14768033563545, - 0.0170314458478176 + 0.0170314458478176, ), ( ConnectorPort.A, -5, BigDecimal("-0.7"), 1.14710068810469, - 0.0149044859727549 + 0.0149044859727549, ), ( ConnectorPort.A, -5, BigDecimal("-0.6"), 1.14651259016991, - 0.0127775259811294 + 0.0127775259811294, ), ( ConnectorPort.A, -5, BigDecimal("-0.5"), 1.14591601587918, - 0.0106505658725832 + 0.0106505658725832, ), ( ConnectorPort.A, -5, BigDecimal("-0.4"), 1.14531093879785, - 0.00852360564675163 + 0.00852360564675163, ), ( ConnectorPort.A, -5, BigDecimal("-0.3"), 1.14469733200211, - 0.00639664530326336 + 0.00639664530326336, ), ( ConnectorPort.A, -5, BigDecimal("-0.2"), 1.14407516807242, - 0.00426968484174022 + 0.00426968484174022, ), ( ConnectorPort.A, -5, BigDecimal("-0.1"), 1.14344441908675, - 0.00214272426179696 + 0.00214272426179696, ), ( ConnectorPort.A, -5, BigDecimal("0"), 1.14280505661365, - 0.0000157635630414583 + 0.0000157635630414583, ), ( ConnectorPort.A, -5, BigDecimal("0.1"), 1.14215705170516, - -0.00211119725492569 + -0.00211119725492569, ), ( ConnectorPort.A, -5, BigDecimal("0.2"), 1.14150037488952, - -0.00423815819251083 + -0.00423815819251083, ), ( ConnectorPort.A, -5, BigDecimal("0.3"), 1.14083499616373, - -0.00636511925012798 + -0.00636511925012798, ), ( ConnectorPort.A, -5, BigDecimal("0.4"), 1.14016088498588, - -0.00849208042819832 + -0.00849208042819832, ), ( ConnectorPort.A, -5, BigDecimal("0.5"), 1.13947801026731, - -0.0106190417271507 + -0.0106190417271507, ), ( ConnectorPort.A, -5, BigDecimal("0.6"), 1.13878634036457, - -0.0127460031474217 + -0.0127460031474217, ), ( ConnectorPort.A, -5, BigDecimal("0.7"), 1.1380858430712, - -0.0148729646894554 + -0.0148729646894554, ), ( ConnectorPort.A, -5, BigDecimal("0.8"), 1.13737648560922, - -0.016999926353704 + -0.016999926353704, ), ( ConnectorPort.A, -5, BigDecimal("0.9"), 1.13665823462052, - -0.0191268881406277 + -0.0191268881406277, ), ( ConnectorPort.A, -5, BigDecimal("1"), 1.13593105615792, - -0.0212538500506947 + -0.0212538500506947, ), ( ConnectorPort.A, -4, BigDecimal("-1"), 1.11721628752459, - 0.0218926299305844 + 0.0218926299305844, ), ( ConnectorPort.A, -4, BigDecimal("-0.9"), 1.11664213051416, - 0.0197049000775551 + 0.0197049000775551, ), ( ConnectorPort.A, -4, BigDecimal("-0.8"), 1.11605884680756, - 0.0175171700986343 + 0.0175171700986343, ), ( ConnectorPort.A, -4, BigDecimal("-0.7"), 1.11546640788156, - 0.0153294399934289 + 0.0153294399934289, ), ( ConnectorPort.A, -4, BigDecimal("-0.6"), 1.11486478464348, - 0.0131417097615372 + 0.0131417097615372, ), ( ConnectorPort.A, -4, BigDecimal("-0.5"), 1.11425394742336, - 0.0109539794025504 + 0.0109539794025504, ), ( ConnectorPort.A, -4, BigDecimal("-0.4"), 1.11363386596595, - 0.00876624891605077 + 0.00876624891605077, ), ( ConnectorPort.A, -4, BigDecimal("-0.3"), 1.11300450942251, - 0.00657851830161297 + 0.00657851830161297, ), ( ConnectorPort.A, -4, BigDecimal("-0.2"), 1.1123658463424, - 0.00439078755880325 + 0.00439078755880325, ), ( ConnectorPort.A, -4, BigDecimal("-0.1"), 1.11171784466437, - 0.00220305668717925 + 0.00220305668717925, ), ( ConnectorPort.A, -4, BigDecimal("0"), 1.11106047170771, - 0.0000153256862902373 + 0.0000153256862902373, ), ( ConnectorPort.A, -4, BigDecimal("0.1"), 1.1103936941631, - -0.00217240544432333 + -0.00217240544432333, ), ( ConnectorPort.A, -4, BigDecimal("0.2"), 1.10971747808323, - -0.0043601367051296 + -0.0043601367051296, ), ( ConnectorPort.A, -4, BigDecimal("0.3"), 1.10903178887323, - -0.00654786809660587 + -0.00654786809660587, ), ( ConnectorPort.A, -4, BigDecimal("0.4"), 1.10833659128073, - -0.00873559961923841 + -0.00873559961923841, ), ( ConnectorPort.A, -4, BigDecimal("0.5"), 1.10763184938575, - -0.0109233312735225 + -0.0109233312735225, ), ( ConnectorPort.A, -4, BigDecimal("0.6"), 1.10691752659028, - -0.0131110630599632 + -0.0131110630599632, ), ( ConnectorPort.A, -4, BigDecimal("0.7"), 1.10619358560756, - -0.0152987949790748 + -0.0152987949790748, ), ( ConnectorPort.A, -4, BigDecimal("0.8"), 1.10545998845117, - -0.017486527031381 + -0.017486527031381, ), ( ConnectorPort.A, -4, BigDecimal("0.9"), 1.10471669642365, - -0.019674259217416 + -0.019674259217416, ), (ConnectorPort.A, -4, BigDecimal("1"), 1.103963670105, -0.0218619915377232), (ConnectorPort.A, -3, BigDecimal("-1"), 1.08733201897279, 0.02249991825158), @@ -1058,3815 +1058,3815 @@ trait TransformerTestData extends TransformerTestGrid { -3, BigDecimal("-0.9"), 1.08674692060804, - 0.0202514181939269 + 0.0202514181939269, ), ( ConnectorPort.A, -3, BigDecimal("-0.8"), 1.08615192912595, - 0.0180029179998106 + 0.0180029179998106, ), ( ConnectorPort.A, -3, BigDecimal("-0.7"), 1.08554701212492, - 0.0157544176687841 + 0.0157544176687841, ), ( ConnectorPort.A, -3, BigDecimal("-0.6"), 1.08493213651765, - 0.0135059172003913 + 0.0135059172003913, ), ( ConnectorPort.A, -3, BigDecimal("-0.5"), 1.08430726852129, - 0.011257416594166 + 0.011257416594166, ), ( ConnectorPort.A, -3, BigDecimal("-0.4"), 1.08367237364723, - 0.00900891584963238 + 0.00900891584963238, ), ( ConnectorPort.A, -3, BigDecimal("-0.3"), 1.08302741669076, - 0.00676041496630505 + 0.00676041496630505, ), ( ConnectorPort.A, -3, BigDecimal("-0.2"), 1.08237236172029, - 0.0045119139436882 + 0.0045119139436882, ), ( ConnectorPort.A, -3, BigDecimal("-0.1"), 1.08170717206634, - 0.00226341278127613 + 0.00226341278127613, ), ( ConnectorPort.A, -3, BigDecimal("0"), 1.08103181031021, - 0.0000149114785526847 + 0.0000149114785526847, ), ( ConnectorPort.A, -3, BigDecimal("0.1"), 1.08034623827232, - -0.00223358996500881 + -0.00223358996500881, ), ( ConnectorPort.A, -3, BigDecimal("0.2"), 1.07965041700025, - -0.00448209154994563 + -0.00448209154994563, ), ( ConnectorPort.A, -3, BigDecimal("0.3"), 1.07894430675637, - -0.006730593276806 + -0.006730593276806, ), ( ConnectorPort.A, -3, BigDecimal("0.4"), 1.07822786700521, - -0.00897909514614891 + -0.00897909514614891, ), ( ConnectorPort.A, -3, BigDecimal("0.5"), 1.07750105640042, - -0.0112275971585447 + -0.0112275971585447, ), ( ConnectorPort.A, -3, BigDecimal("0.6"), 1.07676383277138, - -0.0134760993145751 + -0.0134760993145751, ), ( ConnectorPort.A, -3, BigDecimal("0.7"), 1.0760161531094, - -0.0157246016148335 + -0.0157246016148335, ), ( ConnectorPort.A, -3, BigDecimal("0.8"), 1.07525797355358, - -0.0179731040599247 + -0.0179731040599247, ), ( ConnectorPort.A, -3, BigDecimal("0.9"), 1.07448924937621, - -0.0202216066504656 + -0.0202216066504656, ), ( ConnectorPort.A, -3, BigDecimal("1"), 1.0737099349678, - -0.0224701093870857 + -0.0224701093870857, ), ( ConnectorPort.A, -2, BigDecimal("-1"), 1.05902605337401, - 0.023107228343286 + 0.023107228343286, ), ( ConnectorPort.A, -2, BigDecimal("-0.9"), 1.05843041651441, - 0.0207979580865661 + 0.0207979580865661, ), ( ConnectorPort.A, -2, BigDecimal("-0.8"), 1.05782407954748, - 0.0184886876822516 + 0.0184886876822516, ), ( ConnectorPort.A, -2, BigDecimal("-0.7"), 1.05720700581082, - 0.0161794171298368 + 0.0161794171298368, ), ( ConnectorPort.A, -2, BigDecimal("-0.6"), 1.05657915782069, - 0.0138701464288047 + 0.0138701464288047, ), ( ConnectorPort.A, -2, BigDecimal("-0.5"), 1.05594049725962, - 0.0115608755786267 + 0.0115608755786267, ), ( ConnectorPort.A, -2, BigDecimal("-0.4"), 1.05529098496362, - 0.00925160457876267 + 0.00925160457876267, ), ( ConnectorPort.A, -2, BigDecimal("-0.3"), 1.05463058090905, - 0.00694233342866044 + 0.00694233342866044, ), ( ConnectorPort.A, -2, BigDecimal("-0.2"), 1.0539592441991, - 0.00463306212775601 + 0.00463306212775601, ), ( ConnectorPort.A, -2, BigDecimal("-0.1"), 1.0532769330498, - 0.00232379067547291 + 0.00232379067547291, ), ( ConnectorPort.A, -2, BigDecimal("0"), 1.05258360477573, - 0.0000145190712223228 + 0.0000145190712223228, ), ( ConnectorPort.A, -2, BigDecimal("0.1"), 1.05187921577518, - -0.00229475268559709 + -0.00229475268559709, ), ( ConnectorPort.A, -2, BigDecimal("0.2"), 1.05116372151496, - -0.00460402459559959 + -0.00460402459559959, ), ( ConnectorPort.A, -2, BigDecimal("0.3"), 1.05043707651473, - -0.00691329665941254 + -0.00691329665941254, ), ( ConnectorPort.A, -2, BigDecimal("0.4"), 1.0496992343308, - -0.00922256887767665 + -0.00922256887767665, ), ( ConnectorPort.A, -2, BigDecimal("0.5"), 1.04895014753959, - -0.011531841251046 + -0.011531841251046, ), ( ConnectorPort.A, -2, BigDecimal("0.6"), 1.04818976772044, - -0.0138411137801886 + -0.0138411137801886, ), ( ConnectorPort.A, -2, BigDecimal("0.7"), 1.04741804543799, - -0.0161503864657862 + -0.0161503864657862, ), ( ConnectorPort.A, -2, BigDecimal("0.8"), 1.04663493022402, - -0.018459659308535 + -0.018459659308535, ), ( ConnectorPort.A, -2, BigDecimal("0.9"), 1.04584037055874, - -0.0207689323091456 + -0.0207689323091456, ), ( ConnectorPort.A, -2, BigDecimal("1"), 1.0450343138515, - -0.0230782054683436 + -0.0230782054683436, ), ( ConnectorPort.A, -1, BigDecimal("-1"), 1.03217676324027, - 0.0237145585280039 + 0.0237145585280039, ), ( ConnectorPort.A, -1, BigDecimal("-0.9"), 1.03157100055975, - 0.0213445180779095 + 0.0213445180779095, ), ( ConnectorPort.A, -1, BigDecimal("-0.8"), 1.03095368930288, - 0.0189744774685169 + 0.0189744774685169, ), ( ConnectorPort.A, -1, BigDecimal("-0.7"), 1.03032478814181, - 0.0166044366992562 + 0.0166044366992562, ), ( ConnectorPort.A, -1, BigDecimal("-0.6"), 1.02968425476971, - 0.0142343957695436 + 0.0142343957695436, ), ( ConnectorPort.A, -1, BigDecimal("-0.5"), 1.0290320458854, - 0.0118643546787821 + 0.0118643546787821, ), ( ConnectorPort.A, -1, BigDecimal("-0.4"), 1.02836811717731, - 0.00949431342636016 + 0.00949431342636016, ), ( ConnectorPort.A, -1, BigDecimal("-0.3"), 1.02769242330705, - 0.00712427201165266 + 0.00712427201165266, ), ( ConnectorPort.A, -1, BigDecimal("-0.2"), 1.02700491789239, - 0.00475423043401966 + 0.00475423043401966, ), ( ConnectorPort.A, -1, BigDecimal("-0.1"), 1.0263055534898, - 0.00238418869280686 + 0.00238418869280686, ), ( ConnectorPort.A, -1, BigDecimal("0"), 1.02559428157635, - 0.0000141467873448151 + 0.0000141467873448151, ), ( ConnectorPort.A, -1, BigDecimal("0.1"), 1.02487105253106, - -0.00235589528305081 + -0.00235589528305081, ), ( ConnectorPort.A, -1, BigDecimal("0.2"), 1.02413581561573, - -0.00472593751908002 + -0.00472593751908002, ), ( ConnectorPort.A, -1, BigDecimal("0.3"), 1.02338851895507, - -0.00709597992145828 + -0.00709597992145828, ), ( ConnectorPort.A, -1, BigDecimal("0.4"), 1.0226291095163, - -0.00946602249091709 + -0.00946602249091709, ), ( ConnectorPort.A, -1, BigDecimal("0.5"), 1.02185753308803, - -0.0118360652282043 + -0.0118360652282043, ), ( ConnectorPort.A, -1, BigDecimal("0.6"), 1.02107373425853, - -0.0142061081340842 + -0.0142061081340842, ), ( ConnectorPort.A, -1, BigDecimal("0.7"), 1.02027765639326, - -0.016576151209338 + -0.016576151209338, ), ( ConnectorPort.A, -1, BigDecimal("0.8"), 1.01946924161175, - -0.0189461944547642 + -0.0189461944547642, ), ( ConnectorPort.A, -1, BigDecimal("0.9"), 1.01864843076367, - -0.0213162378711784 + -0.0213162378711784, ), ( ConnectorPort.A, -1, BigDecimal("1"), 1.01781516340425, - -0.0236862814594147 + -0.0236862814594147, ), ( ConnectorPort.A, 0, BigDecimal("-1"), 1.00667467871911, - 0.0243219072957343 + 0.0243219072957343, ), ( ConnectorPort.A, 0, BigDecimal("-0.9"), 1.00605921263868, - 0.0218910966580921 + 0.0218910966580921, ), ( ConnectorPort.A, 0, BigDecimal("-0.8"), 1.00543130713357, - 0.0194602858488637 + 0.0194602858488637, ), ( ConnectorPort.A, 0, BigDecimal("-0.7"), 1.0047909157835, - 0.0170294748674087 + 0.0170294748674087, ), ( ConnectorPort.A, 0, BigDecimal("-0.6"), 1.00413799100698, - 0.0145986637130708 + 0.0145986637130708, ), ( ConnectorPort.A, 0, BigDecimal("-0.5"), 1.00347248404206, - 0.0121678523851774 + 0.0121678523851774, ), ( ConnectorPort.A, 0, BigDecimal("-0.4"), 1.00279434492653, - 0.00973704088303931 + 0.00973704088303931, ), ( ConnectorPort.A, 0, BigDecimal("-0.3"), 1.00210352247738, - 0.00730622920595051 + 0.00730622920595051, ), ( ConnectorPort.A, 0, BigDecimal("-0.2"), 1.00139996426967, - 0.00487541735318787 + 0.00487541735318787, ), ( ConnectorPort.A, 0, BigDecimal("-0.1"), 1.00068361661459, - 0.00244460532401091 + 0.00244460532401091, ), ( ConnectorPort.A, 0, BigDecimal("0"), 0.999954424536941, - 0.0000137931176612275 + 0.0000137931176612275, ), ( ConnectorPort.A, 0, BigDecimal("0.1"), 0.999212331751719, - -0.00241701926663761 + -0.00241701926663761, ), ( ConnectorPort.A, 0, BigDecimal("0.2"), 0.99845728064004, - -0.00484783182968026 + -0.00484783182968026, ), ( ConnectorPort.A, 0, BigDecimal("0.3"), 0.997689212224214, - -0.00727864457228031 + -0.00727864457228031, ), ( ConnectorPort.A, 0, BigDecimal("0.4"), 0.996908066142007, - -0.00970945749527035 + -0.00970945749527035, ), ( ConnectorPort.A, 0, BigDecimal("0.5"), 0.996113780620051, - -0.0121402705995025 + -0.0121402705995025, ), ( ConnectorPort.A, 0, BigDecimal("0.6"), 0.995306292446364, - -0.0145710838858487 + -0.0145710838858487, ), ( ConnectorPort.A, 0, BigDecimal("0.7"), 0.994485536941961, - -0.0170018973552011 + -0.0170018973552011, ), ( ConnectorPort.A, 0, BigDecimal("0.8"), 0.993651447931513, - -0.0194327110084725 + -0.0194327110084725, ), ( ConnectorPort.A, 0, BigDecimal("0.9"), 0.99280395771303, - -0.0218635248465967 + -0.0218635248465967, ), ( ConnectorPort.A, 0, BigDecimal("1"), 0.99194299702652, - -0.0242943388705291 + -0.0242943388705291, ), ( ConnectorPort.A, 1, BigDecimal("-1"), 0.98242100499016, - 0.0249292732837263 + 0.0249292732837263, ), ( ConnectorPort.A, 1, BigDecimal("-0.9"), 0.981796267611054, - 0.0224376924644968 + 0.0224376924644968, ), ( ConnectorPort.A, 1, BigDecimal("-0.8"), 0.981158156688823, - 0.019946111460796 + 0.019946111460796, ), ( ConnectorPort.A, 1, BigDecimal("-0.7"), 0.980506620261764, - 0.0174545302719071 + 0.0174545302719071, ), ( ConnectorPort.A, 1, BigDecimal("-0.6"), 0.979841604996861, - 0.0149629488970946 + 0.0149629488970946, ), ( ConnectorPort.A, 1, BigDecimal("-0.5"), 0.979163056166092, - 0.0124713673356035 + 0.0124713673356035, ), ( ConnectorPort.A, 1, BigDecimal("-0.4"), 0.978470917621914, - 0.00997978558665933 + 0.00997978558665933, ), ( ConnectorPort.A, 1, BigDecimal("-0.3"), 0.977765131771884, - 0.00748820364946775 + 0.00748820364946775, ), ( ConnectorPort.A, 1, BigDecimal("-0.2"), 0.977045639552417, - 0.00499662152321397 + 0.00499662152321397, ), ( ConnectorPort.A, 1, BigDecimal("-0.1"), 0.976312380401615, - 0.00250503920706258 + 0.00250503920706258, ), ( ConnectorPort.A, 1, BigDecimal("0"), 0.975565292231162, - 0.0000134567001572926 + 0.0000134567001572926, ), ( ConnectorPort.A, 1, BigDecimal("0.1"), 0.974804311397244, - -0.00247812599838001 + -0.00247812599838001, ), ( ConnectorPort.A, 1, BigDecimal("0.2"), 0.974029372670451, - -0.0049697088894488 + -0.0049697088894488, ), ( ConnectorPort.A, 1, BigDecimal("0.3"), 0.973240409204641, - -0.00746129197397136 + -0.00746129197397136, ), ( ConnectorPort.A, 1, BigDecimal("0.4"), 0.972437352504711, - -0.00995287525289237 + -0.00995287525289237, ), ( ConnectorPort.A, 1, BigDecimal("0.5"), 0.971620132393254, - -0.0124444587271799 + -0.0124444587271799, ), ( ConnectorPort.A, 1, BigDecimal("0.6"), 0.97078867697604, - -0.0149360423978257 + -0.0149360423978257, ), ( ConnectorPort.A, 1, BigDecimal("0.7"), 0.969942912606292, - -0.0174276262658455 + -0.0174276262658455, ), ( ConnectorPort.A, 1, BigDecimal("0.8"), 0.969082763847711, - -0.0199192103322799 + -0.0199192103322799, ), ( ConnectorPort.A, 1, BigDecimal("0.9"), 0.968208153436193, - -0.0224107945981947 + -0.0224107945981947, ), ( ConnectorPort.A, 1, BigDecimal("1"), 0.967319002240194, - -0.0249023790646814 + -0.0249023790646814, ), ( ConnectorPort.A, 2, BigDecimal("-1"), 0.959326351461916, - 0.025536655258949 + 0.025536655258949, ), ( ConnectorPort.A, 2, BigDecimal("-0.9"), 0.958692784499275, - 0.022984304264225 + 0.022984304264225, ), ( ConnectorPort.A, 2, BigDecimal("-0.8"), 0.958044865723424, - 0.0204319530715357 + 0.0204319530715357, ), ( ConnectorPort.A, 2, BigDecimal("-0.7"), 0.957382537160275, - 0.0178796016800814 + 0.0178796016800814, ), ( ConnectorPort.A, 2, BigDecimal("-0.6"), 0.956705739223261, - 0.0153272500890402 + 0.0153272500890402, ), ( ConnectorPort.A, 2, BigDecimal("-0.5"), 0.956014410684269, - 0.0127748982975676 + 0.0127748982975676, ), ( ConnectorPort.A, 2, BigDecimal("-0.4"), 0.955308488643518, - 0.0102225463047959 + 0.0102225463047959, ), ( ConnectorPort.A, 2, BigDecimal("-0.3"), 0.954587908498331, - 0.0076701941098341 + 0.0076701941098341, ), ( ConnectorPort.A, 2, BigDecimal("-0.2"), 0.953852603910776, - 0.00511784171176699 + 0.00511784171176699, ), ( ConnectorPort.A, 2, BigDecimal("-0.1"), 0.953102506774115, - 0.00256548910965531 + 0.00256548910965531, ), ( ConnectorPort.A, 2, BigDecimal("0"), 0.952337547178039, - 0.0000131363025345216 + 0.0000131363025345216, ), ( ConnectorPort.A, 2, BigDecimal("0.1"), 0.951557653372631, - -0.00253921671058493 + -0.00253921671058493, ), ( ConnectorPort.A, 2, BigDecimal("0.2"), 0.950762751731016, - -0.00509156993071863 + -0.00509156993071863, ), ( ConnectorPort.A, 2, BigDecimal("0.3"), 0.949952766710642, - -0.00764392335890866 + -0.00764392335890866, ), ( ConnectorPort.A, 2, BigDecimal("0.4"), 0.949127620813153, - -0.0101962769962239 + -0.0101962769962239, ), ( ConnectorPort.A, 2, BigDecimal("0.5"), 0.948287234542783, - -0.0127486308437611 + -0.0127486308437611, ), ( ConnectorPort.A, 2, BigDecimal("0.6"), 0.947431526363226, - -0.0153009849026448 + -0.0153009849026448, ), ( ConnectorPort.A, 2, BigDecimal("0.7"), 0.946560412652918, - -0.0178533391740284 + -0.0178533391740284, ), ( ConnectorPort.A, 2, BigDecimal("0.8"), 0.945673807658669, - -0.0204056936590949 + -0.0204056936590949, ), ( ConnectorPort.A, 2, BigDecimal("0.9"), 0.944771623447575, - -0.0229580483590572 + -0.0229580483590572, ), ( ConnectorPort.A, 2, BigDecimal("1"), 0.943853769857146, - -0.0255104032751589 + -0.0255104032751589, ), ( ConnectorPort.A, 3, BigDecimal("-1"), 0.937309638289396, - 0.0261440521030076 + 0.0261440521030076, ), ( ConnectorPort.A, 3, BigDecimal("-0.9"), 0.936667693006795, - 0.0235309309390136 + 0.0235309309390136, ), ( ConnectorPort.A, 3, BigDecimal("-0.8"), 0.936010372616478, - 0.0209178095629393 + 0.0209178095629393, ), ( ConnectorPort.A, 3, BigDecimal("-0.7"), 0.93533761263946, - 0.0183046879738953 + 0.0183046879738953, ), ( ConnectorPort.A, 3, BigDecimal("-0.6"), 0.934649346708417, - 0.015691566170966 + 0.015691566170966, ), ( ConnectorPort.A, 3, BigDecimal("-0.5"), 0.933945506532227, - 0.0130784441532096 + 0.0130784441532096, ), ( ConnectorPort.A, 3, BigDecimal("-0.4"), 0.933226021859156, - 0.0104653219196569 + 0.0104653219196569, ), ( ConnectorPort.A, 3, BigDecimal("-0.3"), 0.932490820438636, - 0.00785219946931139 + 0.00785219946931139, ), ( ConnectorPort.A, 3, BigDecimal("-0.2"), 0.931739827981568, - 0.00523907680114834 + 0.00523907680114834, ), ( ConnectorPort.A, 3, BigDecimal("-0.1"), 0.930972968119121, - 0.00262595391411435 + 0.00262595391411435, ), ( ConnectorPort.A, 3, BigDecimal("0"), 0.930190162359945, - 0.0000128308071266819 + 0.0000128308071266819, ), ( ConnectorPort.A, 3, BigDecimal("0.1"), 0.929391330045746, - -0.00260029252092719 + -0.00260029252092719, ), ( ConnectorPort.A, 3, BigDecimal("0.2"), 0.928576388305162, - -0.00521341607119046 + -0.00521341607119046, ), ( ConnectorPort.A, 3, BigDecimal("0.3"), 0.927745252005883, - -0.00782653984483726 + -0.00782653984483726, ), ( ConnectorPort.A, 3, BigDecimal("0.4"), 0.92689783370491, - -0.010439663843074 + -0.010439663843074, ), ( ConnectorPort.A, 3, BigDecimal("0.5"), 0.926034043596923, - -0.0130527880671392 + -0.0130527880671392, ), ( ConnectorPort.A, 3, BigDecimal("0.6"), 0.925153789460646, - -0.0156659125183051 + -0.0156659125183051, ), ( ConnectorPort.A, 3, BigDecimal("0.7"), 0.924256976603146, - -0.0182790371978777 + -0.0182790371978777, ), ( ConnectorPort.A, 3, BigDecimal("0.8"), 0.923343507801969, - -0.0208921621071982 + -0.0208921621071982, ), ( ConnectorPort.A, 3, BigDecimal("0.9"), 0.922413283245032, - -0.0235052872476434 + -0.0235052872476434, ), ( ConnectorPort.A, 3, BigDecimal("1"), 0.921466200468159, - -0.0261184126206265 + -0.0261184126206265, ), ( ConnectorPort.A, 4, BigDecimal("-1"), 0.916297152002557, - 0.0267514627991171 + 0.0267514627991171, ), ( ConnectorPort.A, 4, BigDecimal("-0.9"), 0.915647289147419, - 0.0240775714722086 + 0.0240775714722086, ), ( ConnectorPort.A, 4, BigDecimal("-0.8"), 0.914980982001204, - 0.0214036799184718 + 0.0214036799184718, ), ( ConnectorPort.A, 4, BigDecimal("-0.7"), 0.914298159066424, - 0.0187297881369204 + 0.0187297881369204, ), ( ConnectorPort.A, 4, BigDecimal("-0.6"), 0.913598746642793, - 0.0160558961265377 + 0.0160558961265377, ), ( ConnectorPort.A, 4, BigDecimal("-0.5"), 0.912882668784197, - 0.0133820038862763 + 0.0133820038862763, ), ( ConnectorPort.A, 4, BigDecimal("-0.4"), 0.912149847253943, - 0.010708111415057 + 0.010708111415057, ), ( ConnectorPort.A, 4, BigDecimal("-0.3"), 0.911400201478191, - 0.00803421871176822 + 0.00803421871176822, ), ( ConnectorPort.A, 4, BigDecimal("-0.2"), 0.910633648497533, - 0.00536032577526581 + 0.00536032577526581, ), ( ConnectorPort.A, 4, BigDecimal("-0.1"), 0.909850102916617, - 0.00268643260437178 + 0.00268643260437178, ), ( ConnectorPort.A, 4, BigDecimal("0"), 0.909049476851765, - 0.0000125391978738261 + 0.0000125391978738261, ), ( ConnectorPort.A, 4, BigDecimal("0.1"), 0.908231679876474, - -0.00266135444547526 + -0.00266135444547526, ), ( ConnectorPort.A, 4, BigDecimal("0.2"), 0.907396618964748, - -0.00533524832695871 + -0.00533524832695871, ), ( ConnectorPort.A, 4, BigDecimal("0.3"), 0.90654419843214, - -0.00800914244789641 + -0.00800914244789641, ), ( ConnectorPort.A, 4, BigDecimal("0.4"), 0.905674319874432, - -0.0106830368096457 + -0.0106830368096457, ), ( ConnectorPort.A, 4, BigDecimal("0.5"), 0.904786882103834, - -0.0133569314136022 + -0.0133569314136022, ), ( ConnectorPort.A, 4, BigDecimal("0.6"), 0.903881781082618, - -0.0160308262612012 + -0.0160308262612012, ), ( ConnectorPort.A, 4, BigDecimal("0.7"), 0.902958909854047, - -0.0187047213539179 + -0.0187047213539179, ), ( ConnectorPort.A, 4, BigDecimal("0.8"), 0.902018158470513, - -0.0213786166932688 + -0.0213786166932688, ), ( ConnectorPort.A, 4, BigDecimal("0.9"), 0.901059413918729, - -0.0240525122808131 + -0.0240525122808131, ), ( ConnectorPort.A, 4, BigDecimal("1"), 0.900082560041867, - -0.0267264081181527 + -0.0267264081181527, ), ( ConnectorPort.A, 5, BigDecimal("-1"), 0.896221727050347, - 0.0273588864208129 + 0.0273588864208129, ), ( ConnectorPort.A, 5, BigDecimal("-0.9"), 0.895564416790433, - 0.0246242249374753 + 0.0246242249374753, ), ( ConnectorPort.A, 5, BigDecimal("-0.8"), 0.894889546310647, - 0.0218895632119166 + 0.0218895632119166, ), ( ConnectorPort.A, 5, BigDecimal("-0.7"), 0.894197036560895, - 0.0191549012430461 + 0.0191549012430461, ), ( ConnectorPort.A, 5, BigDecimal("-0.6"), 0.893486805931015, - 0.0164202390297385 + 0.0164202390297385, ), ( ConnectorPort.A, 5, BigDecimal("-0.5"), 0.892758770198814, - 0.0136855765708318 + 0.0136855765708318, ), ( ConnectorPort.A, 5, BigDecimal("-0.4"), 0.892012842475918, - 0.0109509138651274 + 0.0109509138651274, ), ( ConnectorPort.A, 5, BigDecimal("-0.3"), 0.891248933151341, - 0.00821625091138941 + 0.00821625091138941, ), ( ConnectorPort.A, 5, BigDecimal("-0.2"), 0.890466949832678, - 0.00548158770834329 + 0.00548158770834329, ), ( ConnectorPort.A, 5, BigDecimal("-0.1"), 0.889666797284832, - 0.00274692425467551 + 0.00274692425467551, ), ( ConnectorPort.A, 5, BigDecimal("0"), 0.88884837736617, - 0.0000122605490321726 + 0.0000122605490321726, ), ( ConnectorPort.A, 5, BigDecimal("0.1"), 0.888011588961992, - -0.00272240340998137 + -0.00272240340998137, ), ( ConnectorPort.A, 5, BigDecimal("0.2"), 0.887156327915216, - -0.0054570676238018 + -0.0054570676238018, ), ( ConnectorPort.A, 5, BigDecimal("0.3"), 0.886282486954139, - -0.00819173209390892 + -0.00819173209390892, ), ( ConnectorPort.A, 5, BigDecimal("0.4"), 0.885389955617163, - -0.0109263968218263 + -0.0109263968218263, ), ( ConnectorPort.A, 5, BigDecimal("0.5"), 0.884478620174337, - -0.0136610618091228 + -0.0136610618091228, ), ( ConnectorPort.A, 5, BigDecimal("0.6"), 0.883548363545585, - -0.0163957270574133 + -0.0163957270574133, ), ( ConnectorPort.A, 5, BigDecimal("0.7"), 0.882599065215458, - -0.0191303925683602 + -0.0191303925683602, ), ( ConnectorPort.A, 5, BigDecimal("0.8"), 0.881630601144261, - -0.0218650583436745 + -0.0218650583436745, ), ( ConnectorPort.A, 5, BigDecimal("0.9"), 0.880642843675374, - -0.024599724385117 + -0.024599724385117, ), ( ConnectorPort.A, 5, BigDecimal("1"), 0.879635661438599, - -0.0273343906944998 + -0.0273343906944998, ), ( ConnectorPort.A, 6, BigDecimal("-1"), 0.877022034099252, - 0.0279663221221337 + 0.0279663221221337, ), ( ConnectorPort.A, 6, BigDecimal("-0.9"), 0.876357755960366, - 0.0251708904889815 + 0.0251708904889815, ), ( ConnectorPort.A, 6, BigDecimal("-0.8"), 0.875674754078128, - 0.0223754585975588 + 0.0223754585975588, ), ( ConnectorPort.A, 6, BigDecimal("-0.7"), 0.874972941295997, - 0.0195800264466633 + 0.0195800264466633, ), ( ConnectorPort.A, 6, BigDecimal("-0.6"), 0.874252227492712, - 0.0167845940350519 + 0.0167845940350519, ), ( ConnectorPort.A, 6, BigDecimal("-0.5"), 0.873512519519852, - 0.0139891613614397 + 0.0139891613614397, ), ( ConnectorPort.A, 6, BigDecimal("-0.4"), 0.872753721136625, - 0.0111937284244993 + 0.0111937284244993, ), ( ConnectorPort.A, 6, BigDecimal("-0.3"), 0.871975732941789, - 0.00839829522285939 + 0.00839829522285939, ), ( ConnectorPort.A, 6, BigDecimal("-0.2"), 0.871178452302574, - 0.00560286175510445 + 0.00560286175510445, ), ( ConnectorPort.A, 6, BigDecimal("-0.1"), 0.870361773280489, - 0.00280742801977313 + 0.00280742801977313, ), ( ConnectorPort.A, 6, BigDecimal("0"), 0.869525586553862, - 0.0000119940153575949 + 0.0000119940153575949, ), ( ConnectorPort.A, 6, BigDecimal("0.1"), 0.868669779336989, - -0.00278344025969814 + -0.00278344025969814, ), ( ConnectorPort.A, 6, BigDecimal("0.2"), 0.867794235295722, - -0.00557887480699857 + -0.00557887480699857, ), ( ConnectorPort.A, 6, BigDecimal("0.3"), 0.866898834459354, - -0.00837430962819862 + -0.00837430962819862, ), ( ConnectorPort.A, 6, BigDecimal("0.4"), 0.865983453128614, - -0.0111697447250045 + -0.0111697447250045, ), ( ConnectorPort.A, 6, BigDecimal("0.5"), 0.865047963779603, - -0.0139651800991754 + -0.0139651800991754, ), ( ConnectorPort.A, 6, BigDecimal("0.6"), 0.864092234963478, - -0.0167606157525242 + -0.0167606157525242, ), ( ConnectorPort.A, 6, BigDecimal("0.7"), 0.863116131201677, - -0.0195560516869199 + -0.0195560516869199, ), ( ConnectorPort.A, 6, BigDecimal("0.8"), 0.862119512876472, - -0.0223514879042882 + -0.0223514879042882, ), ( ConnectorPort.A, 6, BigDecimal("0.9"), 0.861102236116629, - -0.0251469244066139 + -0.0251469244066139, ), ( ConnectorPort.A, 6, BigDecimal("1"), 0.860064152677919, - -0.0279423611959415 + -0.0279423611959415, ), ( ConnectorPort.A, 7, BigDecimal("-1"), 0.858641959186664, - 0.0285737691290579 + 0.0285737691290579, ), ( ConnectorPort.A, 7, BigDecimal("-0.9"), 0.857971201991724, - 0.0257175673528338 + 0.0257175673528338, ), ( ConnectorPort.A, 7, BigDecimal("-0.8"), 0.857280509092796, - 0.0228613653016216 + 0.0228613653016216, ), ( ConnectorPort.A, 7, BigDecimal("-0.7"), 0.856569784654187, - 0.0200051629740995 + 0.0200051629740995, ), ( ConnectorPort.A, 7, BigDecimal("-0.6"), 0.855838929418557, - 0.0171489603688983 + 0.0171489603688983, ), ( ConnectorPort.A, 7, BigDecimal("-0.5"), 0.855087840632218, - 0.0142927574846006 + 0.0142927574846006, ), ( ConnectorPort.A, 7, BigDecimal("-0.4"), 0.854316411966964, - 0.0114365543197398 + 0.0114365543197398, ), ( ConnectorPort.A, 7, BigDecimal("-0.3"), 0.853524533438308, - 0.00858035087279871 + 0.00858035087279871, ), ( ConnectorPort.A, 7, BigDecimal("-0.2"), 0.852712091319953, - 0.00572414714220867 + 0.00572414714220867, ), ( ConnectorPort.A, 7, BigDecimal("-0.1"), 0.851878968054342, - 0.00286794312634817 + 0.00286794312634817, ), ( ConnectorPort.A, 7, BigDecimal("0"), 0.851025042159099, - 0.0000117388235414818 + 0.0000117388235414818, ), ( ConnectorPort.A, 7, BigDecimal("0.1"), 0.850150188129183, - -0.00284446576794258 + -0.00284446576794258, ), ( ConnectorPort.A, 7, BigDecimal("0.2"), 0.849254276334546, - -0.00570067064989212 + -0.00570067064989212, ), ( ConnectorPort.A, 7, BigDecimal("0.3"), 0.848337172913088, - -0.00855687582415354 + -0.00855687582415354, ), ( ConnectorPort.A, 7, BigDecimal("0.4"), 0.847398739658691, - -0.0114130812926333 + -0.0114130812926333, ), ( ConnectorPort.A, 7, BigDecimal("0.5"), 0.846438833904073, - -0.0142692870572994 + -0.0142692870572994, ), ( ConnectorPort.A, 7, BigDecimal("0.6"), 0.845457308398231, - -0.0171254931201827 + -0.0171254931201827, ), ( ConnectorPort.A, 7, BigDecimal("0.7"), 0.844454011178183, - -0.0199816994833795 + -0.0199816994833795, ), ( ConnectorPort.A, 7, BigDecimal("0.8"), 0.843428785434739, - -0.0228379061490529 + -0.0228379061490529, ), ( ConnectorPort.A, 7, BigDecimal("0.9"), 0.842381469371976, - -0.0256941131194345 + -0.0256941131194345, ), ( ConnectorPort.A, 7, BigDecimal("1"), 0.841311896060106, - -0.0285503203968269 + -0.0285503203968269, ), ( ConnectorPort.A, 8, BigDecimal("-1"), 0.841030060479342, - 0.0291812267320097 + 0.0291812267320097, ), ( ConnectorPort.A, 8, BigDecimal("-0.9"), 0.840353322288959, - 0.0262642548195838 + 0.0262642548195838, ), ( ConnectorPort.A, 8, BigDecimal("-0.8"), 0.83965538716051, - 0.0233472826147727 + 0.0233472826147727, ), ( ConnectorPort.A, 8, BigDecimal("-0.7"), 0.838936149988622, - 0.0204303101161266 + 0.0204303101161266, ), ( ConnectorPort.A, 8, BigDecimal("-0.6"), 0.838195501731806, - 0.0175133373221414 + 0.0175133373221414, ), ( ConnectorPort.A, 8, BigDecimal("-0.5"), 0.83743332932346, - 0.0145963642312576 + 0.0145963642312576, ), ( ConnectorPort.A, 8, BigDecimal("-0.4"), 0.836649515578583, - 0.0116793908418586 + 0.0116793908418586, ), ( ConnectorPort.A, 8, BigDecimal("-0.3"), 0.835843939095994, - 0.00876241715226996 + 0.00876241715226996, ), ( ConnectorPort.A, 8, BigDecimal("-0.2"), 0.835016474155855, - 0.0058454431607575 + 0.0058454431607575, ), ( ConnectorPort.A, 8, BigDecimal("-0.1"), 0.834166990612276, - 0.00292846886552601 + 0.00292846886552601, ), ( ConnectorPort.A, 8, BigDecimal("0"), 0.833295353780784, - 0.0000114942647176662 + 0.0000114942647176662, ), ( ConnectorPort.A, 8, BigDecimal("0.1"), 0.8324014243204, - -0.00290548064358957 + -0.00290548064358957, ), ( ConnectorPort.A, 8, BigDecimal("0.2"), 0.831485058110058, - -0.00582245586138358 + -0.00582245586138358, ), ( ConnectorPort.A, 8, BigDecimal("0.3"), 0.830546106119103, - -0.00873943139072012 + -0.00873943139072012, ), ( ConnectorPort.A, 8, BigDecimal("0.4"), 0.829584414271562, - -0.0116564072337245 + -0.0116564072337245, ), ( ConnectorPort.A, 8, BigDecimal("0.5"), 0.828599823303866, - -0.0145733833925936 + -0.0145733833925936, ), ( ConnectorPort.A, 8, BigDecimal("0.6"), 0.827592168615705, - -0.0174903598695977 + -0.0174903598695977, ), ( ConnectorPort.A, 8, BigDecimal("0.7"), 0.826561280113639, - -0.0204073366670832 + -0.0204073366670832, ), ( ConnectorPort.A, 8, BigDecimal("0.8"), 0.825506982047084, - -0.0233243137874742 + -0.0233243137874742, ), ( ConnectorPort.A, 8, BigDecimal("0.9"), 0.824429092836285, - -0.0262412912332756 + -0.0262412912332756, ), ( ConnectorPort.A, 8, BigDecimal("1"), 0.823327424891804, - -0.0291582690070747 + -0.0291582690070747, ), ( ConnectorPort.A, 9, BigDecimal("-1"), 0.824139091550437, - 0.0297886942792841 + 0.0297886942792841, ), ( ConnectorPort.A, 9, BigDecimal("-0.9"), 0.823456879605168, - 0.026810952237653 + 0.026810952237653, ), ( ConnectorPort.A, 9, BigDecimal("-0.8"), 0.822752159383568, - 0.0238332098855486 + 0.0238332098855486, ), ( ConnectorPort.A, 9, BigDecimal("-0.7"), 0.822024815903447, - 0.0208554672213847 + 0.0208554672213847, ), ( ConnectorPort.A, 9, BigDecimal("-0.6"), 0.821274729668807, - 0.017877724243513 + 0.017877724243513, ), ( ConnectorPort.A, 9, BigDecimal("-0.5"), 0.820501776564291, - 0.0148999809502215 + 0.0148999809502215, ), ( ConnectorPort.A, 9, BigDecimal("-0.4"), 0.819705827744304, - 0.0119222373397329 + 0.0119222373397329, ), ( ConnectorPort.A, 9, BigDecimal("-0.3"), 0.818886749516568, - 0.00894449341020311 + 0.00894449341020311, ), ( ConnectorPort.A, 9, BigDecimal("-0.2"), 0.818044403219829, - 0.0059667491597195 + 0.0059667491597195, ), ( ConnectorPort.A, 9, BigDecimal("-0.1"), 0.817178645095452, - 0.00298900458629903 + 0.00298900458629903, ), ( ConnectorPort.A, 9, BigDecimal("0"), 0.816289326152605, - 0.0000112596878866997 + 0.0000112596878866997, ), ( ConnectorPort.A, 9, BigDecimal("0.1"), 0.815376292026695, - -0.0029664855376469 + -0.0029664855376469, ), ( ConnectorPort.A, 9, BigDecimal("0.2"), 0.81443938283074, - -0.00594423109250713 + -0.00594423109250713, ), ( ConnectorPort.A, 9, BigDecimal("0.3"), 0.813478432999293, - -0.00892197697897786 + -0.00892197697897786, ), ( ConnectorPort.A, 9, BigDecimal("0.4"), 0.812493271124543, - -0.0118997231994233 + -0.0118997231994233, ), ( ConnectorPort.A, 9, BigDecimal("0.5"), 0.811483719784173, - -0.0148774697562908 + -0.0148774697562908, ), ( ConnectorPort.A, 9, BigDecimal("0.6"), 0.810449595360531, - -0.0178552166521133 + -0.0178552166521133, ), ( ConnectorPort.A, 9, BigDecimal("0.7"), 0.809390707850645, - -0.0208329638895114 + -0.0208329638895114, ), ( ConnectorPort.A, 9, BigDecimal("0.8"), 0.808306860666568, - -0.023810711471197 + -0.023810711471197, ), ( ConnectorPort.A, 9, BigDecimal("0.9"), 0.807197850425516, - -0.0267884593999754 + -0.0267884593999754, ), ( ConnectorPort.A, 9, BigDecimal("1"), 0.806063466729219, - -0.0297662076787489 + -0.0297662076787489, ), ( ConnectorPort.A, 10, BigDecimal("-1"), 0.807925581862439, - 0.0303961711712593 + 0.0303961711712593, ), ( ConnectorPort.A, 10, BigDecimal("-0.9"), 0.80723841252684, - 0.0273576590075458 + 0.0273576590075458, ), ( ConnectorPort.A, 10, BigDecimal("-0.8"), 0.806527372646608, - 0.0243191465145681 + 0.0243191465145681, ), ( ConnectorPort.A, 10, BigDecimal("-0.7"), 0.805792336740328, - 0.0212806336905953 + 0.0212806336905953, ), ( ConnectorPort.A, 10, BigDecimal("-0.6"), 0.80503317416582, - 0.0182421205338254 + 0.0182421205338254, ), ( ConnectorPort.A, 10, BigDecimal("-0.5"), 0.80424974899546, - 0.0152036070423834 + 0.0152036070423834, ), ( ConnectorPort.A, 10, BigDecimal("-0.4"), 0.803441919884922, - 0.0121650932143196 + 0.0121650932143196, ), ( ConnectorPort.A, 10, BigDecimal("-0.3"), 0.802609539935054, - 0.0091265790476078 + 0.0091265790476078, ), ( ConnectorPort.A, 10, BigDecimal("-0.2"), 0.801752456546514, - 0.00608806454014298 + 0.00608806454014298, ), ( ConnectorPort.A, 10, BigDecimal("-0.1"), 0.800870511266842, - 0.0030495496897396 + 0.0030495496897396, ), ( ConnectorPort.A, 10, BigDecimal("0"), 0.799963539629553, - 0.0000110344941289201 + 0.0000110344941289201, ), ( ConnectorPort.A, 10, BigDecimal("0.1"), 0.799031370984863, - -0.0030274810490428 + -0.0030274810490428, ), ( ConnectorPort.A, 10, BigDecimal("0.2"), 0.798073828321583, - -0.00606599694221734 + -0.00606599694221734, ), ( ConnectorPort.A, 10, BigDecimal("0.3"), 0.797090728079733, - -0.00910451318792664 + -0.00910451318792664, ), ( ConnectorPort.A, 10, BigDecimal("0.4"), 0.796081879953352, - -0.0121430297887958 + -0.0121430297887958, ), ( ConnectorPort.A, 10, BigDecimal("0.5"), 0.79504708668297, - -0.0151815467475456 + -0.0151815467475456, ), ( ConnectorPort.A, 10, BigDecimal("0.6"), 0.793986143837166, - -0.018220064066996 + -0.018220064066996, ), ( ConnectorPort.A, 10, BigDecimal("0.7"), 0.792898839582582, - -0.021258581750069 + -0.021258581750069, ), ( ConnectorPort.A, 10, BigDecimal("0.8"), 0.791784954441728, - -0.024297099799792 + -0.024297099799792, ), ( ConnectorPort.A, 10, BigDecimal("0.9"), 0.790644261037859, - -0.0273356182193014 + -0.0273356182193014, ), ( ConnectorPort.A, 10, BigDecimal("1"), 0.789476523826166, - -0.0303741370118462 + -0.0303741370118462, ), ( ConnectorPort.B, -10, BigDecimal("-1"), 0.755006009039332, - 0.0182414304718007 + 0.0182414304718007, ), ( ConnectorPort.B, -10, BigDecimal("-0.9"), 0.754544409479012, - 0.0164183224935691 + 0.0164183224935691, ), ( ConnectorPort.B, -10, BigDecimal("-0.8"), 0.754073480350179, - 0.0145952143866478 + 0.0145952143866478, ), ( ConnectorPort.B, -10, BigDecimal("-0.7"), 0.753593186837628, - 0.0127721061505565 + 0.0127721061505565, ), ( ConnectorPort.B, -10, BigDecimal("-0.6"), 0.753103493255236, - 0.0109489977848031 + 0.0109489977848031, ), ( ConnectorPort.B, -10, BigDecimal("-0.5"), 0.752604363031546, - 0.00912588928888304 + 0.00912588928888304, ), ( ConnectorPort.B, -10, BigDecimal("-0.4"), 0.752095758694897, - 0.00730278066227947 + 0.00730278066227947, ), ( ConnectorPort.B, -10, BigDecimal("-0.3"), 0.751577641858037, - 0.00547967190446287 + 0.00547967190446287, ), ( ConnectorPort.B, -10, BigDecimal("-0.2"), 0.75104997320225, - 0.00365656301489095 + 0.00365656301489095, ), ( ConnectorPort.B, -10, BigDecimal("-0.1"), 0.750512712460944, - 0.00183345399300819 + 0.00183345399300819, ), ( ConnectorPort.B, -10, BigDecimal("0"), 0.749965818402706, - 0.0000103448382458858 + 0.0000103448382458858, ), ( ConnectorPort.B, -10, BigDecimal("0.1"), 0.749409248813789, - -0.00181276444997821 + -0.00181276444997821, ), ( ConnectorPort.B, -10, BigDecimal("0.2"), 0.74884296048003, - -0.00363587387226018 + -0.00363587387226018, ), ( ConnectorPort.B, -10, BigDecimal("0.3"), 0.74826690916816, - -0.00545898342921021 + -0.00545898342921021, ), ( ConnectorPort.B, -10, BigDecimal("0.4"), 0.747681049606505, - -0.00728209312145274 + -0.00728209312145274, ), ( ConnectorPort.B, -10, BigDecimal("0.5"), 0.747085335465038, - -0.00910520294962691 + -0.00910520294962691, ), ( ConnectorPort.B, -10, BigDecimal("0.6"), 0.746479719334773, - -0.0109283129143865 + -0.0109283129143865, ), ( ConnectorPort.B, -10, BigDecimal("0.7"), 0.74586415270647, - -0.0127514230164008 + -0.0127514230164008, ), ( ConnectorPort.B, -10, BigDecimal("0.8"), 0.745238585948635, - -0.0145745332563544 + -0.0145745332563544, ), ( ConnectorPort.B, -10, BigDecimal("0.9"), 0.744602968284773, - -0.0163976436349476 + -0.0163976436349476, ), ( ConnectorPort.B, -10, BigDecimal("1"), 0.74395724776989, - -0.0182207541528969 + -0.0182207541528969, ), ( ConnectorPort.B, -9, BigDecimal("-1"), 0.78017287600731, - 0.018849478154194 + 0.018849478154194, ), ( ConnectorPort.B, -9, BigDecimal("-0.9"), 0.779695889794979, - 0.0169655999100214 + 0.0169655999100214, ), ( ConnectorPort.B, -9, BigDecimal("-0.8"), 0.779209263028518, - 0.0150817215328694 + 0.0150817215328694, ), ( ConnectorPort.B, -9, BigDecimal("-0.7"), 0.778712959732216, - 0.0131978430222418 + 0.0131978430222418, ), ( ConnectorPort.B, -9, BigDecimal("-0.6"), 0.77820694303041, - 0.0113139643776299 + 0.0113139643776299, ), ( ConnectorPort.B, -9, BigDecimal("-0.5"), 0.777691175132598, - 0.00943008559851245 + 0.00943008559851245, ), ( ConnectorPort.B, -9, BigDecimal("-0.4"), 0.77716561731806, - 0.00754620668435543 + 0.00754620668435543, ), ( ConnectorPort.B, -9, BigDecimal("-0.3"), 0.776630229919971, - 0.00566232763461165 + 0.00566232763461165, ), ( ConnectorPort.B, -9, BigDecimal("-0.2"), 0.776084972308991, - 0.00377844844872068 + 0.00377844844872068, ), ( ConnectorPort.B, -9, BigDecimal("-0.1"), 0.775529802876309, - 0.00189456912610848 + 0.00189456912610848, ), ( ConnectorPort.B, -9, BigDecimal("0"), 0.77496467901613, - 0.0000106896661874416 + 0.0000106896661874416, ), ( ConnectorPort.B, -9, BigDecimal("0.1"), 0.774389557107582, - -0.00187318993164411 + -0.00187318993164411, ), ( ConnectorPort.B, -9, BigDecimal("0.2"), 0.773804392496031, - -0.00375706966800219 + -0.00375706966800219, ), ( ConnectorPort.B, -9, BigDecimal("0.3"), 0.773209139473766, - -0.00564094954351721 + -0.00564094954351721, ), ( ConnectorPort.B, -9, BigDecimal("0.4"), 0.772603751260056, - -0.00752482955883452 + -0.00752482955883452, ), ( ConnectorPort.B, -9, BigDecimal("0.5"), 0.77198817998054, - -0.00940870971461444 + -0.00940870971461444, ), ( ConnectorPort.B, -9, BigDecimal("0.6"), 0.771362376645932, - -0.0112925900115327 + -0.0112925900115327, ), ( ConnectorPort.B, -9, BigDecimal("0.7"), 0.770726291130019, - -0.0131764704502808 + -0.0131764704502808, ), ( ConnectorPort.B, -9, BigDecimal("0.8"), 0.770079872146923, - -0.0150603510315661 + -0.0150603510315661, ), ( ConnectorPort.B, -9, BigDecimal("0.9"), 0.769423067227599, - -0.0169442317561124 + -0.0169442317561124, ), ( ConnectorPort.B, -9, BigDecimal("1"), 0.768755822695553, - -0.0188281126246601 + -0.0188281126246601, ), ( ConnectorPort.B, -8, BigDecimal("-1"), 0.805339742975287, - 0.0194575258365874 + 0.0194575258365874, ), ( ConnectorPort.B, -8, BigDecimal("-0.9"), 0.804847370110946, - 0.0175128773264737 + 0.0175128773264737, ), ( ConnectorPort.B, -8, BigDecimal("-0.8"), 0.804345045706857, - 0.015568228679091 + 0.015568228679091, ), ( ConnectorPort.B, -8, BigDecimal("-0.7"), 0.803832732626804, - 0.0136235798939269 + 0.0136235798939269, ), ( ConnectorPort.B, -8, BigDecimal("-0.6"), 0.803310392805585, - 0.0116789309704566 + 0.0116789309704566, ), ( ConnectorPort.B, -8, BigDecimal("-0.5"), 0.802777987233649, - 0.00973428190814192 + 0.00973428190814192, ), ( ConnectorPort.B, -8, BigDecimal("-0.4"), 0.802235475941223, - 0.00778963270643144 + 0.00778963270643144, ), ( ConnectorPort.B, -8, BigDecimal("-0.3"), 0.801682817981906, - 0.0058449833647604 + 0.0058449833647604, ), ( ConnectorPort.B, -8, BigDecimal("-0.2"), 0.801119971415733, - 0.00390033388255032 + 0.00390033388255032, ), ( ConnectorPort.B, -8, BigDecimal("-0.1"), 0.800546893291674, - 0.00195568425920872 + 0.00195568425920872, ), ( ConnectorPort.B, -8, BigDecimal("0"), 0.799963539629553, - 0.0000110344941289503 + 0.0000110344941289503, ), ( ConnectorPort.B, -8, BigDecimal("0.1"), 0.799369865401375, - -0.00193361541331008 + -0.00193361541331008, ), ( ConnectorPort.B, -8, BigDecimal("0.2"), 0.798765824512032, - -0.0038782654637442 + -0.0038782654637442, ), ( ConnectorPort.B, -8, BigDecimal("0.3"), 0.798151369779371, - -0.00582291565782424 + -0.00582291565782424, ), ( ConnectorPort.B, -8, BigDecimal("0.4"), 0.797526452913606, - -0.00776756599621625 + -0.00776756599621625, ), ( ConnectorPort.B, -8, BigDecimal("0.5"), 0.796891024496041, - -0.00971221647960199 + -0.00971221647960199, ), ( ConnectorPort.B, -8, BigDecimal("0.6"), 0.796245033957091, - -0.011656867108679 + -0.011656867108679, ), ( ConnectorPort.B, -8, BigDecimal("0.7"), 0.795588429553568, - -0.0136015178841608 + -0.0136015178841608, ), ( ConnectorPort.B, -8, BigDecimal("0.8"), 0.79492115834521, - -0.015546168806778 + -0.015546168806778, ), ( ConnectorPort.B, -8, BigDecimal("0.9"), 0.794243166170425, - -0.0174908198772774 + -0.0174908198772774, ), ( ConnectorPort.B, -8, BigDecimal("1"), 0.793554397621216, - -0.0194354710964233 + -0.0194354710964233, ), ( ConnectorPort.B, -7, BigDecimal("-1"), 0.830506609943265, - 0.0200655735189807 + 0.0200655735189807, ), ( ConnectorPort.B, -7, BigDecimal("-0.9"), 0.829998850426913, - 0.018060154742926 + 0.018060154742926, ), ( ConnectorPort.B, -7, BigDecimal("-0.8"), 0.829480828385196, - 0.0160547358253125 + 0.0160547358253125, ), ( ConnectorPort.B, -7, BigDecimal("-0.7"), 0.828952505521391, - 0.0140493167656122 + 0.0140493167656122, ), ( ConnectorPort.B, -7, BigDecimal("-0.6"), 0.828413842580759, - 0.0120438975632834 + 0.0120438975632834, ), ( ConnectorPort.B, -7, BigDecimal("-0.5"), 0.827864799334701, - 0.0100384782177713 + 0.0100384782177713, ), ( ConnectorPort.B, -7, BigDecimal("-0.4"), 0.827305334564386, - 0.00803305872850738 + 0.00803305872850738, ), ( ConnectorPort.B, -7, BigDecimal("-0.3"), 0.82673540604384, - 0.00602763909490915 + 0.00602763909490915, ), ( ConnectorPort.B, -7, BigDecimal("-0.2"), 0.826154970522475, - 0.00402221931638 + 0.00402221931638, ), ( ConnectorPort.B, -7, BigDecimal("-0.1"), 0.825563983707039, - 0.00201679939230899 + 0.00201679939230899, ), ( ConnectorPort.B, -7, BigDecimal("0"), 0.824962400242977, - 0.0000113793220704718 + 0.0000113793220704718, ), ( ConnectorPort.B, -7, BigDecimal("0.1"), 0.824350173695168, - -0.00199404089497599 + -0.00199404089497599, ), ( ConnectorPort.B, -7, BigDecimal("0.2"), 0.823727256528033, - -0.00399946125948622 + -0.00399946125948622, ), ( ConnectorPort.B, -7, BigDecimal("0.3"), 0.823093600084976, - -0.00600488177213127 + -0.00600488177213127, ), ( ConnectorPort.B, -7, BigDecimal("0.4"), 0.822449154567156, - -0.00801030243359804 + -0.00801030243359804, ), ( ConnectorPort.B, -7, BigDecimal("0.5"), 0.821793869011542, - -0.0100157232445896 + -0.0100157232445896, ), ( ConnectorPort.B, -7, BigDecimal("0.6"), 0.82112769126825, - -0.0120211442058252 + -0.0120211442058252, ), ( ConnectorPort.B, -7, BigDecimal("0.7"), 0.820450567977117, - -0.0140265653180409 + -0.0140265653180409, ), ( ConnectorPort.B, -7, BigDecimal("0.8"), 0.819762444543498, - -0.0160319865819898 + -0.0160319865819898, ), ( ConnectorPort.B, -7, BigDecimal("0.9"), 0.81906326511325, - -0.0180374079984423 + -0.0180374079984423, ), ( ConnectorPort.B, -7, BigDecimal("1"), 0.818352972546879, - -0.0200428295681866 + -0.0200428295681866, ), ( ConnectorPort.B, -6, BigDecimal("-1"), 0.855673476911243, - 0.0206736212013741 + 0.0206736212013741, ), ( ConnectorPort.B, -6, BigDecimal("-0.9"), 0.85515033074288, - 0.0186074321593783 + 0.0186074321593783, ), ( ConnectorPort.B, -6, BigDecimal("-0.8"), 0.854616611063536, - 0.0165412429715342 + 0.0165412429715342, ), ( ConnectorPort.B, -6, BigDecimal("-0.7"), 0.854072278415979, - 0.0144750536372974 + 0.0144750536372974, ), ( ConnectorPort.B, -6, BigDecimal("-0.6"), 0.853517292355934, - 0.0124088641561102 + 0.0124088641561102, ), ( ConnectorPort.B, -6, BigDecimal("-0.5"), 0.852951611435753, - 0.0103426745274008 + 0.0103426745274008, ), ( ConnectorPort.B, -6, BigDecimal("-0.4"), 0.852375193187549, - 0.0082764847505834 + 0.0082764847505834, ), ( ConnectorPort.B, -6, BigDecimal("-0.3"), 0.851787994105775, - 0.00621029482505794 + 0.00621029482505794, ), ( ConnectorPort.B, -6, BigDecimal("-0.2"), 0.851189969629216, - 0.00414410475020971 + 0.00414410475020971, ), ( ConnectorPort.B, -6, BigDecimal("-0.1"), 0.850581074122403, - 0.00207791452540928 + 0.00207791452540928, ), ( ConnectorPort.B, -6, BigDecimal("0"), 0.8499612608564, - 0.0000117241500120423 + 0.0000117241500120423, ), ( ConnectorPort.B, -6, BigDecimal("0.1"), 0.849330481988961, - -0.00205446637664193 + -0.00205446637664193, ), ( ConnectorPort.B, -6, BigDecimal("0.2"), 0.848688688544034, - -0.0041206570552282 + -0.0041206570552282, ), ( ConnectorPort.B, -6, BigDecimal("0.3"), 0.848035830390582, - -0.00618684788643825 + -0.00618684788643825, ), ( ConnectorPort.B, -6, BigDecimal("0.4"), 0.847371856220706, - -0.00825303887097983 + -0.00825303887097983, ), ( ConnectorPort.B, -6, BigDecimal("0.5"), 0.846696713527044, - -0.0103192300095771 + -0.0103192300095771, ), ( ConnectorPort.B, -6, BigDecimal("0.6"), 0.84601034857941, - -0.0123854213029714 + -0.0123854213029714, ), ( ConnectorPort.B, -6, BigDecimal("0.7"), 0.845312706400666, - -0.0144516127519209 + -0.0144516127519209, ), ( ConnectorPort.B, -6, BigDecimal("0.8"), 0.844603730741786, - -0.0165178043572016 + -0.0165178043572016, ), ( ConnectorPort.B, -6, BigDecimal("0.9"), 0.843883364056076, - -0.0185839961196072 + -0.0185839961196072, ), ( ConnectorPort.B, -6, BigDecimal("1"), 0.843151547472542, - -0.0206501880399498 + -0.0206501880399498, ), ( ConnectorPort.B, -5, BigDecimal("-1"), 0.88084034387922, - 0.0212816688837675 + 0.0212816688837675, ), ( ConnectorPort.B, -5, BigDecimal("-0.9"), 0.880301811058847, - 0.0191547095758306 + 0.0191547095758306, ), ( ConnectorPort.B, -5, BigDecimal("-0.8"), 0.879752393741875, - 0.0170277501177557 + 0.0170277501177557, ), ( ConnectorPort.B, -5, BigDecimal("-0.7"), 0.879192051310566, - 0.0149007905089826 + 0.0149007905089826, ), ( ConnectorPort.B, -5, BigDecimal("-0.6"), 0.878620742131108, - 0.0127738307489369 + 0.0127738307489369, ), ( ConnectorPort.B, -5, BigDecimal("-0.5"), 0.878038423536804, - 0.0106468708370302 + 0.0106468708370302, ), ( ConnectorPort.B, -5, BigDecimal("-0.4"), 0.877445051810713, - 0.00851991077265941 + 0.00851991077265941, ), ( ConnectorPort.B, -5, BigDecimal("-0.3"), 0.876840582167709, - 0.00639295055520668 + 0.00639295055520668, ), ( ConnectorPort.B, -5, BigDecimal("-0.2"), 0.876224968735958, - 0.00426599018403942 + 0.00426599018403942, ), ( ConnectorPort.B, -5, BigDecimal("-0.1"), 0.875598164537768, - 0.00213902965850952 + 0.00213902965850952, ), ( ConnectorPort.B, -5, BigDecimal("0"), 0.874960121469824, - 0.0000120689779535628 + 0.0000120689779535628, ), ( ConnectorPort.B, -5, BigDecimal("0.1"), 0.874310790282754, - -0.00211489185830792 + -0.00211489185830792, ), ( ConnectorPort.B, -5, BigDecimal("0.2"), 0.873650120560035, - -0.00424185285097023 + -0.00424185285097023, ), ( ConnectorPort.B, -5, BigDecimal("0.3"), 0.872978060696187, - -0.00636881400074527 + -0.00636881400074527, ), ( ConnectorPort.B, -5, BigDecimal("0.4"), 0.872294557874257, - -0.0084957753083616 + -0.0084957753083616, ), ( ConnectorPort.B, -5, BigDecimal("0.5"), 0.871599558042545, - -0.0106227367745647 + -0.0106227367745647, ), ( ConnectorPort.B, -5, BigDecimal("0.6"), 0.870893005890569, - -0.0127496984001176 + -0.0127496984001176, ), ( ConnectorPort.B, -5, BigDecimal("0.7"), 0.870174844824216, - -0.014876660185801 + -0.014876660185801, ), ( ConnectorPort.B, -5, BigDecimal("0.8"), 0.869445016940074, - -0.0170036221324134 + -0.0170036221324134, ), ( ConnectorPort.B, -5, BigDecimal("0.9"), 0.868703462998902, - -0.0191305842407722 + -0.0191305842407722, ), ( ConnectorPort.B, -5, BigDecimal("1"), 0.867950122398205, - -0.0212575465117131 + -0.0212575465117131, ), ( ConnectorPort.B, -4, BigDecimal("-1"), 0.906007210847198, - 0.0218897165661608 + 0.0218897165661608, ), ( ConnectorPort.B, -4, BigDecimal("-0.9"), 0.905453291374814, - 0.0197019869922829 + 0.0197019869922829, ), ( ConnectorPort.B, -4, BigDecimal("-0.8"), 0.904888176420214, - 0.0175142572639773 + 0.0175142572639773, ), ( ConnectorPort.B, -4, BigDecimal("-0.7"), 0.904311824205154, - 0.0153265273806679 + 0.0153265273806679, ), ( ConnectorPort.B, -4, BigDecimal("-0.6"), 0.903724191906283, - 0.0131387973417637 + 0.0131387973417637, ), ( ConnectorPort.B, -4, BigDecimal("-0.5"), 0.903125235637856, - 0.0109510671466597 + 0.0109510671466597, ), ( ConnectorPort.B, -4, BigDecimal("-0.4"), 0.902514910433876, - 0.00876333679473538 + 0.00876333679473538, ), ( ConnectorPort.B, -4, BigDecimal("-0.3"), 0.901893170229644, - 0.00657560628535547 + 0.00657560628535547, ), ( ConnectorPort.B, -4, BigDecimal("-0.2"), 0.901259967842699, - 0.00438787561786912 + 0.00438787561786912, ), ( ConnectorPort.B, -4, BigDecimal("-0.1"), 0.900615254953133, - 0.00220014479160983 + 0.00220014479160983, ), ( ConnectorPort.B, -4, BigDecimal("0"), 0.899958982083247, - 0.0000124138058950773 + 0.0000124138058950773, ), ( ConnectorPort.B, -4, BigDecimal("0.1"), 0.899291098576547, - -0.0021753173399738 + -0.0021753173399738, ), ( ConnectorPort.B, -4, BigDecimal("0.2"), 0.898611552576036, - -0.00436304864671219 + -0.00436304864671219, ), ( ConnectorPort.B, -4, BigDecimal("0.3"), 0.897920291001792, - -0.00655078011505222 + -0.00655078011505222, ), ( ConnectorPort.B, -4, BigDecimal("0.4"), 0.897217259527807, - -0.00873851174574332 + -0.00873851174574332, ), ( ConnectorPort.B, -4, BigDecimal("0.5"), 0.896502402558046, - -0.0109262435395523 + -0.0109262435395523, ), ( ConnectorPort.B, -4, BigDecimal("0.6"), 0.895775663201728, - -0.0131139754972638 + -0.0131139754972638, ), ( ConnectorPort.B, -4, BigDecimal("0.7"), 0.895036983247764, - -0.015301707619681 + -0.015301707619681, ), ( ConnectorPort.B, -4, BigDecimal("0.8"), 0.894286303138362, - -0.0174894399076252 + -0.0174894399076252, ), ( ConnectorPort.B, -4, BigDecimal("0.9"), 0.893523561941728, - -0.019677172361937 + -0.019677172361937, ), ( ConnectorPort.B, -4, BigDecimal("1"), 0.892748697323868, - -0.0218649049834762 + -0.0218649049834762, ), ( ConnectorPort.B, -3, BigDecimal("-1"), 0.931174077815176, - 0.0224977642485542 + 0.0224977642485542, ), ( ConnectorPort.B, -3, BigDecimal("-0.9"), 0.930604771690782, - 0.0202492644087352 + 0.0202492644087352, ), ( ConnectorPort.B, -3, BigDecimal("-0.8"), 0.930023959098554, - 0.018000764410199 + 0.018000764410199, ), ( ConnectorPort.B, -3, BigDecimal("-0.7"), 0.929431597099742, - 0.0157522642523531 + 0.0157522642523531, ), ( ConnectorPort.B, -3, BigDecimal("-0.6"), 0.928827641681457, - 0.0135037639345905 + 0.0135037639345905, ), ( ConnectorPort.B, -3, BigDecimal("-0.5"), 0.928212047738907, - 0.0112552634562891 + 0.0112552634562891, ), ( ConnectorPort.B, -3, BigDecimal("-0.4"), 0.927584769057039, - 0.00900676281681138 + 0.00900676281681138, ), ( ConnectorPort.B, -3, BigDecimal("-0.3"), 0.926945758291578, - 0.00675826201550427 + 0.00675826201550427, ), ( ConnectorPort.B, -3, BigDecimal("-0.2"), 0.926294966949441, - 0.00450976105169881 + 0.00450976105169881, ), ( ConnectorPort.B, -3, BigDecimal("-0.1"), 0.925632345368498, - 0.00226125992471011 + 0.00226125992471011, ), ( ConnectorPort.B, -3, BigDecimal("0"), 0.924957842696671, - 0.0000127586338366326 + 0.0000127586338366326, ), ( ConnectorPort.B, -3, BigDecimal("0.1"), 0.92427140687034, - -0.00223574282163975 + -0.00223574282163975, ), ( ConnectorPort.B, -3, BigDecimal("0.2"), 0.923572984592037, - -0.00448424444245421 + -0.00448424444245421, ), ( ConnectorPort.B, -3, BigDecimal("0.3"), 0.922862521307398, - -0.00673274622935925 + -0.00673274622935925, ), ( ConnectorPort.B, -3, BigDecimal("0.4"), 0.922139961181357, - -0.00898124818312505 + -0.00898124818312505, ), ( ConnectorPort.B, -3, BigDecimal("0.5"), 0.921405247073547, - -0.0112297503045398 + -0.0112297503045398, ), ( ConnectorPort.B, -3, BigDecimal("0.6"), 0.920658320512887, - -0.0134782525944101 + -0.0134782525944101, ), ( ConnectorPort.B, -3, BigDecimal("0.7"), 0.919899121671314, - -0.015726755053561 + -0.015726755053561, ), ( ConnectorPort.B, -3, BigDecimal("0.8"), 0.91912758933665, - -0.017975257682837 + -0.017975257682837, ), ( ConnectorPort.B, -3, BigDecimal("0.9"), 0.918343660884553, - -0.0202237604831019 + -0.0202237604831019, ), ( ConnectorPort.B, -3, BigDecimal("1"), 0.917547272249531, - -0.0224722634552394 + -0.0224722634552394, ), ( ConnectorPort.B, -2, BigDecimal("-1"), 0.956340944783154, - 0.0231058119309475 + 0.0231058119309475, ), ( ConnectorPort.B, -2, BigDecimal("-0.9"), 0.955756252006749, - 0.0207965418251875 + 0.0207965418251875, ), ( ConnectorPort.B, -2, BigDecimal("-0.8"), 0.955159741776893, - 0.0184872715564205 + 0.0184872715564205, ), ( ConnectorPort.B, -2, BigDecimal("-0.7"), 0.954551369994329, - 0.0161780011240382 + 0.0161780011240382, ), ( ConnectorPort.B, -2, BigDecimal("-0.6"), 0.953931091456632, - 0.0138687305274172 + 0.0138687305274172, ), ( ConnectorPort.B, -2, BigDecimal("-0.5"), 0.953298859839959, - 0.0115594597659185 + 0.0115594597659185, ), ( ConnectorPort.B, -2, BigDecimal("-0.4"), 0.952654627680202, - 0.00925018883888728 + 0.00925018883888728, ), ( ConnectorPort.B, -2, BigDecimal("-0.3"), 0.951998346353513, - 0.00694091774565297 + 0.00694091774565297, ), ( ConnectorPort.B, -2, BigDecimal("-0.2"), 0.951329966056183, - 0.00463164648552851 + 0.00463164648552851, ), ( ConnectorPort.B, -2, BigDecimal("-0.1"), 0.950649435783863, - 0.00232237505781035 + 0.00232237505781035, ), ( ConnectorPort.B, -2, BigDecimal("0"), 0.949956703310094, - 0.000013103461778146 + 0.000013103461778146, ), ( ConnectorPort.B, -2, BigDecimal("0.1"), 0.949251715164133, - -0.00229616830330571 + -0.00229616830330571, ), ( ConnectorPort.B, -2, BigDecimal("0.2"), 0.948534416608038, - -0.00460544023819623 + -0.00460544023819623, ), ( ConnectorPort.B, -2, BigDecimal("0.3"), 0.947804751613003, - -0.00691471234366629 + -0.00691471234366629, ), ( ConnectorPort.B, -2, BigDecimal("0.4"), 0.947062662834907, - -0.00922398462050684 + -0.00922398462050684, ), ( ConnectorPort.B, -2, BigDecimal("0.5"), 0.946308091589049, - -0.0115332570695274 + -0.0115332570695274, ), ( ConnectorPort.B, -2, BigDecimal("0.6"), 0.945540977824046, - -0.0138425296915563 + -0.0138425296915563, ), ( ConnectorPort.B, -2, BigDecimal("0.7"), 0.944761260094862, - -0.0161518024874411 + -0.0161518024874411, ), ( ConnectorPort.B, -2, BigDecimal("0.8"), 0.943968875534937, - -0.0184610754580489 + -0.0184610754580489, ), ( ConnectorPort.B, -2, BigDecimal("0.9"), 0.943163759827379, - -0.0207703486042669 + -0.0207703486042669, ), ( ConnectorPort.B, -2, BigDecimal("1"), 0.942345847175194, - -0.0230796219270027 + -0.0230796219270027, ), ( ConnectorPort.B, -1, BigDecimal("-1"), 0.981507811751131, - 0.023713859613341 + 0.023713859613341, ), ( ConnectorPort.B, -1, BigDecimal("-0.9"), 0.980907732322716, - 0.0213438192416398 + 0.0213438192416398, ), ( ConnectorPort.B, -1, BigDecimal("-0.8"), 0.980295524455232, - 0.0189737787026421 + 0.0189737787026421, ), ( ConnectorPort.B, -1, BigDecimal("-0.7"), 0.979671142888917, - 0.0166037379957236 + 0.0166037379957236, ), ( ConnectorPort.B, -1, BigDecimal("-0.6"), 0.979034541231806, - 0.0142336971202441 + 0.0142336971202441, ), ( ConnectorPort.B, -1, BigDecimal("-0.5"), 0.97838567194101, - 0.0118636560755479 + 0.0118636560755479, ), ( ConnectorPort.B, -1, BigDecimal("-0.4"), 0.977724486303365, - 0.00949361486096332 + 0.00949361486096332, ), ( ConnectorPort.B, -1, BigDecimal("-0.3"), 0.977050934415447, - 0.00712357347580179 + 0.00712357347580179, ), ( ConnectorPort.B, -1, BigDecimal("-0.2"), 0.976364965162924, - 0.00475353191935825 + 0.00475353191935825, ), ( ConnectorPort.B, -1, BigDecimal("-0.1"), 0.975666526199227, - 0.00238349019091072 + 0.00238349019091072, ), ( ConnectorPort.B, -1, BigDecimal("0"), 0.974955563923518, - 0.0000134482897197081 + 0.0000134482897197081, ), ( ConnectorPort.B, -1, BigDecimal("0.1"), 0.974232023457926, - -0.0023565937849716 + -0.0023565937849716, ), ( ConnectorPort.B, -1, BigDecimal("0.2"), 0.973495848624039, - -0.00472663603393815 + -0.00472663603393815, ), ( ConnectorPort.B, -1, BigDecimal("0.3"), 0.972746981918608, - -0.00709667845797326 + -0.00709667845797326, ), ( ConnectorPort.B, -1, BigDecimal("0.4"), 0.971985364488457, - -0.00946672105788853 + -0.00946672105788853, ), ( ConnectorPort.B, -1, BigDecimal("0.5"), 0.97121093610455, - -0.0118367638345149 + -0.0118367638345149, ), ( ConnectorPort.B, -1, BigDecimal("0.6"), 0.970423635135205, - -0.0142068067887024 + -0.0142068067887024, ), ( ConnectorPort.B, -1, BigDecimal("0.7"), 0.969623398518412, - -0.016576849921321 + -0.016576849921321, ), ( ConnectorPort.B, -1, BigDecimal("0.8"), 0.968810161733225, - -0.0189468932332606 + -0.0189468932332606, ), ( ConnectorPort.B, -1, BigDecimal("0.9"), 0.967983858770205, - -0.0213169367254318 + -0.0213169367254318, ), ( ConnectorPort.B, -1, BigDecimal("1"), 0.967144422100857, - -0.0236869803987659 + -0.0236869803987659, ), ( ConnectorPort.B, 0, BigDecimal("-1"), 1.00667467871911, - 0.0243219072957343 + 0.0243219072957343, ), ( ConnectorPort.B, 0, BigDecimal("-0.9"), 1.00605921263868, - 0.0218910966580921 + 0.0218910966580921, ), ( ConnectorPort.B, 0, BigDecimal("-0.8"), 1.00543130713357, - 0.0194602858488637 + 0.0194602858488637, ), ( ConnectorPort.B, 0, BigDecimal("-0.7"), 1.0047909157835, - 0.0170294748674087 + 0.0170294748674087, ), ( ConnectorPort.B, 0, BigDecimal("-0.6"), 1.00413799100698, - 0.0145986637130708 + 0.0145986637130708, ), ( ConnectorPort.B, 0, BigDecimal("-0.5"), 1.00347248404206, - 0.0121678523851774 + 0.0121678523851774, ), ( ConnectorPort.B, 0, BigDecimal("-0.4"), 1.00279434492653, - 0.00973704088303931 + 0.00973704088303931, ), ( ConnectorPort.B, 0, BigDecimal("-0.3"), 1.00210352247738, - 0.00730622920595051 + 0.00730622920595051, ), ( ConnectorPort.B, 0, BigDecimal("-0.2"), 1.00139996426967, - 0.00487541735318787 + 0.00487541735318787, ), ( ConnectorPort.B, 0, BigDecimal("-0.1"), 1.00068361661459, - 0.00244460532401091 + 0.00244460532401091, ), ( ConnectorPort.B, 0, BigDecimal("0"), 0.999954424536941, - 0.0000137931176612275 + 0.0000137931176612275, ), ( ConnectorPort.B, 0, BigDecimal("0.1"), 0.999212331751719, - -0.00241701926663761 + -0.00241701926663761, ), ( ConnectorPort.B, 0, BigDecimal("0.2"), 0.99845728064004, - -0.00484783182968026 + -0.00484783182968026, ), ( ConnectorPort.B, 0, BigDecimal("0.3"), 0.997689212224214, - -0.00727864457228031 + -0.00727864457228031, ), ( ConnectorPort.B, 0, BigDecimal("0.4"), 0.996908066142007, - -0.00970945749527035 + -0.00970945749527035, ), ( ConnectorPort.B, 0, BigDecimal("0.5"), 0.996113780620051, - -0.0121402705995025 + -0.0121402705995025, ), ( ConnectorPort.B, 0, BigDecimal("0.6"), 0.995306292446364, - -0.0145710838858487 + -0.0145710838858487, ), ( ConnectorPort.B, 0, BigDecimal("0.7"), 0.994485536941961, - -0.0170018973552011 + -0.0170018973552011, ), ( ConnectorPort.B, 0, BigDecimal("0.8"), 0.993651447931513, - -0.0194327110084725 + -0.0194327110084725, ), ( ConnectorPort.B, 0, BigDecimal("0.9"), 0.99280395771303, - -0.0218635248465967 + -0.0218635248465967, ), ( ConnectorPort.B, 0, BigDecimal("1"), 0.99194299702652, - -0.0242943388705291 + -0.0242943388705291, ), ( ConnectorPort.B, 1, BigDecimal("-1"), 1.03184154568709, - 0.0249299549781277 + 0.0249299549781277, ), ( ConnectorPort.B, 1, BigDecimal("-0.9"), 1.03121069295465, - 0.0224383740745444 + 0.0224383740745444, ), ( ConnectorPort.B, 1, BigDecimal("-0.8"), 1.03056708981191, - 0.0199467929950853 + 0.0199467929950853, ), ( ConnectorPort.B, 1, BigDecimal("-0.7"), 1.02991068867809, - 0.0174552117390939 + 0.0174552117390939, ), ( ConnectorPort.B, 1, BigDecimal("-0.6"), 1.02924144078216, - 0.0149636303058977 + 0.0149636303058977, ), ( ConnectorPort.B, 1, BigDecimal("-0.5"), 1.02855929614311, - 0.0124720486948069 + 0.0124720486948069, ), ( ConnectorPort.B, 1, BigDecimal("-0.4"), 1.02786420354969, - 0.00998046690511528 + 0.00998046690511528, ), ( ConnectorPort.B, 1, BigDecimal("-0.3"), 1.02715611053932, - 0.00748888493609935 + 0.00748888493609935, ), ( ConnectorPort.B, 1, BigDecimal("-0.2"), 1.02643496337641, - 0.00499730278701767 + 0.00499730278701767, ), ( ConnectorPort.B, 1, BigDecimal("-0.1"), 1.02570070702996, - 0.00250572045711118 + 0.00250572045711118, ), ( ConnectorPort.B, 1, BigDecimal("0"), 1.02495328515036, - 0.0000141379456027874 + 0.0000141379456027874, ), ( ConnectorPort.B, 1, BigDecimal("0.1"), 1.02419264004551, - -0.00247744474830352 + -0.00247744474830352, ), ( ConnectorPort.B, 1, BigDecimal("0.2"), 1.02341871265604, - -0.00496902762542224 + -0.00496902762542224, ), ( ConnectorPort.B, 1, BigDecimal("0.3"), 1.02263144252982, - -0.00746061068658732 + -0.00746061068658732, ), ( ConnectorPort.B, 1, BigDecimal("0.4"), 1.02183076779556, - -0.00995219393265205 + -0.00995219393265205, ), ( ConnectorPort.B, 1, BigDecimal("0.5"), 1.02101662513555, - -0.01244377736449 + -0.01244377736449, ), ( ConnectorPort.B, 1, BigDecimal("0.6"), 1.02018894975752, - -0.0149353609829949 + -0.0149353609829949, ), ( ConnectorPort.B, 1, BigDecimal("0.7"), 1.01934767536551, - -0.0174269447890811 + -0.0174269447890811, ), ( ConnectorPort.B, 1, BigDecimal("0.8"), 1.0184927341298, - -0.0199185287836842 + -0.0199185287836842, ), ( ConnectorPort.B, 1, BigDecimal("0.9"), 1.01762405665586, - -0.0224101129677615 + -0.0224101129677615, ), ( ConnectorPort.B, 1, BigDecimal("1"), 1.01674157195218, - -0.0249016973422923 + -0.0249016973422923, ), (ConnectorPort.B, 2, BigDecimal("-1"), 1.05700841265506, 0.025538002660521), ( @@ -4874,434 +4874,434 @@ trait TransformerTestData extends TransformerTestGrid { 2, BigDecimal("-0.9"), 1.05636217327062, - 0.0229856514909967 + 0.0229856514909967, ), ( ConnectorPort.B, 2, BigDecimal("-0.8"), 1.05570287249025, - 0.0204333001413069 + 0.0204333001413069, ), ( ConnectorPort.B, 2, BigDecimal("-0.7"), 1.05503046157268, - 0.0178809486107791 + 0.0178809486107791, ), ( ConnectorPort.B, 2, BigDecimal("-0.6"), 1.05434489055733, - 0.0153285968987244 + 0.0153285968987244, ), ( ConnectorPort.B, 2, BigDecimal("-0.5"), 1.05364610824416, - 0.0127762450044363 + 0.0127762450044363, ), ( ConnectorPort.B, 2, BigDecimal("-0.4"), 1.05293406217286, - 0.0102238929271913 + 0.0102238929271913, ), ( ConnectorPort.B, 2, BigDecimal("-0.3"), 1.05220869860125, - 0.00767154066624801 + 0.00767154066624801, ), ( ConnectorPort.B, 2, BigDecimal("-0.2"), 1.05146996248315, - 0.00511918822084738 + 0.00511918822084738, ), ( ConnectorPort.B, 2, BigDecimal("-0.1"), 1.05071779744532, - 0.00256683559021147 + 0.00256683559021147, ), ( ConnectorPort.B, 2, BigDecimal("0"), 1.04995214576379, - 0.0000144827735443296 + 0.0000144827735443296, ), ( ConnectorPort.B, 2, BigDecimal("0.1"), 1.04917294833931, - -0.00253787022996945 + -0.00253787022996945, ), ( ConnectorPort.B, 2, BigDecimal("0.2"), 1.04838014467204, - -0.00509022342116422 + -0.00509022342116422, ), ( ConnectorPort.B, 2, BigDecimal("0.3"), 1.04757367283542, - -0.00764257680089427 + -0.00764257680089427, ), ( ConnectorPort.B, 2, BigDecimal("0.4"), 1.04675346944911, - -0.0101949303700338 + -0.0101949303700338, ), ( ConnectorPort.B, 2, BigDecimal("0.5"), 1.04591946965105, - -0.0127472841294777 + -0.0127472841294777, ), ( ConnectorPort.B, 2, BigDecimal("0.6"), 1.04507160706868, - -0.0152996380801412 + -0.0152996380801412, ), ( ConnectorPort.B, 2, BigDecimal("0.7"), 1.04420981378906, - -0.0178519922229611 + -0.0178519922229611, ), ( ConnectorPort.B, 2, BigDecimal("0.8"), 1.04333402032809, - -0.0204043465588961 + -0.0204043465588961, ), ( ConnectorPort.B, 2, BigDecimal("0.9"), 1.04244415559868, - -0.0229567010889265 + -0.0229567010889265, ), ( ConnectorPort.B, 2, BigDecimal("1"), 1.04154014687785, - -0.0255090558140557 + -0.0255090558140557, ), ( ConnectorPort.B, 3, BigDecimal("-1"), 1.08217527962304, - 0.0261460503429143 + 0.0261460503429143, ), ( ConnectorPort.B, 3, BigDecimal("-0.9"), 1.08151365358658, - 0.023532928907449 + 0.023532928907449, ), ( ConnectorPort.B, 3, BigDecimal("-0.8"), 1.08083865516859, - 0.0209198072875285 + 0.0209198072875285, ), ( ConnectorPort.B, 3, BigDecimal("-0.7"), 1.08015023446727, - 0.0183066854824644 + 0.0183066854824644, ), ( ConnectorPort.B, 3, BigDecimal("-0.6"), 1.0794483403325, - 0.0156935634915511 + 0.0156935634915511, ), ( ConnectorPort.B, 3, BigDecimal("-0.5"), 1.07873292034522, - 0.0130804413140657 + 0.0130804413140657, ), ( ConnectorPort.B, 3, BigDecimal("-0.4"), 1.07800392079602, - 0.0104673189492672 + 0.0104673189492672, ), ( ConnectorPort.B, 3, BigDecimal("-0.3"), 1.07726128666319, - 0.00785419639639677 + 0.00785419639639677, ), ( ConnectorPort.B, 3, BigDecimal("-0.2"), 1.07650496158989, - 0.00524107365467694 + 0.00524107365467694, ), ( ConnectorPort.B, 3, BigDecimal("-0.1"), 1.07573488786069, - 0.00262795072331172 + 0.00262795072331172, ), ( ConnectorPort.B, 3, BigDecimal("0"), 1.07495100637721, - 0.0000148276014858161 + 0.0000148276014858161, ), ( ConnectorPort.B, 3, BigDecimal("0.1"), 1.0741532566331, - -0.00259829571163542 + -0.00259829571163542, ), ( ConnectorPort.B, 3, BigDecimal("0.2"), 1.07334157668804, - -0.00521141921690625 + -0.00521141921690625, ), ( ConnectorPort.B, 3, BigDecimal("0.3"), 1.07251590314103, - -0.00782454291520131 + -0.00782454291520131, ), ( ConnectorPort.B, 3, BigDecimal("0.4"), 1.07167617110266, - -0.0104376668074156 + -0.0104376668074156, ), ( ConnectorPort.B, 3, BigDecimal("0.5"), 1.07082231416656, - -0.0130507908944652 + -0.0130507908944652, ), ( ConnectorPort.B, 3, BigDecimal("0.6"), 1.06995426437984, - -0.0156639151772874 + -0.0156639151772874, ), ( ConnectorPort.B, 3, BigDecimal("0.7"), 1.06907195221261, - -0.0182770396568411 + -0.0182770396568411, ), ( ConnectorPort.B, 3, BigDecimal("0.8"), 1.06817530652638, - -0.0208901643341079 + -0.0208901643341079, ), ( ConnectorPort.B, 3, BigDecimal("0.9"), 1.06726425454151, - -0.0235032892100915 + -0.0235032892100915, ), ( ConnectorPort.B, 3, BigDecimal("1"), 1.06633872180351, - -0.0261164142858189 + -0.0261164142858189, ), ( ConnectorPort.B, 4, BigDecimal("-1"), 1.10734214659102, - 0.0267540980253077 + 0.0267540980253077, ), ( ConnectorPort.B, 4, BigDecimal("-0.9"), 1.10666513390255, - 0.0240802063239013 + 0.0240802063239013, ), ( ConnectorPort.B, 4, BigDecimal("-0.8"), 1.10597443784693, - 0.0214063144337501 + 0.0214063144337501, ), ( ConnectorPort.B, 4, BigDecimal("-0.7"), 1.10527000736186, - 0.0187324223541496 + 0.0187324223541496, ), ( ConnectorPort.B, 4, BigDecimal("-0.6"), 1.10455179010768, - 0.016058530084378 + 0.016058530084378, ), ( ConnectorPort.B, 4, BigDecimal("-0.5"), 1.10381973244627, - 0.0133846376236952 + 0.0133846376236952, ), ( ConnectorPort.B, 4, BigDecimal("-0.4"), 1.10307377941918, - 0.0107107449713433 + 0.0107107449713433, ), ( ConnectorPort.B, 4, BigDecimal("-0.3"), 1.10231387472512, - 0.00803685212654552 + 0.00803685212654552, ), ( ConnectorPort.B, 4, BigDecimal("-0.2"), 1.10153996069663, - 0.00536295908850669 + 0.00536295908850669, ), ( ConnectorPort.B, 4, BigDecimal("-0.1"), 1.10075197827605, - 0.00268906585641202 + 0.00268906585641202, ), ( ConnectorPort.B, 4, BigDecimal("0"), 1.09994986699064, - 0.0000151724294273726 + 0.0000151724294273726, ), ( ConnectorPort.B, 4, BigDecimal("0.1"), 1.09913356492689, - -0.00265872119330126 + -0.00265872119330126, ), ( ConnectorPort.B, 4, BigDecimal("0.2"), 1.09830300870404, - -0.00533261501264826 + -0.00533261501264826, ), ( ConnectorPort.B, 4, BigDecimal("0.3"), 1.09745813344664, - -0.00800650902950831 + -0.00800650902950831, ), ( ConnectorPort.B, 4, BigDecimal("0.4"), 1.09659887275621, - -0.0106804032447974 + -0.0106804032447974, ), ( ConnectorPort.B, 4, BigDecimal("0.5"), 1.09572515868206, - -0.0133542976594527 + -0.0133542976594527, ), ( ConnectorPort.B, 4, BigDecimal("0.6"), 1.094836921691, - -0.0160281922744335 + -0.0160281922744335, ), ( ConnectorPort.B, 4, BigDecimal("0.7"), 1.09393409063616, - -0.0187020870907211 + -0.0187020870907211, ), ( ConnectorPort.B, 4, BigDecimal("0.8"), 1.09301659272466, - -0.0213759821093196 + -0.0213759821093196, ), ( ConnectorPort.B, 4, BigDecimal("0.9"), 1.09208435348433, - -0.0240498773312563 + -0.0240498773312563, ), ( ConnectorPort.B, 4, BigDecimal("1"), 1.09113729672917, - -0.0267237727575821 + -0.0267237727575821, ), (ConnectorPort.B, 5, BigDecimal("-1"), 1.132509013559, 0.027362145707701), ( @@ -5309,280 +5309,280 @@ trait TransformerTestData extends TransformerTestGrid { 5, BigDecimal("-0.9"), 1.13181661421852, - 0.0246274837403537 + 0.0246274837403537, ), ( ConnectorPort.B, 5, BigDecimal("-0.8"), 1.13111022052527, - 0.0218928215799717 + 0.0218928215799717, ), ( ConnectorPort.B, 5, BigDecimal("-0.7"), 1.13038978025644, - 0.0191581592258348 + 0.0191581592258348, ), ( ConnectorPort.B, 5, BigDecimal("-0.6"), 1.12965523988285, - 0.0164234966772046 + 0.0164234966772046, ), ( ConnectorPort.B, 5, BigDecimal("-0.5"), 1.12890654454732, - 0.0136888339333246 + 0.0136888339333246, ), ( ConnectorPort.B, 5, BigDecimal("-0.4"), 1.12814363804234, - 0.0109541709934192 + 0.0109541709934192, ), ( ConnectorPort.B, 5, BigDecimal("-0.3"), 1.12736646278705, - 0.00821950785669432 + 0.00821950785669432, ), ( ConnectorPort.B, 5, BigDecimal("-0.2"), 1.12657495980337, - 0.00548484452233641 + 0.00548484452233641, ), ( ConnectorPort.B, 5, BigDecimal("-0.1"), 1.12576906869142, - 0.00275018098951233 + 0.00275018098951233, ), ( ConnectorPort.B, 5, BigDecimal("0"), 1.12494872760406, - 0.0000155172573689131 + 0.0000155172573689131, ), ( ConnectorPort.B, 5, BigDecimal("0.1"), 1.12411387322068, - -0.00271914667496727 + -0.00271914667496727, ), ( ConnectorPort.B, 5, BigDecimal("0.2"), 1.12326444072004, - -0.00545381080839021 + -0.00545381080839021, ), ( ConnectorPort.B, 5, BigDecimal("0.3"), 1.12240036375224, - -0.00818847514381527 + -0.00818847514381527, ), ( ConnectorPort.B, 5, BigDecimal("0.4"), 1.12152157440976, - -0.0109231396821791 + -0.0109231396821791, ), ( ConnectorPort.B, 5, BigDecimal("0.5"), 1.12062800319756, - -0.0136578044244403 + -0.0136578044244403, ), ( ConnectorPort.B, 5, BigDecimal("0.6"), 1.11971957900216, - -0.0163924693715797 + -0.0163924693715797, ), ( ConnectorPort.B, 5, BigDecimal("0.7"), 1.11879622905971, - -0.0191271345246012 + -0.0191271345246012, ), ( ConnectorPort.B, 5, BigDecimal("0.8"), 1.11785787892295, - -0.0218617998845315 + -0.0218617998845315, ), ( ConnectorPort.B, 5, BigDecimal("0.9"), 1.11690445242716, - -0.0245964654524212 + -0.0245964654524212, ), ( ConnectorPort.B, 5, BigDecimal("1"), 1.11593587165483, - -0.0273311312293454 + -0.0273311312293454, ), ( ConnectorPort.B, 6, BigDecimal("-1"), 1.15767588052698, - 0.0279701933900944 + 0.0279701933900944, ), ( ConnectorPort.B, 6, BigDecimal("-0.9"), 1.15696809453449, - 0.0251747611568059 + 0.0251747611568059, ), ( ConnectorPort.B, 6, BigDecimal("-0.8"), 1.15624600320361, - 0.0223793287261932 + 0.0223793287261932, ), ( ConnectorPort.B, 6, BigDecimal("-0.7"), 1.15550955315103, - 0.01958389609752 + 0.01958389609752, ), ( ConnectorPort.B, 6, BigDecimal("-0.6"), 1.15475868965803, - 0.0167884632700314 + 0.0167884632700314, ), ( ConnectorPort.B, 6, BigDecimal("-0.5"), 1.15399335664837, - 0.0139930302429539 + 0.0139930302429539, ), ( ConnectorPort.B, 6, BigDecimal("-0.4"), 1.15321349666551, - 0.0111975970154952 + 0.0111975970154952, ), ( ConnectorPort.B, 6, BigDecimal("-0.3"), 1.15241905084899, - 0.00840216358684306 + 0.00840216358684306, ), ( ConnectorPort.B, 6, BigDecimal("-0.2"), 1.15160995891012, - 0.00560672995616601 + 0.00560672995616601, ), ( ConnectorPort.B, 6, BigDecimal("-0.1"), 1.15078615910678, - 0.00281129612261251 + 0.00281129612261251, ), ( ConnectorPort.B, 6, BigDecimal("0"), 1.14994758821748, - 0.0000158620853104297 + 0.0000158620853104297, ), ( ConnectorPort.B, 6, BigDecimal("0.1"), 1.14909418151448, - -0.00277957215663318 + -0.00277957215663318, ), ( ConnectorPort.B, 6, BigDecimal("0.2"), 1.14822587273605, - -0.0055750066041323 + -0.0055750066041323, ), ( ConnectorPort.B, 6, BigDecimal("0.3"), 1.14734259405785, - -0.00837044125812234 + -0.00837044125812234, ), ( ConnectorPort.B, 6, BigDecimal("0.4"), 1.14644427606331, - -0.0111658761195609 + -0.0111658761195609, ), ( ConnectorPort.B, 6, BigDecimal("0.5"), 1.14553084771306, - -0.0139613111894279 + -0.0139613111894279, ), ( ConnectorPort.B, 6, BigDecimal("0.6"), 1.14460223631332, - -0.016756746468726 + -0.016756746468726, ), ( ConnectorPort.B, 6, BigDecimal("0.7"), 1.14365836748325, - -0.0195521819584812 + -0.0195521819584812, ), ( ConnectorPort.B, 6, BigDecimal("0.8"), 1.14269916512124, - -0.0223476176597433 + -0.0223476176597433, ), ( ConnectorPort.B, 6, BigDecimal("0.9"), 1.14172455136999, - -0.0251430535735862 + -0.0251430535735862, ), (ConnectorPort.B, 6, BigDecimal("1"), 1.1407344465805, -0.0279384897011086), ( @@ -5590,287 +5590,287 @@ trait TransformerTestData extends TransformerTestGrid { 7, BigDecimal("-1"), 1.18284274749495, - 0.0285782410724878 + 0.0285782410724878, ), ( ConnectorPort.B, 7, BigDecimal("-0.9"), 1.18211957485045, - 0.0257220385732582 + 0.0257220385732582, ), ( ConnectorPort.B, 7, BigDecimal("-0.8"), 1.18138178588195, - 0.0228658358724148 + 0.0228658358724148, ), ( ConnectorPort.B, 7, BigDecimal("-0.7"), 1.18062932604562, - 0.0200096329692052 + 0.0200096329692052, ), ( ConnectorPort.B, 7, BigDecimal("-0.6"), 1.1798621394332, - 0.0171534298628582 + 0.0171534298628582, ), ( ConnectorPort.B, 7, BigDecimal("-0.5"), 1.17908016874942, - 0.0142972265525834 + 0.0142972265525834, ), ( ConnectorPort.B, 7, BigDecimal("-0.4"), 1.17828335528867, - 0.0114410230375711 + 0.0114410230375711, ), ( ConnectorPort.B, 7, BigDecimal("-0.3"), 1.17747163891092, - 0.00858481931699185 + 0.00858481931699185, ), ( ConnectorPort.B, 7, BigDecimal("-0.2"), 1.17664495801686, - 0.00572861538999577 + 0.00572861538999577, ), ( ConnectorPort.B, 7, BigDecimal("-0.1"), 1.17580324952215, - 0.00287241125571286 + 0.00287241125571286, ), ( ConnectorPort.B, 7, BigDecimal("0"), 1.17494644883091, - 0.0000162069132519891 + 0.0000162069132519891, ), ( ConnectorPort.B, 7, BigDecimal("0.1"), 1.17407448980827, - -0.00283999763829914 + -0.00283999763829914, ), ( ConnectorPort.B, 7, BigDecimal("0.2"), 1.17318730475205, - -0.00569620239987423 + -0.00569620239987423, ), ( ConnectorPort.B, 7, BigDecimal("0.3"), 1.17228482436345, - -0.0085524073724293 + -0.0085524073724293, ), ( ConnectorPort.B, 7, BigDecimal("0.4"), 1.17136697771686, - -0.0114086125569427 + -0.0114086125569427, ), ( ConnectorPort.B, 7, BigDecimal("0.5"), 1.17043369222856, - -0.0142648179544154 + -0.0142648179544154, ), ( ConnectorPort.B, 7, BigDecimal("0.6"), 1.16948489362448, - -0.0171210235658722 + -0.0171210235658722, ), ( ConnectorPort.B, 7, BigDecimal("0.7"), 1.1685205059068, - -0.0199772293923612 + -0.0199772293923612, ), ( ConnectorPort.B, 7, BigDecimal("0.8"), 1.16754045131953, - -0.0228334354349551 + -0.0228334354349551, ), ( ConnectorPort.B, 7, BigDecimal("0.9"), 1.16654465031281, - -0.0256896416947511 + -0.0256896416947511, ), ( ConnectorPort.B, 7, BigDecimal("1"), 1.16553302150616, - -0.0285458481728718 + -0.0285458481728718, ), ( ConnectorPort.B, 8, BigDecimal("-1"), 1.20800961446293, - 0.0291862887548811 + 0.0291862887548811, ), ( ConnectorPort.B, 8, BigDecimal("-0.9"), 1.20727105516642, - 0.0262693159897105 + 0.0262693159897105, ), ( ConnectorPort.B, 8, BigDecimal("-0.8"), 1.20651756856029, - 0.0233523430186365 + 0.0233523430186365, ), ( ConnectorPort.B, 8, BigDecimal("-0.7"), 1.20574909894021, - 0.0204353698408905 + 0.0204353698408905, ), ( ConnectorPort.B, 8, BigDecimal("-0.6"), 1.20496558920838, - 0.017518396455685 + 0.017518396455685, ), ( ConnectorPort.B, 8, BigDecimal("-0.5"), 1.20416698085047, - 0.0146014228622129 + 0.0146014228622129, ), ( ConnectorPort.B, 8, BigDecimal("-0.4"), 1.20335321391183, - 0.0116844490596472 + 0.0116844490596472, ), ( ConnectorPort.B, 8, BigDecimal("-0.3"), 1.20252422697286, - 0.00876747504714063 + 0.00876747504714063, ), ( ConnectorPort.B, 8, BigDecimal("-0.2"), 1.2016799571236, - 0.00585050082382552 + 0.00585050082382552, ), ( ConnectorPort.B, 8, BigDecimal("-0.1"), 1.20082033993751, - 0.00293352638881315 + 0.00293352638881315, ), ( ConnectorPort.B, 8, BigDecimal("0"), 1.19994530944433, - 0.0000165517411934878 + 0.0000165517411934878, ), ( ConnectorPort.B, 8, BigDecimal("0.1"), 1.19905479810206, - -0.00290042311996509 + -0.00290042311996509, ), ( ConnectorPort.B, 8, BigDecimal("0.2"), 1.19814873676805, - -0.00581739819561628 + -0.00581739819561628, ), ( ConnectorPort.B, 8, BigDecimal("0.3"), 1.19722705466906, - -0.00873437348673637 + -0.00873437348673637, ), ( ConnectorPort.B, 8, BigDecimal("0.4"), 1.19628967937041, - -0.0116513489943244 + -0.0116513489943244, ), ( ConnectorPort.B, 8, BigDecimal("0.5"), 1.19533653674406, - -0.014568324719403 + -0.014568324719403, ), ( ConnectorPort.B, 8, BigDecimal("0.6"), 1.19436755093564, - -0.0174853006630184 + -0.0174853006630184, ), ( ConnectorPort.B, 8, BigDecimal("0.7"), 1.19338264433035, - -0.0204022768262413 + -0.0204022768262413, ), ( ConnectorPort.B, 8, BigDecimal("0.8"), 1.19238173751782, - -0.0233192532101669 + -0.0233192532101669, ), ( ConnectorPort.B, 8, BigDecimal("0.9"), 1.19136474925564, - -0.026236229815916 + -0.026236229815916, ), (ConnectorPort.B, 8, BigDecimal("1"), 1.19033159643182, -0.029153206644635), ( @@ -5878,295 +5878,295 @@ trait TransformerTestData extends TransformerTestGrid { 9, BigDecimal("-1"), 1.23317648143091, - 0.0297943364372745 + 0.0297943364372745, ), ( ConnectorPort.B, 9, BigDecimal("-0.9"), 1.23242253548239, - 0.0268165934061628 + 0.0268165934061628, ), ( ConnectorPort.B, 9, BigDecimal("-0.8"), 1.23165335123863, - 0.0238388501648581 + 0.0238388501648581, ), ( ConnectorPort.B, 9, BigDecimal("-0.7"), 1.23086887183479, - 0.0208611067125756 + 0.0208611067125756, ), ( ConnectorPort.B, 9, BigDecimal("-0.6"), 1.23006903898355, - 0.0178833630485118 + 0.0178833630485118, ), ( ConnectorPort.B, 9, BigDecimal("-0.5"), 1.22925379295153, - 0.0149056191718423 + 0.0149056191718423, ), ( ConnectorPort.B, 9, BigDecimal("-0.4"), 1.228423072535, - 0.0119278750817232 + 0.0119278750817232, ), ( ConnectorPort.B, 9, BigDecimal("-0.3"), 1.22757681503479, - 0.00895013077728943 + 0.00895013077728943, ), ( ConnectorPort.B, 9, BigDecimal("-0.2"), 1.22671495623034, - 0.00597238625765516 + 0.00597238625765516, ), ( ConnectorPort.B, 9, BigDecimal("-0.1"), 1.22583743035288, - 0.00299464152191339 + 0.00299464152191339, ), ( ConnectorPort.B, 9, BigDecimal("0"), 1.22494417005775, - 0.0000168965691349742 + 0.0000168965691349742, ), ( ConnectorPort.B, 9, BigDecimal("0.1"), 1.22403510639586, - -0.00296084860163105 + -0.00296084860163105, ), ( ConnectorPort.B, 9, BigDecimal("0.2"), 1.22311016878405, - -0.0059385939913583 + -0.0059385939913583, ), ( ConnectorPort.B, 9, BigDecimal("0.3"), 1.22216928497466, - -0.00891633960104338 + -0.00891633960104338, ), ( ConnectorPort.B, 9, BigDecimal("0.4"), 1.22121238102396, - -0.0118940854317062 + -0.0118940854317062, ), ( ConnectorPort.B, 9, BigDecimal("0.5"), 1.22023938125956, - -0.0148718314843905 + -0.0148718314843905, ), ( ConnectorPort.B, 9, BigDecimal("0.6"), 1.2192502082468, - -0.0178495777601646 + -0.0178495777601646, ), ( ConnectorPort.B, 9, BigDecimal("0.7"), 1.2182447827539, - -0.0208273242601213 + -0.0208273242601213, ), ( ConnectorPort.B, 9, BigDecimal("0.8"), 1.2172230237161, - -0.0238050709853787 + -0.0238050709853787, ), ( ConnectorPort.B, 9, BigDecimal("0.9"), 1.21618484819846, - -0.0267828179370809 + -0.0267828179370809, ), ( ConnectorPort.B, 9, BigDecimal("1"), 1.21513017135749, - -0.0297605651163982 + -0.0297605651163982, ), ( ConnectorPort.B, 10, BigDecimal("-1"), 1.25834334839889, - 0.0304023841196678 + 0.0304023841196678, ), ( ConnectorPort.B, 10, BigDecimal("-0.9"), 1.25757401579835, - 0.0273638708226152 + 0.0273638708226152, ), ( ConnectorPort.B, 10, BigDecimal("-0.8"), 1.25678913391696, - 0.0243253573110796 + 0.0243253573110796, ), ( ConnectorPort.B, 10, BigDecimal("-0.7"), 1.25598864472938, - 0.0212868435842609 + 0.0212868435842609, ), ( ConnectorPort.B, 10, BigDecimal("-0.6"), 1.25517248875873, - 0.0182483296413385 + 0.0182483296413385, ), ( ConnectorPort.B, 10, BigDecimal("-0.5"), 1.25434060505258, - 0.0152098154814717 + 0.0152098154814717, ), ( ConnectorPort.B, 10, BigDecimal("-0.4"), 1.25349293115816, - 0.0121713011037991 + 0.0121713011037991, ), ( ConnectorPort.B, 10, BigDecimal("-0.3"), 1.25262940309673, - 0.00913278650743818 + 0.00913278650743818, ), ( ConnectorPort.B, 10, BigDecimal("-0.2"), 1.25174995533708, - 0.00609427169148496 + 0.00609427169148496, ), ( ConnectorPort.B, 10, BigDecimal("-0.1"), 1.25085452076824, - 0.00305575665501359 + 0.00305575665501359, ), ( ConnectorPort.B, 10, BigDecimal("0"), 1.24994303067118, - 0.0000172413970765587 + 0.0000172413970765587, ), ( ConnectorPort.B, 10, BigDecimal("0.1"), 1.24901541468965, - -0.00302127408329697 + -0.00302127408329697, ), ( ConnectorPort.B, 10, BigDecimal("0.2"), 1.24807160080005, - -0.00605978978710035 + -0.00605978978710035, ), ( ConnectorPort.B, 10, BigDecimal("0.3"), 1.24711151528027, - -0.00909830571535039 + -0.00909830571535039, ), ( ConnectorPort.B, 10, BigDecimal("0.4"), 1.24613508267751, - -0.0121368218690879 + -0.0121368218690879, ), ( ConnectorPort.B, 10, BigDecimal("0.5"), 1.24514222577506, - -0.0151753382493781 + -0.0151753382493781, ), ( ConnectorPort.B, 10, BigDecimal("0.6"), 1.24413286555796, - -0.0182138548573108 + -0.0182138548573108, ), ( ConnectorPort.B, 10, BigDecimal("0.7"), 1.24310692117745, - -0.0212523716940014 + -0.0212523716940014, ), ( ConnectorPort.B, 10, BigDecimal("0.8"), 1.24206430991439, - -0.0242908887605906 + -0.0242908887605906, ), ( ConnectorPort.B, 10, BigDecimal("0.9"), 1.24100494714129, - -0.0273294060582459 + -0.0273294060582459, ), ( ConnectorPort.B, 10, BigDecimal("1"), 1.23992874628315, - -0.0303679235881615 - ) + -0.0303679235881615, + ), ) val tapDependentPortCurrents: TableFor9[ @@ -6178,7 +6178,7 @@ trait TransformerTestData extends TransformerTestGrid { Double, Double, Double, - Double + Double, ] = Table( ( "tapSide", @@ -6189,7 +6189,7 @@ trait TransformerTestData extends TransformerTestGrid { "iAMag", "iAAng", "iBMag", - "iBAng" + "iBAng", ), ( ConnectorPort.A, @@ -6200,7 +6200,7 @@ trait TransformerTestData extends TransformerTestGrid { 23.003954085118, -178.834651058510, 431.294763182407, - 0.781125259497 + 0.781125259497, ), ( ConnectorPort.A, @@ -6211,7 +6211,7 @@ trait TransformerTestData extends TransformerTestGrid { 11.525560223429, -178.842119238276, 216.075065421917, - 0.391722549446 + 0.391722549446, ), ( ConnectorPort.A, @@ -6222,7 +6222,7 @@ trait TransformerTestData extends TransformerTestGrid { 0.153959642453, -89.999604838591, 0.000000000011, - -63.434948822922 + -63.434948822922, ), ( ConnectorPort.A, @@ -6233,7 +6233,7 @@ trait TransformerTestData extends TransformerTestGrid { 4.625629756310, -2.062621156246, 86.678612785391, - -180.156031274941 + -180.156031274941, ), ( ConnectorPort.A, @@ -6244,7 +6244,7 @@ trait TransformerTestData extends TransformerTestGrid { 18.540232162149, -1.103088525750, 347.601584970335, - -180.628112995813 + -180.628112995813, ), ( ConnectorPort.A, @@ -6255,7 +6255,7 @@ trait TransformerTestData extends TransformerTestGrid { 22.971640550171, -178.655670795668, 502.475593932476, - 1.061459638084 + 1.061459638084, ), ( ConnectorPort.A, @@ -6266,7 +6266,7 @@ trait TransformerTestData extends TransformerTestGrid { 11.516767368719, -178.903976192179, 251.905603222771, - 0.532511914342 + 0.532511914342, ), ( ConnectorPort.A, @@ -6277,7 +6277,7 @@ trait TransformerTestData extends TransformerTestGrid { 0.113113206667, -89.999604843751, 0.000000000777, - -73.119669834476 + -73.119669834476, ), ( ConnectorPort.A, @@ -6288,7 +6288,7 @@ trait TransformerTestData extends TransformerTestGrid { 4.625851685250, -1.613085600310, 101.155690258838, - -180.212726208353 + -180.212726208353, ), ( ConnectorPort.A, @@ -6299,7 +6299,7 @@ trait TransformerTestData extends TransformerTestGrid { 18.563349939554, -1.204609465931, 406.047287157229, - -180.856312689835 + -180.856312689835, ), ( ConnectorPort.A, @@ -6310,7 +6310,7 @@ trait TransformerTestData extends TransformerTestGrid { 22.935405069071, -178.398896556822, 573.354864130381, - 1.384031350735 + 1.384031350735, ), ( ConnectorPort.A, @@ -6321,7 +6321,7 @@ trait TransformerTestData extends TransformerTestGrid { 11.507053462181, -178.873309313946, 287.655034835151, - 0.694718904051 + 0.694718904051, ), ( ConnectorPort.A, @@ -6332,7 +6332,7 @@ trait TransformerTestData extends TransformerTestGrid { 0.086602298880, -89.999604838507, 0.000000000005, - -90.000000000000 + -90.000000000000, ), ( ConnectorPort.A, @@ -6343,7 +6343,7 @@ trait TransformerTestData extends TransformerTestGrid { 4.626903589562, -1.349856236502, 115.647100480956, - -180.278184711145 + -180.278184711145, ), ( ConnectorPort.A, @@ -6354,7 +6354,7 @@ trait TransformerTestData extends TransformerTestGrid { 18.590741530558, -1.386445189457, 464.742359900663, - -181.120381398034 + -181.120381398034, ), ( ConnectorPort.A, @@ -6365,7 +6365,7 @@ trait TransformerTestData extends TransformerTestGrid { 22.919874893106, -178.278100673998, 601.615721696539, - 1.524814468172 + 1.524814468172, ), ( ConnectorPort.A, @@ -6376,7 +6376,7 @@ trait TransformerTestData extends TransformerTestGrid { 11.502886546947, -178.842403214648, 301.929928522615, - 0.765577315227 + 0.765577315227, ), ( ConnectorPort.A, @@ -6387,7 +6387,7 @@ trait TransformerTestData extends TransformerTestGrid { 0.078550816962, -89.999609475535, 0.000000576609, - -73.176741233690 + -73.176741233690, ), ( ConnectorPort.A, @@ -6398,7 +6398,7 @@ trait TransformerTestData extends TransformerTestGrid { 4.627473005039, -1.278661221495, 121.448172109735, - -180.306829295407 + -180.306829295407, ), ( ConnectorPort.A, @@ -6409,7 +6409,7 @@ trait TransformerTestData extends TransformerTestGrid { 18.602925214424, -1.477216350318, 488.300222258160, - -181.236130852830 + -181.236130852830, ), ( ConnectorPort.A, @@ -6420,7 +6420,7 @@ trait TransformerTestData extends TransformerTestGrid { 22.870025241112, -177.861439802860, 686.067080644780, - 1.987191673501 + 1.987191673501, ), ( ConnectorPort.A, @@ -6431,7 +6431,7 @@ trait TransformerTestData extends TransformerTestGrid { 11.489409416903, -178.700787286039, 344.661815409481, - 0.998555958661 + 0.998555958661, ), ( ConnectorPort.A, @@ -6442,7 +6442,7 @@ trait TransformerTestData extends TransformerTestGrid { 0.060140485118, -89.999604900530, 0.000000006742, - -73.172405921417 + -73.172405921417, ), ( ConnectorPort.A, @@ -6453,7 +6453,7 @@ trait TransformerTestData extends TransformerTestGrid { 4.629556005151, -1.144721361043, 138.868669271316, - -180.401205209677 + -180.401205209677, ), ( ConnectorPort.A, @@ -6464,7 +6464,7 @@ trait TransformerTestData extends TransformerTestGrid { 18.643871513939, -1.802390457726, 559.287783590753, - -181.618432259161 + -181.618432259161, ), ( ConnectorPort.B, @@ -6475,7 +6475,7 @@ trait TransformerTestData extends TransformerTestGrid { 22.935405088363, -178.398896932957, 764.473152835885, - 1.384030974747 + 1.384030974747, ), ( ConnectorPort.B, @@ -6486,7 +6486,7 @@ trait TransformerTestData extends TransformerTestGrid { 11.507053497806, -178.873310168971, 383.540047677483, - 0.694718050283 + 0.694718050283, ), ( ConnectorPort.B, @@ -6497,7 +6497,7 @@ trait TransformerTestData extends TransformerTestGrid { 0.086602095802, -89.999645497660, 0.000007072753, - -73.163406799512 + -73.163406799512, ), ( ConnectorPort.B, @@ -6508,7 +6508,7 @@ trait TransformerTestData extends TransformerTestGrid { 4.626903666866, -1.349855603483, 154.196136582985, - -180.278184095994 + -180.278184095994, ), ( ConnectorPort.B, @@ -6519,7 +6519,7 @@ trait TransformerTestData extends TransformerTestGrid { 18.590741530561, -1.386445189467, 619.656479867641, - -181.120381398044 + -181.120381398044, ), ( ConnectorPort.B, @@ -6530,7 +6530,7 @@ trait TransformerTestData extends TransformerTestGrid { 22.935405069060, -178.398896556791, 655.262701863002, - 1.384031350765 + 1.384031350765, ), ( ConnectorPort.B, @@ -6541,7 +6541,7 @@ trait TransformerTestData extends TransformerTestGrid { 11.507053462181, -178.873309313955, 328.748611240179, - 0.694718904041 + 0.694718904041, ), ( ConnectorPort.B, @@ -6552,7 +6552,7 @@ trait TransformerTestData extends TransformerTestGrid { 0.086602298877, -89.999604839117, 0.000000000096, - -73.739795291688 + -73.739795291688, ), ( ConnectorPort.B, @@ -6563,7 +6563,7 @@ trait TransformerTestData extends TransformerTestGrid { 4.626903745261, -1.349858306013, 132.168119193982, - -180.278186816939 + -180.278186816939, ), ( ConnectorPort.B, @@ -6574,7 +6574,7 @@ trait TransformerTestData extends TransformerTestGrid { 18.590741530557, -1.386445189446, 531.134125600727, - -181.120381398021 + -181.120381398021, ), ( ConnectorPort.B, @@ -6585,7 +6585,7 @@ trait TransformerTestData extends TransformerTestGrid { 22.935405069071, -178.398896556822, 573.354864130381, - 1.384031350735 + 1.384031350735, ), ( ConnectorPort.B, @@ -6596,7 +6596,7 @@ trait TransformerTestData extends TransformerTestGrid { 11.507053462181, -178.873309313946, 287.655034835151, - 0.694718904051 + 0.694718904051, ), ( ConnectorPort.B, @@ -6607,7 +6607,7 @@ trait TransformerTestData extends TransformerTestGrid { 0.086602298880, -89.999604838507, 0.000000000005, - -90.000000000000 + -90.000000000000, ), ( ConnectorPort.B, @@ -6618,7 +6618,7 @@ trait TransformerTestData extends TransformerTestGrid { 4.626903589562, -1.349856236502, 115.647100480956, - -180.278184711145 + -180.278184711145, ), ( ConnectorPort.B, @@ -6629,7 +6629,7 @@ trait TransformerTestData extends TransformerTestGrid { 18.590741530558, -1.386445189457, 464.742359900663, - -181.120381398034 + -181.120381398034, ), ( ConnectorPort.B, @@ -6640,7 +6640,7 @@ trait TransformerTestData extends TransformerTestGrid { 22.935405170891, -178.398896948562, 546.052253991224, - 1.384030959920 + 1.384030959920, ), ( ConnectorPort.B, @@ -6651,7 +6651,7 @@ trait TransformerTestData extends TransformerTestGrid { 11.507053496248, -178.873309646778, 273.957176856597, - 0.694718572467 + 0.694718572467, ), ( ConnectorPort.B, @@ -6662,7 +6662,7 @@ trait TransformerTestData extends TransformerTestGrid { 0.086602265146, -89.999611600556, 0.000000839270, - -73.144433757855 + -73.144433757855, ), ( ConnectorPort.B, @@ -6673,7 +6673,7 @@ trait TransformerTestData extends TransformerTestGrid { 4.626903738866, -1.349857959049, 110.140099188552, - -180.278186468467 + -180.278186468467, ), ( ConnectorPort.B, @@ -6684,7 +6684,7 @@ trait TransformerTestData extends TransformerTestGrid { 18.590741530489, -1.386445115448, 442.611771334987, - -181.120381324018 + -181.120381324018, ), ( ConnectorPort.B, @@ -6695,7 +6695,7 @@ trait TransformerTestData extends TransformerTestGrid { 22.935405072746, -178.398896583674, 477.795720186062, - 1.384031323914 + 1.384031323914, ), ( ConnectorPort.B, @@ -6706,7 +6706,7 @@ trait TransformerTestData extends TransformerTestGrid { 11.507053464629, -178.873309352293, 239.712529081517, - 0.694718865792 + 0.694718865792, ), ( ConnectorPort.B, @@ -6717,7 +6717,7 @@ trait TransformerTestData extends TransformerTestGrid { 0.086602293201, -89.999605976054, 0.000000123615, - -73.155567956978 + -73.155567956978, ), ( ConnectorPort.B, @@ -6728,7 +6728,7 @@ trait TransformerTestData extends TransformerTestGrid { 4.626903743678, -1.349858243420, 96.372586881264, - -180.278186753973 + -180.278186753973, ), ( ConnectorPort.B, @@ -6739,7 +6739,7 @@ trait TransformerTestData extends TransformerTestGrid { 18.590741529536, -1.386445177723, 387.285299896290, - -181.120381386284 - ) + -181.120381386284, + ), ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/model/grid/TransformerTestGrid.scala b/src/test/scala/edu/ie3/simona/test/common/model/grid/TransformerTestGrid.scala index 9f0fc77394..aff8b1f3a8 100644 --- a/src/test/scala/edu/ie3/simona/test/common/model/grid/TransformerTestGrid.scala +++ b/src/test/scala/edu/ie3/simona/test/common/model/grid/TransformerTestGrid.scala @@ -12,16 +12,16 @@ import edu.ie3.datamodel.models.input.connector.{ LineInput, SwitchInput, Transformer2WInput, - Transformer3WInput + Transformer3WInput, } import edu.ie3.datamodel.models.input.container.{ RawGridElements, - SubGridContainer + SubGridContainer, } import edu.ie3.datamodel.models.input.{ MeasurementUnitInput, NodeInput, - OperatorInput + OperatorInput, } import edu.ie3.datamodel.models.voltagelevels.GermanVoltageLevelUtils import edu.ie3.simona.model.SystemComponent @@ -60,7 +60,7 @@ trait TransformerTestGrid { SystemComponent.determineOperationInterval( defaultSimulationStart, defaultSimulationEnd, - defaultOperationTime + defaultOperationTime, ) def mainRefSystem: RefSystem = { @@ -85,7 +85,7 @@ trait TransformerTestGrid { false, 0, -10, - 10 + 10, ) val transformerTypeTapLv = new Transformer2WTypeInput( @@ -103,7 +103,7 @@ trait TransformerTestGrid { true, 0, -10, - 10 + 10, ) val nodeA = new NodeInput( @@ -115,7 +115,7 @@ trait TransformerTestGrid { true, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.MV_10KV, - 0 + 0, ) val nodeB = new NodeInput( @@ -127,7 +127,7 @@ trait TransformerTestGrid { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.LV, - 1 + 1, ) val transformerInputTapHv = new Transformer2WInput( @@ -140,14 +140,14 @@ trait TransformerTestGrid { 1, transformerTypeTapHv, 0, - false + false, ) val transformerModelTapHv: TransformerModel = TransformerModel( transformerInputTapHv, mainRefSystem, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) val transformerInputTapLv = new Transformer2WInput( @@ -160,14 +160,14 @@ trait TransformerTestGrid { 1, transformerTypeTapLv, 0, - false + false, ) val transformerModelTapLv: TransformerModel = TransformerModel( transformerInputTapLv, mainRefSystem, defaultSimulationStart, - defaultSimulationEnd + defaultSimulationEnd, ) val gridTapHv: SubGridContainer = { @@ -177,12 +177,12 @@ trait TransformerTestGrid { Set(transformerInputTapHv).asJava, Set.empty[Transformer3WInput].asJava, Set.empty[SwitchInput].asJava, - Set.empty[MeasurementUnitInput].asJava + Set.empty[MeasurementUnitInput].asJava, ) TestGridFactory.createSubGrid( gridName = "transformer_test_grid", subgrid = 1, - rawGridElements = rawGridElements + rawGridElements = rawGridElements, ) } @@ -193,12 +193,12 @@ trait TransformerTestGrid { Set(transformerInputTapLv).asJava, Set.empty[Transformer3WInput].asJava, Set.empty[SwitchInput].asJava, - Set.empty[MeasurementUnitInput].asJava + Set.empty[MeasurementUnitInput].asJava, ) TestGridFactory.createSubGrid( gridName = "transformer_test_grid", subgrid = 1, - rawGridElements = rawGridElements + rawGridElements = rawGridElements, ) } } diff --git a/src/test/scala/edu/ie3/simona/test/common/model/participant/HpTestData.scala b/src/test/scala/edu/ie3/simona/test/common/model/participant/HpTestData.scala index 39873e9ece..60750607b4 100644 --- a/src/test/scala/edu/ie3/simona/test/common/model/participant/HpTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/model/participant/HpTestData.scala @@ -15,7 +15,7 @@ import edu.ie3.datamodel.models.input.system.characteristic.ReactivePowerCharact import edu.ie3.datamodel.models.input.thermal.{ ThermalBusInput, ThermalHouseInput, - ThermalStorageInput + ThermalStorageInput, } import edu.ie3.datamodel.models.voltagelevels.GermanVoltageLevelUtils import edu.ie3.simona.test.common.DefaultTestData @@ -34,12 +34,12 @@ trait HpTestData extends DefaultTestData { false, NodeInput.DEFAULT_GEO_POSITION, GermanVoltageLevelUtils.LV, - 2 + 2, ) protected val thermalBusInput = new ThermalBusInput( UUID.fromString("48fa6e8d-c07f-45cd-9ad7-094a1f2a7489"), - "thermal bus" + "thermal bus", ) protected val typeInput = new HpTypeInput( @@ -49,7 +49,7 @@ trait HpTestData extends DefaultTestData { Quantities.getQuantity(0.0, StandardUnits.ENERGY_PRICE), Quantities.getQuantity(15.0, StandardUnits.ACTIVE_POWER_IN), 0.97, - Quantities.getQuantity(11.0, StandardUnits.ACTIVE_POWER_IN) + Quantities.getQuantity(11.0, StandardUnits.ACTIVE_POWER_IN), ) protected val hpInputModel = new HpInput( @@ -60,7 +60,7 @@ trait HpTestData extends DefaultTestData { nodeInput, thermalBusInput, ReactivePowerCharacteristic.parse("cosPhiFixed:{(0.00,0.98)}"), - typeInput + typeInput, ) protected val thermalHouse = new ThermalHouseInput( @@ -71,12 +71,12 @@ trait HpTestData extends DefaultTestData { Quantities.getQuantity(75, StandardUnits.HEAT_CAPACITY), Quantities.getQuantity(21.0, StandardUnits.TEMPERATURE), Quantities.getQuantity(22.0, StandardUnits.TEMPERATURE), - Quantities.getQuantity(20.0, StandardUnits.TEMPERATURE) + Quantities.getQuantity(20.0, StandardUnits.TEMPERATURE), ) protected val thermalGrid = new ThermalGrid( thermalBusInput, Seq(thermalHouse).asJava, - Seq.empty[ThermalStorageInput].asJava + Seq.empty[ThermalStorageInput].asJava, ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/model/participant/LoadTestData.scala b/src/test/scala/edu/ie3/simona/test/common/model/participant/LoadTestData.scala index 1aeb8adc5e..c0985612ba 100644 --- a/src/test/scala/edu/ie3/simona/test/common/model/participant/LoadTestData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/model/participant/LoadTestData.scala @@ -30,6 +30,6 @@ trait LoadTestData extends LoadInputTestData { SystemComponent.determineOperationInterval( simulationStartDate, simulationEndDate, - operationTime + operationTime, ) } diff --git a/src/test/scala/edu/ie3/simona/test/common/result/PowerFlowResultData.scala b/src/test/scala/edu/ie3/simona/test/common/result/PowerFlowResultData.scala index c04999be92..9b51cb3b86 100644 --- a/src/test/scala/edu/ie3/simona/test/common/result/PowerFlowResultData.scala +++ b/src/test/scala/edu/ie3/simona/test/common/result/PowerFlowResultData.scala @@ -13,7 +13,7 @@ import edu.ie3.datamodel.models.result.NodeResult import edu.ie3.datamodel.models.result.connector.{ LineResult, SwitchResult, - Transformer2WResult + Transformer2WResult, } import edu.ie3.datamodel.models.result.system.PvResult import edu.ie3.util.TimeUtil @@ -33,7 +33,7 @@ trait PowerFlowResultData { dummyTime, dummyInputModel, Quantities.getQuantity(10, StandardUnits.ACTIVE_POWER_IN), - Quantities.getQuantity(10, StandardUnits.REACTIVE_POWER_IN) + Quantities.getQuantity(10, StandardUnits.REACTIVE_POWER_IN), ) val dummyPvResultDataString = @@ -44,7 +44,7 @@ trait PowerFlowResultData { dummyTime, dummyInputModel, Quantities.getQuantity(1.0, PowerSystemUnits.PU), - Quantities.getQuantity(10, PowerSystemUnits.DEGREE_GEOM) + Quantities.getQuantity(10, PowerSystemUnits.DEGREE_GEOM), ) val dummyNodeResultString = @@ -54,7 +54,7 @@ trait PowerFlowResultData { UUID.fromString("647efb19-ec38-4e01-812b-0d751f0150e8"), dummyTime, dummyInputModel, - true + true, ) val dummySwitchResultString = @@ -68,7 +68,7 @@ trait PowerFlowResultData { Quantities.getQuantity(100, PowerSystemUnits.DEGREE_GEOM), Quantities.getQuantity(100, Units.AMPERE), Quantities.getQuantity(100, PowerSystemUnits.DEGREE_GEOM), - 0 + 0, ) val dummyTrafo2wResultDataString = @@ -81,7 +81,7 @@ trait PowerFlowResultData { Quantities.getQuantity(100, Units.AMPERE), Quantities.getQuantity(100, PowerSystemUnits.DEGREE_GEOM), Quantities.getQuantity(100, Units.AMPERE), - Quantities.getQuantity(100, PowerSystemUnits.DEGREE_GEOM) + Quantities.getQuantity(100, PowerSystemUnits.DEGREE_GEOM), ) val dummyLineResultDataString = diff --git a/src/test/scala/edu/ie3/simona/test/matchers/QuantityMatchers.scala b/src/test/scala/edu/ie3/simona/test/matchers/QuantityMatchers.scala index 50c8d4776e..1cae268736 100644 --- a/src/test/scala/edu/ie3/simona/test/matchers/QuantityMatchers.scala +++ b/src/test/scala/edu/ie3/simona/test/matchers/QuantityMatchers.scala @@ -8,7 +8,7 @@ package edu.ie3.simona.test.matchers import edu.ie3.simona.test.matchers.QuantityMatchers.{ QuantityEqualityMatcher, - QuantityEquivalenceMatcher + QuantityEquivalenceMatcher, } import edu.ie3.util.quantities.QuantityUtil @@ -20,12 +20,12 @@ import org.scalatest.matchers.{MatchResult, Matcher} trait QuantityMatchers { def equalWithTolerance[Q <: Quantity[Q]]( right: Quantity[Q], - tolerance: Double = 1e-10 + tolerance: Double = 1e-10, ) = new QuantityEqualityMatcher(right, tolerance) def beEquivalentTo[Q <: Quantity[Q]]( right: Quantity[Q], - tolerance: Double = 1e-10 + tolerance: Double = 1e-10, ) = new QuantityEquivalenceMatcher(right, tolerance) } @@ -34,37 +34,37 @@ object QuantityMatchers { class QuantityEqualityMatcher[Q <: Quantity[Q]]( right: Quantity[Q], - tolerance: Double + tolerance: Double, ) extends Matcher[Quantity[Q]] with QuantityMatchers { override def apply(left: Quantity[Q]): MatchResult = MatchResult( QuantityUtil.equals(left, right, tolerance), QuantityMatchers.assembleRawFailureMessage(left, right, tolerance), - QuantityMatchers.assembleNegatedFailureMessage(left, right, tolerance) + QuantityMatchers.assembleNegatedFailureMessage(left, right, tolerance), ) } class QuantityEquivalenceMatcher[Q <: Quantity[Q]]( right: Quantity[Q], - tolerance: Double + tolerance: Double, ) extends Matcher[Quantity[Q]] with QuantityMatchers { override def apply(left: Quantity[Q]): MatchResult = MatchResult( QuantityUtil.isEquivalentAbs(left, right, tolerance), QuantityMatchers.assembleRawFailureMessage(left, right, tolerance), - QuantityMatchers.assembleNegatedFailureMessage(left, right, tolerance) + QuantityMatchers.assembleNegatedFailureMessage(left, right, tolerance), ) } private def assembleRawFailureMessage[Q <: Quantity[Q]]( lhs: Quantity[Q], rhs: Quantity[Q], - tolerance: Double + tolerance: Double, ) = s"The quantities $lhs and $rhs differ more than $tolerance in value" private def assembleNegatedFailureMessage[Q <: Quantity[Q]]( lhs: Quantity[Q], rhs: Quantity[Q], - tolerance: Double + tolerance: Double, ) = s"The quantities $lhs and $rhs differ less than $tolerance in value" } diff --git a/src/test/scala/edu/ie3/simona/test/matchers/QuantityMatchersSpec.scala b/src/test/scala/edu/ie3/simona/test/matchers/QuantityMatchersSpec.scala index ef1662da07..86f2d9ede8 100644 --- a/src/test/scala/edu/ie3/simona/test/matchers/QuantityMatchersSpec.scala +++ b/src/test/scala/edu/ie3/simona/test/matchers/QuantityMatchersSpec.scala @@ -25,7 +25,7 @@ class QuantityMatchersSpec extends UnitSpec { "pass if quantities are approximately the same" in { quant should equalWithTolerance( quant.add(toleranceQuantity.multiply(0.9)), - testTolerance + testTolerance, ) } @@ -33,7 +33,7 @@ class QuantityMatchersSpec extends UnitSpec { quant should not( equalWithTolerance( quant.add(toleranceQuantity.multiply(1.1)), - testTolerance + testTolerance, ) ) } diff --git a/src/test/scala/edu/ie3/simona/test/matchers/SquantsMatchers.scala b/src/test/scala/edu/ie3/simona/test/matchers/SquantsMatchers.scala index 1fdeb01349..54cd678ed2 100644 --- a/src/test/scala/edu/ie3/simona/test/matchers/SquantsMatchers.scala +++ b/src/test/scala/edu/ie3/simona/test/matchers/SquantsMatchers.scala @@ -16,7 +16,7 @@ trait SquantsMatchers { override def apply(left: Quantity[Q]): MatchResult = MatchResult( left =~ right, s"The quantities $left and $right differ more than $tolerance in value", - s"The quantities $left and $right differ less than $tolerance in value" + s"The quantities $left and $right differ less than $tolerance in value", ) } diff --git a/src/test/scala/edu/ie3/simona/util/ActorUtils.scala b/src/test/scala/edu/ie3/simona/util/ActorUtils.scala index a7466c126a..986a7b6de7 100644 --- a/src/test/scala/edu/ie3/simona/util/ActorUtils.scala +++ b/src/test/scala/edu/ie3/simona/util/ActorUtils.scala @@ -20,7 +20,7 @@ object ActorUtils { def expectActivationAndComplete( scheduler: ActorRef[SchedulerMessage], expectedTick: Long, - newTick: Option[Long] = None + newTick: Option[Long] = None, ): Unit = { val receivedTrigger = triggeredActor.expectMessageType[Activation] @@ -29,7 +29,7 @@ object ActorUtils { scheduler ! Completion( triggeredActor.ref, - newTick + newTick, ) } diff --git a/src/test/scala/edu/ie3/simona/util/CollectionUtilsSpec.scala b/src/test/scala/edu/ie3/simona/util/CollectionUtilsSpec.scala index 2553818567..d96c5da9af 100644 --- a/src/test/scala/edu/ie3/simona/util/CollectionUtilsSpec.scala +++ b/src/test/scala/edu/ie3/simona/util/CollectionUtilsSpec.scala @@ -29,7 +29,7 @@ class CollectionUtilsSpec extends UnitSpec { List( (Each(1d), Each(2d)), (Each(2d), Each(4d)), - (Each(3d), Each(8d)) + (Each(3d), Each(8d)), ) ) @@ -45,11 +45,11 @@ class CollectionUtilsSpec extends UnitSpec { returnedSequence1 shouldBe Seq( (Each(1d), Each(2d)), - (Each(2d), Each(4d)) + (Each(2d), Each(4d)), ) returnedSequence2 shouldBe Seq( (Each(2d), Each(4d)), - (Each(3d), Each(8d)) + (Each(3d), Each(8d)), ) returnedSequence3 shouldBe Seq((Each(3d), Each(8d))) } diff --git a/src/test/scala/edu/ie3/simona/util/ConfigUtilSpec.scala b/src/test/scala/edu/ie3/simona/util/ConfigUtilSpec.scala index f9d98acc0d..c04877efeb 100644 --- a/src/test/scala/edu/ie3/simona/util/ConfigUtilSpec.scala +++ b/src/test/scala/edu/ie3/simona/util/ConfigUtilSpec.scala @@ -11,7 +11,7 @@ import edu.ie3.datamodel.models.result.connector.{ LineResult, SwitchResult, Transformer2WResult, - Transformer3WResult + Transformer3WResult, } import edu.ie3.datamodel.models.result.system.{ChpResult, LoadResult} import edu.ie3.datamodel.models.result.{NodeResult, ResultEntity} @@ -25,7 +25,7 @@ import edu.ie3.simona.util.ConfigUtil.{ GridOutputConfigUtil, NotifierIdentifier, ParticipantConfigUtil, - OutputConfigUtil + OutputConfigUtil, } import org.scalatest.prop.{TableDrivenPropertyChecks, TableFor2} @@ -67,7 +67,7 @@ class ConfigUtilSpec scaling, uuids, modelBehaviour, - reference + reference, ) ) => calculateMissingReactivePowerWithModel shouldBe false @@ -126,7 +126,7 @@ class ConfigUtilSpec scaling, uuids, modelBehaviour, - reference + reference, ) ) => calculateMissingReactivePowerWithModel shouldBe false @@ -242,7 +242,7 @@ class ConfigUtilSpec 1.3, List("49f250fa-41ff-4434-a083-79c98d260a76"), "profile", - "power" + "power", ) actual.getOrDefault[LoadRuntimeConfig]( UUID.fromString("fb8f1443-1843-4ecd-a94a-59be8148397f") @@ -252,7 +252,7 @@ class ConfigUtilSpec 1.5, List("fb8f1443-1843-4ecd-a94a-59be8148397f"), "random", - "energy" + "energy", ) } } @@ -286,7 +286,7 @@ class ConfigUtilSpec FixedFeedInRuntimeConfig( calculateMissingReactivePowerWithModel, scaling, - uuids + uuids, ) ) => calculateMissingReactivePowerWithModel shouldBe false @@ -337,7 +337,7 @@ class ConfigUtilSpec FixedFeedInRuntimeConfig( calculateMissingReactivePowerWithModel, scaling, - uuids + uuids, ) ) => calculateMissingReactivePowerWithModel shouldBe false @@ -439,7 +439,7 @@ class ConfigUtilSpec FixedFeedInRuntimeConfig( calculateMissingReactivePowerWithModel = false, 1.3, - List("49f250fa-41ff-4434-a083-79c98d260a76") + List("49f250fa-41ff-4434-a083-79c98d260a76"), ) actual.getOrDefault[FixedFeedInRuntimeConfig]( UUID.fromString("fb8f1443-1843-4ecd-a94a-59be8148397f") @@ -447,7 +447,7 @@ class ConfigUtilSpec FixedFeedInRuntimeConfig( calculateMissingReactivePowerWithModel = false, 1.5, - List("fb8f1443-1843-4ecd-a94a-59be8148397f") + List("fb8f1443-1843-4ecd-a94a-59be8148397f"), ) } } @@ -538,7 +538,7 @@ class ConfigUtilSpec FixedFeedInRuntimeConfig( calculateMissingReactivePowerWithModel = false, 1.0, - List("default") + List("default"), ) // return default if a request for load is done, but fixed feed is found @@ -550,7 +550,7 @@ class ConfigUtilSpec 1.0, List("default"), "profile", - "power" + "power", ) // return default if a request for pv is done, but fixed feed is found @@ -560,7 +560,7 @@ class ConfigUtilSpec PvRuntimeConfig( calculateMissingReactivePowerWithModel = false, 1.0, - List("default") + List("default"), ) } } @@ -572,27 +572,27 @@ class ConfigUtilSpec ("config", "expected"), ( new GridOutputConfig(false, false, "grid", false, false, false), - Set.empty[Class[_ <: ResultEntity]] + Set.empty[Class[_ <: ResultEntity]], ), ( new GridOutputConfig(true, false, "grid", false, false, false), - Set(classOf[LineResult]) + Set(classOf[LineResult]), ), ( new GridOutputConfig(false, true, "grid", false, false, false), - Set(classOf[NodeResult]) + Set(classOf[NodeResult]), ), ( new GridOutputConfig(false, false, "grid", true, false, false), - Set(classOf[SwitchResult]) + Set(classOf[SwitchResult]), ), ( new GridOutputConfig(false, false, "grid", false, true, false), - Set(classOf[Transformer2WResult]) + Set(classOf[Transformer2WResult]), ), ( new GridOutputConfig(false, false, "grid", false, false, true), - Set(classOf[Transformer3WResult]) + Set(classOf[Transformer3WResult]), ), ( new GridOutputConfig(true, true, "grid", true, true, true), @@ -601,9 +601,9 @@ class ConfigUtilSpec classOf[NodeResult], classOf[SwitchResult], classOf[Transformer2WResult], - classOf[Transformer3WResult] - ) - ) + classOf[Transformer3WResult], + ), + ), ) forAll(ddt) { @@ -621,28 +621,28 @@ class ConfigUtilSpec notifier = "default", powerRequestReply = false, simulationResult = false, - flexResult = false + flexResult = false, ), List( SimonaConfig.ParticipantBaseOutputConfig( notifier = "load", powerRequestReply = false, simulationResult = false, - flexResult = false + flexResult = false, ), SimonaConfig.ParticipantBaseOutputConfig( notifier = "pv", powerRequestReply = false, simulationResult = false, - flexResult = false + flexResult = false, ), SimonaConfig.ParticipantBaseOutputConfig( notifier = "chp", powerRequestReply = false, simulationResult = false, - flexResult = false - ) - ) + flexResult = false, + ), + ), ) "build the correct map on valid input" in { @@ -651,24 +651,24 @@ class ConfigUtilSpec default shouldBe NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false + flexResult = false, ) configs shouldBe Map( Load -> NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false + flexResult = false, ), PvPlant -> NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false + flexResult = false, ), ChpPlant -> NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false - ) + flexResult = false, + ), ) } } @@ -679,7 +679,7 @@ class ConfigUtilSpec actual shouldBe NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false + flexResult = false, ) } @@ -687,7 +687,7 @@ class ConfigUtilSpec configUtil.getOrDefault(Wec) shouldBe NotifierConfig( simulationResultInfo = false, powerRequestReply = false, - flexResult = false + flexResult = false, ) } @@ -697,28 +697,28 @@ class ConfigUtilSpec notifier = "default", powerRequestReply = false, simulationResult = true, - flexResult = false + flexResult = false, ), List( SimonaConfig.ParticipantBaseOutputConfig( notifier = "load", powerRequestReply = true, simulationResult = true, - flexResult = false + flexResult = false, ), SimonaConfig.ParticipantBaseOutputConfig( notifier = "pv", powerRequestReply = true, simulationResult = false, - flexResult = false + flexResult = false, ), SimonaConfig.ParticipantBaseOutputConfig( notifier = "chp", powerRequestReply = true, simulationResult = true, - flexResult = false - ) - ) + flexResult = false, + ), + ), ) val configUtil = OutputConfigUtil(inputConfig) val expectedResult: Set[Value] = NotifierIdentifier.values -- Vector( @@ -734,28 +734,28 @@ class ConfigUtilSpec notifier = "default", powerRequestReply = false, simulationResult = false, - flexResult = false + flexResult = false, ), List( SimonaConfig.ParticipantBaseOutputConfig( notifier = "load", powerRequestReply = true, simulationResult = true, - flexResult = false + flexResult = false, ), SimonaConfig.ParticipantBaseOutputConfig( notifier = "pv", powerRequestReply = true, simulationResult = false, - flexResult = false + flexResult = false, ), SimonaConfig.ParticipantBaseOutputConfig( notifier = "chp", powerRequestReply = true, simulationResult = true, - flexResult = false - ) - ) + flexResult = false, + ), + ), ) val configUtil = OutputConfigUtil(inputConfig) val expectedResult: Set[Value] = @@ -770,28 +770,28 @@ class ConfigUtilSpec notifier = "default", powerRequestReply = false, simulationResult = false, - flexResult = false + flexResult = false, ), List( SimonaConfig.ParticipantBaseOutputConfig( notifier = "load", powerRequestReply = true, simulationResult = true, - flexResult = false + flexResult = false, ), SimonaConfig.ParticipantBaseOutputConfig( notifier = "pv", powerRequestReply = true, simulationResult = false, - flexResult = false + flexResult = false, ), SimonaConfig.ParticipantBaseOutputConfig( notifier = "chp", powerRequestReply = true, simulationResult = true, - flexResult = false - ) - ) + flexResult = false, + ), + ), ) val configUtil = OutputConfigUtil(inputConfig) val expectedResult: Set[Class[_ <: ResultEntity]] = @@ -810,9 +810,9 @@ class ConfigUtilSpec 0, "-not-a-uuid-", "https://reg:123", - "topic" + "topic", ), - Seq("topic") + Seq("topic"), ) }.getMessage shouldBe "The UUID '-not-a-uuid-' cannot be parsed as it is invalid." } @@ -825,9 +825,9 @@ class ConfigUtilSpec 0, "00000000-0000-0000-0000-000000000000", "https://reg:123", - "topic" + "topic", ), - Seq("topic") + Seq("topic"), ) }.getMessage shouldBe "Exception creating kafka client for broker not#a#server." } @@ -840,9 +840,9 @@ class ConfigUtilSpec 0, "00000000-0000-0000-0000-000000000000", "https://reg:123", - "topic" + "topic", ), - Seq("topic") + Seq("topic"), ) }.getMessage shouldBe "Connection with kafka broker localhost:12345 failed." } diff --git a/src/test/scala/edu/ie3/simona/util/TestGridFactory.scala b/src/test/scala/edu/ie3/simona/util/TestGridFactory.scala index 89f0cdf57e..df7be2d0a4 100644 --- a/src/test/scala/edu/ie3/simona/util/TestGridFactory.scala +++ b/src/test/scala/edu/ie3/simona/util/TestGridFactory.scala @@ -11,18 +11,18 @@ import edu.ie3.datamodel.models.input.connector.{ LineInput, SwitchInput, Transformer2WInput, - Transformer3WInput + Transformer3WInput, } import edu.ie3.datamodel.models.input.container.{ GraphicElements, JointGridContainer, RawGridElements, SubGridContainer, - SystemParticipants + SystemParticipants, } import edu.ie3.datamodel.models.input.graphics.{ LineGraphicInput, - NodeGraphicInput + NodeGraphicInput, } import edu.ie3.datamodel.models.input.system._ @@ -51,13 +51,13 @@ object TestGridFactory { gridName: String = "TestGrid", rawGridElements: RawGridElements = createEmptyRawGridElements(), systemParticipants: SystemParticipants = createEmptySystemParticipants(), - graphicElements: GraphicElements = createEmptyGraphicElements() + graphicElements: GraphicElements = createEmptyGraphicElements(), ): JointGridContainer = new JointGridContainer( gridName, rawGridElements, systemParticipants, - graphicElements + graphicElements, ) /** Creates a sub grid container for testing purposes. @@ -84,14 +84,14 @@ object TestGridFactory { subgrid: Int = 100, rawGridElements: RawGridElements = createEmptyRawGridElements(), systemParticipants: SystemParticipants = createEmptySystemParticipants(), - graphicElements: GraphicElements = createEmptyGraphicElements() + graphicElements: GraphicElements = createEmptyGraphicElements(), ): SubGridContainer = new SubGridContainer( gridName, subgrid, rawGridElements, systemParticipants, - graphicElements + graphicElements, ) def createEmptyRawGridElements(): RawGridElements = @@ -101,7 +101,7 @@ object TestGridFactory { Set.empty[Transformer2WInput].asJava, Set.empty[Transformer3WInput].asJava, Set.empty[SwitchInput].asJava, - Set.empty[MeasurementUnitInput].asJava + Set.empty[MeasurementUnitInput].asJava, ) def createEmptySystemParticipants(): SystemParticipants = @@ -116,12 +116,12 @@ object TestGridFactory { Set.empty[PvInput].asJava, Set.empty[StorageInput].asJava, Set.empty[WecInput].asJava, - Set.empty[EmInput].asJava + Set.empty[EmInput].asJava, ) def createEmptyGraphicElements(): GraphicElements = new GraphicElements( Set.empty[NodeGraphicInput].asJava, - Set.empty[LineGraphicInput].asJava + Set.empty[LineGraphicInput].asJava, ) } diff --git a/src/test/scala/edu/ie3/util/quantities/IrradianceSpec.scala b/src/test/scala/edu/ie3/util/quantities/IrradianceSpec.scala index 37759008e5..a9c9eabe7c 100644 --- a/src/test/scala/edu/ie3/util/quantities/IrradianceSpec.scala +++ b/src/test/scala/edu/ie3/util/quantities/IrradianceSpec.scala @@ -8,7 +8,7 @@ package edu.ie3.util.quantities import edu.ie3.util.scala.quantities.{ WattHoursPerSquareMeter, - WattsPerSquareMeter + WattsPerSquareMeter, } import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers diff --git a/src/test/scala/edu/ie3/util/quantities/IrradiationSpec.scala b/src/test/scala/edu/ie3/util/quantities/IrradiationSpec.scala index a2e7663864..30a2e0bff6 100644 --- a/src/test/scala/edu/ie3/util/quantities/IrradiationSpec.scala +++ b/src/test/scala/edu/ie3/util/quantities/IrradiationSpec.scala @@ -8,7 +8,7 @@ package edu.ie3.util.quantities import edu.ie3.util.scala.quantities.{ WattHoursPerSquareMeter, - WattsPerSquareMeter + WattsPerSquareMeter, } import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers diff --git a/src/test/scala/edu/ie3/util/quantities/QuantityUtilSpec.scala b/src/test/scala/edu/ie3/util/quantities/QuantityUtilSpec.scala index 55755258c0..1c1edb1f44 100644 --- a/src/test/scala/edu/ie3/util/quantities/QuantityUtilSpec.scala +++ b/src/test/scala/edu/ie3/util/quantities/QuantityUtilSpec.scala @@ -24,7 +24,7 @@ class QuantityUtilSpec extends UnitSpec with TableDrivenPropertyChecks { 2L -> unit(5d), 4L -> unit(15d), 6L -> unit(-5d), - 8L -> unit(-10d) + 8L -> unit(-10d), ) "Integrating over quantities" when { @@ -36,7 +36,7 @@ class QuantityUtilSpec extends UnitSpec with TableDrivenPropertyChecks { intercept[QuantityException] { QuantityUtil invokePrivate startingValue( Map.empty[Long, Power], - 1L + 1L, ) }.getMessage shouldBe "Unable to determine unit for dummy starting value." } @@ -44,7 +44,7 @@ class QuantityUtilSpec extends UnitSpec with TableDrivenPropertyChecks { "bring default value, if there is nothing before window starts" in { QuantityUtil invokePrivate startingValue( values, - 1L + 1L, ) should be unit(0d) @@ -53,7 +53,7 @@ class QuantityUtilSpec extends UnitSpec with TableDrivenPropertyChecks { "bring correct value, if there is something before window starts" in { QuantityUtil invokePrivate startingValue( values, - 2L + 2L, ) should be unit(5d) @@ -86,14 +86,14 @@ class QuantityUtilSpec extends UnitSpec with TableDrivenPropertyChecks { (1L, 3L, integrationUnit(5d)), (2L, 4L, integrationUnit(10d)), (2L, 8L, integrationUnit(30d)), - (0L, 12L, integrationUnit(-10d)) + (0L, 12L, integrationUnit(-10d)), ) forAll(cases) { (windowStart, windowEnd, expectedResult) => QuantityUtil.integrate[Power, Energy]( values, windowStart, - windowEnd + windowEnd, ) =~ expectedResult } } @@ -106,14 +106,14 @@ class QuantityUtilSpec extends UnitSpec with TableDrivenPropertyChecks { QuantityUtil.average[Power, Energy]( values, 0L, - 0L + 0L, ) match { case Failure(exception: IllegalArgumentException) => exception.getMessage shouldBe "Cannot average over trivial time window." case Failure(exception) => fail( "Averaging over values failed with wrong exception.", - exception + exception, ) case Success(_) => fail("Averaging with trivial window length should fail") @@ -124,14 +124,14 @@ class QuantityUtilSpec extends UnitSpec with TableDrivenPropertyChecks { QuantityUtil.average[Power, Energy]( values, 3L, - 0L + 0L, ) match { case Failure(exception: IllegalArgumentException) => exception.getMessage shouldBe "Window end is before window start." case Failure(exception) => fail( "Averaging over values failed with wrong exception.", - exception + exception, ) case Success(_) => fail("Averaging with flipped window start / end should fail") @@ -146,21 +146,21 @@ class QuantityUtilSpec extends UnitSpec with TableDrivenPropertyChecks { (1L, 3L, unit(2.5d)), (2L, 4L, unit(5d)), (2L, 8L, unit(5d)), - (0L, 12L, unit(-0.8333333)) + (0L, 12L, unit(-0.8333333)), ) forAll(cases) { (windowStart, windowEnd, expectedResult) => QuantityUtil.average[Power, Energy]( values, windowStart, - windowEnd + windowEnd, ) match { case Success(result) => result should approximate(expectedResult) case Failure(exception) => fail( "Averaging with fine input should pass, but failed.", - exception + exception, ) } } diff --git a/src/test/scala/edu/ie3/util/quantities/SpecificHeatCapacitySpec.scala b/src/test/scala/edu/ie3/util/quantities/SpecificHeatCapacitySpec.scala index d2a5aef2f8..adf15f89b6 100644 --- a/src/test/scala/edu/ie3/util/quantities/SpecificHeatCapacitySpec.scala +++ b/src/test/scala/edu/ie3/util/quantities/SpecificHeatCapacitySpec.scala @@ -39,7 +39,7 @@ class SpecificHeatCapacitySpec extends AnyFlatSpec with Matchers { KilowattHoursPerKelvinCubicMeters(1000).calcEnergy( Kelvin(10), Kelvin(20), - CubicMeters(5) + CubicMeters(5), ) should be(KilowattHours(50000.0)) } @@ -47,7 +47,7 @@ class SpecificHeatCapacitySpec extends AnyFlatSpec with Matchers { KilowattHoursPerKelvinCubicMeters(1000).calcEnergy( Celsius(100), Celsius(101), - CubicMeters(5) + CubicMeters(5), ) should be(KilowattHours(5000)) } } diff --git a/src/test/scala/edu/ie3/util/quantities/ThermalConductanceSpec.scala b/src/test/scala/edu/ie3/util/quantities/ThermalConductanceSpec.scala index fd2e290f16..7b71137d69 100644 --- a/src/test/scala/edu/ie3/util/quantities/ThermalConductanceSpec.scala +++ b/src/test/scala/edu/ie3/util/quantities/ThermalConductanceSpec.scala @@ -36,7 +36,7 @@ class ThermalConductanceSpec extends AnyFlatSpec with Matchers { WattsPerKelvin(1000).thermalConductanceToEnergy( Kelvin(10), Kelvin(0), - Hours(5) + Hours(5), ) should be(KilowattHours(50d)) } @@ -44,7 +44,7 @@ class ThermalConductanceSpec extends AnyFlatSpec with Matchers { WattsPerKelvin(1000).thermalConductanceToEnergy( Celsius(10), Celsius(0), - Hours(5) + Hours(5), ) should be(KilowattHours(50d)) } }