From 6e9b40f1c004020a54500edc5dccc408e88c318b Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Sat, 24 Aug 2024 09:56:41 +0200 Subject: [PATCH 01/46] Refactoring of ThermalGrid.energyGrid to distinguish between demand of house and storage --- CHANGELOG.md | 1 + .../participant/hp/HpAgentFundamentals.scala | 6 +- .../simona/model/participant/HpModel.scala | 148 +++-- .../simona/model/thermal/ThermalGrid.scala | 105 +++- .../model/participant/HpModelSpec.scala | 537 ++++++++++++++---- .../ThermalGridWithHouseAndStorageSpec.scala | 72 ++- .../ThermalGridWithHouseOnlySpec.scala | 32 +- .../ThermalGridWithStorageOnlySpec.scala | 51 +- 8 files changed, 693 insertions(+), 259 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91b25a5dbf..b1de2d3306 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,6 +78,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated `Gradle` to version V8.10 [#829](https://github.com/ie3-institute/simona/issues/829) - Updated AUTHORS.md [#905](https://github.com/ie3-institute/simona/issues/905) - Prepare ThermalStorageTestData for Storage without storageVolumeLvlMin [#894](https://github.com/ie3-institute/simona/issues/894) +- Refactoring of `ThermalGrid.energyGrid` to distinguish between demand of house and storage [#928](https://github.com/ie3-institute/simona/issues/928) ### Fixed - Removed a repeated line in the documentation of vn_simona config [#658](https://github.com/ie3-institute/simona/issues/658) 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 9add5d8ddc..7940120b4c 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 @@ -293,7 +293,11 @@ trait HpAgentFundamentals calcRelevantData: HpRelevantData, nodalVoltage: squants.Dimensionless, model: HpModel, - ): HpState = model.determineState(modelState, calcRelevantData) + ): HpState = { + val (_, _, state) = + model.determineState(modelState, calcRelevantData) + state + } /** Abstract definition, individual implementations found in individual agent * fundamental classes 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 4d9fc68899..ad512a75e0 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -11,16 +11,15 @@ import edu.ie3.simona.agent.participant.data.Data.PrimaryData.ApparentPowerAndHe import edu.ie3.simona.model.SystemComponent import edu.ie3.simona.model.participant.HpModel.{HpRelevantData, HpState} import edu.ie3.simona.model.participant.control.QControl -import edu.ie3.simona.model.thermal.ThermalGrid.ThermalGridState +import edu.ie3.simona.model.thermal.ThermalGrid.{ThermalEnergyDemand, ThermalGridState} import edu.ie3.simona.model.thermal.{ThermalGrid, ThermalThreshold} import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage.ProvideFlexOptions import edu.ie3.simona.ontology.messages.flex.MinMaxFlexibilityMessage.ProvideMinMaxFlexOptions import edu.ie3.util.quantities.PowerSystemUnits import edu.ie3.util.scala.OperationInterval -import edu.ie3.util.scala.quantities.DefaultQuantities import edu.ie3.util.scala.quantities.DefaultQuantities._ -import squants.energy.Kilowatts -import squants.{Power, Temperature} +import squants.energy.{KilowattHours, Kilowatts} +import squants.{Energy, Power, Temperature} import java.time.ZonedDateTime import java.util.UUID @@ -116,19 +115,23 @@ final case class HpModel( * function calculates the heat pump's next state to get the actual active * power of this state use [[calculateActivePower]] with the generated state * - * @param state - * Current state of the heat pump + * @param lastState + * Last state of the heat pump * @param relevantData * data of heat pump including * @return - * next [[HpState]] + * Booleans if Hp can operate and can be out of operation plus next + * [[HpState]] */ def determineState( - state: HpState, + lastState: HpState, relevantData: HpRelevantData, - ): HpState = { - val turnOn = operatesInNextState(state, relevantData) - calcState(state, relevantData, turnOn) + ): (Boolean, Boolean, HpState) = { + val (turnOn, canOperate, canBeOutOfOperation, houseDemand, storageDemand) = + operatesInNextState(lastState, relevantData) + val updatedState = + calcState(lastState, relevantData, turnOn, houseDemand, storageDemand) + (canOperate, canBeOutOfOperation, updatedState) } /** Depending on the input, this function decides whether the heat pump will @@ -142,18 +145,63 @@ final case class HpModel( * @param relevantData * Relevant (external) data * @return - * boolean defining if heat pump runs in next time step + * boolean defining if heat pump runs in next time step, if it can be in + * operation and out of operation plus the demand of house and storage */ private def operatesInNextState( state: HpState, relevantData: HpRelevantData, - ): Boolean = { - val demand = thermalGrid.energyDemand( - relevantData.currentTick, - relevantData.ambientTemperature, - state.thermalGridState, + ): (Boolean, Boolean, Boolean, Boolean, Boolean) = { + val (demandHouse, demandThermalStorage, updatedState) = + thermalGrid.energyDemandAndUpdatedState( + relevantData.currentTick, + state.ambientTemperature.getOrElse(relevantData.ambientTemperature), + relevantData.ambientTemperature, + state.thermalGridState, + ) + + val ( + houseDemand, + heatStorageDemand, + noThermalStorageOrThermalStorageIsEmpty, + ) = determineDemandBooleans( + state, + updatedState, + demandHouse, + demandThermalStorage, ) - demand.hasRequiredDemand || (state.isRunning && demand.hasAdditionalDemand) + + val turnHpOn: Boolean = + houseDemand || heatStorageDemand + + val canOperate = + demandHouse.hasRequiredDemand || demandHouse.hasAdditionalDemand || + demandThermalStorage.hasRequiredDemand || demandThermalStorage.hasAdditionalDemand + val canBeOutOfOperation = + !(demandHouse.hasRequiredDemand && noThermalStorageOrThermalStorageIsEmpty) + + (turnHpOn, canOperate, canBeOutOfOperation, houseDemand, heatStorageDemand) + } + + def determineDemandBooleans( + hpState: HpState, + updatedGridState: ThermalGridState, + demandHouse: ThermalEnergyDemand, + demandThermalStorage: ThermalEnergyDemand, + ): (Boolean, Boolean, Boolean) = { + implicit val tolerance: Energy = KilowattHours(1e-3) + val noThermalStorageOrThermalStorageIsEmpty: Boolean = + updatedGridState.storageState.isEmpty || updatedGridState.storageState + .exists( + _.storedEnergy =~ zeroKWH + ) + + val houseDemand = + (demandHouse.hasRequiredDemand && noThermalStorageOrThermalStorageIsEmpty) || (hpState.isRunning && demandHouse.hasAdditionalDemand) + val heatStorageDemand = { + (demandThermalStorage.hasRequiredDemand) || (hpState.isRunning && demandThermalStorage.hasAdditionalDemand) + } + (houseDemand, heatStorageDemand, noThermalStorageOrThermalStorageIsEmpty) } /** Calculate state depending on whether heat pump is needed or not. Also @@ -173,11 +221,19 @@ final case class HpModel( state: HpState, relevantData: HpRelevantData, isRunning: Boolean, + houseDemand: Boolean, + storageDemand: Boolean, ): HpState = { + val lastStateStorageqDot = state.thermalGridState.storageState + .map(_.qDot) + .getOrElse(zeroKW) + val (newActivePower, newThermalPower) = if (isRunning) (pRated, pThermal) - else (DefaultQuantities.zeroKW, DefaultQuantities.zeroKW) + else if (lastStateStorageqDot < zeroKW) + (zeroKW, lastStateStorageqDot * (-1)) + else (zeroKW, zeroKW) /* Push thermal energy to the thermal grid and get its updated state in return */ val (thermalGridState, maybeThreshold) = @@ -205,23 +261,14 @@ final case class HpModel( lastState: HpState, ): ProvideFlexOptions = { /* Determine the operating state in the given tick */ - val updatedState = determineState(lastState, data) - - /* Determine the options we have */ - val thermalEnergyDemand = thermalGrid.energyDemand( - data.currentTick, - data.ambientTemperature, - lastState.thermalGridState, - ) - val canOperate = - thermalEnergyDemand.hasRequiredDemand || thermalEnergyDemand.hasAdditionalDemand - val canBeOutOfOperation = !thermalEnergyDemand.hasRequiredDemand + val (canOperate, canBeOutOfOperation, updatedHpState) + : (Boolean, Boolean, HpState) = determineState(lastState, data) val lowerBoundary = if (canBeOutOfOperation) zeroKW else - updatedState.activePower + updatedHpState.activePower val upperBoundary = if (canOperate) sRated * cosPhiRated @@ -230,7 +277,7 @@ final case class HpModel( ProvideMinMaxFlexOptions( uuid, - updatedState.activePower, + updatedHpState.activePower, lowerBoundary, upperBoundary, ) @@ -260,13 +307,44 @@ final case class HpModel( ): (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) - val updatedState = calcState(lastState, data, turnOn) + + val ( + thermalEnergyDemandHouse, + thermalEnergyDemandStorage, + updatedThermalGridState, + ) = + thermalGrid.energyDemandAndUpdatedState( + data.currentTick, + lastState.ambientTemperature.getOrElse(data.ambientTemperature), + data.ambientTemperature, + lastState.thermalGridState, + ) + + val ( + houseDemand, + heatStorageDemand, + noThermalStorageOrThermalStorageIsEmpty, + ) = determineDemandBooleans( + lastState, + updatedThermalGridState, + thermalEnergyDemandHouse, + thermalEnergyDemandStorage, + ) + + val updatedHpState: HpState = + calcState( + lastState, + data, + turnOn, + houseDemand, + heatStorageDemand, + ) ( - updatedState, + updatedHpState, FlexChangeIndicator( changesAtNextActivation = true, - updatedState.maybeThermalThreshold.map(_.tick), + updatedHpState.maybeThermalThreshold.map(_.tick), ), ) } 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 286b0e829f..3e983b6abe 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala @@ -43,60 +43,105 @@ final case class ThermalGrid( ) extends LazyLogging { /** Determine the energy demand of the total grid at the given instance in - * time + * time and returns it including the updatedState + * * @param tick * Questioned instance in time + * @param lastAmbientTemperature + * Ambient temperature until this tick * @param ambientTemperature * Ambient temperature in the instance in question * @param state * Currently applicable state of the thermal grid * @return - * The total energy demand of the grid + * The total energy demand of the house and the storage and an updated + * [[ThermalGridState]] */ - def energyDemand( + def energyDemandAndUpdatedState( tick: Long, + // FIXME this is also in state + lastAmbientTemperature: Temperature, ambientTemperature: Temperature, state: ThermalGridState, - ): ThermalEnergyDemand = { - /* First get the energy demand of the houses */ - val houseDemand = house - .zip(state.houseState) - .map { case (house, state) => - house.energyDemand( - tick, - ambientTemperature, - state, - ) + ): (ThermalEnergyDemand, ThermalEnergyDemand, ThermalGridState) = { + /* First get the energy demand of the houses but only if inner temperature is below target temperature */ + + val (houseDemand, updatedHouseState) = + house.zip(state.houseState).headOption match { + case Some((thermalHouse, lastHouseState)) => + val (updatedHouseState, updatedStorageState) = + thermalHouse.determineState( + tick, + lastHouseState, + lastAmbientTemperature, + ambientTemperature, + lastHouseState.qDot, + ) + if ( + updatedHouseState.innerTemperature < thermalHouse.targetTemperature | (lastHouseState.qDot > zeroKW && updatedHouseState.innerTemperature < thermalHouse.upperBoundaryTemperature) + ) { + ( + thermalHouse.energyDemand( + tick, + ambientTemperature, + updatedHouseState, + ), + Some(updatedHouseState), + ) + + } else { + (ThermalEnergyDemand.noDemand, Some(updatedHouseState)) + } + + case None => + (ThermalEnergyDemand.noDemand, None) } - .getOrElse(ThermalEnergyDemand.noDemand) /* Then go over the storages, see what they can provide and what they might be able to charge */ - val (storedEnergy, remainingCapacity) = { + val (storageDemand, updatedStorageState) = { + storage .zip(state.storageState) .map { case (storage, state) => - val usableEnergy = state.storedEnergy - val remaining = storage.getMaxEnergyThreshold - usableEnergy + val (updatedStorageState, _) = + storage.updateState(tick, state.qDot, state) + val storedEnergy = updatedStorageState.storedEnergy + val soc = storedEnergy / storage.getMaxEnergyThreshold + val storageRequired = { + if (soc == 0d) { + storage.getMaxEnergyThreshold - storedEnergy + + } else { + zeroMWH + } + } + + val storagePossible = storage.getMaxEnergyThreshold - storedEnergy ( - usableEnergy, - remaining, + ThermalEnergyDemand( + storageRequired, + storagePossible, + ), + Some(updatedStorageState), ) + } .getOrElse( - (zeroMWH, zeroMWH) + ThermalEnergyDemand(zeroMWH, zeroMWH), + None, ) } - val usedEnergy = - if (storedEnergy >= houseDemand.required) - houseDemand.required - else - storedEnergy - val finallyRemaining = remainingCapacity + usedEnergy - - ThermalEnergyDemand( - houseDemand.required - usedEnergy, - houseDemand.possible + finallyRemaining, + ( + ThermalEnergyDemand( + houseDemand.required, + houseDemand.possible, + ), + ThermalEnergyDemand( + storageDemand.required, + storageDemand.possible, + ), + ThermalGridState(updatedHouseState, updatedStorageState), ) } 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 e99a5c8c26..81c62e549d 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/HpModelSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/HpModelSpec.scala @@ -208,14 +208,18 @@ class HpModelSpec val hp = hpModel(grid) hp.determineState(state, data) match { - case HpState( - isRunning, + case ( _, _, - activePower, - _, - ThermalGridState(Some(thermalHouseState), _), - maybeThreshold, + HpState( + isRunning, + _, + _, + activePower, + _, + ThermalGridState(Some(thermalHouseState), _), + maybeThreshold, + ), ) => isRunning shouldBe expectedRunningState activePower should approximate(Kilowatts(expectedActivePower)) @@ -234,166 +238,447 @@ class HpModelSpec "determining the flexibility options for different states" should { "deliver correct flexibility options" in { - val testCases = Table( - ("thermalState", "lastState", "expectedValues"), - // House is below lower temperature boundary - ( - ThermalGridState( - Some(ThermalHouseState(0L, Celsius(15), Kilowatts(0))), - Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), + val testCases = + Table( + ("thermalState", "lastState", "expectedValues"), + // 1. Hp actually not running + // House is below lower temperature boundary + // Heat storage is empty + // hp must be turned on + ( + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(15), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(0), Kilowatts(0))), + ), + HpState( + isRunning = false, + 0, + Some(hpData.ambientTemperature), + Kilowatts(0.0), + Kilowatts(0.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(15), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(0), Kilowatts(0))), + ), + None, + ), + (95.0, 95.0, 95.0), ), - HpState( - isRunning = false, - 0, - Some(hpData.ambientTemperature), - Kilowatts(0.0), - Kilowatts(0.0), + // 2. Same as before but heat storage is NOT empty + // should be possible to keep hp off + ( ThermalGridState( Some(ThermalHouseState(0L, Celsius(15), Kilowatts(0))), - Some( - ThermalStorageState(0L, KilowattHours(20), Kilowatts(0)) + Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), + ), + HpState( + isRunning = false, + 0, + Some(hpData.ambientTemperature), + Kilowatts(0.0), + Kilowatts(0.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(15), Kilowatts(0))), + Some( + ThermalStorageState(0L, KilowattHours(20), Kilowatts(0)) + ), ), + None, ), - None, + (0.0, 0.0, 95.0), ), - (95.0, 95.0, 95.0), - ), - // House is between target temperature and lower temperature boundary, Hp actually running - ( - ThermalGridState( - Some(ThermalHouseState(0L, Celsius(19), Kilowatts(0))), - Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), + // 3. Hp actually running + // House is below lower temperature boundary + // Heat storage is empty + // Hp must run because of house and storage + ( + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(15), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(0), Kilowatts(0))), + ), + HpState( + isRunning = true, + 0, + Some(hpData.ambientTemperature), + Kilowatts(0.0), + Kilowatts(0.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(15), Kilowatts(0))), + Some( + ThermalStorageState(0L, KilowattHours(0), Kilowatts(0)) + ), + ), + None, + ), + (95.0, 95.0, 95.0), ), - HpState( - isRunning = true, - 0, - Some(hpData.ambientTemperature), - Kilowatts(95.0), - Kilowatts(80.0), + // 4. Same as before but heat storage is NOT empty + // Hp should not run because of storage but can be turned on + ( ThermalGridState( - Some(ThermalHouseState(0L, Celsius(19), Kilowatts(80))), - Some( - ThermalStorageState(0L, KilowattHours(20), Kilowatts(0)) + Some(ThermalHouseState(0L, Celsius(15), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), + ), + HpState( + isRunning = false, + 0, + Some(hpData.ambientTemperature), + Kilowatts(0.0), + Kilowatts(0.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(15), Kilowatts(0))), + Some( + ThermalStorageState(0L, KilowattHours(20), Kilowatts(0)) + ), ), + None, ), - None, + (0.0, 0.0, 95.0), ), - (95.0, 0.0, 95.0), - ), - - // House is between target temperature and lower temperature boundary, Hp actually not running - ( - ThermalGridState( - Some(ThermalHouseState(0L, Celsius(19), Kilowatts(0))), - Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), + // 5. Hp actually running + // House is between target temperature and lower temperature boundary + // Heat storage is empty + // Hp runs but can be turned off + ( + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(19), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(0), Kilowatts(0))), + ), + HpState( + isRunning = true, + 0, + Some(hpData.ambientTemperature), + Kilowatts(95.0), + Kilowatts(80.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(19), Kilowatts(0))), + Some( + ThermalStorageState(0L, KilowattHours(0), Kilowatts(0)) + ), + ), + None, + ), + (95.0, 0.0, 95.0), ), - HpState( - isRunning = false, - 0, - Some(hpData.ambientTemperature), - Kilowatts(0.0), - Kilowatts(0.0), + // 6. Same as before but heat storage is NOT empty + // should be possible to keep hp off + ( ThermalGridState( Some(ThermalHouseState(0L, Celsius(19), Kilowatts(0))), - Some( - ThermalStorageState(0L, KilowattHours(20), Kilowatts(0)) + Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), + ), + HpState( + isRunning = true, + 0, + Some(hpData.ambientTemperature), + Kilowatts(95.0), + Kilowatts(80.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(19), Kilowatts(0))), + Some( + ThermalStorageState(0L, KilowattHours(20), Kilowatts(0)) + ), ), + None, ), - None, + (95.0, 0.0, 95.0), ), - (0.0, 0.0, 95.0), - ), - // Storage and house have remaining capacity - ( - ThermalGridState( - Some(ThermalHouseState(0L, Celsius(21), Kilowatts(80))), - Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), + // 7. Hp actually NOT running + // House is between target temperature and lower temperature boundary + // Heat storage is empty + // Hp should run because of storage but can be turned off + ( + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(19), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(0), Kilowatts(0))), + ), + HpState( + isRunning = false, + 0, + Some(hpData.ambientTemperature), + Kilowatts(95.0), + Kilowatts(80.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(19), Kilowatts(0))), + Some( + ThermalStorageState(0L, KilowattHours(0), Kilowatts(0)) + ), + ), + None, + ), + (95.0, 0.0, 95.0), ), - HpState( - isRunning = true, - 0, - Some(hpData.ambientTemperature), - Kilowatts(95.0), - Kilowatts(80.0), + // 8. Same as before but heat storage is NOT empty + // Hp should be off but able to turn on + ( ThermalGridState( - Some(ThermalHouseState(0L, Celsius(21), Kilowatts(80))), + Some(ThermalHouseState(0L, Celsius(19), Kilowatts(0))), Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), ), - Some(HouseTemperatureUpperBoundaryReached(0L)), + HpState( + isRunning = false, + 0, + Some(hpData.ambientTemperature), + Kilowatts(95.0), + Kilowatts(80.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(19), Kilowatts(0))), + Some( + ThermalStorageState(0L, KilowattHours(20), Kilowatts(0)) + ), + ), + None, + ), + (0.0, 0.0, 95.0), ), - (95.0, 0.0, 95.0), - ), - - // Storage is full, House has capacity till upper boundary - ( - ThermalGridState( - Some(ThermalHouseState(0L, Celsius(21), Kilowatts(80))), - Some(ThermalStorageState(0L, KilowattHours(500), Kilowatts(0))), + // 9. Hp actually running + // House is between target temperature and upper temperature boundary + // Heat storage is empty + // Hp will run because of storage but can be turned off + ( + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(21), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(0), Kilowatts(0))), + ), + HpState( + isRunning = true, + 0, + Some(hpData.ambientTemperature), + Kilowatts(95.0), + Kilowatts(80.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(21), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(0), Kilowatts(0))), + ), + Some(HouseTemperatureUpperBoundaryReached(0L)), + ), + (95.0, 0.0, 95.0), ), - HpState( - isRunning = false, - 0, - Some(hpData.ambientTemperature), - Kilowatts(0.0), - Kilowatts(0.0), + // 10. Same as before but storage is NOT empty + // Hp should run but can be turned off + ( + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(21), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), + ), + HpState( + isRunning = true, + 0, + Some(hpData.ambientTemperature), + Kilowatts(95.0), + Kilowatts(80.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(21), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), + ), + Some(HouseTemperatureUpperBoundaryReached(0L)), + ), + (95.0, 0.0, 95.0), + ), + // 11. Hp actually not running + // House is between target temperature and upper temperature boundary + // Heat storage is empty + // Hp should run because of storage but can be turned off + ( ThermalGridState( - Some(ThermalHouseState(0L, Celsius(21), Kilowatts(80))), - Some( - ThermalStorageState(0L, KilowattHours(500), Kilowatts(0)) + Some(ThermalHouseState(0L, Celsius(21), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(0), Kilowatts(0))), + ), + HpState( + isRunning = false, + 0, + Some(hpData.ambientTemperature), + Kilowatts(95.0), + Kilowatts(80.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(21), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(0), Kilowatts(0))), ), + Some(HouseTemperatureUpperBoundaryReached(0L)), ), - Some(HouseTemperatureUpperBoundaryReached(0L)), + (95.0, 0.0, 95.0), + ), + // 12. Same as before but storage is NOT empty + // Hp should not run but can be turned on for storage or house + ( + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(21), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), + ), + HpState( + isRunning = false, + 0, + Some(hpData.ambientTemperature), + Kilowatts(95.0), + Kilowatts(80.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(21), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), + ), + Some(HouseTemperatureUpperBoundaryReached(0L)), + ), + (0.0, 0.0, 95.0), ), - (0.0, 0.0, 95.0), - ), - // No capacity for flexibility at all because house is - // at upperTempBoundary and storage is at max capacity - ( - ThermalGridState( - Some(ThermalHouseState(0L, Celsius(22), Kilowatts(80))), - Some(ThermalStorageState(0L, KilowattHours(500), Kilowatts(0))), + // 13. Hp actually running + // House is at upper temperature boundary + // Heat storage is empty + // Hp should run because of storage but can be turned off + ( + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(22), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(0), Kilowatts(0))), + ), + HpState( + isRunning = true, + 0, + Some(hpData.ambientTemperature), + Kilowatts(95.0), + Kilowatts(80.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(21), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(0), Kilowatts(0))), + ), + Some(HouseTemperatureUpperBoundaryReached(0L)), + ), + (95.0, 0.0, 95.0), ), - HpState( - isRunning = true, - 0, - Some(hpData.ambientTemperature), - Kilowatts(95.0), - Kilowatts(80.0), + // 14. Same as before but storage is NOT empty + // Hp should run but can be turned off + ( ThermalGridState( - Some(ThermalHouseState(0L, Celsius(22), Kilowatts(80))), - Some( - ThermalStorageState(0L, KilowattHours(500), Kilowatts(0)) + Some(ThermalHouseState(0L, Celsius(22), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), + ), + HpState( + isRunning = true, + 0, + Some(hpData.ambientTemperature), + Kilowatts(95.0), + Kilowatts(80.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(21), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), ), + Some(HouseTemperatureUpperBoundaryReached(0L)), ), - Some(HouseTemperatureUpperBoundaryReached(0L)), + (95.0, 0.0, 95.0), + ), + // 15. Hp actually not running + // House is at upper temperature boundary + // Heat storage is empty + // Hp should run because of storage but can be turned off + ( + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(22), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(0), Kilowatts(0))), + ), + HpState( + isRunning = false, + 0, + Some(hpData.ambientTemperature), + Kilowatts(95.0), + Kilowatts(80.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(21), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(0), Kilowatts(0))), + ), + Some(HouseTemperatureUpperBoundaryReached(0L)), + ), + (95.0, 0.0, 95.0), ), - (0.0, 0.0, 0.0), - ), - // No capacity for flexibility at all when storage is full and house has been (externally) heated up above upperTemperatureBoundary - ( - ThermalGridState( - Some(ThermalHouseState(0L, Celsius(25), Kilowatts(0))), - Some(ThermalStorageState(0L, KilowattHours(500), Kilowatts(0))), + // 16. Same as before but storage is NOT empty + // Hp should not run but can be turned on for storage + ( + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(22), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), + ), + HpState( + isRunning = false, + 0, + Some(hpData.ambientTemperature), + Kilowatts(95.0), + Kilowatts(80.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(21), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(20), Kilowatts(0))), + ), + Some(HouseTemperatureUpperBoundaryReached(0L)), + ), + (0.0, 0.0, 95.0), ), - HpState( - isRunning = false, - 0, - Some(hpData.ambientTemperature), - Kilowatts(95.0), - Kilowatts(80.0), + + // Storage is full, House has capacity till upper boundary + ( + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(21), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(500), Kilowatts(0))), + ), + HpState( + isRunning = false, + 0, + Some(hpData.ambientTemperature), + Kilowatts(0.0), + Kilowatts(0.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(19), Kilowatts(0))), + Some( + ThermalStorageState(0L, KilowattHours(500), Kilowatts(0)) + ), + ), + Some(HouseTemperatureUpperBoundaryReached(0L)), + ), + (0.0, 0.0, 95.0), + ), + // No capacity for flexibility at all because house is + // at upperTempBoundary and storage is at max capacity + ( + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(22), Kilowatts(0))), + Some(ThermalStorageState(0L, KilowattHours(500), Kilowatts(0))), + ), + HpState( + isRunning = true, + 0, + Some(hpData.ambientTemperature), + Kilowatts(95.0), + Kilowatts(80.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(22), Kilowatts(0))), + Some( + ThermalStorageState(0L, KilowattHours(500), Kilowatts(0)) + ), + ), + Some(HouseTemperatureUpperBoundaryReached(0L)), + ), + (0.0, 0.0, 0.0), + ), + + // No capacity for flexibility at all when storage is full and house has been (externally) heated up above upperTemperatureBoundary + ( ThermalGridState( Some(ThermalHouseState(0L, Celsius(25), Kilowatts(0))), - Some( - ThermalStorageState(0L, KilowattHours(500), Kilowatts(0)) + Some(ThermalStorageState(0L, KilowattHours(500), Kilowatts(0))), + ), + HpState( + isRunning = false, + 0, + Some(hpData.ambientTemperature), + Kilowatts(95.0), + Kilowatts(80.0), + ThermalGridState( + Some(ThermalHouseState(0L, Celsius(25), Kilowatts(0))), + Some( + ThermalStorageState(0L, KilowattHours(500), Kilowatts(0)) + ), ), + None, ), - None, + (0.0, 0.0, 0.0), ), - (0.0, 0.0, 0.0), - ), - ) + ) // Run the test cases forAll(testCases) { 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 5d4fe69d88..1ea45a656d 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala @@ -96,53 +96,51 @@ class ThermalGridWithHouseAndStorageSpec "deliver the house demand (no demand) with added flexibility by storage" in { val tick = 10800 // after three hours - val gridDemand = thermalGrid.energyDemand( - tick, - testGridAmbientTemperature, - ThermalGrid.startingState(thermalGrid), + val (houseDemand, storageDemand, updatedThermalGridState) = + thermalGrid.energyDemandAndUpdatedState( + tick, + testGridAmbientTemperature, + testGridAmbientTemperature, + ThermalGrid.startingState(thermalGrid), + ) + houseDemand.required should approximate(KilowattHours(0d)) + houseDemand.possible should approximate(KilowattHours(31.05009722d)) + storageDemand.required should approximate(KilowattHours(1150d)) + storageDemand.possible should approximate(KilowattHours(1150d)) + updatedThermalGridState.houseState shouldBe Some( + ThermalHouseState(10800, Kelvin(292.0799935185185), Kilowatts(0d)) ) - - gridDemand.required should approximate(KilowattHours(0d)) - gridDemand.possible should approximate( - KilowattHours(31.05009722 + 1150) + updatedThermalGridState.storageState shouldBe Some( + ThermalStorageState(10800, KilowattHours(0d), Kilowatts(0d)) ) } - "consider stored energy to reduce house demand" in { + "deliver the correct house and storage demand" in { val tick = 10800 // after three hours val startingState = ThermalGrid.startingState(thermalGrid) - val gridDemand = thermalGrid.energyDemand( - tick, - testGridAmbientTemperature, - startingState.copy(houseState = - startingState.houseState.map( - _.copy(innerTemperature = Celsius(16d)) - ) - ), - ) - - gridDemand.required should approximate(KilowattHours(45.60005555555534)) - gridDemand.possible should approximate(KilowattHours(1225.600055555)) - } - - "consider stored energy to reduce house demand if stored energy is not enough" in { - val tick = 10800 // after three hours + val (houseDemand, storageDemand, updatedThermalGridState) = + thermalGrid.energyDemandAndUpdatedState( + tick, + testGridAmbientTemperature, + testGridAmbientTemperature, + startingState.copy(houseState = + startingState.houseState.map( + _.copy(innerTemperature = Celsius(16d)) + ) + ), + ) - val startingState = ThermalGrid.startingState(thermalGrid) - val gridDemand = thermalGrid.energyDemand( - tick, - testGridAmbientTemperature, - startingState.copy(houseState = - startingState.houseState.map( - _.copy(innerTemperature = Celsius(3d)) - ) - ), + houseDemand.required should approximate(KilowattHours(45.6000555)) + houseDemand.possible should approximate(KilowattHours(75.600055555)) + storageDemand.required should approximate(KilowattHours(1150d)) + storageDemand.possible should approximate(KilowattHours(1150d)) + updatedThermalGridState.houseState shouldBe Some( + ThermalHouseState(10800, Celsius(15.959996296296296), Kilowatts(0d)) ) - gridDemand.required should approximate( - KilowattHours(238.64987499999984) + updatedThermalGridState.storageState shouldBe Some( + ThermalStorageState(10800, KilowattHours(0d), Kilowatts(0d)) ) - gridDemand.possible should approximate(KilowattHours(1418.64987499999)) } } 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 d2b48ff3b3..eb447d0fc4 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala @@ -14,9 +14,9 @@ import edu.ie3.simona.model.thermal.ThermalHouse.ThermalHouseThreshold.{ HouseTemperatureUpperBoundaryReached, } import edu.ie3.simona.test.common.UnitSpec -import squants.energy.{Kilowatts, Megawatts, WattHours, Watts} +import squants.energy._ import squants.thermal.Celsius -import squants.{Energy, Power, Temperature} +import squants.{Energy, Kelvin, Power, Temperature} import scala.jdk.CollectionConverters._ @@ -73,21 +73,29 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { "determining the energy demand" should { "exactly be the demand of the house" in { - val tick = 10800 // after three house - val houseDemand = thermalHouse.energyDemand( + val tick = 10800 // after three hours + val expectedHouseDemand = thermalHouse.energyDemand( tick, testGridAmbientTemperature, expectedHouseStartingState, ) - val gridDemand = thermalGrid.energyDemand( - tick, - testGridAmbientTemperature, - ThermalGrid.startingState(thermalGrid), - ) + val (houseDemand, storageDemand, updatedThermalGridState) = + thermalGrid.energyDemandAndUpdatedState( + tick, + testGridAmbientTemperature, + testGridAmbientTemperature, + ThermalGrid.startingState(thermalGrid), + ) - gridDemand.required should approximate(houseDemand.required) - gridDemand.possible should approximate(houseDemand.possible) + houseDemand.required should approximate(expectedHouseDemand.required) + houseDemand.possible should approximate(expectedHouseDemand.possible) + storageDemand.required should approximate(KilowattHours(0d)) + storageDemand.possible should approximate(KilowattHours(0d)) + updatedThermalGridState.houseState shouldBe Some( + ThermalHouseState(10800, Kelvin(292.0799935185185), Kilowatts(0d)) + ) + updatedThermalGridState.storageState shouldBe None } } @@ -127,7 +135,7 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { } "not withdraw energy from the house, if actual consumption is given" in { - val tick = 0L // after three house + val tick = 0L // after three hours val gridState = ThermalGrid.startingState(thermalGrid) val (updatedGridState, reachedThreshold) = 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 bbb804c35f..93a45e3180 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithStorageOnlySpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithStorageOnlySpec.scala @@ -80,31 +80,46 @@ class ThermalGridWithStorageOnlySpec "deliver the capabilities of the storage" in { val tick = 10800 // after three hours - val gridDemand = thermalGrid.energyDemand( - tick, - testGridAmbientTemperature, - ThermalGrid.startingState(thermalGrid), - ) - - gridDemand.required should approximate(KilowattHours(0d)) - gridDemand.possible should approximate(KilowattHours(1150d)) + val (houseDemand, storageDemand, updatedThermalGridState) = + thermalGrid.energyDemandAndUpdatedState( + tick, + testGridAmbientTemperature, + testGridAmbientTemperature, + ThermalGrid.startingState(thermalGrid), + ) + houseDemand.required should approximate(KilowattHours(0d)) + houseDemand.possible should approximate(KilowattHours(0d)) + storageDemand.required should approximate(KilowattHours(1150d)) + storageDemand.possible should approximate(KilowattHours(1150d)) + updatedThermalGridState.houseState shouldBe None + updatedThermalGridState.storageState shouldBe Some( + ThermalStorageState(10800, KilowattHours(0d), Kilowatts(0d)) + ) } "deliver the capabilities of a half full storage" in { val tick = 10800 // after three hours - val gridDemand = thermalGrid.energyDemand( - tick, - testGridAmbientTemperature, - ThermalGridState( - None, - Some(ThermalStorageState(0L, KilowattHours(575d), Kilowatts(0d))), - ), - ) + val (houseDemand, storageDemand, updatedThermalGridState) = + thermalGrid.energyDemandAndUpdatedState( + tick, + testGridAmbientTemperature, + testGridAmbientTemperature, + ThermalGridState( + None, + Some(ThermalStorageState(0L, KilowattHours(575d), Kilowatts(0d))), + ), + ) - gridDemand.required should approximate(KilowattHours(0d)) - gridDemand.possible should approximate(KilowattHours(575d)) + houseDemand.required should approximate(KilowattHours(0d)) + houseDemand.possible should approximate(KilowattHours(0d)) + storageDemand.required should approximate(KilowattHours(0d)) + storageDemand.possible should approximate(KilowattHours(575d)) + updatedThermalGridState.houseState shouldBe None + updatedThermalGridState.storageState shouldBe Some( + ThermalStorageState(10800L, KilowattHours(575d), Kilowatts(0d)) + ) } } From 67e2a4e433b0c7d5ef8931ae95299de116f15066 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Sat, 24 Aug 2024 10:00:39 +0200 Subject: [PATCH 02/46] fmt --- .../scala/edu/ie3/simona/model/participant/HpModel.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ad512a75e0..569bd48c10 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -11,7 +11,10 @@ import edu.ie3.simona.agent.participant.data.Data.PrimaryData.ApparentPowerAndHe import edu.ie3.simona.model.SystemComponent import edu.ie3.simona.model.participant.HpModel.{HpRelevantData, HpState} import edu.ie3.simona.model.participant.control.QControl -import edu.ie3.simona.model.thermal.ThermalGrid.{ThermalEnergyDemand, ThermalGridState} +import edu.ie3.simona.model.thermal.ThermalGrid.{ + ThermalEnergyDemand, + ThermalGridState, +} import edu.ie3.simona.model.thermal.{ThermalGrid, ThermalThreshold} import edu.ie3.simona.ontology.messages.flex.FlexibilityMessage.ProvideFlexOptions import edu.ie3.simona.ontology.messages.flex.MinMaxFlexibilityMessage.ProvideMinMaxFlexOptions From 1ec348cc749eccd6a27a21d044ee5efca8cde191 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Sat, 24 Aug 2024 11:10:56 +0200 Subject: [PATCH 03/46] Add unapply method for ThermalHouseResults --- CHANGELOG.md | 1 + .../edu/ie3/simona/agent/ValueStore.scala | 2 +- .../ParticipantAgentFundamentals.scala | 5 +- .../edu/ie3/simona/event/ResultEvent.scala | 59 ++++++++++++++++++- 4 files changed, 63 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b43cb834c8..2b39983e5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update RTD references and bibliography [#868](https://github.com/ie3-institute/simona/issues/868) - Add gradle application plugin for command line execution with gradle run [#890](https://github.com/ie3-institute/simona/issues/890) - Additional tests to check flexibility options of thermal house and storage [#729](https://github.com/ie3-institute/simona/issues/729) +- Add unapply method for ThermalHouseResults [#934](https://github.com/ie3-institute/simona/issues/934) ### Changed - Adapted to changed data source in PSDM [#435](https://github.com/ie3-institute/simona/issues/435) diff --git a/src/main/scala/edu/ie3/simona/agent/ValueStore.scala b/src/main/scala/edu/ie3/simona/agent/ValueStore.scala index a21f7d0f58..fbae2ff77c 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], + store: SortedMap[Long, D] = SortedMap.empty[Long, D], ) { /** Determine the lastly known data tick, if available. Includes the given 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 e9fef1ad20..fe78e9136f 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentals.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentals.scala @@ -1907,8 +1907,9 @@ protected trait ParticipantAgentFundamentals[ def buildResultEvent[R <: ResultEntity]( result: R ): Option[ResultEvent] = result match { - case thermalResult: ThermalUnitResult => - Some(ThermalResultEvent(thermalResult)) + case thermalUnitResult: ThermalUnitResult => + Some(ThermalResultEvent(thermalUnitResult)) + case unsupported => log.debug( s"Results of class '${unsupported.getClass.getSimpleName}' are currently not supported." diff --git a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala index d81242c608..a1a765d977 100644 --- a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala +++ b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala @@ -16,9 +16,18 @@ import edu.ie3.datamodel.models.result.system.{ FlexOptionsResult, SystemParticipantResult, } -import edu.ie3.datamodel.models.result.thermal.ThermalUnitResult +import edu.ie3.datamodel.models.result.thermal.{ + CylindricalStorageResult, + ThermalHouseResult, + ThermalUnitResult, +} import edu.ie3.simona.agent.grid.GridResultsSupport.PartialTransformer3wResult import edu.ie3.simona.event.listener.ResultEventListener +import tech.units.indriya.ComparableQuantity + +import java.time.ZonedDateTime +import java.util.UUID +import javax.measure.quantity.{Energy, Power, Temperature} sealed trait ResultEvent extends Event with ResultEventListener.Request @@ -44,6 +53,54 @@ object ResultEvent { thermalResult: ThermalUnitResult ) extends ResultEvent + object ThermalHouseResult { + def unapply(result: ThermalHouseResult): Option[ + ( + ZonedDateTime, + UUID, + ComparableQuantity[Power], + ComparableQuantity[Temperature], + ) + ] = { + if (result != null) { + Some( + ( + result.getTime, + result.getInputModel, + result.getqDot, + result.getIndoorTemperature, + ) + ) + } else { + None + } + } + } + + object CylindricalThermalStorageResult { + def unapply(result: CylindricalStorageResult): Option[ + ( + ZonedDateTime, + UUID, + ComparableQuantity[Power], + ComparableQuantity[Energy], + ) + ] = { + if (result != null) { + Some( + ( + result.getTime, + result.getInputModel, + result.getqDot, + result.getEnergy, + ) + ) + } else { + None + } + } + } + /** Event that holds all grid calculation results of a power flow calculation. * The usage of a type is necessary here, to avoid passing in other instances * of [[edu.ie3.datamodel.models.result.ResultEntity]] except of the wanted From 32dea34a90aac575aeaf263eb2be80fb8e369d1f Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Sat, 26 Oct 2024 18:06:06 +0200 Subject: [PATCH 04/46] remove unused parameter --- .../simona/model/participant/HpModel.scala | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) 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 569bd48c10..3c02b58f09 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -133,7 +133,7 @@ final case class HpModel( val (turnOn, canOperate, canBeOutOfOperation, houseDemand, storageDemand) = operatesInNextState(lastState, relevantData) val updatedState = - calcState(lastState, relevantData, turnOn, houseDemand, storageDemand) + calcState(lastState, relevantData, turnOn) (canOperate, canBeOutOfOperation, updatedState) } @@ -224,8 +224,6 @@ final case class HpModel( state: HpState, relevantData: HpRelevantData, isRunning: Boolean, - houseDemand: Boolean, - storageDemand: Boolean, ): HpState = { val lastStateStorageqDot = state.thermalGridState.storageState .map(_.qDot) @@ -311,36 +309,11 @@ final case class HpModel( /* 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) - val ( - thermalEnergyDemandHouse, - thermalEnergyDemandStorage, - updatedThermalGridState, - ) = - thermalGrid.energyDemandAndUpdatedState( - data.currentTick, - lastState.ambientTemperature.getOrElse(data.ambientTemperature), - data.ambientTemperature, - lastState.thermalGridState, - ) - - val ( - houseDemand, - heatStorageDemand, - noThermalStorageOrThermalStorageIsEmpty, - ) = determineDemandBooleans( - lastState, - updatedThermalGridState, - thermalEnergyDemandHouse, - thermalEnergyDemandStorage, - ) - val updatedHpState: HpState = calcState( lastState, data, turnOn, - houseDemand, - heatStorageDemand, ) ( From e886345b083572f60a6d97665d4613cb42385c09 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Mon, 28 Oct 2024 09:25:43 +0100 Subject: [PATCH 05/46] remove unused parameter --- .../scala/edu/ie3/simona/model/participant/HpModel.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 3c02b58f09..e136de4d54 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -130,7 +130,7 @@ final case class HpModel( lastState: HpState, relevantData: HpRelevantData, ): (Boolean, Boolean, HpState) = { - val (turnOn, canOperate, canBeOutOfOperation, houseDemand, storageDemand) = + val (turnOn, canOperate, canBeOutOfOperation) = operatesInNextState(lastState, relevantData) val updatedState = calcState(lastState, relevantData, turnOn) @@ -149,12 +149,12 @@ final case class HpModel( * Relevant (external) data * @return * boolean defining if heat pump runs in next time step, if it can be in - * operation and out of operation plus the demand of house and storage + * operation and can be out of operation */ private def operatesInNextState( state: HpState, relevantData: HpRelevantData, - ): (Boolean, Boolean, Boolean, Boolean, Boolean) = { + ): (Boolean, Boolean, Boolean) = { val (demandHouse, demandThermalStorage, updatedState) = thermalGrid.energyDemandAndUpdatedState( relevantData.currentTick, @@ -183,7 +183,7 @@ final case class HpModel( val canBeOutOfOperation = !(demandHouse.hasRequiredDemand && noThermalStorageOrThermalStorageIsEmpty) - (turnHpOn, canOperate, canBeOutOfOperation, houseDemand, heatStorageDemand) + (turnHpOn, canOperate, canBeOutOfOperation) } def determineDemandBooleans( From b893c0897a3a23b2725c8af9362bd7458dbb0bd2 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Mon, 28 Oct 2024 09:49:22 +0100 Subject: [PATCH 06/46] fix scapegoat code smell because of unnecessary store before return --- .../ie3/simona/agent/participant/hp/HpAgentFundamentals.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 a390f290b6..9eb908d1ac 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 @@ -314,9 +314,7 @@ trait HpAgentFundamentals nodalVoltage: squants.Dimensionless, model: HpModel, ): HpState = { - val (_, _, state) = - model.determineState(modelState, calcRelevantData) - state + model.determineState(modelState, calcRelevantData)._3 } /** Abstract definition, individual implementations found in individual agent From 23b2582f027a3869d7b09e623f550d1bbccfe686 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Mon, 28 Oct 2024 12:06:54 +0100 Subject: [PATCH 07/46] Proposal for separating state and operation point calculation --- .../simona/model/participant/HpModel.scala | 61 +++++++++++++------ 1 file changed, 42 insertions(+), 19 deletions(-) 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 e136de4d54..1eb45443ec 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -118,7 +118,7 @@ final case class HpModel( * function calculates the heat pump's next state to get the actual active * power of this state use [[calculateActivePower]] with the generated state * - * @param lastState + * @param lastHpState * Last state of the heat pump * @param relevantData * data of heat pump including @@ -127,13 +127,34 @@ final case class HpModel( * [[HpState]] */ def determineState( - lastState: HpState, + lastHpState: HpState, relevantData: HpRelevantData, ): (Boolean, Boolean, HpState) = { + + // Use lastHpState and relevantData to update state of thermalGrid to the current tick + val (demandHouse, demandThermalStorage, currentThermalGridState) = + thermalGrid.energyDemandAndUpdatedState( + relevantData.currentTick, + lastHpState.ambientTemperature.getOrElse( + relevantData.ambientTemperature + ), + relevantData.ambientTemperature, + lastHpState.thermalGridState, + ) + + // Determining the operation point and limitations at this tick val (turnOn, canOperate, canBeOutOfOperation) = - operatesInNextState(lastState, relevantData) + operatesInNextState( + lastHpState, + currentThermalGridState, + relevantData, + demandHouse, + demandThermalStorage, + ) + + // Updating the HpState val updatedState = - calcState(lastState, relevantData, turnOn) + calcState(lastHpState, relevantData, turnOn) (canOperate, canBeOutOfOperation, updatedState) } @@ -143,39 +164,41 @@ final case class HpModel( * met or the heat pump currently is in operation and the grid is able to * handle additional energy * - * @param state - * Current state of the heat pump + * @param lastState + * last state of the heat pump + * @param currentThermalGridState + * to current tick updated state of the thermalGrid * @param relevantData * Relevant (external) data + * @param demandHouse + * ThermalEnergyDemand of the house + * @param demandThermalStorage + * ThermalEnergyDemand of the thermal storage * @return * boolean defining if heat pump runs in next time step, if it can be in * operation and can be out of operation */ private def operatesInNextState( - state: HpState, + lastState: HpState, + currentThermalGridState: ThermalGridState, relevantData: HpRelevantData, + demandHouse: ThermalEnergyDemand, + demandThermalStorage: ThermalEnergyDemand, ): (Boolean, Boolean, Boolean) = { - val (demandHouse, demandThermalStorage, updatedState) = - thermalGrid.energyDemandAndUpdatedState( - relevantData.currentTick, - state.ambientTemperature.getOrElse(relevantData.ambientTemperature), - relevantData.ambientTemperature, - state.thermalGridState, - ) val ( - houseDemand, - heatStorageDemand, + houseHasDemand, + heatStorageHasDemand, noThermalStorageOrThermalStorageIsEmpty, ) = determineDemandBooleans( - state, - updatedState, + lastState, + currentThermalGridState, demandHouse, demandThermalStorage, ) val turnHpOn: Boolean = - houseDemand || heatStorageDemand + houseHasDemand || heatStorageHasDemand val canOperate = demandHouse.hasRequiredDemand || demandHouse.hasAdditionalDemand || From 6be8e36fe31833c3e6b727be6572b2b3b9e69ff4 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Tue, 29 Oct 2024 11:30:30 +0100 Subject: [PATCH 08/46] aligning states of HpModel --- .../participant/hp/HpAgentFundamentals.scala | 4 +- .../simona/model/participant/HpModel.scala | 48 +++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) 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 9eb908d1ac..dc9465e67b 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 @@ -189,7 +189,7 @@ trait HpAgentFundamentals val accompanyingResults = baseStateData.model.thermalGrid.results( tick, - updatedState.thermalGridState, + updatedState.currentThermalGridState, )(baseStateData.startDate) val result = AccompaniedSimulationResult(power, accompanyingResults) @@ -254,7 +254,7 @@ trait HpAgentFundamentals ) val accompanyingResults = baseStateData.model.thermalGrid.results( currentTick, - lastModelState.thermalGridState, + lastModelState.currentThermalGridState, )(baseStateData.startDate) val result = AccompaniedSimulationResult(power, accompanyingResults) 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 1eb45443ec..a3f04c0209 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -82,7 +82,7 @@ final case class HpModel( * [[HpModel.determineState]]. This state then is fed into the power * calculation logic by [[HpState]]. * - * @param modelState + * @param currentState * Current state of the heat pump * @param relevantData * data of heat pump including state of the heat pump @@ -90,9 +90,9 @@ final case class HpModel( * active power */ override protected def calculateActivePower( - modelState: HpState, + currentState: HpState, relevantData: HpRelevantData, - ): Power = modelState.activePower + ): Power = currentState.activePower /** "Calculate" the heat output of the heat pump. The hp's state is already * updated, because the calculation of apparent power in @@ -101,7 +101,7 @@ final case class HpModel( * * @param tick * Current simulation time for the calculation - * @param modelState + * @param currentState * Current state of the heat pump * @param data * Relevant (external) data for calculation @@ -110,20 +110,20 @@ final case class HpModel( */ override def calculateHeat( tick: Long, - modelState: HpState, + currentState: HpState, data: HpRelevantData, - ): Power = modelState.qDot + ): Power = currentState.qDot - /** Given a [[HpRelevantData]] object and the current [[HpState]], this - * function calculates the heat pump's next state to get the actual active - * power of this state use [[calculateActivePower]] with the generated state + /** Given a [[HpRelevantData]] object and the last [[HpState]], this function + * calculates the heat pump's next state to get the actual active power of + * this state use [[calculateActivePower]] with the generated state * * @param lastHpState * Last state of the heat pump * @param relevantData * data of heat pump including * @return - * Booleans if Hp can operate and can be out of operation plus next + * Booleans if Hp can operate and can be out of operation plus the updated * [[HpState]] */ def determineState( @@ -139,7 +139,7 @@ final case class HpModel( relevantData.ambientTemperature ), relevantData.ambientTemperature, - lastHpState.thermalGridState, + lastHpState.currentThermalGridState, ) // Determining the operation point and limitations at this tick @@ -210,7 +210,7 @@ final case class HpModel( } def determineDemandBooleans( - hpState: HpState, + lastHpState: HpState, updatedGridState: ThermalGridState, demandHouse: ThermalEnergyDemand, demandThermalStorage: ThermalEnergyDemand, @@ -223,9 +223,9 @@ final case class HpModel( ) val houseDemand = - (demandHouse.hasRequiredDemand && noThermalStorageOrThermalStorageIsEmpty) || (hpState.isRunning && demandHouse.hasAdditionalDemand) + (demandHouse.hasRequiredDemand && noThermalStorageOrThermalStorageIsEmpty) || (lastHpState.isRunning && demandHouse.hasAdditionalDemand) val heatStorageDemand = { - (demandThermalStorage.hasRequiredDemand) || (hpState.isRunning && demandThermalStorage.hasAdditionalDemand) + (demandThermalStorage.hasRequiredDemand) || (lastHpState.isRunning && demandThermalStorage.hasAdditionalDemand) } (houseDemand, heatStorageDemand, noThermalStorageOrThermalStorageIsEmpty) } @@ -234,8 +234,8 @@ final case class HpModel( * calculate inner temperature change of thermal house and update its inner * temperature. * - * @param state - * Current state of the heat pump + * @param lastState + * state of the heat pump until this tick * @param relevantData * data of heat pump including state of the heat pump * @param isRunning @@ -244,27 +244,27 @@ final case class HpModel( * next [[HpState]] */ private def calcState( - state: HpState, + lastState: HpState, relevantData: HpRelevantData, isRunning: Boolean, ): HpState = { - val lastStateStorageqDot = state.thermalGridState.storageState + val lastStateStorageQDot = lastState.currentThermalGridState.storageState .map(_.qDot) .getOrElse(zeroKW) val (newActivePower, newThermalPower) = if (isRunning) (pRated, pThermal) - else if (lastStateStorageqDot < zeroKW) - (zeroKW, lastStateStorageqDot * (-1)) + else if (lastStateStorageQDot < zeroKW) + (zeroKW, lastStateStorageQDot * (-1)) else (zeroKW, zeroKW) /* Push thermal energy to the thermal grid and get its updated state in return */ val (thermalGridState, maybeThreshold) = thermalGrid.updateState( relevantData.currentTick, - state.thermalGridState, - state.ambientTemperature.getOrElse(relevantData.ambientTemperature), + lastState.currentThermalGridState, + lastState.ambientTemperature.getOrElse(relevantData.ambientTemperature), relevantData.ambientTemperature, newThermalPower, ) @@ -411,7 +411,7 @@ object HpModel { * result active power * @param qDot * result heat power - * @param thermalGridState + * @param currentThermalGridState * Currently applicable state of the thermal grid * @param maybeThermalThreshold * An optional threshold of the thermal grid, indicating the next state @@ -423,7 +423,7 @@ object HpModel { ambientTemperature: Option[Temperature], activePower: Power, qDot: Power, - thermalGridState: ThermalGridState, + currentThermalGridState: ThermalGridState, maybeThermalThreshold: Option[ThermalThreshold], ) extends ModelState From 286f0ebad8d7f9b94dccf7a2bad139db0721ee61 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Tue, 29 Oct 2024 11:30:41 +0100 Subject: [PATCH 09/46] add scala doc --- .../edu/ie3/simona/model/participant/HpModel.scala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 a3f04c0209..c104571b9b 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -209,6 +209,20 @@ final case class HpModel( (turnHpOn, canOperate, canBeOutOfOperation) } + /** This method will return booleans whether there is a heat demand of house + * or thermal storage as well as a boolean indicating if there is no thermal + * storage or it is empty. + * + * @param lastHpState + * @param updatedGridState + * @param demandHouse + * @param demandThermalStorage + * @return + * First boolean: true, if house has heat demand Second boolean: true, if + * thermalStorage has heat demand Third boolean: true, if there is no + * thermalStorage or it's empty + */ + def determineDemandBooleans( lastHpState: HpState, updatedGridState: ThermalGridState, From f44dddff0798a43571e0440edeb78ef265b46284 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 1 Nov 2024 18:15:07 +0100 Subject: [PATCH 10/46] merging dev --- .../ie3/simona/agent/participant/hp/HpAgentFundamentals.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 58b9c402b1..128e1e7395 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 @@ -189,7 +189,7 @@ trait HpAgentFundamentals val accompanyingResults = baseStateData.model.thermalGrid.results( updatedState.tick, - updatedState.thermalGridState, + updatedState.currentThermalGridState, )(baseStateData.startDate) val result = AccompaniedSimulationResult(power, accompanyingResults) @@ -254,7 +254,7 @@ trait HpAgentFundamentals ) val accompanyingResults = baseStateData.model.thermalGrid.results( updatedState.tick, - updatedState.thermalGridState, + updatedState.currentThermalGridState, )(baseStateData.startDate) val result = AccompaniedSimulationResult(power, accompanyingResults) From ae614e9e6735edb76d83650d578ad2bc1d90c69d Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Tue, 5 Nov 2024 16:09:27 +0100 Subject: [PATCH 11/46] ValueStore.store again private val --- src/main/scala/edu/ie3/simona/agent/ValueStore.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/edu/ie3/simona/agent/ValueStore.scala b/src/main/scala/edu/ie3/simona/agent/ValueStore.scala index fbae2ff77c..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, - 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 From 3243763269dfa98026bfc340f2c0c87356f31255 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Tue, 5 Nov 2024 16:09:47 +0100 Subject: [PATCH 12/46] SonarQube issue null parameter --- src/main/scala/edu/ie3/simona/event/ResultEvent.scala | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala index a1a765d977..da844a801f 100644 --- a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala +++ b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala @@ -62,7 +62,7 @@ object ResultEvent { ComparableQuantity[Temperature], ) ] = { - if (result != null) { + Option(result).flatMap { result => Some( ( result.getTime, @@ -71,8 +71,6 @@ object ResultEvent { result.getIndoorTemperature, ) ) - } else { - None } } } @@ -86,7 +84,7 @@ object ResultEvent { ComparableQuantity[Energy], ) ] = { - if (result != null) { + Option(result).flatMap { result => Some( ( result.getTime, @@ -95,8 +93,6 @@ object ResultEvent { result.getEnergy, ) ) - } else { - None } } } From 80fbc092122622856e269af10d4e7046a9d6c4f2 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Tue, 5 Nov 2024 16:36:39 +0100 Subject: [PATCH 13/46] remove not necessary headOption --- src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ee743d88ca..40de44725c 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala @@ -67,7 +67,7 @@ final case class ThermalGrid( /* First get the energy demand of the houses but only if inner temperature is below target temperature */ val (houseDemand, updatedHouseState) = - house.zip(state.houseState).headOption match { + house.zip(state.houseState) match { case Some((thermalHouse, lastHouseState)) => val (updatedHouseState, updatedStorageState) = thermalHouse.determineState( From 1beb478839d9ec62e979df7ffa753f994d053c3a Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Tue, 5 Nov 2024 16:36:47 +0100 Subject: [PATCH 14/46] break long line --- src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 40de44725c..074d80e0a4 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala @@ -78,7 +78,8 @@ final case class ThermalGrid( lastHouseState.qDot, ) if ( - updatedHouseState.innerTemperature < thermalHouse.targetTemperature | (lastHouseState.qDot > zeroKW && updatedHouseState.innerTemperature < thermalHouse.upperBoundaryTemperature) + updatedHouseState.innerTemperature < thermalHouse.targetTemperature | + (lastHouseState.qDot > zeroKW && updatedHouseState.innerTemperature < thermalHouse.upperBoundaryTemperature) ) { ( thermalHouse.energyDemand( From 07a65f11afef654dfdeae05de1208a95df2fa61f Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Tue, 5 Nov 2024 16:37:02 +0100 Subject: [PATCH 15/46] use wildcard for not used val --- src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 074d80e0a4..0d868e64df 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala @@ -69,7 +69,7 @@ final case class ThermalGrid( val (houseDemand, updatedHouseState) = house.zip(state.houseState) match { case Some((thermalHouse, lastHouseState)) => - val (updatedHouseState, updatedStorageState) = + val (updatedHouseState, _) = thermalHouse.determineState( tick, lastHouseState, From 79e91c21efa356bc4d68184335e5eac170481f40 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Tue, 5 Nov 2024 16:45:24 +0100 Subject: [PATCH 16/46] rollback currentThermalGridState to thermalGridState --- .../agent/participant/hp/HpAgentFundamentals.scala | 4 ++-- .../edu/ie3/simona/model/participant/HpModel.scala | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) 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 128e1e7395..58b9c402b1 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 @@ -189,7 +189,7 @@ trait HpAgentFundamentals val accompanyingResults = baseStateData.model.thermalGrid.results( updatedState.tick, - updatedState.currentThermalGridState, + updatedState.thermalGridState, )(baseStateData.startDate) val result = AccompaniedSimulationResult(power, accompanyingResults) @@ -254,7 +254,7 @@ trait HpAgentFundamentals ) val accompanyingResults = baseStateData.model.thermalGrid.results( updatedState.tick, - updatedState.currentThermalGridState, + updatedState.thermalGridState, )(baseStateData.startDate) val result = AccompaniedSimulationResult(power, accompanyingResults) 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 ccc295e240..4f3b1f92bc 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -139,7 +139,7 @@ final case class HpModel( relevantData.ambientTemperature ), relevantData.ambientTemperature, - lastHpState.currentThermalGridState, + lastHpState.thermalGridState, ) // Determining the operation point and limitations at this tick @@ -262,7 +262,7 @@ final case class HpModel( relevantData: HpRelevantData, isRunning: Boolean, ): HpState = { - val lastStateStorageQDot = lastState.currentThermalGridState.storageState + val lastStateStorageQDot = lastState.thermalGridState.storageState .map(_.qDot) .getOrElse(zeroKW) @@ -277,7 +277,7 @@ final case class HpModel( val (thermalGridState, maybeThreshold) = thermalGrid.updateState( relevantData.currentTick, - lastState.currentThermalGridState, + lastState.thermalGridState, lastState.ambientTemperature.getOrElse(relevantData.ambientTemperature), relevantData.ambientTemperature, newThermalPower, @@ -425,8 +425,8 @@ object HpModel { * result active power * @param qDot * result heat power - * @param currentThermalGridState - * Currently applicable state of the thermal grid + * @param thermalGridState + * applicable state of the thermal grid * @param maybeThermalThreshold * An optional threshold of the thermal grid, indicating the next state * change @@ -437,7 +437,7 @@ object HpModel { ambientTemperature: Option[Temperature], activePower: Power, qDot: Power, - currentThermalGridState: ThermalGridState, + thermalGridState: ThermalGridState, maybeThermalThreshold: Option[ThermalThreshold], ) extends ModelState From 71c9852a0c38526266f5afeaadb1b6e6a61cc756 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Tue, 5 Nov 2024 16:45:36 +0100 Subject: [PATCH 17/46] scala doc format --- .../scala/edu/ie3/simona/model/participant/HpModel.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 4f3b1f92bc..41927fd2b0 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -218,9 +218,9 @@ final case class HpModel( * @param demandHouse * @param demandThermalStorage * @return - * First boolean: true, if house has heat demand Second boolean: true, if - * thermalStorage has heat demand Third boolean: true, if there is no - * thermalStorage or it's empty + * First boolean is true, if house has heat demand. Second boolean is true, + * if thermalStorage has heat demand. Third boolean is true, if there is no + * thermalStorage or it's empty. */ def determineDemandBooleans( From 1521db7aea8a77afd669e490a480cd354ce53727 Mon Sep 17 00:00:00 2001 From: staudtMarius Date: Tue, 12 Nov 2024 08:01:19 +0100 Subject: [PATCH 18/46] Fixing `CHANGELOG` entry for issue 103. --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac4517ba8c..7b2359990d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,7 +94,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Replace mutable var in ChpModelSpec [#1002](https://github.com/ie3-institute/simona/issues/1002) - Move compression of output files into `ResultEventListener`[#965](https://github.com/ie3-institute/simona/issues/965) - Rewrote StorageModelTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646) - +- Changed implementation of actor naming for unique name generation [#103](https://github.com/ie3-institute/simona/issues/103) + ### Fixed - Removed a repeated line in the documentation of vn_simona config [#658](https://github.com/ie3-institute/simona/issues/658) - Removed version number "2.0" from the logo printed to console [#642](https://github.com/ie3-institute/simona/issues/642) @@ -127,6 +128,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix CheckWindow duration [#921](https://github.com/ie3-institute/simona/issues/921) - Fixed ThermalStorageResults having multiple entries [#924](https://github.com/ie3-institute/simona/issues/924) - Fix filter for thermal result checking for lastTick not for currentTick [#1008](https://github.com/ie3-institute/simona/issues/1008) +- Fixed `CHANGELOG` entry for issue ([#103](https://github.com/ie3-institute/simona/issues/103)) [#941](https://github.com/ie3-institute/simona/issues/941) ## [3.0.0] - 2023-08-07 @@ -189,7 +191,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Changed format of example grid `vn_simona` [#216](https://github.com/ie3-institute/simona/issues/216) - Renamed ChpData to ChpRelevantData [#494](https://github.com/ie3-institute/simona/issues/494) - Updated gradle to 8.2.1, cleaned up `build.gradle` and `Jenkinsfile` [#572](https://github.com/ie3-institute/simona/issues/572) -- Changed implementation of actor naming for unique name generation [#103](https://github.com/ie3-institute/simona/issues/103) ### Fixed - Location of `vn_simona` test grid (was partially in Berlin and Dortmund) [#72](https://github.com/ie3-institute/simona/issues/72) From f819146eac5a7099b6381c239c5ba7943af3d01c Mon Sep 17 00:00:00 2001 From: Sebastian Peter Date: Wed, 13 Nov 2024 17:56:28 +0100 Subject: [PATCH 19/46] Tiny bit of code cleanup --- .../simona/model/participant/HpModel.scala | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) 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 41927fd2b0..9f0e94a9cf 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -223,7 +223,7 @@ final case class HpModel( * thermalStorage or it's empty. */ - def determineDemandBooleans( + private def determineDemandBooleans( lastHpState: HpState, updatedGridState: ThermalGridState, demandHouse: ThermalEnergyDemand, @@ -238,9 +238,8 @@ final case class HpModel( val houseDemand = (demandHouse.hasRequiredDemand && noThermalStorageOrThermalStorageIsEmpty) || (lastHpState.isRunning && demandHouse.hasAdditionalDemand) - val heatStorageDemand = { - (demandThermalStorage.hasRequiredDemand) || (lastHpState.isRunning && demandThermalStorage.hasAdditionalDemand) - } + val heatStorageDemand = + demandThermalStorage.hasRequiredDemand || (lastHpState.isRunning && demandThermalStorage.hasAdditionalDemand) (houseDemand, heatStorageDemand, noThermalStorageOrThermalStorageIsEmpty) } @@ -270,7 +269,7 @@ final case class HpModel( if (isRunning) (pRated, pThermal) else if (lastStateStorageQDot < zeroKW) - (zeroKW, lastStateStorageQDot * (-1)) + (zeroKW, lastStateStorageQDot * -1) else (zeroKW, zeroKW) /* Push thermal energy to the thermal grid and get its updated state in return */ @@ -346,12 +345,11 @@ final case class HpModel( /* 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) - val updatedHpState: HpState = - calcState( - lastState, - data, - turnOn, - ) + val updatedHpState = calcState( + lastState, + data, + turnOn, + ) ( updatedHpState, From 01059692787766be4c1eb2ebc2473bff2bf44b04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 08:26:54 +0000 Subject: [PATCH 20/46] Bump sphinx-rtd-theme from 3.0.1 to 3.0.2 in /docs/readthedocs (#1018) --- docs/readthedocs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/readthedocs/requirements.txt b/docs/readthedocs/requirements.txt index 5ed7a8bf17..fcef71943b 100644 --- a/docs/readthedocs/requirements.txt +++ b/docs/readthedocs/requirements.txt @@ -1,5 +1,5 @@ Sphinx==8.1.3 -sphinx-rtd-theme==3.0.1 +sphinx-rtd-theme==3.0.2 sphinxcontrib-plantuml==0.30 myst-parser==4.0.0 markdown-it-py==3.0.0 From 61acfb680ea1ac13088d6b0c89b9d54e142d743a Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 14 Nov 2024 09:45:37 +0100 Subject: [PATCH 21/46] grammar --- src/main/scala/edu/ie3/simona/model/participant/HpModel.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 9f0e94a9cf..f555827013 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -211,7 +211,7 @@ final case class HpModel( /** This method will return booleans whether there is a heat demand of house * or thermal storage as well as a boolean indicating if there is no thermal - * storage or it is empty. + * storage, or it is empty. * * @param lastHpState * @param updatedGridState @@ -220,7 +220,7 @@ final case class HpModel( * @return * First boolean is true, if house has heat demand. Second boolean is true, * if thermalStorage has heat demand. Third boolean is true, if there is no - * thermalStorage or it's empty. + * thermalStorage, or it's empty. */ private def determineDemandBooleans( From 1ca9b3a0c913876d09bff2c77b69ff84a3decc0a Mon Sep 17 00:00:00 2001 From: Sebastian Peter Date: Thu, 14 Nov 2024 11:36:08 +0100 Subject: [PATCH 22/46] Also moving issue #505 to its right place Signed-off-by: Sebastian Peter --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ba1d272ba..ba1648c26b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -98,6 +98,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated `ExtEvSimulationClasses` [#898](https://github.com/ie3-institute/simona/issues/898) ### Fixed +- Fix rendering of references in documentation [#505](https://github.com/ie3-institute/simona/issues/505) - Removed a repeated line in the documentation of vn_simona config [#658](https://github.com/ie3-institute/simona/issues/658) - Removed version number "2.0" from the logo printed to console [#642](https://github.com/ie3-institute/simona/issues/642) - Fixed PV Model documentation [#684](https://github.com/ie3-institute/simona/issues/684), [#686](https://github.com/ie3-institute/simona/issues/686) @@ -227,7 +228,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed broken layout in RTD documentation [#500](https://github.com/ie3-institute/simona/issues/500) - Corrected tests in RefSystemTest [#560](https://github.com/ie3-institute/simona/issues/560) - Take log file event filters from `logback.xml` when defining the run log appender [#108](https://github.com/ie3-institute/simona/issues/108) -- Fix rendering of references in documentation [#505](https://github.com/ie3-institute/simona/issues/505) ### Removed - Remove workaround for tscfg tmp directory [#178](https://github.com/ie3-institute/simona/issues/178) From 671325ea387a1f5663794d39a07c493ab5b890ca Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 14 Nov 2024 12:56:30 +0100 Subject: [PATCH 23/46] fmt from review --- .../edu/ie3/simona/event/ResultEvent.scala | 71 +++++++++---------- 1 file changed, 34 insertions(+), 37 deletions(-) diff --git a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala index da844a801f..5e86582ffb 100644 --- a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala +++ b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala @@ -53,47 +53,44 @@ object ResultEvent { thermalResult: ThermalUnitResult ) extends ResultEvent - object ThermalHouseResult { - def unapply(result: ThermalHouseResult): Option[ - ( - ZonedDateTime, - UUID, - ComparableQuantity[Power], - ComparableQuantity[Temperature], - ) - ] = { - Option(result).flatMap { result => - Some( - ( - result.getTime, - result.getInputModel, - result.getqDot, - result.getIndoorTemperature, - ) + object ThermalHouseResult + def unapply(result: ThermalHouseResult): Option[ + ( + ZonedDateTime, + UUID, + ComparableQuantity[Power], + ComparableQuantity[Temperature], + ) + ] = + Option(result).flatMap { result => + Some( + ( + result.getTime, + result.getInputModel, + result.getqDot, + result.getIndoorTemperature, ) - } + ) } - } - object CylindricalThermalStorageResult { - def unapply(result: CylindricalStorageResult): Option[ - ( - ZonedDateTime, - UUID, - ComparableQuantity[Power], - ComparableQuantity[Energy], - ) - ] = { - Option(result).flatMap { result => - Some( - ( - result.getTime, - result.getInputModel, - result.getqDot, - result.getEnergy, - ) + object CylindricalThermalStorageResult + def unapply(result: CylindricalStorageResult): Option[ + ( + ZonedDateTime, + UUID, + ComparableQuantity[Power], + ComparableQuantity[Energy], + ) + ] = { + Option(result).flatMap { result => + Some( + ( + result.getTime, + result.getInputModel, + result.getqDot, + result.getEnergy, ) - } + ) } } From 5790cff86f58e6d13c92d05aacc5cd0fc4731a6d Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Thu, 14 Nov 2024 12:59:45 +0100 Subject: [PATCH 24/46] update scalaDoc --- src/main/scala/edu/ie3/simona/model/participant/HpModel.scala | 4 ++++ 1 file changed, 4 insertions(+) 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 f555827013..bf26b80fd8 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -214,9 +214,13 @@ final case class HpModel( * storage, or it is empty. * * @param lastHpState + * Current state of the heat pump * @param updatedGridState + * The updated state of the [[ThermalGrid]] * @param demandHouse + * heat demand of the thermal house * @param demandThermalStorage + * heat demand of the thermal storage * @return * First boolean is true, if house has heat demand. Second boolean is true, * if thermalStorage has heat demand. Third boolean is true, if there is no From 1e99533088964742ca9166b3cba4a65781125be3 Mon Sep 17 00:00:00 2001 From: Daniel Feismann <98817556+danielfeismann@users.noreply.github.com> Date: Fri, 15 Nov 2024 08:09:27 +0100 Subject: [PATCH 25/46] Update src/main/scala/edu/ie3/simona/event/ResultEvent.scala include reviewers suggestion Co-authored-by: Sebastian Peter --- src/main/scala/edu/ie3/simona/event/ResultEvent.scala | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala index 5e86582ffb..2ec9ab5882 100644 --- a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala +++ b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala @@ -62,16 +62,14 @@ object ResultEvent { ComparableQuantity[Temperature], ) ] = - Option(result).flatMap { result => - Some( + Option(result).map { result => ( result.getTime, result.getInputModel, result.getqDot, result.getIndoorTemperature, ) - ) - } + } object CylindricalThermalStorageResult def unapply(result: CylindricalStorageResult): Option[ From 005b9b7261ee5fd2f2fa007d219e9dbfd1a3fb4b Mon Sep 17 00:00:00 2001 From: Daniel Feismann <98817556+danielfeismann@users.noreply.github.com> Date: Fri, 15 Nov 2024 08:09:57 +0100 Subject: [PATCH 26/46] Update src/main/scala/edu/ie3/simona/event/ResultEvent.scala include more suggestion from reviewer Co-authored-by: Sebastian Peter --- src/main/scala/edu/ie3/simona/event/ResultEvent.scala | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala index 2ec9ab5882..0ccaa7f909 100644 --- a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala +++ b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala @@ -80,16 +80,14 @@ object ResultEvent { ComparableQuantity[Energy], ) ] = { - Option(result).flatMap { result => - Some( + Option(result).map { result => ( result.getTime, result.getInputModel, result.getqDot, result.getEnergy, ) - ) - } + } } /** Event that holds all grid calculation results of a power flow calculation. From 61e71a1cdc5b910b6662f98b3adbacb306a45486 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 08:14:59 +0100 Subject: [PATCH 27/46] add brackets for objects --- .../edu/ie3/simona/event/ResultEvent.scala | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala index 0ccaa7f909..6e91283b65 100644 --- a/src/main/scala/edu/ie3/simona/event/ResultEvent.scala +++ b/src/main/scala/edu/ie3/simona/event/ResultEvent.scala @@ -53,15 +53,15 @@ object ResultEvent { thermalResult: ThermalUnitResult ) extends ResultEvent - object ThermalHouseResult - def unapply(result: ThermalHouseResult): Option[ - ( - ZonedDateTime, - UUID, - ComparableQuantity[Power], - ComparableQuantity[Temperature], - ) - ] = + object ThermalHouseResult { + def unapply(result: ThermalHouseResult): Option[ + ( + ZonedDateTime, + UUID, + ComparableQuantity[Power], + ComparableQuantity[Temperature], + ) + ] = Option(result).map { result => ( result.getTime, @@ -70,16 +70,17 @@ object ResultEvent { result.getIndoorTemperature, ) } + } - object CylindricalThermalStorageResult - def unapply(result: CylindricalStorageResult): Option[ - ( - ZonedDateTime, - UUID, - ComparableQuantity[Power], - ComparableQuantity[Energy], - ) - ] = { + object CylindricalThermalStorageResult { + def unapply(result: CylindricalStorageResult): Option[ + ( + ZonedDateTime, + UUID, + ComparableQuantity[Power], + ComparableQuantity[Energy], + ) + ] = { Option(result).map { result => ( result.getTime, @@ -88,6 +89,7 @@ object ResultEvent { result.getEnergy, ) } + } } /** Event that holds all grid calculation results of a power flow calculation. From c3a823a2bc8298038bf9634c876a57e4f3d2251d Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 10:30:47 +0100 Subject: [PATCH 28/46] spelling --- docs/readthedocs/models/thermal_house_model.md | 2 +- .../fixedfeedin/FixedFeedInAgentFundamentals.scala | 4 ++-- .../simona/agent/participant/pv/PvAgentFundamentals.scala | 2 +- src/main/scala/edu/ie3/simona/main/RunSimona.scala | 2 +- .../participant/load/random/RandomLoadParamStore.scala | 6 +++--- src/main/scala/edu/ie3/simona/scheduler/Scheduler.scala | 2 +- src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala | 2 +- .../ie3/simona/event/listener/ResultEventListenerSpec.scala | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/readthedocs/models/thermal_house_model.md b/docs/readthedocs/models/thermal_house_model.md index 7914270c7f..84044085dc 100644 --- a/docs/readthedocs/models/thermal_house_model.md +++ b/docs/readthedocs/models/thermal_house_model.md @@ -6,7 +6,7 @@ This page documents the functionality of the thermal house available in SIMONA. ## Behaviour -This house model represents the thermal behaviour of a building. This reflects a simple shoe box with a thermal capacity and with transmission losses. +This house model represents the thermal behaviour of a building. This reflects a simple shoebox with a thermal capacity and with transmission losses. ## Attributes, Units and Remarks 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 5d3a2d6805..a1da136749 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 @@ -134,8 +134,8 @@ protected trait FixedFeedInAgentFundamentals /* As participant agents always return their last known operation point on request, it is sufficient * to let a fixed fixed in model determine it's operation point on: * 1) The first tick of the simulation - * 2) The tick, it turns on (in time dependent operation) - * 3) The tick, it turns off (in time dependent operation) + * 2) The tick, it turns on (in time-dependent operation) + * 3) The tick, it turns off (in time-dependent operation) * Coinciding ticks are summarized and the last tick is removed, as the change in operation status * doesn't affect anything then */ SortedSet[Long]( 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 ce152a3d7e..d1e441e4b4 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 @@ -210,7 +210,7 @@ protected trait PvAgentFundamentals tick - dataTick case _ => /* At the first tick, we are not able to determine the tick interval from last tick - * (since there is none). Then we use a fall back pv stem distance. */ + * (since there is none). Then we use a fallback pv stem distance. */ FALLBACK_WEATHER_STEM_DISTANCE } diff --git a/src/main/scala/edu/ie3/simona/main/RunSimona.scala b/src/main/scala/edu/ie3/simona/main/RunSimona.scala index c255990a05..9d03f38665 100644 --- a/src/main/scala/edu/ie3/simona/main/RunSimona.scala +++ b/src/main/scala/edu/ie3/simona/main/RunSimona.scala @@ -86,7 +86,7 @@ trait RunSimona[T <: SimonaSetup] extends LazyLogging { } } - /** Method to be implemented to setup everything that is necessary for a + /** Method to be implemented to set up everything that is necessary for a * simulations. This is by creating an instance of [[SimonaSetup]] * implementation * 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 36635ae940..195b40a4a3 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 @@ -124,13 +124,13 @@ case object RandomLoadParamStore extends LazyLogging { } /** Builds a descriptor tree, which gives information what to find where in - * the file. Each head line element breaks down to encoded information about + * the file. Each headline element breaks down to encoded information about * the probability density function parameter and the addressed day type. All - * head line elements are treated this way and a mapping from day type to + * headline elements are treated this way and a mapping from day type to * column position of parameter is build. * * @param headerElements - * List of head line elements + * List of headline elements * @return * Mapping from day type to a mapping from parameter to column index */ diff --git a/src/main/scala/edu/ie3/simona/scheduler/Scheduler.scala b/src/main/scala/edu/ie3/simona/scheduler/Scheduler.scala index 7339fbbe61..7cc4174e10 100644 --- a/src/main/scala/edu/ie3/simona/scheduler/Scheduler.scala +++ b/src/main/scala/edu/ie3/simona/scheduler/Scheduler.scala @@ -160,7 +160,7 @@ object Scheduler { stopOnError(ctx, s"Received unexpected message $unexpected when active") } - /** Data that is constant over the life time of a scheduler. + /** Data that is constant over the lifetime of a scheduler. * @param parent * The parent of the scheduler * @param activationAdapter 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 9c6effa859..170c807e80 100644 --- a/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala +++ b/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala @@ -21,7 +21,7 @@ import org.apache.pekko.actor.typed.ActorRef import org.apache.pekko.actor.typed.scaladsl.ActorContext import org.apache.pekko.actor.{ActorRef => ClassicRef} -/** Trait that can be used to setup a customized simona simulation by providing +/** Trait that can be used to set up a customized simona simulation by providing * implementations for all setup information required by a * [[edu.ie3.simona.sim.SimonaSim]]. Most of the time, using or extending * [[SimonaStandaloneSetup]] might be considered instead of providing a your 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 f110feca8e..26c3145945 100644 --- a/src/test/scala/edu/ie3/simona/event/listener/ResultEventListenerSpec.scala +++ b/src/test/scala/edu/ie3/simona/event/listener/ResultEventListenerSpec.scala @@ -316,7 +316,7 @@ class ResultEventListenerSpec ), ) ) - /* The result file is created at start up and only contains a head line. */ + /* The result file is created at start up and only contains a headline. */ awaitCond( outputFile.exists(), interval = 500.millis, From a960acec51427a38dfb323e9a8aa6a005ad5ee4a Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 10:26:48 +0100 Subject: [PATCH 29/46] grammar correct tense second part --- .../edu/ie3/simona/agent/grid/GridResultsSupport.scala | 6 +++--- src/main/scala/edu/ie3/simona/service/SimonaService.scala | 6 +++--- .../edu/ie3/simona/service/weather/WeatherService.scala | 6 +++--- .../scala/edu/ie3/simona/util/ResultFileHierarchy.scala | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) 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 c872cc8e54..55ea126136 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/GridResultsSupport.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/GridResultsSupport.scala @@ -96,7 +96,7 @@ private[grid] trait GridResultsSupport { * and the corresponding sweep value data * * @param lines - * the set of lines which the result should be build for + * the set of lines which the result should be built for * @param sweepValueStoreData * the value store with all power flow result values of the provided lines * @param iNominal @@ -142,7 +142,7 @@ private[grid] trait GridResultsSupport { * [[TransformerModel]] and the corresponding sweep value data * * @param transformers - * the set of transformers which the result should be build for + * the set of transformers which the result should be built for * @param sweepValueStoreData * the value store with all power flow result values of the provided * transformers @@ -190,7 +190,7 @@ private[grid] trait GridResultsSupport { * [[Transformer3wModel]] and the corresponding sweep value data * * @param transformers3w - * the set of 3 winding transformers which the result should be build for + * the set of 3 winding transformers which the result should be built for * @param sweepValueStoreData * the value store with all power flow result values of the provided 3 * winding transformers diff --git a/src/main/scala/edu/ie3/simona/service/SimonaService.scala b/src/main/scala/edu/ie3/simona/service/SimonaService.scala index 1b41b30400..f6db7b5c72 100644 --- a/src/main/scala/edu/ie3/simona/service/SimonaService.scala +++ b/src/main/scala/edu/ie3/simona/service/SimonaService.scala @@ -182,9 +182,9 @@ abstract class SimonaService[ /** Initialize the concrete service implementation using the provided * initialization data. This method should perform all heavyweight tasks * before the actor becomes ready. The return values are a) the state data of - * the initialized service and b) optional triggers that should be send to + * the initialized service and b) optional triggers that should be sent to * the [[edu.ie3.simona.scheduler.Scheduler]] together with the completion - * message that is send in response to the trigger that is send to start the + * message that is sent in response to the trigger that is sent to start the * initialization process * * @param initServiceData @@ -221,7 +221,7 @@ abstract class SimonaService[ * the current state data of this service * @return * the service stata data that should be used in the next state (normally - * with updated values) together with the completion message that is send + * with updated values) together with the completion message that is sent * in response to the trigger that was sent to start this announcement */ protected def announceInformation(tick: Long)(implicit 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 a75b0c38fd..4092a2850f 100644 --- a/src/main/scala/edu/ie3/simona/service/weather/WeatherService.scala +++ b/src/main/scala/edu/ie3/simona/service/weather/WeatherService.scala @@ -107,9 +107,9 @@ final case class WeatherService( /** Initialize the concrete service implementation using the provided * initialization data. This method should perform all heavyweight tasks * before the actor becomes ready. The return values are a) the state data of - * the initialized service and b) optional triggers that should be send to + * the initialized service and b) optional triggers that should be sent to * the [[edu.ie3.simona.scheduler.Scheduler]] together with the completion - * message that is send in response to the trigger that is send to start the + * message that is sent in response to the trigger that is sent to start the * initialization process * * @param initServiceData @@ -284,7 +284,7 @@ final case class WeatherService( * the current state data of this service * @return * the service stata data that should be used in the next state (normally - * with updated values) together with the completion message that is send + * with updated values) together with the completion message that is sent * in response to the trigger that was sent to start this announcement */ override protected def announceInformation(tick: Long)(implicit diff --git a/src/main/scala/edu/ie3/simona/util/ResultFileHierarchy.scala b/src/main/scala/edu/ie3/simona/util/ResultFileHierarchy.scala index 171c5835a2..0212ad124e 100644 --- a/src/main/scala/edu/ie3/simona/util/ResultFileHierarchy.scala +++ b/src/main/scala/edu/ie3/simona/util/ResultFileHierarchy.scala @@ -156,7 +156,7 @@ object ResultFileHierarchy extends LazyLogging { ) /** @param modelClass - * the model class a file path should be build for + * the model class a file path should be built for * @param csvSink * the csv sink type parameters * @param rawOutputDataDir From a9a335d779fe42d2f7a9f9d675d3bb0b82155878 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 10:21:37 +0100 Subject: [PATCH 30/46] grammar correct tense --- .../scala/edu/ie3/simona/agent/grid/GridAgentData.scala | 2 +- .../edu/ie3/simona/agent/grid/GridAgentMessages.scala | 2 +- .../edu/ie3/simona/service/ev/ExtEvDataService.scala | 2 +- .../ie3/simona/service/primary/PrimaryServiceWorker.scala | 4 ++-- .../ie3/simona/agent/grid/DBFSAlgorithmCenGridSpec.scala | 4 ++-- .../agent/grid/DBFSAlgorithmFailedPowerFlowSpec.scala | 8 ++++---- .../ie3/simona/agent/grid/DBFSAlgorithmSupGridSpec.scala | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) 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 636baca646..6b77430487 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/GridAgentData.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/GridAgentData.scala @@ -56,7 +56,7 @@ object GridAgentData { } } - /** Data that is send to the [[GridAgent]] directly after startup. It contains + /** Data that is sent to the [[GridAgent]] directly after startup. It contains * the main information for initialization. This data should include all * [[GridAgent]] individual data, for data that is the same for all * [[GridAgent]] s please use [[GridAgent.apply()]] diff --git a/src/main/scala/edu/ie3/simona/agent/grid/GridAgentMessages.scala b/src/main/scala/edu/ie3/simona/agent/grid/GridAgentMessages.scala index b0d98be1e9..288add1bd9 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/GridAgentMessages.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/GridAgentMessages.scala @@ -186,7 +186,7 @@ object GridAgentMessages { /** Provide values as a reply to a * [[edu.ie3.simona.agent.participant.ParticipantAgent.RequestAssetPowerMessage]]. * In contrast to [[AssetPowerChangedMessage]], this message indicates that - * the same values for [[p]] and [[q]] has been send again as in the previous + * the same values for [[p]] and [[q]] has been sent again as in the previous * request * * @param p 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 66cfaa96f1..680c6050b1 100644 --- a/src/main/scala/edu/ie3/simona/service/ev/ExtEvDataService.scala +++ b/src/main/scala/edu/ie3/simona/service/ev/ExtEvDataService.scala @@ -170,7 +170,7 @@ class ExtEvDataService(override val scheduler: ActorRef) * the current state data of this service * @return * the service stata data that should be used in the next state (normally - * with updated values) together with the completion message that is send + * with updated values) together with the completion message that is sent * in response to the trigger that was sent to start this announcement */ override protected def announceInformation( 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 7ff05ccf1a..bd09c0b81b 100644 --- a/src/main/scala/edu/ie3/simona/service/primary/PrimaryServiceWorker.scala +++ b/src/main/scala/edu/ie3/simona/service/primary/PrimaryServiceWorker.scala @@ -198,8 +198,8 @@ final case class PrimaryServiceWorker[V <: Value]( * the current state data of this service * @return * the service stata data that should be used in the next state (normally - * with updated values) together with the completion message that is send - * in response to the trigger that is send to start the initialization + * with updated values) together with the completion message that is sent + * in response to the trigger that is sent to start the initialization * process */ override protected def announceInformation( 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 4da922de62..c93a049bf0 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmCenGridSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmCenGridSpec.scala @@ -424,8 +424,8 @@ class DBFSAlgorithmCenGridSpec // connected inferior grids, because the slack node is just a mock, we imitate this behavior centerGridAgent ! FinishGridSimulationTrigger(3600) - // after a FinishGridSimulationTrigger is send the inferior grids, they themselves will send the - // Trigger forward the trigger to their connected inferior grids. Therefore the inferior grid + // after a FinishGridSimulationTrigger is sent the inferior grids, they themselves will send the + // Trigger forward the trigger to their connected inferior grids. Therefore, the inferior grid // agent should receive a FinishGridSimulationTrigger inferiorGrid11.gaProbe.expectMessage(FinishGridSimulationTrigger(3600)) 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 ce904d0b11..7a4b2bce6e 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmFailedPowerFlowSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmFailedPowerFlowSpec.scala @@ -200,8 +200,8 @@ class DBFSAlgorithmFailedPowerFlowSpec // connected inferior grids, because the slack node is just a mock, we imitate this behavior centerGridAgent ! FinishGridSimulationTrigger(3600) - // after a FinishGridSimulationTrigger is send to the inferior grids, they themselves will - // forward the trigger to their connected inferior grids. Therefore the inferior grid agent + // after a FinishGridSimulationTrigger is sent to the inferior grids, they themselves will + // forward the trigger to their connected inferior grids. Therefore, the inferior grid agent // should receive a FinishGridSimulationTrigger inferiorGridAgent.gaProbe.expectMessage(FinishGridSimulationTrigger(3600)) @@ -272,8 +272,8 @@ class DBFSAlgorithmFailedPowerFlowSpec // connected inferior grids, because the slack node is just a mock, we imitate this behavior centerGridAgent ! FinishGridSimulationTrigger(3600) - // after a FinishGridSimulationTrigger is send to the inferior grids, they themselves will - // forward the trigger to their connected inferior grids. Therefore the inferior grid agent + // after a FinishGridSimulationTrigger is sent to the inferior grids, they themselves will + // forward the trigger to their connected inferior grids. Therefore, the inferior grid agent // should receive a FinishGridSimulationTrigger inferiorGridAgent.gaProbe.expectMessage(FinishGridSimulationTrigger(3600)) 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 9c716def88..beb1408270 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmSupGridSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmSupGridSpec.scala @@ -154,7 +154,7 @@ class DBFSAlgorithmSupGridSpec ) // we expect a completion message here and that the agent goes back to simulate grid - // and waits until the newly scheduled StartGridSimulationTrigger is send + // and waits until the newly scheduled StartGridSimulationTrigger is sent // wait 30 seconds max for power flow to finish scheduler.expectMessageType[Completion](130 seconds) match { case Completion(_, Some(3600)) => @@ -271,7 +271,7 @@ class DBFSAlgorithmSupGridSpec ) // we expect a completion message here and that the agent goes back to simulate grid - // and waits until the newly scheduled StartGridSimulationTrigger is send + // and waits until the newly scheduled StartGridSimulationTrigger is sent // Simulate Grid // wait 30 seconds max for power flow to finish From aa22b46371665aae0dbe2e081a01cabd31a295c7 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 10:05:57 +0100 Subject: [PATCH 31/46] grammar, spelling, typos, wording etc. --- docs/readthedocs/developersguide.md | 2 +- docs/readthedocs/models/em.md | 2 +- docs/readthedocs/models/hp_model.md | 2 +- docs/readthedocs/usersguide.md | 2 +- .../ie3/simona/actor/SimonaActorNaming.scala | 2 +- .../agent/grid/GridAgentController.scala | 2 +- .../simona/agent/grid/PowerFlowSupport.scala | 2 +- .../agent/participant/ParticipantAgent.scala | 6 +++--- .../ParticipantAgentFundamentals.scala | 21 ++++++++++--------- .../edu/ie3/simona/event/RuntimeEvent.scala | 2 +- .../exceptions/WeatherServiceException.scala | 2 +- .../ie3/simona/model/SystemComponent.scala | 2 +- .../model/em/PrioritizedFlexStrat.scala | 4 ++-- .../edu/ie3/simona/model/grid/GridModel.scala | 4 ++-- .../edu/ie3/simona/model/grid/RefSystem.scala | 2 +- .../model/grid/TransformerTapping.scala | 2 +- .../model/participant/evcs/EvcsModel.scala | 4 ++-- .../ie3/simona/service/SimonaService.scala | 2 +- .../service/primary/PrimaryServiceProxy.scala | 2 +- .../service/weather/SampleWeatherSource.scala | 2 +- .../ie3/simona/sim/setup/SimonaSetup.scala | 4 ++-- .../ie3/simona/util/ParsableEnumeration.scala | 2 +- .../util/scala/quantities/QuantityUtil.scala | 5 ++--- .../agent/grid/DBFSAlgorithmCenGridSpec.scala | 6 +++--- .../DBFSAlgorithmFailedPowerFlowSpec.scala | 8 +++---- .../RuntimeEventListenerLoggingSpec.scala | 2 +- .../model/participant/StorageModelSpec.scala | 2 +- .../common/model/grid/SubGridGateMokka.scala | 2 +- 28 files changed, 50 insertions(+), 50 deletions(-) diff --git a/docs/readthedocs/developersguide.md b/docs/readthedocs/developersguide.md index ace59e05e6..a246fc106a 100644 --- a/docs/readthedocs/developersguide.md +++ b/docs/readthedocs/developersguide.md @@ -2,7 +2,7 @@ # Developer’s Guide -The SIMONA repository can be found [on Github](https://github.com/ie3-institute/simona). +The SIMONA repository can be found [on GitHub](https://github.com/ie3-institute/simona). ```{contents} --- diff --git a/docs/readthedocs/models/em.md b/docs/readthedocs/models/em.md index ae10cb3ac2..ea7261d4f8 100644 --- a/docs/readthedocs/models/em.md +++ b/docs/readthedocs/models/em.md @@ -16,7 +16,7 @@ If an EmAgent is itself controlled by another EmAgent, it also behaves like a sy Every EmAgent aggregates flex options and power of its connected assets and disaggregates flex control among the connected assets. It also functions as a scheduler for all connected assets by processing information on the ticks of the next desired activations and conveying such information to the controlling EmAgent or a central scheduler respectively. -Uncontrolled EmAgents answer to a scheduler with regards to their activation. +Uncontrolled EmAgents answer to a scheduler with regard to their activation. ![](http://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/ie3-institute/simona/dev/docs/uml/protocol/em/UncontrolledEm.puml) diff --git a/docs/readthedocs/models/hp_model.md b/docs/readthedocs/models/hp_model.md index 0458fffbac..bcc10f3a97 100644 --- a/docs/readthedocs/models/hp_model.md +++ b/docs/readthedocs/models/hp_model.md @@ -6,7 +6,7 @@ This page documents the functionality of the Heat Pump Model (HP model) availabl ## Assumptions -The HP unit is able to operate either at full load or not at all. Uncovered heat demand of former time-steps is not considered in the following steps, as the HP unit does not posses a memory. +The HP unit is able to operate either at full load or not at all. Uncovered heat demand of former time-steps is not considered in the following steps, as the HP unit does not possess a memory. ## Parameters diff --git a/docs/readthedocs/usersguide.md b/docs/readthedocs/usersguide.md index 5b75b15ac7..ea6a9babf1 100644 --- a/docs/readthedocs/usersguide.md +++ b/docs/readthedocs/usersguide.md @@ -37,7 +37,7 @@ You can either delegate the job to your preferred IDE or build an executable jar In order to be able to execute SIMONA from a CLI, you need an executable fat jar. A fat jar contains all compiled classes and dependencies, ready for execution. For building one, you can use a Gradle task of the project. 1. Open a CLI and change directories to the top level directory of the project. -2. Execute ``gradlew shadowJar`` within the CLI. This creates a fat jar of SIMONA inside of the directory ``build/libs``. +2. Execute ``gradlew shadowJar`` within the CLI. This creates a fat jar of SIMONA inside the directory ``build/libs``. 3. For executing a fat jar you need to specify the classpath of the entrypoint of your application. Assuming we are still in the top level directory of our project, the execution command would look as follows: diff --git a/src/main/scala/edu/ie3/simona/actor/SimonaActorNaming.scala b/src/main/scala/edu/ie3/simona/actor/SimonaActorNaming.scala index fed8f600f3..2b0c62e780 100644 --- a/src/main/scala/edu/ie3/simona/actor/SimonaActorNaming.scala +++ b/src/main/scala/edu/ie3/simona/actor/SimonaActorNaming.scala @@ -21,7 +21,7 @@ object SimonaActorNaming { refFactory.actorOf(props, actorName(props, simonaActorId(actorId))) } - /** Constructs an Id for convenience actor naming. Although this is dangerous + /** Constructs an id for convenience actor naming. Although this is dangerous * as duplicates might be possible, it should be sufficient in our case as * the uniqueness is only required in one actor system * 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 f2e78f7c53..ad0d6c3b07 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/GridAgentController.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/GridAgentController.scala @@ -158,7 +158,7 @@ class GridAgentController( /** Go through all provided input models, build agents for those and group the * resulting actor references for each connection nodes. All participant * agents are also introduced to the agent environment and the scheduler is - * requested to send a initialisation trigger. + * requested to send an initialisation trigger. * * @param participantsConfig * Configuration information for participant models 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 eae1369de4..50a785af8d 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/PowerFlowSupport.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/PowerFlowSupport.scala @@ -203,7 +203,7 @@ trait PowerFlowSupport { * p/q values from the provided sweepDataValues and combines them with * updated receivedSlackValues. Normally used in a forward sweep phase of * [[DBFSAlgorithm]] as in this state only voltages are updated and a power - * flow with new voltages but old p/q values is executed afterwards + * flow with new voltages but old p/q values is executed afterward. * * @param receivedSlackValues * new slack voltages provided by the superior grid 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 52e3a53a59..19a18c60c7 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgent.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgent.scala @@ -448,8 +448,8 @@ abstract class ParticipantAgent[ case _ => participantStateData.receivedSecondaryDataStore } - /* At least parts of the needed data has been received or it is an additional activation, that has been triggered. - * Anyways, the calculation routine has also to take care of filling up missing data. */ + /* At least parts of the needed data has been received, or it is an additional activation, that has been triggered. + * Anyway, the calculation routine has also to take care of filling up missing data. */ val lastModelState = getLastOrInitialStateData(participantStateData, currentTick) calculatePowerWithSecondaryDataAndGoToIdle( @@ -656,7 +656,7 @@ abstract class ParticipantAgent[ * the agent is meant to replay external primary data: Announce result, add * content to result value store, go to [[Idle]] and answer the scheduler, * that the activity start trigger is fulfilled. 2.2) All secondary data is - * there, go to [[Calculate]] and ask the scheduler to trigger ourself for + * there, go to [[Calculate]] and ask the scheduler to trigger ourselves for * starting the model based calculation 3) Everything is at place and the * [[Activation]] has NOT yet been sent: Stay here and wait * 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 984815a846..536dc8d412 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentals.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentals.scala @@ -388,7 +388,7 @@ protected trait ParticipantAgentFundamentals[ /** Assume we have information, that are available in a fixed resolution after * each full hour (including the full hour), then we have to determine, at - * what first tick those information are available. + * what first tick this information are available. * * @param simulationStartDate * Beginning of the simulation @@ -515,7 +515,7 @@ protected trait ParticipantAgentFundamentals[ val foreseenDataTicks = baseStateData.foreseenDataTicks + (msg.serviceRef -> msg.nextDataTick) - /* Go over to handling these information */ + /* Go over to handling this information */ val nextStateData = DataCollectionStateData( BaseStateData.updateBaseStateData( baseStateData, @@ -538,8 +538,9 @@ protected trait ParticipantAgentFundamentals[ * Announce result, add content to result value store, go to [[Idle]] and * answer the scheduler, that the activity start trigger is fulfilled. 2.2) * All secondary data is there, go to [[Calculate]] and ask the scheduler to - * trigger ourself for starting the model based calculation 3) Everything is - * at place and the [[Activation]] has NOT yet been sent: Stay here and wait + * trigger ourselves for starting the model based calculation 3) Everything + * is at place and the [[Activation]] has NOT yet been sent: Stay here and + * wait * * @param stateData * Apparent state data @@ -645,7 +646,7 @@ protected trait ParticipantAgentFundamentals[ ) } } else { - /* We sill have to wait - either for data or activation */ + /* We still have to wait - either for data or activation */ stay() using stateData } } @@ -1141,7 +1142,7 @@ protected trait ParticipantAgentFundamentals[ baseStateData, ) case (Some(additionalTick), _) => - /* The next activation is additional (either there is no foreseen data tick or it is after the additional tick. + /* The next activation is additional (either there is no foreseen data tick or it is after the additional tick). * Remove the tick from the list of additional activation ticks. */ val upcomingActivationTicks = baseStateData.additionalActivationTicks.rangeFrom(additionalTick + 1) @@ -1159,7 +1160,7 @@ protected trait ParticipantAgentFundamentals[ updatedBaseStateData, ) case (None, None) => - /* We don't know nothing about either additional activation nor new incoming data */ + /* We don't know anything about either additional activation nor new incoming data */ (None, baseStateData) } } @@ -1258,7 +1259,7 @@ protected trait ParticipantAgentFundamentals[ } /** Checks, if a fast reply is possible, when the very same request (in terms - * of tick and nodal voltage) already has been answered. Then a Option on + * of tick and nodal voltage) already has been answered. Then an Option on * stay in the same state with sending an [[AssetPowerUnchangedMessage]] is * given back. If a fast reply is not possible, [[None]] is given back. * Additionally, the listener are informed about the result. @@ -1292,7 +1293,7 @@ protected trait ParticipantAgentFundamentals[ case Some((mostRecentRequestTick, latestProvidedValues)) if mostRecentRequestTick == requestTick => /* A request for this tick has already been answered. Check, if it has been the same request. - * if it has been the same request we wanna answer with the same values afterwards, this data MUST always + * if it has been the same request we want to answer with the same values afterwards, this data MUST always * be available when we already provided data for this tick */ baseStateData match { case externalBaseStateData: FromOutsideBaseStateData[M, PD] => @@ -1753,7 +1754,7 @@ protected trait ParticipantAgentFundamentals[ * @param tick * Tick, the result belongs to * @param result - * The result to build a event for + * The result to build an event for * @param outputConfig * Configuration of the output behaviour */ diff --git a/src/main/scala/edu/ie3/simona/event/RuntimeEvent.scala b/src/main/scala/edu/ie3/simona/event/RuntimeEvent.scala index da02b9c258..44d092ea0f 100644 --- a/src/main/scala/edu/ie3/simona/event/RuntimeEvent.scala +++ b/src/main/scala/edu/ie3/simona/event/RuntimeEvent.scala @@ -21,7 +21,7 @@ object RuntimeEvent { /** Indicates that the scheduler has finished a pre-defined advancement in * ticks and is ready to carry out the next task. In contrast to the * [[CheckWindowPassed]] event, whenever a [[Ready]] event is scheduled, the - * scheduled of [[edu.ie3.simona.scheduler.Scheduler]] will be stopped and + * schedule of [[edu.ie3.simona.scheduler.Scheduler]] will be stopped and * further commands are necessary to continue the schedule. * * @param tick diff --git a/src/main/scala/edu/ie3/simona/exceptions/WeatherServiceException.scala b/src/main/scala/edu/ie3/simona/exceptions/WeatherServiceException.scala index 08d109a2a6..b1291f6694 100644 --- a/src/main/scala/edu/ie3/simona/exceptions/WeatherServiceException.scala +++ b/src/main/scala/edu/ie3/simona/exceptions/WeatherServiceException.scala @@ -45,7 +45,7 @@ object WeatherServiceException { private val cause: Throwable = None.orNull, ) extends WeatherServiceException(msg, cause) - /** Exception to be thrown if the registration of the an agent fails + /** Exception to be thrown if the registration of an agent fails * @param msg * Message to prompt to the end user * @param cause diff --git a/src/main/scala/edu/ie3/simona/model/SystemComponent.scala b/src/main/scala/edu/ie3/simona/model/SystemComponent.scala index 623e5a58c3..6553faab08 100644 --- a/src/main/scala/edu/ie3/simona/model/SystemComponent.scala +++ b/src/main/scala/edu/ie3/simona/model/SystemComponent.scala @@ -40,7 +40,7 @@ abstract class SystemComponent( private val elementType: String = this.getClass.getSimpleName - // check if a uuid is provided + // check if an uuid is provided if (Option.apply(uuid).isEmpty) throw new InvalidParameterException( s"Uuid of $elementType $id cannot be null!" diff --git a/src/main/scala/edu/ie3/simona/model/em/PrioritizedFlexStrat.scala b/src/main/scala/edu/ie3/simona/model/em/PrioritizedFlexStrat.scala index 98162db86c..3d934e21f3 100644 --- a/src/main/scala/edu/ie3/simona/model/em/PrioritizedFlexStrat.scala +++ b/src/main/scala/edu/ie3/simona/model/em/PrioritizedFlexStrat.scala @@ -122,7 +122,7 @@ final case class PrioritizedFlexStrat(curtailRegenerative: Boolean) (issueCtrlMsgs, Some(remainingExcessPower)) } else if (remainingExcessPower < flexPotential) { // we cannot cover the excess feed-in with just this flexibility, - // thus use all of the available flexibility and continue + // thus use all the available flexibility and continue ( issueCtrlMsgs :+ (inputModel.getUuid, flexOption.max), Some(remainingExcessPower - flexPotential), @@ -171,7 +171,7 @@ final case class PrioritizedFlexStrat(curtailRegenerative: Boolean) (issueCtrlMsgs, Some(remainingExcessPower)) } else if (remainingExcessPower > flexPotential) { // we cannot cover the excess load with just this flexibility, - // thus use all of the available flexibility and continue + // thus use all the available flexibility and continue ( issueCtrlMsgs :+ (inputModel.getUuid, flexOption.min), Some(remainingExcessPower - flexPotential), 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 af90cfc344..25cee7edcf 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/GridModel.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/GridModel.scala @@ -332,7 +332,7 @@ object GridModel { } /** This checks whether the provided grid model graph is connected, that means - * if every node can be reached from every other node trough a sequence of + * if every node can be reached from every other node through a sequence of * edges. Also checks for referenced nodes that are missing. This check * considers the state (enabled/disabled) of the elements. * @@ -605,7 +605,7 @@ object GridModel { /** Check and validates the grid. Especially the consistency of the grid * model the connectivity of the grid model if there is InitData for - * superior or inferior GridGates if there exits voltage measurements for + * superior or inferior GridGates if there exists voltage measurements for * transformerControlGroups */ 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 40319e699a..d9a6090601 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/RefSystem.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/RefSystem.scala @@ -153,7 +153,7 @@ final case class RefSystem private ( /** Converts a provided voltage value from physical SI value into p.u. value * * @param vInSi - * real or imaginary part of a unreferenced physical SI value + * real or imaginary part of an unreferenced physical SI value * @return * referenced voltage value in p.u. */ 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 809e7c5f8f..a1679a54f2 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/TransformerTapping.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/TransformerTapping.scala @@ -17,7 +17,7 @@ import tech.units.indriya.quantity.Quantities * necessary to override updateTapPos (e.g. in [[Transformer3wModel]]). The * provided [[TransformerTappingModel]] *should* be protected and not be * accessible from outside to prevent direct access to internal functions! - * Instead all the functions provided here should be used for tap position + * Instead, all the functions provided here should be used for tap position * manipulation. */ trait TransformerTapping { 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 a1d21252ec..b703304893 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 @@ -194,7 +194,7 @@ final case class EvcsModel( state.evs } - /** Charge the given EV under consideration a applicable schedule + /** Charge the given EV under consideration an applicable schedule * * @param ev * Electric vehicle to charge @@ -271,7 +271,7 @@ final case class EvcsModel( /* Filter for entries, that end after the last schedule application and that start before the current tick. Entries that end at lastTick are not included because schedule - intervals are open at the right hand side. + intervals are open on the right hand side. Entries that start at currentTick are not included because these will be calculated with the next state. */ diff --git a/src/main/scala/edu/ie3/simona/service/SimonaService.scala b/src/main/scala/edu/ie3/simona/service/SimonaService.scala index f6db7b5c72..310c7f0b32 100644 --- a/src/main/scala/edu/ie3/simona/service/SimonaService.scala +++ b/src/main/scala/edu/ie3/simona/service/SimonaService.scala @@ -30,7 +30,7 @@ object SimonaService { /** Service initialization data can sometimes only be constructed once the * service actor is created (e.g. - * [[edu.ie3.simona.service.ev.ExtEvDataService]]. Thus, we need an extra + * [[edu.ie3.simona.service.ev.ExtEvDataService]]). Thus, we need an extra * initialization message. */ final case class Create[+I <: InitializeServiceStateData]( 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 ca41a11234..be9a87fc4d 100644 --- a/src/main/scala/edu/ie3/simona/service/primary/PrimaryServiceProxy.scala +++ b/src/main/scala/edu/ie3/simona/service/primary/PrimaryServiceProxy.scala @@ -269,7 +269,7 @@ case class PrimaryServiceProxy( unhandled(x) } - /** Handle the registration request for a covered model. First, try to get a + /** Handle the registration request for a covered model. First, try to get an * already existing worker for this time series, otherwise spin-off a new * one, remember it and forward the request * 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 c8045ced59..2e2dd58c7c 100644 --- a/src/main/scala/edu/ie3/simona/service/weather/SampleWeatherSource.scala +++ b/src/main/scala/edu/ie3/simona/service/weather/SampleWeatherSource.scala @@ -183,7 +183,7 @@ object SampleWeatherSource { } } - // these lists contain the hourly weather values for each first of the month of 2011 + january of + // these lists contain the hourly weather values for each first of the month of 2011 + january // 2012 at coordinate id 213089 val diffuseRadiation: Vector[Double] = Vector(0, 0, 0, 0, 0, 1.18179e-12, 4.42315e-11, 0.0585938, 1.94141, 15.1172, 74.8438, 89.0469, 104.062, 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 170c807e80..4a2d8abd42 100644 --- a/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala +++ b/src/main/scala/edu/ie3/simona/sim/setup/SimonaSetup.scala @@ -24,8 +24,8 @@ import org.apache.pekko.actor.{ActorRef => ClassicRef} /** Trait that can be used to set up a customized simona simulation by providing * implementations for all setup information required by a * [[edu.ie3.simona.sim.SimonaSim]]. Most of the time, using or extending - * [[SimonaStandaloneSetup]] might be considered instead of providing a your - * own implementation for all methods. + * [[SimonaStandaloneSetup]] might be considered instead of providing your own + * implementation for all methods. * * @version 0.1 * @since 01.07.20 diff --git a/src/main/scala/edu/ie3/simona/util/ParsableEnumeration.scala b/src/main/scala/edu/ie3/simona/util/ParsableEnumeration.scala index 6097ac1247..eee647d73f 100644 --- a/src/main/scala/edu/ie3/simona/util/ParsableEnumeration.scala +++ b/src/main/scala/edu/ie3/simona/util/ParsableEnumeration.scala @@ -26,7 +26,7 @@ abstract class ParsableEnumeration extends Enumeration { withName(cleanedInput) } - /** Checks, if the given input is an eligible description of a enum value + /** Checks, if the given input is an eligible description of an enum value * * @param input * Input string 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 b55678ef83..7ccc3b7aa2 100644 --- a/src/main/scala/edu/ie3/util/scala/quantities/QuantityUtil.scala +++ b/src/main/scala/edu/ie3/util/scala/quantities/QuantityUtil.scala @@ -21,9 +21,8 @@ object QuantityUtil { /** The [[tech.units.indriya.function.DefaultNumberSystem]] is only covering * java [[Number]] children. As [[BigDecimal]] is not related to * [[java.math.BigDecimal]], this causes issues, why the - * [[tech.units.indriya.spi.NumberSystem]] has to be to be used has to be - * specified to something, that actually is able to handle the scala number - * system. + * [[tech.units.indriya.spi.NumberSystem]] has to be used has to be specified + * to something, that actually is able to handle the scala number system. */ def adjustNumberSystem(): Unit = Calculus.setCurrentNumberSystem( 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 c93a049bf0..59a32256d2 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmCenGridSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmCenGridSpec.scala @@ -164,7 +164,7 @@ class DBFSAlgorithmCenGridSpec val firstSlackVoltageRequestSender = superiorGridAgent.expectSlackVoltageRequest(firstSweepNo) - // normally the inferior grid agents ask for the slack voltage as well to do their power flow calculations + // normally the inferior grid agents ask for the slack voltage as well to run their power flow calculations // we simulate this behaviour now by doing the same for our three inferior grid agents inferiorGrid11.requestSlackVoltage(centerGridAgent, firstSweepNo) @@ -300,7 +300,7 @@ class DBFSAlgorithmCenGridSpec Kilovolts(374.22694614463d), // 380 kV @ 10° Kilovolts(65.9863075134335d), // 380 kV @ 10° ), - ExchangeVoltage( // this one should currently be ignored anyways + ExchangeVoltage( // this one should currently be ignored anyway supNodeA.getUuid, Kilovolts(380d), Kilovolts(0d), @@ -320,7 +320,7 @@ class DBFSAlgorithmCenGridSpec val secondPowerRequestSender13 = inferiorGrid13.expectGridPowerRequest() - // normally the inferior grid agents ask for the slack voltage as well to do their power flow calculations + // normally the inferior grid agents ask for the slack voltage as well to run their power flow calculations // we simulate this behaviour now by doing the same for our three inferior grid agents inferiorGrid11.requestSlackVoltage(centerGridAgent, secondSweepNo) 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 7a4b2bce6e..a1047edeff 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmFailedPowerFlowSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmFailedPowerFlowSpec.scala @@ -145,7 +145,7 @@ class DBFSAlgorithmFailedPowerFlowSpec val slackVoltageRequestSender = superiorGridAgent.expectSlackVoltageRequest(sweepNo) - // normally the inferior grid agents ask for the slack voltage as well to do their power flow calculation + // normally the inferior grid agents ask for the slack voltage as well to run their power flow calculation // we simulate this behaviour now by doing the same for our inferior grid agent inferiorGridAgent.requestSlackVoltage(centerGridAgent, sweepNo) @@ -191,7 +191,7 @@ class DBFSAlgorithmFailedPowerFlowSpec // hence we ask for them and expect a corresponding response superiorGridAgent.requestGridPower(centerGridAgent, sweepNo) - // the requested power is to high for the grid to handle, therefore the superior grid agent + // the requested power is too high for the grid to handle, therefore the superior grid agent // receives a FailedPowerFlow message // wait 30 seconds max for power flow to finish superiorGridAgent.gaProbe.expectMessage(30 seconds, FailedPowerFlow) @@ -229,7 +229,7 @@ class DBFSAlgorithmFailedPowerFlowSpec val slackVoltageRequestSender = superiorGridAgent.expectSlackVoltageRequest(sweepNo) - // normally the inferior grid agents ask for the slack voltage as well to do their power flow calculation + // normally the inferior grid agents ask for the slack voltage as well to run their power flow calculation // we simulate this behaviour now by doing the same for our inferior grid agent inferiorGridAgent.requestSlackVoltage(centerGridAgent, sweepNo) @@ -341,7 +341,7 @@ class DBFSAlgorithmFailedPowerFlowSpec val powerRequestSender = hvGridAgent.expectGridPowerRequest() - // normally the inferior grid agents ask for the slack voltage as well to do their power flow calculation + // normally the inferior grid agents ask for the slack voltage as well to run their power flow calculation // we simulate this behaviour now by doing the same for our inferior grid agent hvGridAgent.requestSlackVoltage(slackGridAgent, sweepNo) diff --git a/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerLoggingSpec.scala b/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerLoggingSpec.scala index 4e37001c11..7f77f7ca77 100644 --- a/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerLoggingSpec.scala +++ b/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerLoggingSpec.scala @@ -29,7 +29,7 @@ import org.apache.pekko.actor.testkit.typed.scaladsl.{ import org.slf4j.event.Level /** Logging must be tested in a separate test, since LoggingTestKit can still - * receives logs from test that it was not enabled for + * receive logs from test that it was not enabled for */ class RuntimeEventListenerLoggingSpec extends ScalaTestWithActorTestKit( diff --git a/src/test/scala/edu/ie3/simona/model/participant/StorageModelSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/StorageModelSpec.scala index 4d6fff7060..032743fa97 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/StorageModelSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/StorageModelSpec.scala @@ -104,7 +104,7 @@ class StorageModelSpec extends UnitSpec with Matchers { // CHANGED STATE // discharged to empty (10.0, -9.0, 3600, 0.0, 0.0, 10.0), - // almost discharged to lowest allowed charge + // almost discharged to the lowest allowed charge (10.0, -9.0, 3590, 0.0, -10.0, 10.0), // charged to mid-level charge (41.0, 10.0, 3600, 0.0, -10.0, 10.0), 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 6cf1b682d4..1f4761c034 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 @@ -28,7 +28,7 @@ trait SubGridGateMokka extends MockitoSugar { * @param subnet * Sub net number * @return - * [[NodeInput]] with these information + * [[NodeInput]] with this information */ protected def mockNode(uuid: UUID, subnet: Int): NodeInput = { val node = mock[NodeInput] From e3eb74850510d9de1820fab1030ad13733ca1f35 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 09:58:05 +0100 Subject: [PATCH 32/46] grammar fix it's to its --- docs/readthedocs/models/hp_model.md | 2 +- src/main/scala/edu/ie3/simona/agent/em/EmAgent.scala | 2 +- .../participant/fixedfeedin/FixedFeedInAgentFundamentals.scala | 2 +- .../simona/agent/participant/load/LoadAgentFundamentals.scala | 2 +- src/main/scala/edu/ie3/simona/event/Event.scala | 2 +- .../edu/ie3/simona/model/grid/TransformerTappingModel.scala | 2 +- .../edu/ie3/simona/service/primary/PrimaryServiceProxy.scala | 2 +- .../scala/edu/ie3/simona/service/weather/WeatherSource.scala | 2 +- src/main/scala/edu/ie3/simona/sim/setup/SetupHelper.scala | 2 +- .../scala/edu/ie3/util/scala/quantities/ScalaNumberSystem.scala | 2 +- .../ie3/simona/test/common/model/grid/SubGridGateMokka.scala | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/readthedocs/models/hp_model.md b/docs/readthedocs/models/hp_model.md index bcc10f3a97..8070e36f36 100644 --- a/docs/readthedocs/models/hp_model.md +++ b/docs/readthedocs/models/hp_model.md @@ -17,6 +17,6 @@ Please refer to {doc}`PowerSystemDataModel - HP Model /* As participant agents always return their last known operation point on request, it is sufficient - * to let a fixed load model determine it's operation point on: + * to let a fixed load model determine its operation point on: * 1) The first tick of the simulation * 2) The tick, it turns on (in time dependent operation) * 3) The tick, it turns off (in time dependent operation) diff --git a/src/main/scala/edu/ie3/simona/event/Event.scala b/src/main/scala/edu/ie3/simona/event/Event.scala index 2efb82b76e..dad24a314f 100644 --- a/src/main/scala/edu/ie3/simona/event/Event.scala +++ b/src/main/scala/edu/ie3/simona/event/Event.scala @@ -7,7 +7,7 @@ package edu.ie3.simona.event /** Trait that should be mixed into each event in [[edu.ie3.simona.event]] to - * provide an easy access to it's name + * provide easy access to its name */ trait Event { 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 602259cec2..a8534d7b7b 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/TransformerTappingModel.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/TransformerTappingModel.scala @@ -114,7 +114,7 @@ final case class TransformerTappingModel( * inverted. * * Furthermore, this method also considers the transformer not being able to - * change it's tap position anymore. Hence, 0 is returned, if no change is + * change its tap position anymore. Hence, 0 is returned, if no change is * possible anymore. * * @param vChangeRequest 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 be9a87fc4d..838608a514 100644 --- a/src/main/scala/edu/ie3/simona/service/primary/PrimaryServiceProxy.scala +++ b/src/main/scala/edu/ie3/simona/service/primary/PrimaryServiceProxy.scala @@ -126,7 +126,7 @@ case class PrimaryServiceProxy( } /** Prepare the needed state data by building a - * [[edu.ie3.datamodel.io.source.TimeSeriesMappingSource]], obtain it's + * [[edu.ie3.datamodel.io.source.TimeSeriesMappingSource]], obtain its * information and compile them to state data * * @param primaryConfig 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 12a26c3f6c..fbc5af9c1f 100644 --- a/src/main/scala/edu/ie3/simona/service/weather/WeatherSource.scala +++ b/src/main/scala/edu/ie3/simona/service/weather/WeatherSource.scala @@ -424,7 +424,7 @@ object WeatherSource { * coordinates * * @param weighting - * Mapping from weather coordinate to it's weight in averaging + * Mapping from weather coordinate to its weight in averaging */ private[weather] final case class WeightedCoordinates( weighting: Map[Point, Double] 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 535b140798..751dd3fad3 100644 --- a/src/main/scala/edu/ie3/simona/sim/setup/SetupHelper.scala +++ b/src/main/scala/edu/ie3/simona/sim/setup/SetupHelper.scala @@ -46,7 +46,7 @@ trait SetupHelper extends LazyLogging { * Mapping from sub grid number to [[edu.ie3.simona.agent.grid.GridAgent]] * 's [[ActorRef]] * @param gridGates - * [[Set]] of all [[SubGridGate]] s connecting this sub grid with it's + * [[Set]] of all [[SubGridGate]] s connecting this sub grid with its * ancestors and children * @param configRefSystems * Collection of reference systems defined in config 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 238668e67a..137e24a2ce 100644 --- a/src/main/scala/edu/ie3/util/scala/quantities/ScalaNumberSystem.scala +++ b/src/main/scala/edu/ie3/util/scala/quantities/ScalaNumberSystem.scala @@ -8,7 +8,7 @@ package edu.ie3.util.scala.quantities import tech.units.indriya.function.DefaultNumberSystem -/** This number system simply delegates the method calls to it's parent class. +/** This number system simply delegates the method calls to its parent class. * The only difference is, that [[BigDecimal]] is transferred to * [[java.math.BigDecimal]] and back upon necessity. Due to its functionality * as an extension of the [[DefaultNumberSystem]] it CANNOT be an object! 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 1f4761c034..d3ab3e97b3 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 @@ -21,7 +21,7 @@ import org.scalatestplus.mockito.MockitoSugar */ trait SubGridGateMokka extends MockitoSugar { - /** Mocks a node with it's basic needed information + /** Mocks a node with its basic needed information * * @param uuid * Unique identifier of the node From 8467fb64ef726e51f782bc5fdc287fadef28fbe2 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 09:51:51 +0100 Subject: [PATCH 33/46] adding some commas --- docs/readthedocs/models/two_winding_transformer_model.md | 2 +- src/main/scala/edu/ie3/simona/agent/ValueStore.scala | 2 +- src/main/scala/edu/ie3/simona/agent/em/EmDataCore.scala | 2 +- .../scala/edu/ie3/simona/agent/grid/GridResultsSupport.scala | 2 +- .../edu/ie3/simona/agent/participant/ParticipantAgent.scala | 2 +- .../agent/participant/ParticipantAgentFundamentals.scala | 4 ++-- .../scala/edu/ie3/simona/io/result/plain/PlainResult.scala | 4 ++-- src/main/scala/edu/ie3/simona/model/grid/GridModel.scala | 2 +- .../scala/edu/ie3/simona/model/participant/StorageModel.scala | 2 +- .../scala/edu/ie3/simona/model/participant/WecModel.scala | 2 +- .../edu/ie3/simona/model/participant/control/QControl.scala | 2 +- .../scala/edu/ie3/simona/service/weather/WeatherService.scala | 4 ++-- .../scala/edu/ie3/simona/service/weather/WeatherSource.scala | 2 +- src/main/scala/edu/ie3/simona/util/ResultFileHierarchy.scala | 2 +- src/main/scala/edu/ie3/util/scala/ReflectionTools.scala | 2 +- .../edu/ie3/util/scala/quantities/SpecificHeatCapacity.scala | 2 +- .../edu/ie3/simona/agent/grid/DBFSAlgorithmCenGridSpec.scala | 4 ++-- .../ie3/simona/integration/common/IntegrationSpecCommon.scala | 2 +- .../edu/ie3/simona/model/em/ProportionalFlexStratSpec.scala | 2 +- 19 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/readthedocs/models/two_winding_transformer_model.md b/docs/readthedocs/models/two_winding_transformer_model.md index eac989c18d..768785aaaf 100644 --- a/docs/readthedocs/models/two_winding_transformer_model.md +++ b/docs/readthedocs/models/two_winding_transformer_model.md @@ -32,7 +32,7 @@ When the load flow calculation asks for the values with regard to the low voltag 3. Main field resistance: $R_{M,LV} = \frac{R_{M}}{\gamma^{2}}$ 4. Main field reactance: $X_{M,LV} = \frac{X_{M}}{\gamma^{2}}$ -Finally all values are delivered as per unit-values and ready to use in the fundamental $\pi$circuit: +Finally, all values are delivered as per unit-values and ready to use in the fundamental $\pi$circuit: 1. Short circuit conductance: $g_{ij} = \frac{Z_{Ref}}{R_{SC}}$ 2. Short circuit susceptance: $b_{ij} = \frac{Z_{Ref}}{X_{SC}}$ diff --git a/src/main/scala/edu/ie3/simona/agent/ValueStore.scala b/src/main/scala/edu/ie3/simona/agent/ValueStore.scala index a21f7d0f58..a1a1190861 100644 --- a/src/main/scala/edu/ie3/simona/agent/ValueStore.scala +++ b/src/main/scala/edu/ie3/simona/agent/ValueStore.scala @@ -129,7 +129,7 @@ object ValueStore { def forResult[D](maxTickSpan: Long, multiplier: Long): ValueStore[D] = new ValueStore[D](maxTickSpan * multiplier) - /** Updates the value store. Additionally the size of the store is limited to + /** Updates the value store. Additionally, the size of the store is limited to * it's defined maximum capacity. Therefore, the oldest entries are removed. * * @param valueStore diff --git a/src/main/scala/edu/ie3/simona/agent/em/EmDataCore.scala b/src/main/scala/edu/ie3/simona/agent/em/EmDataCore.scala index 9cd9070de8..cb8a73294d 100644 --- a/src/main/scala/edu/ie3/simona/agent/em/EmDataCore.scala +++ b/src/main/scala/edu/ie3/simona/agent/em/EmDataCore.scala @@ -260,7 +260,7 @@ object EmDataCore { awaitedConnectedAgents.excl(flexOptions.modelUuid), ) - /** Checks whether all awaited flex options have been received and we can + /** Checks whether all awaited flex options have been received, and we can * continue by calculating flex control. This method does not change the * state of the [[AwaitingFlexOptions]] data core. * @return 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 55ea126136..8d6d4adcfe 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/GridResultsSupport.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/GridResultsSupport.scala @@ -495,7 +495,7 @@ private[grid] trait GridResultsSupport { /** Calculate the current magnitude and the current angle in physical units * based on a provided electric current in p.u. and the nominal referenced * electric current. The arctangent "only" calculates the angle between the - * complex current and it's real part. This means, that i = (i_real, i_imag) + * complex current, and it's real part. This means, that i = (i_real, i_imag) * and i' = (-i_real, -i_imag) will lead to the same angle. However, for * power system simulation, the absolute orientation in the complex plane * with regard to the positive real axis is of interest. Therefore, 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 19a18c60c7..56f992b0f8 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgent.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgent.scala @@ -149,7 +149,7 @@ abstract class ParticipantAgent[ Activation(tick), 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 + /* An activity start trigger is sent and no data is awaited (neither secondary nor primary). Therefore, go straight * ahead to calculations */ /* Hold tick, as state transition is needed */ 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 536dc8d412..3435057ae0 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentals.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentals.scala @@ -1071,7 +1071,7 @@ protected trait ParticipantAgentFundamentals[ false } - // If we're completing initialization and we're EM-managed: + // If we're completing initialization, and we're EM-managed: // There is no new tick for the scheduler, // since we are activated by the EmAgent from now on scheduler ! Completion( @@ -1476,7 +1476,7 @@ protected trait ParticipantAgentFundamentals[ determineTickWindow(requestTick, requestValueStore) /* All participants simulation results between the most recent simulation tick BEFORE or at the beginning of the - * averaging window and it's end (both including) are relevant for averaging the simulated primary data */ + * averaging window, and it's end (both including) are relevant for averaging the simulated primary data */ val firstRelevantTick = determineFirstRelevantTick( averagingWindowStart, resultValueStore, 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 c85cd167af..4a9e9a4c8d 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 @@ -10,8 +10,8 @@ import java.util.UUID /** Results that are sent out with Kafka and avro should use this trait and * corresponding implementing classes, since these give more control over - * attribute types and naming and they include sim run id. Plain result objects - * can be created by [[PlainWriter]]. + * attribute types and naming, and they include sim run id. Plain result + * objects can be created by [[PlainWriter]]. */ sealed trait PlainResult 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 25cee7edcf..16285b9317 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/GridModel.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/GridModel.scala @@ -194,7 +194,7 @@ object GridModel { /* Nodes that are connected via a [closed] switch map to the same idx as we fuse them during the power flow. - Therefore the admittance matrix has to be of the size of the distinct node idxs. + Therefore, the admittance matrix has to be of the size of the distinct node idxs. */ val linesAdmittanceMatrix = buildAssetAdmittanceMatrix( nodeUuidToIndexMap, diff --git a/src/main/scala/edu/ie3/simona/model/participant/StorageModel.scala b/src/main/scala/edu/ie3/simona/model/participant/StorageModel.scala index 02f82d2670..336eef1979 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/StorageModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/StorageModel.scala @@ -52,7 +52,7 @@ final case class StorageModel( /** Tolerance for power comparisons. With very small (dis-)charging powers, * problems can occur when calculating the future tick at which storage is * full or empty. For sufficiently large time frames, the maximum Long value - * ([[Long.MaxValue]]) can be exceeded, thus the Long value overflows and we + * ([[Long.MaxValue]]) can be exceeded, thus the Long value overflows, and we * get undefined behavior. * * Thus, small (dis-)charging powers compared to storage capacity have to be 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 bffdd7fdae..b661d98948 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/WecModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/WecModel.scala @@ -146,7 +146,7 @@ final case class WecModel( ) } - /** The coefficient is dependent on the wind velocity v. Therefore use v to + /** The coefficient is dependent on the wind velocity v. Therefore, use v to * determine the betz coefficient cₚ. * * @param windVelocity 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 25504c2fff..391d4bca7c 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 @@ -50,7 +50,7 @@ sealed trait QControl { ): Power => ReactivePower } -/** Object to create a [[QControl]]. Currently the following QControls +/** Object to create a [[QControl]]. Currently, the following QControls * characteristics are supported. * - cosine-Phi-Fixed * - cosine-Phi(P) 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 4092a2850f..a31a217eb0 100644 --- a/src/main/scala/edu/ie3/simona/service/weather/WeatherService.scala +++ b/src/main/scala/edu/ie3/simona/service/weather/WeatherService.scala @@ -269,7 +269,7 @@ final case class WeatherService( serviceStateData case _ => - // actor is not registered and we don't have data for it + // actor is not registered, and we don't have data for it // inform the agentToBeRegistered that the registration failed as we don't have data for it agentToBeRegistered ! RegistrationFailedMessage(self) serviceStateData @@ -303,7 +303,7 @@ final case class WeatherService( // get the weather and send it to the subscribed agents // no sanity check needed here as we can assume that we always have weather available - // when we announce it. Otherwise the registration would have failed already! + // when we announce it. Otherwise, the registration would have failed already! updatedStateData.weatherSource .getWeather(tick, updatedStateData.weightedWeatherCoordinates) .foreach { case coordinate -> weatherResult => 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 fbc5af9c1f..8cf874a885 100644 --- a/src/main/scala/edu/ie3/simona/service/weather/WeatherSource.scala +++ b/src/main/scala/edu/ie3/simona/service/weather/WeatherSource.scala @@ -165,7 +165,7 @@ trait WeatherSource { val weightMap = nearestCoordinates .map(coordinateDistance => { /* Maybe some words on the calculus of the weight here: We intend to have a weight, that linear increases - * from zero to one, the closer the coordinate is to the coordinate in question. Therefore we calculate the + * from zero to one, the closer the coordinate is to the coordinate in question. Therefore, we calculate the * proximity of each node as a linear function between 1 at 0m distance to the questioned coordinate to zero * at the sum of all coordinates' distances (1 - d / d_sum). However, summing up this proximity over all * n coordinates brings n*1 from the left part of the sum and -1 as the sum of all distances shares. diff --git a/src/main/scala/edu/ie3/simona/util/ResultFileHierarchy.scala b/src/main/scala/edu/ie3/simona/util/ResultFileHierarchy.scala index 0212ad124e..3c1028be2b 100644 --- a/src/main/scala/edu/ie3/simona/util/ResultFileHierarchy.scala +++ b/src/main/scala/edu/ie3/simona/util/ResultFileHierarchy.scala @@ -28,7 +28,7 @@ import scala.jdk.OptionConverters.RichOptional /** Represents the output directory where the results will be materialized. If * new directories are added please remember to add them to the dirsToBeCreated - * Vector if they should be created. Otherwise they will not be created! + * Vector if they should be created. Otherwise, they will not be created! * * @version 0.1 * @since 12.01.20 diff --git a/src/main/scala/edu/ie3/util/scala/ReflectionTools.scala b/src/main/scala/edu/ie3/util/scala/ReflectionTools.scala index 6ed62dc580..be6df1b955 100644 --- a/src/main/scala/edu/ie3/util/scala/ReflectionTools.scala +++ b/src/main/scala/edu/ie3/util/scala/ReflectionTools.scala @@ -47,7 +47,7 @@ object ReflectionTools { * @tparam A * type of the object * @return - * a map containing the field method and it's value of the object instance + * a map containing the field method, and it's value of the object instance */ def classFieldToVal[A](a: A)(implicit tt: TypeTag[A], 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 e63ec421f5..82ed0b58bc 100644 --- a/src/main/scala/edu/ie3/util/scala/quantities/SpecificHeatCapacity.scala +++ b/src/main/scala/edu/ie3/util/scala/quantities/SpecificHeatCapacity.scala @@ -45,7 +45,7 @@ final class SpecificHeatCapacity private ( ) /** Calculates the Energy of a medium with a given specific heat capacity - * based on the temperature delta and it's volume. + * based on the temperature delta, and it's volume. * @param temperatureA * First temperature of the medium (e.g. inlet temperature) * @param temperatureB 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 59a32256d2..8d23af9c46 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmCenGridSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/DBFSAlgorithmCenGridSpec.scala @@ -41,8 +41,8 @@ import scala.language.postfixOps * be able to do if the DBFSAlgorithm is used. The scheduler, the weather * service as well as the inferior and superior [[GridAgent]] s are simulated * by the TestKit. By now this test does NOT cover interactions with generation - * or load asset agents due to unavailability during test development. Hence it - * would make sense to extend this test in the future to include asset agent + * or load asset agents due to unavailability during test development. Hence, + * it would make sense to extend this test in the future to include asset agent * interaction or cover this behaviour by another (integration) test! */ class DBFSAlgorithmCenGridSpec diff --git a/src/test/scala/edu/ie3/simona/integration/common/IntegrationSpecCommon.scala b/src/test/scala/edu/ie3/simona/integration/common/IntegrationSpecCommon.scala index eeb0804f77..f98abfd663 100644 --- a/src/test/scala/edu/ie3/simona/integration/common/IntegrationSpecCommon.scala +++ b/src/test/scala/edu/ie3/simona/integration/common/IntegrationSpecCommon.scala @@ -10,7 +10,7 @@ trait IntegrationSpecCommon { /* ATTENTION: Do not change this file to a path within "input". If you come to this point because the CI * or some of your tests are failing you very likely have altered the vn_simona.conf. This config although - * is NOT meant to be altered. Instead you should always use a delta config and only override the values and + * is NOT meant to be altered. Instead, you should always use a delta config and only override the values and * files of vn_simona/vn_simona.conf. Delta configs can be created by including the config you want to change * parameters from via include (e.g. include "input/samples/vn_simona/vn_simona.conf") at the * beginning of your config file and then just override the parameters you want to change! */ diff --git a/src/test/scala/edu/ie3/simona/model/em/ProportionalFlexStratSpec.scala b/src/test/scala/edu/ie3/simona/model/em/ProportionalFlexStratSpec.scala index 4a4834fff9..2a90b1432d 100644 --- a/src/test/scala/edu/ie3/simona/model/em/ProportionalFlexStratSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/em/ProportionalFlexStratSpec.scala @@ -43,7 +43,7 @@ class ProportionalFlexStratSpec * * Specifically, we use 40% of the flex potential 2 kW - 1 kW = 1 kW of * the first unit and 40% of the flex potential 4 kW - 0 kW = 4 kW of the - * second unit. Thus we arrive at 1 kW + 40% * 1 kW = 1.4 kW for the + * second unit. Thus, we arrive at 1 kW + 40% * 1 kW = 1.4 kW for the * first unit and 0 kW + 40% * 4 kW = 1.6 kW for the second unit. */ From 1cb082409561029fedc0695c0dad6845dfdca405 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 09:45:12 +0100 Subject: [PATCH 34/46] provide a second dot for all e.g. --- src/main/scala/edu/ie3/simona/agent/grid/GridAgent.scala | 2 +- .../edu/ie3/simona/agent/participant/ParticipantAgent.scala | 4 ++-- .../agent/participant/ParticipantAgentFundamentals.scala | 4 ++-- .../simona/agent/participant/evcs/EvcsAgentFundamentals.scala | 2 +- .../fixedfeedin/FixedFeedInAgentFundamentals.scala | 2 +- .../simona/agent/participant/load/LoadAgentFundamentals.scala | 2 +- .../ie3/simona/agent/participant/pv/PvAgentFundamentals.scala | 2 +- .../simona/agent/participant/wec/WecAgentFundamentals.scala | 2 +- .../ie3/simona/agent/participant/ParticipantAgentMock.scala | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) 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 f02d7c36b1..c9bca30ce1 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/GridAgent.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/GridAgent.scala @@ -57,7 +57,7 @@ object GridAgent extends DBFSAlgorithm { // val initialization val resolution: Long = simonaConfig.simona.powerflow.resolution.get( ChronoUnit.SECONDS - ) // this determines the agents regular time bin it wants to be triggered e.g one hour + ) // this determines the agents regular time bin it wants to be triggered e.g. one hour val simStartTime: ZonedDateTime = TimeUtil.withDefaults .toZonedDateTime(simonaConfig.simona.time.startDateTime) 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 56f992b0f8..d04e6b5154 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgent.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgent.scala @@ -493,7 +493,7 @@ abstract class ParticipantAgent[ * @param simulationEndDate * Real world time date time, when the simulation ends * @param resolution - * Agents regular time bin it wants to be triggered e.g one hour + * Agents regular time bin it wants to be triggered e.g. one hour * @param requestVoltageDeviationThreshold * Threshold, after which two nodal voltage magnitudes from participant * power requests for the same tick are considered to be different @@ -533,7 +533,7 @@ abstract class ParticipantAgent[ * @param simulationEndDate * Real world time date time, when the simulation ends * @param resolution - * Agents regular time bin it wants to be triggered e.g one hour + * Agents regular time bin it wants to be triggered e.g. one hour * @param requestVoltageDeviationThreshold * Threshold, after which two nodal voltage magnitudes from participant * power requests for the same tick are considered to be different 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 3435057ae0..949fb76f18 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentals.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentals.scala @@ -157,7 +157,7 @@ protected trait ParticipantAgentFundamentals[ * @param simulationEndDate * Real world time date time, when the simulation ends * @param resolution - * Agents regular time bin it wants to be triggered e.g one hour + * Agents regular time bin it wants to be triggered e.g. one hour * @param requestVoltageDeviationThreshold * Threshold, after which two nodal voltage magnitudes from participant * power requests for the same tick are considered to be different @@ -244,7 +244,7 @@ protected trait ParticipantAgentFundamentals[ * @param simulationEndDate * Real world time date time, when the simulation ends * @param resolution - * Agents regular time bin it wants to be triggered e.g one hour + * Agents regular time bin it wants to be triggered e.g. one hour * @param requestVoltageDeviationThreshold * Threshold, after which two nodal voltage magnitudes from participant * power requests for the same tick are considered to be different 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 69b072e55b..8894a511ff 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 @@ -96,7 +96,7 @@ protected trait EvcsAgentFundamentals * @param simulationEndDate * Real world time date time, when the simulation ends * @param resolution - * Agents regular time bin it wants to be triggered e.g one hour + * Agents regular time bin it wants to be triggered e.g. one hour * @param requestVoltageDeviationThreshold * Threshold, after which two nodal voltage magnitudes from participant * power requests for the same tick are considered to be different 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 da81883206..233246ca81 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 @@ -92,7 +92,7 @@ protected trait FixedFeedInAgentFundamentals * @param simulationEndDate * Real world time date time, when the simulation ends * @param resolution - * Agents regular time bin it wants to be triggered e.g one hour + * Agents regular time bin it wants to be triggered e.g. one hour * @param requestVoltageDeviationThreshold * Threshold, after which two nodal voltage magnitudes from participant * power requests for the same tick are considered to be different 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 48818d1477..7de29efddf 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 @@ -103,7 +103,7 @@ protected trait LoadAgentFundamentals[LD <: LoadRelevantData, LM <: LoadModel[ * @param simulationEndDate * Real world time date time, when the simulation ends * @param resolution - * Agents regular time bin it wants to be triggered e.g one hour + * Agents regular time bin it wants to be triggered e.g. one hour * @param requestVoltageDeviationThreshold * Threshold, after which two nodal voltage magnitudes from participant * power requests for the same tick are considered to be different 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 d1e441e4b4..52f0a76e24 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 @@ -94,7 +94,7 @@ protected trait PvAgentFundamentals * @param simulationEndDate * Real world time date time, when the simulation ends * @param resolution - * Agents regular time bin it wants to be triggered e.g one hour + * Agents regular time bin it wants to be triggered e.g. one hour * @param requestVoltageDeviationThreshold * Threshold, after which two nodal voltage magnitudes from participant * power requests for the same tick are considered to be different 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 9edf6f2ae8..5b43263925 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 @@ -89,7 +89,7 @@ protected trait WecAgentFundamentals * @param simulationEndDate * Real world time date time, when the simulation ends * @param resolution - * Agents regular time bin it wants to be triggered e.g one hour + * Agents regular time bin it wants to be triggered e.g. one hour * @param requestVoltageDeviationThreshold * Threshold, after which two nodal voltage magnitudes from participant * power requests for the same tick are considered to be different 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 300bfb7e79..4224fc3ff4 100644 --- a/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentMock.scala +++ b/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentMock.scala @@ -175,7 +175,7 @@ class ParticipantAgentMock( * @param simulationEndDate * Real world time date time, when the simulation ends * @param resolution - * Agents regular time bin it wants to be triggered e.g one hour + * Agents regular time bin it wants to be triggered e.g. one hour * @param requestVoltageDeviationThreshold * Threshold, after which two nodal voltage magnitudes from participant * power requests for the same tick are considered to be different From f8c0b342e568b203713bd4acd0a809e10618629a Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 09:36:14 +0100 Subject: [PATCH 35/46] add some hyphens --- docs/readthedocs/models/load_model.md | 2 +- .../edu/ie3/simona/agent/grid/PowerFlowSupport.scala | 2 +- .../ie3/simona/agent/participant/ParticipantAgent.scala | 2 +- .../agent/participant/ParticipantAgentFundamentals.scala | 6 +++--- .../agent/participant/load/LoadAgentFundamentals.scala | 4 ++-- src/main/scala/edu/ie3/simona/model/SystemComponent.scala | 2 +- src/main/scala/edu/ie3/simona/model/grid/LineModel.scala | 2 +- src/main/scala/edu/ie3/simona/model/grid/NodeModel.scala | 2 +- .../scala/edu/ie3/simona/model/grid/SwitchModel.scala | 2 +- .../edu/ie3/simona/model/grid/Transformer3wModel.scala | 2 +- .../edu/ie3/simona/model/grid/TransformerModel.scala | 2 +- .../scala/edu/ie3/simona/model/participant/BMModel.scala | 4 ++-- .../ie3/simona/model/participant/FixedFeedInModel.scala | 2 +- .../scala/edu/ie3/simona/model/participant/HpModel.scala | 2 +- .../ie3/simona/model/participant/SystemParticipant.scala | 2 +- .../scala/edu/ie3/simona/model/participant/WecModel.scala | 2 +- .../edu/ie3/simona/model/participant/evcs/EvcsModel.scala | 2 +- .../simona/model/participant/load/FixedLoadModel.scala | 2 +- .../model/participant/load/profile/LoadProfileStore.scala | 6 +++--- .../model/participant/load/profile/ProfileLoadModel.scala | 2 +- .../model/participant/load/profile/TypeDayProfile.scala | 4 ++-- .../model/participant/load/random/RandomLoadModel.scala | 2 +- .../participant/load/random/RandomLoadParamStore.scala | 4 ++-- .../model/participant/load/random/TypeDayParameters.scala | 8 ++++---- .../scala/edu/ie3/simona/model/thermal/ThermalHouse.scala | 2 +- .../scala/edu/ie3/simona/model/thermal/ThermalSink.scala | 2 +- .../edu/ie3/simona/model/thermal/ThermalStorage.scala | 2 +- src/main/scala/edu/ie3/simona/sim/setup/SetupHelper.scala | 2 +- .../scala/edu/ie3/util/scala/quantities/Irradiance.scala | 2 +- .../scala/edu/ie3/util/scala/quantities/Irradiation.scala | 2 +- .../simona/agent/participant/ParticipantAgentMock.scala | 2 +- .../model/participant/load/LoadProfileStoreSpec.scala | 8 ++++---- .../model/participant/load/RandomLoadModelSpec.scala | 2 +- 33 files changed, 47 insertions(+), 47 deletions(-) diff --git a/docs/readthedocs/models/load_model.md b/docs/readthedocs/models/load_model.md index be2046d717..798a8b5e97 100644 --- a/docs/readthedocs/models/load_model.md +++ b/docs/readthedocs/models/load_model.md @@ -132,7 +132,7 @@ F_t = -3.92 \cdot 10^{-10} \cdot t^4 + 3.2 \cdot 10^{-7} \cdot t + 1.24 $$ -The factor $F_t$, after calculation, shall be rounded to four decimal places. After multiplication with the profile value for given quarter hour, the result should again be rounded to one decimal place. +The factor $F_t$, after calculation, shall be rounded to four decimal places. After multiplication with the profile value for given quarter-hour, the result should again be rounded to one decimal place. #### Maximum value 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 50a785af8d..c43700466c 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/PowerFlowSupport.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/PowerFlowSupport.scala @@ -369,7 +369,7 @@ trait PowerFlowSupport { * from a [[ValidNewtonRaphsonPFResult]] * * @param validResult - * the result that should be converted to a human readable debug string + * the result that should be converted to a human-readable debug string * @param gridModel * the grid model this result comes from * @return 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 d04e6b5154..19eff90211 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgent.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgent.scala @@ -835,7 +835,7 @@ abstract class ParticipantAgent[ )(implicit outputConfig: NotifierConfig): Unit /** Abstract definition to clean up agent value stores after power flow - * convergence. This is necessary for agents whose results are time dependent + * convergence. This is necessary for agents whose results are time-dependent * e.g. storage agents * * @param baseStateData 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 949fb76f18..5c1c484163 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentals.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/ParticipantAgentFundamentals.scala @@ -368,7 +368,7 @@ protected trait ParticipantAgentFundamentals[ operationStart: Long, operationEnd: Long, ): SortedSet[Long] = { - /* The profile load model holds values in the specified resolution (e.g. for each full quarter hour (00:00, + /* 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 * determine, what the first tick is, in which profile information do exist */ val firstProfileTick = @@ -1245,7 +1245,7 @@ protected trait ParticipantAgentFundamentals[ nodalVoltage, lastNodalVoltage, ).getOrElse { - /* If a fast reply is not possible, determine it the old fashioned way */ + /* If a fast reply is not possible, determine it the old-fashioned way */ determineReply( requestTick, baseStateData, @@ -1852,7 +1852,7 @@ protected trait ParticipantAgentFundamentals[ } /** To clean up agent value stores after power flow convergence. This is - * necessary for agents whose results are time dependent e.g. storage agents + * necessary for agents whose results are time-dependent e.g. storage agents * * @param baseStateData * Basic state data 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 7de29efddf..f7cb1d695e 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 @@ -147,8 +147,8 @@ protected trait LoadAgentFundamentals[LD <: LoadRelevantData, LM <: LoadModel[ /* As participant agents always return their last known operation point on request, it is sufficient * to let a fixed load model determine its operation point on: * 1) The first tick of the simulation - * 2) The tick, it turns on (in time dependent operation) - * 3) The tick, it turns off (in time dependent operation) + * 2) The tick, it turns on (in time-dependent operation) + * 3) The tick, it turns off (in time-dependent operation) * Coinciding ticks are summarized and the last tick is removed, as the change in operation status * doesn't affect anything then */ SortedSet[Long]( diff --git a/src/main/scala/edu/ie3/simona/model/SystemComponent.scala b/src/main/scala/edu/ie3/simona/model/SystemComponent.scala index 6553faab08..efc70ba0cf 100644 --- a/src/main/scala/edu/ie3/simona/model/SystemComponent.scala +++ b/src/main/scala/edu/ie3/simona/model/SystemComponent.scala @@ -28,7 +28,7 @@ import scala.util.{Failure, Success, Try} * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operationInterval * Interval, in which the system is in operation */ 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 60a2621630..7c643a2298 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/LineModel.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/LineModel.scala @@ -28,7 +28,7 @@ import java.util.UUID * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operationInterval * Interval, in which the system is in operation * @param nodeAUuid 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 506ea804a1..af26beb12b 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/NodeModel.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/NodeModel.scala @@ -23,7 +23,7 @@ import java.util.UUID * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operationInterval * Interval, in which the system is in operation * @param isSlack 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 5a5a457a5f..8a947e9ee0 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/SwitchModel.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/SwitchModel.scala @@ -22,7 +22,7 @@ import scala.util.{Failure, Success, Try} * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operationInterval * Interval, in which the system is in operation * @param nodeAUuid 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 8f61c2a897..46ce7f3e44 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/Transformer3wModel.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/Transformer3wModel.scala @@ -49,7 +49,7 @@ import scala.math.BigDecimal.RoundingMode * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operationInterval * Interval, in which the system is in operation * @param hvNodeUuid 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 ee03ef837a..81682693fc 100644 --- a/src/main/scala/edu/ie3/simona/model/grid/TransformerModel.scala +++ b/src/main/scala/edu/ie3/simona/model/grid/TransformerModel.scala @@ -33,7 +33,7 @@ import scala.math.BigDecimal.RoundingMode * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operationInterval * Interval, in which the system is in operation * @param hvNodeUuid 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 19fbe3e601..e1c9ed715a 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/BMModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/BMModel.scala @@ -94,7 +94,7 @@ final case class BMModel( applyLoadGradient(pEl) } - /** Calculates first time dependent factor for heat demand + /** Calculates first time-dependent factor for heat demand * @param time * the time * @return @@ -114,7 +114,7 @@ final case class BMModel( } } - /** Calculates second time dependent factor for heat demand + /** Calculates second time-dependent factor for heat demand * @param time * the time * @return 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 dbda236e4c..d5cd82c731 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/FixedFeedInModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/FixedFeedInModel.scala @@ -29,7 +29,7 @@ import java.util.UUID * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operationInterval * Interval, in which the system is in operation * @param qControl 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 bf26b80fd8..993bc276c4 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -34,7 +34,7 @@ import java.util.UUID * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operationInterval * Interval, in which the system is in operation * @param qControl 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 44c70539d7..f245923356 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/SystemParticipant.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/SystemParticipant.scala @@ -30,7 +30,7 @@ import java.util.UUID * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operationInterval * Interval, in which the system is in operation * @param qControl 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 b661d98948..4ecc4e5b5b 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/WecModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/WecModel.scala @@ -41,7 +41,7 @@ import scala.collection.SortedSet * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operationInterval * Interval, in which the system is in operation * @param qControl 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 b703304893..f0a6a34988 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 @@ -47,7 +47,7 @@ import scala.collection.immutable.SortedSet * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operationInterval * Interval, in which the system is in operation * @param simulationStartDate 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 d1ab4bd657..cc4bc82c65 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 @@ -28,7 +28,7 @@ import java.util.UUID * @param uuid * unique identifier * @param id - * human readable id + * human-readable id * @param operationInterval * Interval, in which the system is in operation * @param qControl 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 f1e7d54f62..63e4a0d4a5 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 @@ -45,7 +45,7 @@ class LoadProfileStore private (val reader: Reader) { ) /** Returns the load profiles entry (average power consumption for the - * following quarter hour) for given time and load profile. + * following quarter-hour) for given time and load profile. * * @param time * the requested time @@ -77,7 +77,7 @@ class LoadProfileStore private (val reader: Reader) { } } - /** Returns the maximum average power consumption per quarter hour for a given + /** Returns the maximum average power consumption per quarter-hour for a given * load profile, calculated over all seasons and weekday types of given load * profile * @@ -171,7 +171,7 @@ object LoadProfileStore extends LazyLogging { val headerKeys: util.List[String] = parser.getHeaderNames - // skip last column "quarter hour" + // skip last column "quarter-hour" (for (i <- Range(0, headerKeys.size() - 1)) yield { val headerKey = headerKeys.get(i) val profileKey = LoadProfileKey(headerKey) 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 5e919a0064..e94f50867f 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 @@ -25,7 +25,7 @@ import java.util.UUID * @param uuid * unique identifier * @param id - * human readable id + * human-readable id * @param operationInterval * Interval, in which the system is in operation * @param qControl diff --git a/src/main/scala/edu/ie3/simona/model/participant/load/profile/TypeDayProfile.scala b/src/main/scala/edu/ie3/simona/model/participant/load/profile/TypeDayProfile.scala index dd2fcb6a18..22358772b1 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/load/profile/TypeDayProfile.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/load/profile/TypeDayProfile.scala @@ -26,8 +26,8 @@ final case class TypeDayProfile(private val values: Array[Double]) { "You may only instantiate type day parameters with 96 values." ) - /** Returns a value for given time. If time is not a 15 min step, it is - * rounded up to the next 15 min slice. + /** Returns a value for given time. If time is not a 15-min step, it is + * rounded up to the next 15-min slice. * * @param time * the time 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 a09e9bc8ff..4409d62cf2 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 @@ -33,7 +33,7 @@ import scala.util.Random * @param uuid * unique identifier * @param id - * human readable id + * human-readable id * @param operationInterval * Interval, in which the system is in operation * @param qControl 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 195b40a4a3..33fb57a38a 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 @@ -105,7 +105,7 @@ case object RandomLoadParamStore extends LazyLogging { } catch { case e: FileIOException => throw new FileIOException( - s"Cannot determine random load parameters for day type '$dayType' and quarter hour '$quartHour'", + s"Cannot determine random load parameters for day type '$dayType' and quarter-hour '$quartHour'", e, ) } @@ -115,7 +115,7 @@ case object RandomLoadParamStore extends LazyLogging { case (_, quarterHour, randomLoadParameters) => (quarterHour, randomLoadParameters) } // Group entries by day type - .map { // For each day type, sort the parameters by quarter hour and build a type day parameter object from it + .map { // For each day type, sort the parameters by quarter-hour and build a type day parameter object from it case (dayType, quarterHourToParameters) => dayType -> TypeDayParameters( quarterHourToParameters.sortBy(_._1).map(_._2).toArray diff --git a/src/main/scala/edu/ie3/simona/model/participant/load/random/TypeDayParameters.scala b/src/main/scala/edu/ie3/simona/model/participant/load/random/TypeDayParameters.scala index 36360ff600..57210c68b2 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/load/random/TypeDayParameters.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/load/random/TypeDayParameters.scala @@ -12,8 +12,8 @@ import edu.ie3.simona.model.participant.load.DayType import edu.ie3.util.TimeUtil /** Stores a slice of random load parameters, that comprises a whole day (96 - * quarter hours). The data describes a typical day, that can unequivocally be - * identified by it's [[DayType]]. + * quarter-hours). The data describes a typical day, that can unequivocally be + * identified by its [[DayType]]. * * @param values * 96 quarter-hour values for this day type @@ -26,8 +26,8 @@ final case class TypeDayParameters( s"You may only instantiate type day parameters with 96 values. Apparent: ${values.length}." ) - /** Returns a value for given time. If time is not a 15 min step, it is - * rounded up to the next 15 min slice. + /** Returns a value for given time. If time is not a 15-min step, it is + * rounded up to the next 15-min slice. * * @param time * the time 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 71e992c4e0..ae933f3f03 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala @@ -37,7 +37,7 @@ import java.util.UUID * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operatorInput * Operator input * @param operationTime 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 97661b0201..2b70983c73 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalSink.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalSink.scala @@ -17,7 +17,7 @@ import edu.ie3.datamodel.models.input.thermal.ThermalBusInput * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operatorInput * Operator input * @param operationTime 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 5886a4e7f8..c7818351b6 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalStorage.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalStorage.scala @@ -19,7 +19,7 @@ import java.util.UUID * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operatorInput * Operator input * @param operationTime 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 751dd3fad3..d5b21a99a7 100644 --- a/src/main/scala/edu/ie3/simona/sim/setup/SetupHelper.scala +++ b/src/main/scala/edu/ie3/simona/sim/setup/SetupHelper.scala @@ -37,7 +37,7 @@ trait SetupHelper extends LazyLogging { /** Build the [[GridAgentInitData]]. This also includes the determination of a * mapping from [[SubGridGate]] to [[ActorRef]] of the representing - * [[edu.ie3.simona.agent.grid.GridAgent]] as well as the look up of the + * [[edu.ie3.simona.agent.grid.GridAgent]] as well as the look-up of the * [[RefSystem]] to use being defined in the config. * * @param subGridContainer diff --git a/src/main/scala/edu/ie3/util/scala/quantities/Irradiance.scala b/src/main/scala/edu/ie3/util/scala/quantities/Irradiance.scala index 2ad522980e..7476cbe225 100644 --- a/src/main/scala/edu/ie3/util/scala/quantities/Irradiance.scala +++ b/src/main/scala/edu/ie3/util/scala/quantities/Irradiance.scala @@ -31,7 +31,7 @@ final class Irradiance private (val value: Double, val unit: IrradianceUnit) def *(that: Area): Power = Watts( this.toWattsPerSquareMeter * that.toSquareMeters ) - // the Hours(1).toSeconds is to convert watt hours to watt seconds which + // the Hours(1).toSeconds is to convert watt-hours to watt-seconds which // isn't a normal supported type in Squants def *(that: AreaTime): Energy = WattHours( this.toWattsPerSquareMeter * that.toSquareMeterSeconds / Hours(1).toSeconds diff --git a/src/main/scala/edu/ie3/util/scala/quantities/Irradiation.scala b/src/main/scala/edu/ie3/util/scala/quantities/Irradiation.scala index 5b685fde7e..306d2c11f5 100644 --- a/src/main/scala/edu/ie3/util/scala/quantities/Irradiation.scala +++ b/src/main/scala/edu/ie3/util/scala/quantities/Irradiation.scala @@ -22,7 +22,7 @@ final class Irradiation private (val value: Double, val unit: IrradiationUnit) def *(that: Area): Energy = WattHours( this.toWattHoursPerSquareMeter * that.toSquareMeters ) - // the Hours(1).toSeconds is to convert watt hours to watt seconds which + // the Hours(1).toSeconds is to convert watt-hours to watt-seconds which // isn't a normal supported type in Squants def /(that: Time): Irradiance = WattsPerSquareMeter( 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 4224fc3ff4..8087993f01 100644 --- a/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentMock.scala +++ b/src/test/scala/edu/ie3/simona/agent/participant/ParticipantAgentMock.scala @@ -311,7 +311,7 @@ class ParticipantAgentMock( FixedRelevantData /** To clean up agent value stores after power flow convergence. This is - * necessary for agents whose results are time dependent e.g. storage agents + * necessary for agents whose results are time-dependent e.g. storage agents * @param baseStateData * Basic state data * @param currentTick 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 64701fa993..358da83a31 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 @@ -49,22 +49,22 @@ class LoadProfileStoreSpec "2019-04-01T05:00:00+02:00[Europe/Berlin]", L0, 55.6d, - ), // Weekday, transitional, 20th quarter hour + ), // Weekday, transitional, 20th quarter-hour ( "2019-06-02T00:00:00+02:00[Europe/Berlin]", G0, 68.8d, - ), // Sunday, summer, 0th quarter hour + ), // Sunday, summer, 0th quarter-hour ( "2019-01-05T02:15:00+01:00[Europe/Berlin]", H0, 52.8d, - ), // Saturday, winter, 9th quarter hour, 5th day -> dynamization factor 1.2473 + ), // 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 + ), // Sunday, summer, 4th quarter-hour, 202nd day -> dynamization factor 0.7847 ) forAll(params) { 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 82fa1041e5..08457fc4c8 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 @@ -112,7 +112,7 @@ class RandomLoadModelSpec extends UnitSpec with TableDrivenPropertyChecks { loadInput.getCosPhiRated, ActivePower(Watts(268.6)), ) - /* Working day, 61th quarter hour */ + /* Working day, 61st quarter-hour */ val queryDate = TimeUtil.withDefaults.toZonedDateTime("2019-07-19T15:21:00Z") val expectedParams = new RandomLoadParameters( From 06baf0526f1be3896cf72e3d6ae86107da5972cc Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 08:56:37 +0100 Subject: [PATCH 36/46] more grammar --- CHANGELOG.md | 2 +- docs/readthedocs/models/chp_model.md | 2 +- docs/readthedocs/models/cts_model.md | 2 +- .../ie3/simona/agent/grid/DBFSAlgorithm.scala | 28 +++++++++---------- .../ie3/simona/config/ConfigFailFast.scala | 8 +++--- .../simona/model/participant/ChpModel.scala | 2 +- .../simona/model/system/Characteristic.scala | 2 +- .../thermal/CylindricalThermalStorage.scala | 2 +- .../edu/ie3/simona/util/CollectionUtils.scala | 2 +- .../edu/ie3/simona/util/ConfigUtil.scala | 4 +-- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b683cd1327..04377de7c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -224,7 +224,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Support for three winding transformers [#63](https://github.com/ie3-institute/simona/issues/63) - Handle incoming slack voltage accordingly - Allow multiple sub grid gates at one node (also allows multiple two winding transformers at one node) - - Perform power flow calculation in highest grid, if a three winding transformer is apparent + - Perform power flow calculation in the highest grid, if a three winding transformer is apparent - Write out results - Fixed broken layout in RTD documentation [#500](https://github.com/ie3-institute/simona/issues/500) - Corrected tests in RefSystemTest [#560](https://github.com/ie3-institute/simona/issues/560) diff --git a/docs/readthedocs/models/chp_model.md b/docs/readthedocs/models/chp_model.md index c5f01364bf..d7eb8232eb 100644 --- a/docs/readthedocs/models/chp_model.md +++ b/docs/readthedocs/models/chp_model.md @@ -6,7 +6,7 @@ This page documents the functionality of the CHP Model (combined heat and power ## Assumptions -The CHP unit is able to operate either at full load or not at all. Uncovered heat demand of former time-steps is not considered in the following steps, as the CHP unit does not posses a memory. Losses of the heat storage are not considered. +The CHP unit is able to operate either at full load or not at all. Uncovered heat demand of former time-steps is not considered in the following steps, as the CHP unit does not possess a memory. Losses of the heat storage are not considered. ## Parameters diff --git a/docs/readthedocs/models/cts_model.md b/docs/readthedocs/models/cts_model.md index 5750820624..e03fa06563 100644 --- a/docs/readthedocs/models/cts_model.md +++ b/docs/readthedocs/models/cts_model.md @@ -3,7 +3,7 @@ This page documents the functionality of the cylindrical thermal storage available in SIMONA. ## Behaviour -This storage model operates on volumes, although the functions it provides for other models all operate with energy. Internally the storage model converts energy to volume and vice versa with formulas specified below. Furthermore it is assumed that the storage medium is water. Also the model holds a variable for the current storage level. +This storage model operates on volumes, although the functions it provides for other models all operate with energy. Internally the storage model converts energy to volume and vice versa with formulas specified below. Furthermore, it is assumed that the storage medium is water. Also, the model holds a variable for the current storage level. ## Attributes, Units and Remarks 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 5f21b06a39..a3d54a7d7a 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/DBFSAlgorithm.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/DBFSAlgorithm.scala @@ -197,7 +197,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { case None => // this happens if this agent is either a) the superior grid agent, because it will always get a request for // the next sweep, as it triggers calculations for the next sweep or b) at all other - // (non last downstream grid agents) in sweep 0 + // (non-last downstream grid agents) in sweep 0 ctx.log.debug( "Unable to find slack voltage for nodes '{}' in sweep '{}'. Try to get voltage of previous sweep.", nodeUuids, @@ -386,7 +386,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { // update the sweep value store and clear all received maps // note: normally it is expected that this has to be done after power flow calculations but for the sake - // of having it only once in the code we put this here. Otherwise it would have to been put before EVERY + // of having it only once in the code we put this here. Otherwise, it would have to be put before EVERY // return with a valid power flow result (currently happens already in two situations) val updatedGridAgentBaseData = if (stillPendingRequestAnswers.isEmpty) { @@ -955,13 +955,13 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { } } - /** Checks if all data has been received and if yes checks if the there are - * any failed power flow indications from inferior grids. If both == true, - * then no [[Behavior]] change is triggered but the sweep value store is - * updated with a [[FailedPowerFlow]] information as well, the now used data - * is set to [[PowerFlowDoneData]] and this is escalated to the superior - * grid(s). If there is no [[FailedPowerFlow]] in the [[GridAgentBaseData]] a - * behavior transition to [[handlePowerFlowCalculations]] is triggered. + /** Checks if all data has been received and if yes checks if there are any + * failed power flow indications from inferior grids. If both == true, then + * no [[Behavior]] change is triggered but the sweep value store is updated + * with a [[FailedPowerFlow]] information as well, the now used data is set + * to [[PowerFlowDoneData]] and this is escalated to the superior grid(s). If + * there is no [[FailedPowerFlow]] in the [[GridAgentBaseData]] a behavior + * transition to [[handlePowerFlowCalculations]] is triggered. * * If allReceived == false, no [[Behavior]] transition is triggered * @@ -1023,11 +1023,11 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { /** Normally only reached by the superior (dummy) agent! * - * Checks if all data has been received and if yes checks if the there are - * any failed power flow indications from inferior grids. If both == true, - * then a finish simulation is triggered and depending on the configuration - * this step is skipped and the simulation goes on or this leads to a - * termination of the simulation due to a failed power flow calculation. + * Checks if all data has been received and if yes checks if there are any + * failed power flow indications from inferior grids. If both == true, then a + * finish simulation is triggered and depending on the configuration this + * step is skipped and the simulation goes on or this leads to a termination + * of the simulation due to a failed power flow calculation. * * If there is no [[FailedPowerFlow]] in the [[GridAgentBaseData]] a * [[Behavior]] transition to [[checkPowerDifferences]] is triggered. diff --git a/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala b/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala index 3437944c78..8192814ae3 100644 --- a/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala +++ b/src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala @@ -314,8 +314,8 @@ case object ConfigFailFast extends LazyLogging { ) } - /** Check participants's basic runtime configurations, as well as in default - * as in individual configs. This comprises + /** Check participants' basic runtime configurations, as well as in default as + * in individual configs. This comprises * i.e. uuid and scaling factor */ private def checkBaseRuntimeConfigs( @@ -663,7 +663,7 @@ case object ConfigFailFast extends LazyLogging { } - /** Check the config sub tree for output parameterization + /** Check the config subtree for output parameterization * * @param subConfig * Output sub config tree for participants @@ -685,7 +685,7 @@ case object ConfigFailFast extends LazyLogging { checkIndividualOutputConfigs(subConfig.individualConfigs) } - /** Check the config sub tree for output parameterization + /** Check the config subtree for output parameterization * * @param subConfig * Output sub config tree for participants 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 5af1b68236..795c62c9f8 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/ChpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/ChpModel.scala @@ -31,7 +31,7 @@ import java.util.UUID * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operationInterval * Interval, in which the system is in operation * @param qControl 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 2088ca6cdc..e4b7758b8f 100644 --- a/src/main/scala/edu/ie3/simona/model/system/Characteristic.scala +++ b/src/main/scala/edu/ie3/simona/model/system/Characteristic.scala @@ -14,7 +14,7 @@ import squants.Quantity import scala.collection.SortedSet import scala.reflect.ClassTag -/** Describes a mapping of a x-y-pairs with possibility to interpolate the y +/** Describes a mapping of an x-y-pairs with possibility to interpolate the y * values based on the provided x value */ trait Characteristic[A <: Quantity[A], O <: Quantity[O]] { 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 fedea75204..8cde5ab086 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala @@ -40,7 +40,7 @@ import java.util.UUID * @param uuid * the element's uuid * @param id - * the element's human readable id + * the element's human-readable id * @param operatorInput * Operator input * @param operationTime diff --git a/src/main/scala/edu/ie3/simona/util/CollectionUtils.scala b/src/main/scala/edu/ie3/simona/util/CollectionUtils.scala index 6402ea7b2a..c5e2b45beb 100644 --- a/src/main/scala/edu/ie3/simona/util/CollectionUtils.scala +++ b/src/main/scala/edu/ie3/simona/util/CollectionUtils.scala @@ -98,7 +98,7 @@ object CollectionUtils { * smallest map key is provided. * * @param map - * containing containing the (k,v) pairs (e.g. x,y pairs) + * containing the (k,v) pairs (e.g. x,y pairs) * @param key * the key values are needed for * @return diff --git a/src/main/scala/edu/ie3/simona/util/ConfigUtil.scala b/src/main/scala/edu/ie3/simona/util/ConfigUtil.scala index f32b66ed5f..a91ff99924 100644 --- a/src/main/scala/edu/ie3/simona/util/ConfigUtil.scala +++ b/src/main/scala/edu/ie3/simona/util/ConfigUtil.scala @@ -73,7 +73,7 @@ object ConfigUtil { * participants config for faster access. * * @param subConfig - * Configuration sub tree for the behaviour of system participants + * Configuration subtree for the behaviour of system participants * @return * a matching config utility */ @@ -124,7 +124,7 @@ object ConfigUtil { * @param defaultConfig * Default config to use, when there is no specific one * @param configs - * Mapping from notifier identifier to it's notifier configuration + * Mapping from notifier identifier to its notifier configuration */ final case class OutputConfigUtil( private val defaultConfig: NotifierConfig, From a5bf81201622539a0815ea9a2bd1e05ff9615401 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 08:54:45 +0100 Subject: [PATCH 37/46] adding some commas --- src/main/scala/edu/ie3/simona/agent/grid/DBFSAlgorithm.scala | 4 ++-- .../simona/agent/participant/statedata/BaseStateData.scala | 2 +- .../simona/test/common/model/grid/BasicGridWithSwitches.scala | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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 a3d54a7d7a..f2fdc716f4 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/DBFSAlgorithm.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/DBFSAlgorithm.scala @@ -737,7 +737,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { gridAgentBaseData.powerFlowParams.sweepTimeout, )(ctx) - // when we don't have inferior grids and no assets both methods return None and we can skip doing another power + // when we don't have inferior grids and no assets both methods return None, and we can skip doing another power // flow calculation otherwise we go back to simulate grid and wait for the answers if (!askForAssetPowersOpt && !askForInferiorGridPowersOpt) { ctx.log.debug( @@ -832,7 +832,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { ) /* Regarding the power flow result of this grid, there are two cases. If this is the "highest" grid in a - * simulation without a three winding transformer, the grid consists of only one node and we can mock the power + * simulation without a three winding transformer, the grid consists of only one node, and we can mock the power * flow results. If there is a three winding transformer apparent, we actually have to perform power flow * calculations, as the high voltage branch of the transformer is modeled here. */ (if (gridModel.gridComponents.transformers3w.isEmpty) { 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 96758a2d16..9627ee1578 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 @@ -51,7 +51,7 @@ trait BaseStateData[+PD <: PrimaryDataWithApparentPower[PD]] */ val modelUuid: UUID - /** By default the agent should be triggered in the same tick, where data is + /** By default, the agent should be triggered in the same tick, where data is * incoming from primary or secondary sources. However, if there is no other * information needed, we might have the need to schedule ourselves for * activation triggers 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 bd709daa01..5781848e1b 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 @@ -20,7 +20,7 @@ import tech.units.indriya.quantity.Quantities import java.util.UUID -/** Note: the line parameters are NOT adapted. Instead the line params from +/** Note: the line parameters are NOT adapted. Instead, the line params from * [[FiveLinesWithNodes]] are used instead! * * {{{ From 2236f41ab982c77919a924e6c07be80f3a7e6d7a Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 08:52:30 +0100 Subject: [PATCH 38/46] using past participle --- .../scala/edu/ie3/simona/agent/grid/DBFSAlgorithm.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 f2fdc716f4..d0a23ea6da 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/DBFSAlgorithm.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/DBFSAlgorithm.scala @@ -1153,7 +1153,7 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { * @param askTimeout * a timeout for the request * @return - * true if this grids contains assets or false if no request has been send + * true if this grids contains assets or false if no request has been sent * due to non-existence of assets */ private def askForAssetPowers( @@ -1383,11 +1383,11 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport { } /** This method uses [[ActorContext.pipeToSelf()]] to send a future message to - * itself. If the future is a [[Success]] the message is send, else a - * [[WrappedFailure]] with the thrown error is send. + * itself. If the future is a [[Success]] the message is sent, else a + * [[WrappedFailure]] with the thrown error is sent. * * @param future - * future message that should be send to the agent after it was processed + * future message that should be sent to the agent after it was processed * @param ctx * [[ActorContext]] of the receiving actor */ From 601c1df597253081bd9a535ca6c3fd28f8393b63 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 10:42:09 +0100 Subject: [PATCH 39/46] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04377de7c8..8c26eb2c91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -132,6 +132,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed ThermalStorageResults having multiple entries [#924](https://github.com/ie3-institute/simona/issues/924) - Fix filter for thermal result checking for lastTick not for currentTick [#1008](https://github.com/ie3-institute/simona/issues/1008) - Fixed `CHANGELOG` entry for issue ([#103](https://github.com/ie3-institute/simona/issues/103)) [#941](https://github.com/ie3-institute/simona/issues/941) +- Fix grammar and spelling in docs and comments [#1022](https://github.com/ie3-institute/simona/issues/1022) ## [3.0.0] - 2023-08-07 From ee7fbcccaa565087bdc5a2486d20eed6d548ae02 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 12:54:42 +0100 Subject: [PATCH 40/46] use zeroKW and zeroKWH within thermal unit tests --- .../ThermalGridWithHouseAndStorageSpec.scala | 23 +++++++------- .../ThermalGridWithHouseOnlySpec.scala | 17 +++++----- .../ThermalGridWithStorageOnlySpec.scala | 31 ++++++++++--------- 3 files changed, 37 insertions(+), 34 deletions(-) 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 1ea45a656d..f2829532cd 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala @@ -13,6 +13,7 @@ import edu.ie3.simona.model.thermal.ThermalHouse.ThermalHouseThreshold.{ HouseTemperatureLowerBoundaryReached, HouseTemperatureUpperBoundaryReached, } +import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWH} import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageState import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageThreshold.{ StorageEmpty, @@ -103,15 +104,15 @@ class ThermalGridWithHouseAndStorageSpec testGridAmbientTemperature, ThermalGrid.startingState(thermalGrid), ) - houseDemand.required should approximate(KilowattHours(0d)) + houseDemand.required should approximate(zeroKWH) houseDemand.possible should approximate(KilowattHours(31.05009722d)) storageDemand.required should approximate(KilowattHours(1150d)) storageDemand.possible should approximate(KilowattHours(1150d)) updatedThermalGridState.houseState shouldBe Some( - ThermalHouseState(10800, Kelvin(292.0799935185185), Kilowatts(0d)) + ThermalHouseState(10800, Kelvin(292.0799935185185), zeroKW) ) updatedThermalGridState.storageState shouldBe Some( - ThermalStorageState(10800, KilowattHours(0d), Kilowatts(0d)) + ThermalStorageState(10800, zeroKWH, zeroKW) ) } @@ -136,10 +137,10 @@ class ThermalGridWithHouseAndStorageSpec storageDemand.required should approximate(KilowattHours(1150d)) storageDemand.possible should approximate(KilowattHours(1150d)) updatedThermalGridState.houseState shouldBe Some( - ThermalHouseState(10800, Celsius(15.959996296296296), Kilowatts(0d)) + ThermalHouseState(10800, Celsius(15.959996296296296), zeroKW) ) updatedThermalGridState.storageState shouldBe Some( - ThermalStorageState(10800, KilowattHours(0d), Kilowatts(0d)) + ThermalStorageState(10800, zeroKWH, zeroKW) ) } } @@ -159,7 +160,7 @@ class ThermalGridWithHouseAndStorageSpec storageState.copy(storedEnergy = initialLoading) ) ) - val externalQDot = Kilowatts(0d) + val externalQDot = zeroKW val (updatedGridState, reachedThreshold) = thermalGrid invokePrivate handleConsumption( @@ -216,7 +217,7 @@ class ThermalGridWithHouseAndStorageSpec ) => houseTick shouldBe 0L innerTemperature should approximate(Celsius(18.9999d)) - qDotHouse should approximate(Kilowatts(0d)) + qDotHouse should approximate(zeroKW) storageTick shouldBe 0L storedEnergy should approximate(initialLoading) @@ -228,7 +229,7 @@ class ThermalGridWithHouseAndStorageSpec } "revising infeed from storage to house" should { - val zeroInflux = Kilowatts(0d) + val zeroInflux = zeroKW val tick = 3600L val ambientTemperature = Celsius(14d) "hand back unaltered information if needed information is missing" in { @@ -371,7 +372,7 @@ class ThermalGridWithHouseAndStorageSpec ( ThermalStorageState( tick, - KilowattHours(0d), + zeroKWH, testGridQDotInfeed, ), Some(StorageEmpty(tick)), @@ -517,7 +518,7 @@ class ThermalGridWithHouseAndStorageSpec .getOrElse(fail("No initial storage state found")) ) - qDotStorage should approximate(Kilowatts(0d)) + qDotStorage should approximate(zeroKW) case _ => fail("Thermal grid state has been calculated wrong.") } @@ -554,7 +555,7 @@ class ThermalGridWithHouseAndStorageSpec ) => houseTick shouldBe 0L innerTemperature should approximate(Celsius(20.99999167d)) - qDotHouse should approximate(Kilowatts(0d)) + qDotHouse should approximate(zeroKW) storageTick shouldBe 0L storedEnergy should approximate( 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 eb447d0fc4..c0d6226694 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala @@ -13,6 +13,7 @@ import edu.ie3.simona.model.thermal.ThermalHouse.ThermalHouseThreshold.{ HouseTemperatureLowerBoundaryReached, HouseTemperatureUpperBoundaryReached, } +import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWH} import edu.ie3.simona.test.common.UnitSpec import squants.energy._ import squants.thermal.Celsius @@ -90,10 +91,10 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { houseDemand.required should approximate(expectedHouseDemand.required) houseDemand.possible should approximate(expectedHouseDemand.possible) - storageDemand.required should approximate(KilowattHours(0d)) - storageDemand.possible should approximate(KilowattHours(0d)) + storageDemand.required should approximate(zeroKWH) + storageDemand.possible should approximate(zeroKWH) updatedThermalGridState.houseState shouldBe Some( - ThermalHouseState(10800, Kelvin(292.0799935185185), Kilowatts(0d)) + ThermalHouseState(10800, Kelvin(292.0799935185185), zeroKW) ) updatedThermalGridState.storageState shouldBe None } @@ -108,7 +109,7 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { "deliver the house state by just letting it cool down, if just no infeed is given" in { val tick = 0L val gridState = ThermalGrid.startingState(thermalGrid) - val externalQDot = Megawatts(0d) + val externalQDot =zeroKW val (updatedGridState, reachedThreshold) = thermalGrid invokePrivate handleConsumption( @@ -154,7 +155,7 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { ) => tick shouldBe 0L innerTemperature should approximate(Celsius(18.9999d)) - qDot should approximate(Megawatts(0d)) + qDot should approximate(zeroKW) case _ => fail("Thermal grid state has been calculated wrong.") } reachedThreshold shouldBe Some( @@ -239,7 +240,7 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { ) => tick shouldBe 0L innerTemperature should approximate(Celsius(18.9999d)) - qDot should approximate(Megawatts(0d)) + qDot should approximate(zeroKW) thresholdTick shouldBe 154285L case _ => fail("Thermal grid state updated failed") } @@ -251,7 +252,7 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { ThermalGrid.startingState(thermalGrid), testGridAmbientTemperature, testGridAmbientTemperature, - Megawatts(0d), + zeroKW, ) match { case ( ThermalGridState( @@ -262,7 +263,7 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { ) => tick shouldBe 0L innerTemperature should approximate(Celsius(18.9999d)) - qDot should approximate(Kilowatts(0d)) + qDot should approximate(zeroKW) thresholdTick shouldBe 154285L case _ => fail("Thermal grid state updated failed") } 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 93a45e3180..9ef8dbb424 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithStorageOnlySpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithStorageOnlySpec.scala @@ -17,6 +17,7 @@ import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageThreshold.{ StorageFull, } import edu.ie3.simona.test.common.UnitSpec +import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWH} import squants.energy._ import squants.thermal.Celsius import squants.{Energy, Power, Temperature} @@ -88,13 +89,13 @@ class ThermalGridWithStorageOnlySpec ThermalGrid.startingState(thermalGrid), ) - houseDemand.required should approximate(KilowattHours(0d)) - houseDemand.possible should approximate(KilowattHours(0d)) + houseDemand.required should approximate(zeroKWH) + houseDemand.possible should approximate(zeroKWH) storageDemand.required should approximate(KilowattHours(1150d)) storageDemand.possible should approximate(KilowattHours(1150d)) updatedThermalGridState.houseState shouldBe None updatedThermalGridState.storageState shouldBe Some( - ThermalStorageState(10800, KilowattHours(0d), Kilowatts(0d)) + ThermalStorageState(10800, zeroKWH, zeroKW) ) } @@ -108,17 +109,17 @@ class ThermalGridWithStorageOnlySpec testGridAmbientTemperature, ThermalGridState( None, - Some(ThermalStorageState(0L, KilowattHours(575d), Kilowatts(0d))), + Some(ThermalStorageState(0L, KilowattHours(575d), zeroKW)), ), ) - houseDemand.required should approximate(KilowattHours(0d)) - houseDemand.possible should approximate(KilowattHours(0d)) - storageDemand.required should approximate(KilowattHours(0d)) + houseDemand.required should approximate(zeroKWH) + houseDemand.possible should approximate(zeroKWH) + storageDemand.required should approximate(zeroKWH) storageDemand.possible should approximate(KilowattHours(575d)) updatedThermalGridState.houseState shouldBe None updatedThermalGridState.storageState shouldBe Some( - ThermalStorageState(10800L, KilowattHours(575d), Kilowatts(0d)) + ThermalStorageState(10800L, KilowattHours(575d), zeroKW) ) } } @@ -138,7 +139,7 @@ class ThermalGridWithStorageOnlySpec ThermalStorageState( 0L, KilowattHours(200d), - Kilowatts(0d), + zeroKW, ) ) ) @@ -191,7 +192,7 @@ class ThermalGridWithStorageOnlySpec Some(ThermalStorageState(tick, storedEnergy, qDot)), ) => tick shouldBe 0L - storedEnergy should approximate(KilowattHours(0d)) + storedEnergy should approximate(zeroKWH) qDot should approximate(testGridQDotInfeed) case _ => fail("Thermal grid state has been calculated wrong.") } @@ -217,7 +218,7 @@ class ThermalGridWithStorageOnlySpec Some(ThermalStorageState(tick, storedEnergy, qDot)), ) => tick shouldBe 0L - storedEnergy should approximate(KilowattHours(0d)) + storedEnergy should approximate(zeroKWH) qDot should approximate(testGridQDotInfeed) case _ => fail("Thermal grid state updated failed") } @@ -233,7 +234,7 @@ class ThermalGridWithStorageOnlySpec ThermalStorageState( 0L, KilowattHours(200d), - Kilowatts(0d), + zeroKW, ) ) ), @@ -262,7 +263,7 @@ class ThermalGridWithStorageOnlySpec ThermalGrid.startingState(thermalGrid), testGridAmbientTemperature, testGridAmbientTemperature, - Kilowatts(0d), + zeroKW, ) updatedState match { case ( @@ -273,8 +274,8 @@ class ThermalGridWithStorageOnlySpec None, ) => tick shouldBe 0L - storedEnergy should approximate(KilowattHours(0d)) - qDot should approximate(Megawatts(0d)) + storedEnergy should approximate(zeroKWH) + qDot should approximate(zeroKW) case _ => fail("Thermal grid state updated failed") } From bb2f81027a092441a1e9d7a8ce2ea25e11bfeaad Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 12:58:05 +0100 Subject: [PATCH 41/46] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b683cd1327..4a3acbb5d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -97,6 +97,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rewrote StorageModelTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646) - Updated `ExtEvSimulationClasses` [#898](https://github.com/ie3-institute/simona/issues/898) - Refactoring of `ThermalGrid.energyGrid` to distinguish between demand of house and storage [#928](https://github.com/ie3-institute/simona/issues/928) +- Refactoring to use zeroKW and zeroKWH in thermal grid unit tests [#1023](https://github.com/ie3-institute/simona/issues/1023) ### Fixed - Fix rendering of references in documentation [#505](https://github.com/ie3-institute/simona/issues/505) From 86fcf1ee5976ff984bb7c6b0929f2369ead3f88c Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 12:58:16 +0100 Subject: [PATCH 42/46] fmt --- .../ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c0d6226694..d50b1e558a 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala @@ -109,7 +109,7 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { "deliver the house state by just letting it cool down, if just no infeed is given" in { val tick = 0L val gridState = ThermalGrid.startingState(thermalGrid) - val externalQDot =zeroKW + val externalQDot = zeroKW val (updatedGridState, reachedThreshold) = thermalGrid invokePrivate handleConsumption( From 6892b01ba800ec4715ef852bc16dc3c3c6ff5fcb Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 13:27:36 +0100 Subject: [PATCH 43/46] refactoring zeroKWH to zeroKWh and zeroMWH to zeroMWh --- .../simona/model/participant/ChpModel.scala | 8 ++++---- .../simona/model/participant/HpModel.scala | 2 +- .../model/participant/StorageModel.scala | 2 +- .../model/participant/evcs/EvcsModel.scala | 2 +- .../thermal/CylindricalThermalStorage.scala | 6 +++--- .../simona/model/thermal/ThermalGrid.scala | 10 +++++----- .../simona/model/thermal/ThermalHouse.scala | 6 +++--- .../scala/quantities/DefaultQuantities.scala | 4 ++-- .../ThermalGridWithHouseAndStorageSpec.scala | 10 +++++----- .../ThermalGridWithHouseOnlySpec.scala | 6 +++--- .../ThermalGridWithStorageOnlySpec.scala | 20 +++++++++---------- 11 files changed, 38 insertions(+), 38 deletions(-) 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 5af1b68236..56bd446412 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/ChpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/ChpModel.scala @@ -118,7 +118,7 @@ final case class ChpModel( chpData: ChpRelevantData ): ChpRelevantData => ChpState = { val isRunning = chpData.chpState.isRunning - val hasDemand = chpData.heatDemand > DefaultQuantities.zeroKWH + val hasDemand = chpData.heatDemand > DefaultQuantities.zeroKWh val isCovered = isDemandCovered(chpData) (isRunning, hasDemand, isCovered) match { @@ -145,7 +145,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 @@ -182,7 +182,7 @@ final case class ChpModel( isRunning = false, chpData.currentTimeTick, DefaultQuantities.zeroKW, - DefaultQuantities.zeroKWH, + DefaultQuantities.zeroKWh, ) } @@ -199,7 +199,7 @@ final case class ChpModel( chpData: ChpRelevantData ): ChpState = { val differenceEnergy = chpEnergy(chpData) - chpData.heatDemand - if (differenceEnergy < zeroKWH) { + if (differenceEnergy < zeroKWh) { // Returned lack is always zero, because demand is covered. storage.tryToTakeAndReturnLack(differenceEnergy * -1) calculateStateRunningSurplus(chpData) 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 bf26b80fd8..8a6963e94a 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -237,7 +237,7 @@ final case class HpModel( val noThermalStorageOrThermalStorageIsEmpty: Boolean = updatedGridState.storageState.isEmpty || updatedGridState.storageState .exists( - _.storedEnergy =~ zeroKWH + _.storedEnergy =~ zeroKWh ) val houseDemand = diff --git a/src/main/scala/edu/ie3/simona/model/participant/StorageModel.scala b/src/main/scala/edu/ie3/simona/model/participant/StorageModel.scala index 02f82d2670..742f5d8f68 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/StorageModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/StorageModel.scala @@ -47,7 +47,7 @@ final case class StorageModel( cosPhiRated, ) { - private val minEnergy = zeroKWH + private val minEnergy = zeroKWh /** Tolerance for power comparisons. With very small (dis-)charging powers, * problems can occur when calculating the future tick at which storage is 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 a1d21252ec..4f0e4d9730 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 @@ -222,7 +222,7 @@ final case class EvcsModel( tickStop > lastSchedulingTick && tickStart < currentTick } .sortBy(_.tickStart) - .foldLeft(zeroKWH) { case (accumulatedEnergy, scheduleEntry) => + .foldLeft(zeroKWh) { case (accumulatedEnergy, scheduleEntry) => /* Only the timeframe from the start of last scheduling update and current tick must be considered */ val trimmedEntry = trimScheduleEntry( scheduleEntry, 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 fedea75204..7640505bb1 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala @@ -143,7 +143,7 @@ final case class CylindricalThermalStorage( override def tryToStoreAndReturnRemainder( addedEnergy: Energy ): Option[Energy] = { - if (addedEnergy > zeroKWH) { + if (addedEnergy > zeroKWh) { _storedEnergy = _storedEnergy + addedEnergy if (_storedEnergy > maxEnergyThreshold) { val surplus = _storedEnergy - maxEnergyThreshold @@ -158,7 +158,7 @@ final case class CylindricalThermalStorage( override def tryToTakeAndReturnLack( takenEnergy: Energy ): Option[Energy] = { - if (takenEnergy > zeroKWH) { + if (takenEnergy > zeroKWh) { _storedEnergy = _storedEnergy - takenEnergy if (_storedEnergy < minEnergyThreshold) { val lack = minEnergyThreshold - _storedEnergy @@ -185,7 +185,7 @@ object CylindricalThermalStorage { */ def apply( input: CylindricalStorageInput, - initialStoredEnergy: Energy = DefaultQuantities.zeroKWH, + initialStoredEnergy: Energy = DefaultQuantities.zeroKWh, ): CylindricalThermalStorage = { val minEnergyThreshold: Energy = CylindricalThermalStorage.volumeToEnergy( 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 0d868e64df..747e694243 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala @@ -113,7 +113,7 @@ final case class ThermalGrid( storage.getMaxEnergyThreshold - storedEnergy } else { - zeroMWH + zeroMWh } } @@ -128,7 +128,7 @@ final case class ThermalGrid( } .getOrElse( - ThermalEnergyDemand(zeroMWH, zeroMWH), + ThermalEnergyDemand(zeroMWh, zeroMWh), None, ) } @@ -559,7 +559,7 @@ object ThermalGrid { possible + rhs.possible, ) - def hasRequiredDemand: Boolean = required > zeroMWH + def hasRequiredDemand: Boolean = required > zeroMWh def hasAdditionalDemand: Boolean = possible > required } @@ -586,8 +586,8 @@ object ThermalGrid { } def noDemand: ThermalEnergyDemand = ThermalEnergyDemand( - zeroMWH, - zeroMWH, + zeroMWh, + zeroMWh, ) } } 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 71e992c4e0..aaae60aeab 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala @@ -123,7 +123,7 @@ final case class ThermalHouse( ) ) energy(targetTemperature, currentInnerTemp) else - zeroMWH + zeroMWh val possibleEnergy = if (!isInnerTemperatureTooHigh(currentInnerTemp)) { @@ -131,7 +131,7 @@ final case class ThermalHouse( // there is an amount of optional energy that could be stored energy(upperBoundaryTemperature, currentInnerTemp) } else - zeroMWH + zeroMWh ThermalEnergyDemand(requiredEnergy, possibleEnergy) } @@ -323,7 +323,7 @@ final case class ThermalHouse( qDot: Power, ): Option[Long] = { val flexibleEnergy = energy(higherTemperature, lowerTemperature) - if (flexibleEnergy < zeroMWH) + if (flexibleEnergy < zeroMWh) None else { val duration = Math.round( diff --git a/src/main/scala/edu/ie3/util/scala/quantities/DefaultQuantities.scala b/src/main/scala/edu/ie3/util/scala/quantities/DefaultQuantities.scala index ac401db84c..698f757eff 100644 --- a/src/main/scala/edu/ie3/util/scala/quantities/DefaultQuantities.scala +++ b/src/main/scala/edu/ie3/util/scala/quantities/DefaultQuantities.scala @@ -17,8 +17,8 @@ object DefaultQuantities { val zeroKVAr: ReactivePower = Kilovars(0d) val zeroMVAr: ReactivePower = Megavars(0d) - val zeroKWH: Energy = KilowattHours(0d) - val zeroMWH: Energy = MegawattHours(0d) + val zeroKWh: Energy = KilowattHours(0d) + val zeroMWh: Energy = MegawattHours(0d) val zeroPU: Dimensionless = Each(0d) 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 f2829532cd..7d8d2c27f1 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala @@ -13,7 +13,7 @@ import edu.ie3.simona.model.thermal.ThermalHouse.ThermalHouseThreshold.{ HouseTemperatureLowerBoundaryReached, HouseTemperatureUpperBoundaryReached, } -import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWH} +import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWh} import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageState import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageThreshold.{ StorageEmpty, @@ -104,7 +104,7 @@ class ThermalGridWithHouseAndStorageSpec testGridAmbientTemperature, ThermalGrid.startingState(thermalGrid), ) - houseDemand.required should approximate(zeroKWH) + houseDemand.required should approximate(zeroKWh) houseDemand.possible should approximate(KilowattHours(31.05009722d)) storageDemand.required should approximate(KilowattHours(1150d)) storageDemand.possible should approximate(KilowattHours(1150d)) @@ -112,7 +112,7 @@ class ThermalGridWithHouseAndStorageSpec ThermalHouseState(10800, Kelvin(292.0799935185185), zeroKW) ) updatedThermalGridState.storageState shouldBe Some( - ThermalStorageState(10800, zeroKWH, zeroKW) + ThermalStorageState(10800, zeroKWh, zeroKW) ) } @@ -140,7 +140,7 @@ class ThermalGridWithHouseAndStorageSpec ThermalHouseState(10800, Celsius(15.959996296296296), zeroKW) ) updatedThermalGridState.storageState shouldBe Some( - ThermalStorageState(10800, zeroKWH, zeroKW) + ThermalStorageState(10800, zeroKWh, zeroKW) ) } } @@ -372,7 +372,7 @@ class ThermalGridWithHouseAndStorageSpec ( ThermalStorageState( tick, - zeroKWH, + zeroKWh, testGridQDotInfeed, ), Some(StorageEmpty(tick)), 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 d50b1e558a..6b14ee3780 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala @@ -13,7 +13,7 @@ import edu.ie3.simona.model.thermal.ThermalHouse.ThermalHouseThreshold.{ HouseTemperatureLowerBoundaryReached, HouseTemperatureUpperBoundaryReached, } -import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWH} +import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWh} import edu.ie3.simona.test.common.UnitSpec import squants.energy._ import squants.thermal.Celsius @@ -91,8 +91,8 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { houseDemand.required should approximate(expectedHouseDemand.required) houseDemand.possible should approximate(expectedHouseDemand.possible) - storageDemand.required should approximate(zeroKWH) - storageDemand.possible should approximate(zeroKWH) + storageDemand.required should approximate(zeroKWh) + storageDemand.possible should approximate(zeroKWh) updatedThermalGridState.houseState shouldBe Some( ThermalHouseState(10800, Kelvin(292.0799935185185), zeroKW) ) 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 9ef8dbb424..ead1ff6b03 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithStorageOnlySpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithStorageOnlySpec.scala @@ -17,7 +17,7 @@ import edu.ie3.simona.model.thermal.ThermalStorage.ThermalStorageThreshold.{ StorageFull, } import edu.ie3.simona.test.common.UnitSpec -import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWH} +import edu.ie3.util.scala.quantities.DefaultQuantities.{zeroKW, zeroKWh} import squants.energy._ import squants.thermal.Celsius import squants.{Energy, Power, Temperature} @@ -89,13 +89,13 @@ class ThermalGridWithStorageOnlySpec ThermalGrid.startingState(thermalGrid), ) - houseDemand.required should approximate(zeroKWH) - houseDemand.possible should approximate(zeroKWH) + houseDemand.required should approximate(zeroKWh) + houseDemand.possible should approximate(zeroKWh) storageDemand.required should approximate(KilowattHours(1150d)) storageDemand.possible should approximate(KilowattHours(1150d)) updatedThermalGridState.houseState shouldBe None updatedThermalGridState.storageState shouldBe Some( - ThermalStorageState(10800, zeroKWH, zeroKW) + ThermalStorageState(10800, zeroKWh, zeroKW) ) } @@ -113,9 +113,9 @@ class ThermalGridWithStorageOnlySpec ), ) - houseDemand.required should approximate(zeroKWH) - houseDemand.possible should approximate(zeroKWH) - storageDemand.required should approximate(zeroKWH) + houseDemand.required should approximate(zeroKWh) + houseDemand.possible should approximate(zeroKWh) + storageDemand.required should approximate(zeroKWh) storageDemand.possible should approximate(KilowattHours(575d)) updatedThermalGridState.houseState shouldBe None updatedThermalGridState.storageState shouldBe Some( @@ -192,7 +192,7 @@ class ThermalGridWithStorageOnlySpec Some(ThermalStorageState(tick, storedEnergy, qDot)), ) => tick shouldBe 0L - storedEnergy should approximate(zeroKWH) + storedEnergy should approximate(zeroKWh) qDot should approximate(testGridQDotInfeed) case _ => fail("Thermal grid state has been calculated wrong.") } @@ -218,7 +218,7 @@ class ThermalGridWithStorageOnlySpec Some(ThermalStorageState(tick, storedEnergy, qDot)), ) => tick shouldBe 0L - storedEnergy should approximate(zeroKWH) + storedEnergy should approximate(zeroKWh) qDot should approximate(testGridQDotInfeed) case _ => fail("Thermal grid state updated failed") } @@ -274,7 +274,7 @@ class ThermalGridWithStorageOnlySpec None, ) => tick shouldBe 0L - storedEnergy should approximate(zeroKWH) + storedEnergy should approximate(zeroKWh) qDot should approximate(zeroKW) case _ => fail("Thermal grid state updated failed") From 2fd4f451313ad2c80fa08b4f5efc55855ce3950c Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 13:53:14 +0100 Subject: [PATCH 44/46] including reviewers comments --- .../participant/fixedfeedin/FixedFeedInAgentFundamentals.scala | 2 +- src/main/scala/edu/ie3/simona/main/RunSimona.scala | 2 +- src/main/scala/edu/ie3/simona/model/SystemComponent.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 233246ca81..0b8845d80c 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 @@ -132,7 +132,7 @@ protected trait FixedFeedInAgentFundamentals val lastTickInSimulation = simulationEndDate.toTick(simulationStartDate) val dataTicks = /* As participant agents always return their last known operation point on request, it is sufficient - * to let a fixed model determine its operation point on: + * to let a FixedFeedIn-Model determine its operation point on: * 1) The first tick of the simulation * 2) The tick, it turns on (in time-dependent operation) * 3) The tick, it turns off (in time-dependent operation) diff --git a/src/main/scala/edu/ie3/simona/main/RunSimona.scala b/src/main/scala/edu/ie3/simona/main/RunSimona.scala index 9d03f38665..b08db66361 100644 --- a/src/main/scala/edu/ie3/simona/main/RunSimona.scala +++ b/src/main/scala/edu/ie3/simona/main/RunSimona.scala @@ -87,7 +87,7 @@ trait RunSimona[T <: SimonaSetup] extends LazyLogging { } /** Method to be implemented to set up everything that is necessary for a - * simulations. This is by creating an instance of [[SimonaSetup]] + * simulation. This is by creating an instance of [[SimonaSetup]] * implementation * * @param args diff --git a/src/main/scala/edu/ie3/simona/model/SystemComponent.scala b/src/main/scala/edu/ie3/simona/model/SystemComponent.scala index efc70ba0cf..7408c8cbef 100644 --- a/src/main/scala/edu/ie3/simona/model/SystemComponent.scala +++ b/src/main/scala/edu/ie3/simona/model/SystemComponent.scala @@ -40,7 +40,7 @@ abstract class SystemComponent( private val elementType: String = this.getClass.getSimpleName - // check if an uuid is provided + // check if a uuid is provided if (Option.apply(uuid).isEmpty) throw new InvalidParameterException( s"Uuid of $elementType $id cannot be null!" From c3efd4fc4904eeb70ebba4b27a0110ec7afff926 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 14:30:55 +0100 Subject: [PATCH 45/46] another one --- src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 0d868e64df..6a4b708ea4 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala @@ -446,7 +446,7 @@ final case class ThermalGrid( case _ => (maybeHouseState, maybeStorageState) } - /** Convert the given state of the thermal grid into result models of it's + /** Convert the given state of the thermal grid into result models of its * constituent models * * @param currentTick From 77c7c6cf199854b532fd8ab3531273021c32d885 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Fri, 15 Nov 2024 14:34:04 +0100 Subject: [PATCH 46/46] some more grammar --- .../ie3/simona/model/control/TransformerControlGroupModel.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/edu/ie3/simona/model/control/TransformerControlGroupModel.scala b/src/main/scala/edu/ie3/simona/model/control/TransformerControlGroupModel.scala index 2354770480..c6d7471787 100644 --- a/src/main/scala/edu/ie3/simona/model/control/TransformerControlGroupModel.scala +++ b/src/main/scala/edu/ie3/simona/model/control/TransformerControlGroupModel.scala @@ -134,7 +134,7 @@ object TransformerControlGroupModel { * Array of all regulation requests * @return * None in case of contrary requests, else the highest or lowest voltage - * depending of the direction for regulation + * depending on the direction for regulation */ private def harmonizeRegulationNeeds( regulationRequests: Array[Dimensionless]