java.lang.Object
java.lang.Record
io.openems.edge.controller.ess.timeofusetariff.optimizer.Period

public record Period(ZonedDateTime time, int production, int consumption, int essInitial, StateMachine state, int essChargeDischarge, int grid, double price, double cost) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    Period(ZonedDateTime time, int production, int consumption, int essInitial, StateMachine state, int essChargeDischarge, int grid, double price, double cost)
    Creates an instance of a Period record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the consumption record component.
    double
    Returns the value of the cost record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the essChargeDischarge record component.
    int
    Returns the value of the essInitial record component.
    static Period
    Gets the Period from the Log String.
    int
    Returns the value of the grid record component.
    final int
    Returns a hash code value for this object.
    static String
    Gets the toString() header.
    double
    Returns the value of the price record component.
    int
    Returns the value of the production record component.
    Returns the value of the state record component.
    Returns the value of the time record component.
    Gets the Period as String.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Period

      public Period(ZonedDateTime time, int production, int consumption, int essInitial, StateMachine state, int essChargeDischarge, int grid, double price, double cost)
      Creates an instance of a Period record class.
      Parameters:
      time - the value for the time record component
      production - the value for the production record component
      consumption - the value for the consumption record component
      essInitial - the value for the essInitial record component
      state - the value for the state record component
      essChargeDischarge - the value for the essChargeDischarge record component
      grid - the value for the grid record component
      price - the value for the price record component
      cost - the value for the cost record component
  • Method Details

    • header

      public static String header()
      Gets the toString() header.
      Returns:
      header
    • toString

      public String toString()
      Gets the Period as String.
      Specified by:
      toString in class Record
    • fromLog

      public static Period fromLog(String log) throws RuntimeException
      Gets the Period from the Log String.

      This is the reverse of toString() method.

      Returns:
      a new Period
      Throws:
      RuntimeException - on error
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • time

      public ZonedDateTime time()
      Returns the value of the time record component.
      Returns:
      the value of the time record component
    • production

      public int production()
      Returns the value of the production record component.
      Returns:
      the value of the production record component
    • consumption

      public int consumption()
      Returns the value of the consumption record component.
      Returns:
      the value of the consumption record component
    • essInitial

      public int essInitial()
      Returns the value of the essInitial record component.
      Returns:
      the value of the essInitial record component
    • state

      public StateMachine state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component
    • essChargeDischarge

      public int essChargeDischarge()
      Returns the value of the essChargeDischarge record component.
      Returns:
      the value of the essChargeDischarge record component
    • grid

      public int grid()
      Returns the value of the grid record component.
      Returns:
      the value of the grid record component
    • price

      public double price()
      Returns the value of the price record component.
      Returns:
      the value of the price record component
    • cost

      public double cost()
      Returns the value of the cost record component.
      Returns:
      the value of the cost record component