Class RetireWeibullOperation

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

public class RetireWeibullOperation extends Object implements Operation
Operation that retires equipment according to a Weibull survival curve (shape 2, the Rayleigh case) driven by a mean lifetime in years.

Each year the operation computes a unit count from the Weibull survival curve and the recorded sales history (the cohort size at age a is the newEquipment stream from a years ago), then retires that count through the existing units-based retirement path. This composes with the existing engine retirement machinery rather than duplicating it.

  • Constructor Details

    • RetireWeibullOperation

      public RetireWeibullOperation(BigDecimal meanYears, boolean assumingNew, boolean withReplacement)
      Create a Weibull retire operation that applies to all years.
      Parameters:
      meanYears - The mean equipment lifetime in years.
      assumingNew - Whether prior equipment should be treated as a pseudo-cohort of typical age (the assuming new modifier).
      withReplacement - Whether retired equipment should be replaced to maintain population.
    • RetireWeibullOperation

      public RetireWeibullOperation(BigDecimal meanYears, boolean assumingNew, boolean withReplacement, ParsedDuring during)
      Create a Weibull retire operation that applies to a specific time period.
      Parameters:
      meanYears - The mean equipment lifetime in years.
      assumingNew - Whether prior equipment should be treated as a pseudo-cohort of typical age (the assuming new modifier).
      withReplacement - Whether retired equipment should be replaced to maintain population.
      during - The time period during which this operation applies.
  • Method Details

    • getAssumingNew

      public boolean getAssumingNew()
      Whether prior equipment is treated as a pseudo-cohort of typical age.
      Returns:
      true if the assuming new modifier is set
    • execute

      public void execute(PushDownMachine machine)
      Execute the Weibull retire operation on the given push-down machine.

      Builds a year matcher from the optional during clause, skips execution if the current year is out of range, computes the unit count from the survival history, and delegates the actual retirement to the existing units-based retirement path. With with replacement, measures the equipment population before and after retirement and increases sales by the actual reduction to maintain population, mirroring RetireWithReplacementOperation.

      Specified by:
      execute in interface Operation
      Parameters:
      machine - The push-down machine context for evaluating operations.