-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sebastian Peter <[email protected]>
- Loading branch information
1 parent
5298be2
commit de60e0c
Showing
3 changed files
with
62 additions
and
13 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
src/main/scala/edu/ie3/simona/model/participant2/evcs/ConstantPowerCharging.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* © 2021. TU Dortmund University, | ||
* Institute of Energy Systems, Energy Efficiency and Energy Economics, | ||
* Research group Distribution grid planning and operation | ||
*/ | ||
|
||
package edu.ie3.simona.model.participant2.evcs | ||
|
||
import edu.ie3.simona.model.participant.evcs.EvModelWrapper | ||
import edu.ie3.simona.model.participant2.evcs.EvcsModel.ChargingStrategy | ||
import squants.{Power, Seconds} | ||
|
||
import java.util.UUID | ||
|
||
/** Determine scheduling for charging the EVs currently parked at the charging | ||
* station by charging with constant power from current time until departure. | ||
* If less than the maximum power is required to reach 100% SoC, the power is | ||
* reduced accordingly. | ||
*/ | ||
object ConstantPowerCharging extends ChargingStrategy { | ||
|
||
override def determineChargingPowers( | ||
evs: Iterable[EvModelWrapper], | ||
currentTick: Long, | ||
chargingProps: EvcsChargingProperties, | ||
): Map[UUID, Power] = evs | ||
.filter(ev => ev.storedEnergy < ev.eStorage) | ||
.map { ev => | ||
val maxChargingPower = chargingProps.getMaxAvailableChargingPower(ev) | ||
val remainingParkingTime = Seconds(ev.departureTick - currentTick) | ||
|
||
val requiredEnergyUntilFull = ev.eStorage - ev.storedEnergy | ||
val maxChargedEnergyUntilDeparture = | ||
maxChargingPower * remainingParkingTime | ||
val actualChargedEnergy = | ||
requiredEnergyUntilFull.min(maxChargedEnergyUntilDeparture) | ||
|
||
val chargingPower = actualChargedEnergy / remainingParkingTime | ||
|
||
ev.uuid -> chargingPower | ||
} | ||
.toMap | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters