Class FlowSpec
The object created with the constructor will initially not have any periods selected for comparison. Use the object methods to set up the comparison logic.
The following example will set up an even flow objective to compare all periods to the specified period:
flow = new FlowSpec().even();This will not include period 0 (the period prior to the start of the simulation) since the common idiom is to use even flow for harvest products, which do not occur in period 0. In order to include period 0, use
flow = new FlowSpec().even(0, periods, periods);
In order to set up a non-declining type of comparison, use one of the ndy methods. These require an offset value to specify which periods should be compared to. The following example compares to the previous period for the last 5 period. This would be typical for a non-delining closing inventory constraint:
flow = new FlowSpec().ndy(periods-4, periods, -1);
The methods may be chained together to make more complex relationships. The following example compares the first four period for evenflow, and the rest for a separate evenflow level:
flow = new FlowSpec().even(1,2,2).even(3,periods,periods);
-
Constructor Summary
ConstructorsConstructorDescriptionFlowSpec()
Create a FlowSpec object, initially with all periods not being compared to anything. -
Method Summary
Modifier and TypeMethodDescriptioneven()
Set all periods to compare to the final period.even(int anchor)
Set all periods to compare to the same anchor period.even(int low, int high, int anchor)
Set selected periods to compare to the same anchor period.int[]
Return a reference to the internal array of flow periods.incrementFrom(int start)
Set to calculate the increment from period to period, starting with start period.ndy(int offset)
Set all periods to compare to the period with the same offset.ndy(int low, int high, int offset)
Set selected periods to compare to the period with the same offset.nop()
Set all periods to not comparenop(int period)
Set a single period to not comparenop(int low, int high)
Set selected periods to not be compared.pass(int period)
Pass a value from the input account unchanged.toString()
-
Constructor Details
-
FlowSpec
public FlowSpec()Create a FlowSpec object, initially with all periods not being compared to anything.
-
-
Method Details
-
getFlowPeriods
public int[] getFlowPeriods()Return a reference to the internal array of flow periods. Changes that are made to this array will change the FlowSpec. -
even
Set all periods to compare to the final period. This method has the same effect aseven(0, periods, periods);
-
even
Set all periods to compare to the same anchor period. This method has the same effect aseven(0, periods, anchor);
- Parameters:
anchor
- The period for all other periods to compare to
-
even
Set selected periods to compare to the same anchor period. All periods between low and high inclusive are set to compare to the anchor period.- Parameters:
low
- the lowest period to sethigh
- the highest period to setanchor
- The period for all other periods to compare to
-
ndy
Set all periods to compare to the period with the same offset. This method has the same effect asndy(0, periods, offset);
- Parameters:
offset
- The offset for all other periods to compare to
-
ndy
Set selected periods to compare to the period with the same offset. All periods between low and high inclusive are set to compare to the offset period.- Parameters:
low
- the lowest period to sethigh
- the highest period to setoffset
- The offset to the period to compare to
-
nop
Set all periods to not compare -
nop
Set a single period to not compare- Parameters:
period
- the period that will not be compared
-
nop
Set selected periods to not be compared. All periods between low and high inclusive are set to not compare. to the offset period.- Parameters:
low
- the lowest period to sethigh
- the highest period to set
-
pass
Pass a value from the input account unchanged. This option is only appropriate forFlowValueTarget
.- Parameters:
period
- the period that should have the unchanged value
-
incrementFrom
Set to calculate the increment from period to period, starting with start period. Periods earlier than the start period will show zero values. The start period will show the value of start period of the input account, and all remaining periods will show the increment from the previous period. -
toString
-