Skip to content

Commit

Permalink
Enhancing charging strats of evcs
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Peter <[email protected]>
  • Loading branch information
sebastian-peter committed Nov 15, 2024
1 parent 5298be2 commit de60e0c
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 13 deletions.
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
}
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,19 @@ object EvcsModel {
) extends OperationRelevantData

trait ChargingStrategy {

/** Determine scheduling for charging the EVs currently parked at the
* charging station until their departure.
*
* @param evs
* currently parked evs at the charging station
* @param currentTick
* current tick
* @param chargingProps
* interface that provides information on charging station
* @return
* scheduling for charging the EVs
*/
def determineChargingPowers(
evs: Iterable[EvModelWrapper],
currentTick: Long,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,13 @@ import squants.Power

import java.util.UUID

object MaximumPowerStrategy extends ChargingStrategy {
/** Determine scheduling for charging the EVs currently parked at the charging
* station until their departure. In this case, each EV is charged with maximum
* power from current time until it reaches either 100% SoC or its departure
* time.
*/
object MaximumPowerCharging extends ChargingStrategy {

/** Determine scheduling for charging the EVs currently parked at the charging
* station until their departure. In this case, each EV is charged with
* maximum power from current time until it reaches either 100% SoC or its
* departure time.
*
* @param currentTick
* current tick
* @param evs
* currently parked evs at the charging station
* @return
* scheduling for charging the EVs
*/
def determineChargingPowers(
evs: Iterable[EvModelWrapper],
currentTick: Long,
Expand Down

0 comments on commit de60e0c

Please sign in to comment.