Class TimerCondition

java.lang.Object
neqsim.process.logic.condition.TimerCondition
All Implemented Interfaces:
LogicCondition

public class TimerCondition extends Object implements LogicCondition
Condition that becomes true after a specified time delay.

Used for:

  • Minimum wait times between steps
  • Equipment warm-up periods
  • Stabilization delays
  • Timeout detection

Example usage:

// Wait 30 seconds before starting pump
TimerCondition warmUp = new TimerCondition(30.0);
warmUp.start();

// In simulation loop
warmUp.update(timeStep);
if (warmUp.evaluate()) {
  // 30 seconds elapsed
}
Version:
1.0
Author:
ESOL
  • Field Details

    • duration

      private final double duration
    • elapsed

      private double elapsed
    • started

      private boolean started
  • Constructor Details

    • TimerCondition

      public TimerCondition(double duration)
      Creates a timer condition.
      Parameters:
      duration - duration in seconds
  • Method Details

    • start

      public void start()
      Starts the timer.
    • reset

      public void reset()
      Resets the timer.
    • update

      public void update(double timeStep)
      Updates the timer with a time step.
      Parameters:
      timeStep - time step in seconds
    • evaluate

      public boolean evaluate()
      Description copied from interface: LogicCondition
      Evaluates if the condition is currently met.
      Specified by:
      evaluate in interface LogicCondition
      Returns:
      true if condition is satisfied, false otherwise
    • getElapsed

      public double getElapsed()
      Gets the elapsed time.
      Returns:
      elapsed time in seconds
    • getRemaining

      public double getRemaining()
      Gets the remaining time.
      Returns:
      remaining time in seconds, or 0 if complete
    • getDescription

      public String getDescription()
      Description copied from interface: LogicCondition
      Gets a description of this condition.
      Specified by:
      getDescription in interface LogicCondition
      Returns:
      human-readable description
    • getTargetEquipment

      public ProcessEquipmentInterface getTargetEquipment()
      Description copied from interface: LogicCondition
      Gets the target equipment this condition monitors (if any).
      Specified by:
      getTargetEquipment in interface LogicCondition
      Returns:
      target equipment, or null if not equipment-specific
    • getCurrentValue

      public String getCurrentValue()
      Description copied from interface: LogicCondition
      Gets the current value being evaluated (for diagnostics).
      Specified by:
      getCurrentValue in interface LogicCondition
      Returns:
      current value as string, or empty if not applicable
    • getExpectedValue

      public String getExpectedValue()
      Description copied from interface: LogicCondition
      Gets the expected/setpoint value (for diagnostics).
      Specified by:
      getExpectedValue in interface LogicCondition
      Returns:
      expected value as string, or empty if not applicable