Class RechargeOperation

java.lang.Object
org.kigalisim.lang.operation.RechargeOperation
All Implemented Interfaces:
Operation

public class RechargeOperation extends Object implements Operation
Operation that recharges equipment with a specified volume and intensity.

This operation calculates a recharge volume and intensity and applies it to the engine. It can optionally be limited to a specific time period using a ParsedDuring object.

  • Constructor Details

    • RechargeOperation

      public RechargeOperation(Operation volumeOperation, Operation intensityOperation)
      Create a new RechargeOperation that applies to all years.
      Parameters:
      volumeOperation - The operation that calculates the recharge volume.
      intensityOperation - The operation that calculates the recharge intensity.
    • RechargeOperation

      public RechargeOperation(Operation volumeOperation, Operation intensityOperation, ParsedDuring during)
      Create a new RechargeOperation that applies to a specific time period.
      Parameters:
      volumeOperation - The operation that calculates the recharge volume.
      intensityOperation - The operation that calculates the recharge intensity.
      during - The time period during which this operation applies.
  • Method Details

    • execute

      public void execute(PushDownMachine machine)
      Execute the calculation and leave the result at the top of the stack.
      Specified by:
      execute in interface Operation
      Parameters:
      machine - The machine in which to execute the calculation if needed.