Class RecoverOperation

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

public class RecoverOperation extends Object implements Operation
Operation that recovers a percentage or amount of refrigerant.

This operation calculates a recovery amount and yield rate and applies it to the engine. It can optionally be limited to a specific time period using a ParsedDuring object.

  • Constructor Details

    • RecoverOperation

      public RecoverOperation(Operation volumeOperation, Operation yieldOperation)
      Create a new RecoverOperation that applies to all years.
      Parameters:
      volumeOperation - The operation that calculates the recovery amount.
      yieldOperation - The operation that calculates the yield rate.
    • RecoverOperation

      public RecoverOperation(Operation volumeOperation, Operation yieldOperation, RecoverOperation.RecoveryStage stage)
      Create a new RecoverOperation that applies to all years with stage.
      Parameters:
      volumeOperation - The operation that calculates the recovery amount.
      yieldOperation - The operation that calculates the yield rate.
      stage - The recovery stage (EOL or RECHARGE).
    • RecoverOperation

      public RecoverOperation(Operation volumeOperation, Operation yieldOperation, ParsedDuring during)
      Create a new RecoverOperation that applies to a specific time period.
      Parameters:
      volumeOperation - The operation that calculates the recovery amount.
      yieldOperation - The operation that calculates the yield rate.
      during - The time period during which this operation applies.
    • RecoverOperation

      public RecoverOperation(Operation volumeOperation, Operation yieldOperation, ParsedDuring during, RecoverOperation.RecoveryStage stage)
      Create a new RecoverOperation that applies to a specific time period with stage.
      Parameters:
      volumeOperation - The operation that calculates the recovery amount.
      yieldOperation - The operation that calculates the yield rate.
      during - The time period during which this operation applies.
      stage - The recovery stage (EOL or RECHARGE).
    • RecoverOperation

      public RecoverOperation(Operation volumeOperation, Operation yieldOperation, Optional<Operation> inductionOperation)
      Create a new RecoverOperation that applies to all years with induction.
      Parameters:
      volumeOperation - The operation that calculates the recovery amount.
      yieldOperation - The operation that calculates the yield rate.
      inductionOperation - The operation that calculates the induction rate (Optional.empty() for default).
    • RecoverOperation

      public RecoverOperation(Operation volumeOperation, Operation yieldOperation, RecoverOperation.RecoveryStage stage, Optional<Operation> inductionOperation)
      Create a new RecoverOperation that applies to all years with stage and induction.
      Parameters:
      volumeOperation - The operation that calculates the recovery amount.
      yieldOperation - The operation that calculates the yield rate.
      stage - The recovery stage (EOL or RECHARGE).
      inductionOperation - The operation that calculates the induction rate (Optional.empty() for default).
    • RecoverOperation

      public RecoverOperation(Operation volumeOperation, Operation yieldOperation, ParsedDuring during, Optional<Operation> inductionOperation)
      Create a new RecoverOperation that applies to a specific time period with induction.
      Parameters:
      volumeOperation - The operation that calculates the recovery amount.
      yieldOperation - The operation that calculates the yield rate.
      during - The time period during which this operation applies.
      inductionOperation - The operation that calculates the induction rate (Optional.empty() for default).
    • RecoverOperation

      public RecoverOperation(Operation volumeOperation, Operation yieldOperation, ParsedDuring during, RecoverOperation.RecoveryStage stage, Optional<Operation> inductionOperation)
      Create a new RecoverOperation that applies to a specific time period with stage and induction.
      Parameters:
      volumeOperation - The operation that calculates the recovery amount.
      yieldOperation - The operation that calculates the yield rate.
      during - The time period during which this operation applies.
      stage - The recovery stage (EOL or RECHARGE).
      inductionOperation - The operation that calculates the induction rate (Optional.empty() for default).
  • Method Details

    • getStage

      public RecoverOperation.RecoveryStage getStage()
      Get the recovery stage.
      Returns:
      The recovery stage (EOL or RECHARGE).
    • execute

      public void execute(PushDownMachine machine)
      Executes the recovery operation.
      This method performs the following steps:
      • Executes the volume operation to get the recovery amount
      • Executes the yield operation to get the yield rate
      • Handles the induction operation if present
      • Builds the year matcher from the parsed during object
      • Sets the induction rate on the engine
      • Calls the recycle method on the engine
      Specified by:
      execute in interface Operation
      Parameters:
      machine - The push down machine to execute the operation on.