Class RetireWithReplacementOperation
java.lang.Object
org.kigalisim.lang.operation.RetireWithReplacementOperation
- All Implemented Interfaces:
Operation
Operation that retires equipment and immediately replaces it by increasing sales.
This operation executes a normal retirement and then increases sales by the same amount, effectively maintaining the equipment population while simulating equipment turnover.
-
Constructor Summary
ConstructorsConstructorDescriptionRetireWithReplacementOperation(Operation amountOperation) Create a new RetireWithReplacementOperation that applies to all years.RetireWithReplacementOperation(Operation amountOperation, ParsedDuring during) Create a new RetireWithReplacementOperation that applies to a specific time period. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(PushDownMachine machine) Execute the retire and replacement operation.Get a record describing this operation's semantics.
-
Constructor Details
-
RetireWithReplacementOperation
Create a new RetireWithReplacementOperation that applies to all years.- Parameters:
amountOperation- The operation that calculates the retirement rate.
-
RetireWithReplacementOperation
Create a new RetireWithReplacementOperation that applies to a specific time period.- Parameters:
amountOperation- The operation that calculates the retirement rate.during- The time period during which this operation applies.
-
-
Method Details
-
execute
Execute the retire and replacement operation.This operation executes a normal retirement and then increases sales by the actual retirement amount, effectively maintaining the equipment population while simulating equipment turnover. The operation:- Executes the amount operation to calculate the retirement rate
- Validates that the current year is in the specified time range
- Checks for mixed retire commands with and without replacement
- Determines target units for replacement based on last specified sales units
- Measures equipment before and after retirement to calculate actual reduction
- Increases sales by the actual reduction amount to replace retired equipment
-
getStaticSemantics
Get a record describing this operation's semantics.Get a record describing this operation's semantics that are inferrable from its static expression in code. In other words, properties and effects which do not require inspection at time of executing the operation.
- Specified by:
getStaticSemanticsin interfaceOperation- Returns:
- Inference of common static properties found for this operation.
-