java.lang.Object
io.openems.edge.controller.ess.timeofusetariff.optimizer.Simulator

public class Simulator extends Object
  • Field Details

    • EFFICIENCY_FACTOR

      public static final double EFFICIENCY_FACTOR
      Used to incorporate charge/discharge efficiency.
      See Also:
  • Constructor Details

    • Simulator

      public Simulator()
  • Method Details

    • calculateCost

      protected static double calculateCost(Params p, StateMachine[] states)
      Calculates the cost of a Schedule.
      Parameters:
      p - the Params
      states - the StateMachine states of the Schedule
      Returns:
      the cost, lower is better; always positive
    • calculateCost

      protected static double calculateCost(Params p, StateMachine[] states, Consumer<Period> collect)
      Calculates the cost of a Schedule.
      Parameters:
      p - the Params
      states - the StateMachine states of the Schedule
      collect - a Consumer to collect the simulation results if required. We are not always collecting results to reduce workload during simulation.
      Returns:
      the cost, lower is better; always positive
    • calculatePeriodCost

      protected static double calculatePeriodCost(Params p, int i, StateMachine[] states, AtomicInteger nextEssInitial, Consumer<Period> collect)
      Calculates the cost of one Period under the given Schedule.
      Parameters:
      p - the Params
      i - the index of the current period
      states - the StateMachine states of the Schedule
      nextEssInitial - the initial SoC-Energy; also used as return value
      collect - a Consumer to collect the simulation results if required. We are not always collecting results to reduce workload during simulation.
      Returns:
      the cost, lower is better; always positive
    • getBestSchedule

      protected static StateMachine[] getBestSchedule(Params p, long executionLimitSeconds)
      Runs the optimization with default settings.
      Parameters:
      p - the Params
      executionLimitSeconds - limit.byExecutionTime.ofSeconds
      Returns:
      the best schedule
    • getBestSchedule

      protected static StateMachine[] getBestSchedule(Params p, long executionLimitSeconds, Integer populationSize, Integer limit)