Package ca.spatial.patchworks
Interface Target
- All Known Implementing Classes:
Exclusive
,ExclusiveDependent
,FlowRatioTarget
,FlowValueTarget
,PatchTarget
,PoolAccount
,TabulateTarget
public interface Target
Targets are modeling objects that control how accounts participate
in the objective function. This interface describes the methods
that are used to set parameters on targets. You can use these
methods to turn targets on and off, set minimum and maximum values,
weigths, discount rates, change the way weights are applied, and
inspect the state of the target.
A list of all targets are maintained by the Control
class.
Use the Control.getTarget(java.lang.String)
method to get references to
Target objects. For example,
Target t = control.getTarget("feature.Area.managed.DF")
- See Also:
Control
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addObserver(Observer o)
Add anObserver
to be notified when target settings have been changed.void
Remove theObserver
on this target.float
getCurrent(int period)
Get the current value of the target for the specified period.float
getDiscount(int period)
Get the discounting value that applies to a specific periodfloat
Get the discounting rate that has been set for this targetdouble
getInitial(int period)
Get the initial target value in the specified periodfloat
getInterval(int period)
Get the width of the specified periodgetLabel()
Get the name of the targetfloat
getMarginalCost(int period)
Compute the marginal cost at the given period.float
getMaximum(int period)
Get the maximum target value in the specified periodfloat
getMaxWeight(int period)
Get the weighting factor on targets above the maximum for the specified period.float
getMinimum(int period)
Get the minimum target value in the specified periodfloat
getMinWeight(int period)
Get the weighting factor on targets below the minimum for the specified period.double
Get the contribution of this target towards the objective function value.double
getObjectiveValue(int period)
Get the contribution of this target towards the objective function value in the specified period.int
Get the number of periods for this targetboolean
Obtain the current setting for non-linear scaling penalty calculation.double
getShortage(int period)
Get the shortage between the target and the current value.float
getSummary(int period)
Get the normalizing value for the specified period.boolean
isActive()
Is the target actively contributing to the objective function?boolean
isLinear()
Determine if this target is using linear or quadratic scaling.boolean
Is the maximum value actively contributing to the objective function?boolean
Is the minimum value actively contributing to the objective function?boolean
Deprecated.Summary charts are no longer supportedvoid
setActive(boolean value)
Set the active status of the target.void
setDiscountRate(float value)
Set the discounting rate to be used on this target The rate is expressed as a value such as 1.04 for a 4% discounting.void
setLinear(boolean value)
Set the type of weighting to be used to linear (true) or quadratic (false).void
setMaxActive(boolean value)
Set the active status of the maximum value.void
setMaximum(float value, int period)
Set the maximum target value in a specific periodvoid
setMaximum(Curve curve)
Set all maximum target values using the shape of the curvevoid
setMaxWeight(float value, int period)
Set the weighting factor on targets above the maximum for the specified period to the given value.void
setMaxWeight(Curve curve)
Set all the weighting factors on targets above the maximum using curve interpolation.void
setMinActive(boolean value)
Set the active status of the minimum value.void
setMinimum(float value, int period)
Set the minimum target value in a specific periodvoid
setMinimum(Curve curve)
Set all minimum target values using the shape of the curvevoid
setMinWeight(float value, int period)
Set the weighting factor on targets below the minimum for the specified period to the given value.void
setMinWeight(Curve curve)
Set all the weighting factors on targets below the minimum using curve interpolation.void
setPreMultiply(boolean state)
This variable controls the order of operation for computing the penalty value for non-linear scaling.void
setSumActive(boolean value)
Deprecated.Summary charts are no longer supportedvoid
setSummary(float value, int period)
Set the normalizing value for the specified period.void
setSummary(Curve curve)
Set the normalizing value for all periods using curve interpolation.
-
Method Details
-
getLabel
String getLabel()Get the name of the target -
getPeriods
int getPeriods()Get the number of periods for this target -
isActive
boolean isActive()Is the target actively contributing to the objective function? -
setActive
void setActive(boolean value)Set the active status of the target. If true then the target contributes to the objective function. If false then the value are being tracked, but not used by the solver to control the solution. -
isMinActive
boolean isMinActive()Is the minimum value actively contributing to the objective function? -
setMinActive
void setMinActive(boolean value)Set the active status of the minimum value. If true then the values below the minimum value will contribute to the objective function. -
isMaxActive
boolean isMaxActive()Is the maximum value actively contributing to the objective function? -
setMaxActive
void setMaxActive(boolean value)Set the active status of the maximum value. If true then the values above the maximum value will contribute to the objective function. -
isSumActive
boolean isSumActive()Deprecated.Summary charts are no longer supportedIs the target in summary mode. Summary mode will cause the values to be display in chart format as a percentage of the summary value. -
setSumActive
void setSumActive(boolean value)Deprecated.Summary charts are no longer supportedSet the display mode to normal (false) or summary (true). In summary mode the target values will be normalized by the summary values. -
getCurrent
float getCurrent(int period)Get the current value of the target for the specified period. -
getInterval
float getInterval(int period)Get the width of the specified period -
getInitial
double getInitial(int period)Get the initial target value in the specified period -
getMinimum
float getMinimum(int period)Get the minimum target value in the specified period -
setMinimum
Set all minimum target values using the shape of the curve -
setMinimum
void setMinimum(float value, int period)Set the minimum target value in a specific period -
getMaximum
float getMaximum(int period)Get the maximum target value in the specified period -
setMaximum
Set all maximum target values using the shape of the curve -
setMaximum
void setMaximum(float value, int period)Set the maximum target value in a specific period -
getSummary
float getSummary(int period)Get the normalizing value for the specified period. -
setSummary
Set the normalizing value for all periods using curve interpolation. -
setSummary
void setSummary(float value, int period)Set the normalizing value for the specified period. -
getDiscount
float getDiscount(int period)Get the discounting value that applies to a specific period -
setDiscountRate
void setDiscountRate(float value)Set the discounting rate to be used on this target The rate is expressed as a value such as 1.04 for a 4% discounting.The discount rate is applied to cost calculations along with the weighting factor. Over long time horizons the dicount rate will outweigh the weighting factor.
Discounting is by midperiod
-
getDiscountRate
float getDiscountRate()Get the discounting rate that has been set for this target -
getMinWeight
float getMinWeight(int period)Get the weighting factor on targets below the minimum for the specified period. -
setMinWeight
Set all the weighting factors on targets below the minimum using curve interpolation. -
setMinWeight
void setMinWeight(float value, int period)Set the weighting factor on targets below the minimum for the specified period to the given value. -
getMaxWeight
float getMaxWeight(int period)Get the weighting factor on targets above the maximum for the specified period. -
setMaxWeight
Set all the weighting factors on targets above the maximum using curve interpolation. -
setMaxWeight
void setMaxWeight(float value, int period)Set the weighting factor on targets above the maximum for the specified period to the given value. -
getMarginalCost
float getMarginalCost(int period)Compute the marginal cost at the given period. The marginal cost is the change in weighted value for a change in one unit of the target. -
setLinear
void setLinear(boolean value)Set the type of weighting to be used to linear (true) or quadratic (false). -
isLinear
boolean isLinear()Determine if this target is using linear or quadratic scaling. -
setPreMultiply
void setPreMultiply(boolean state)This variable controls the order of operation for computing the penalty value for non-linear scaling. If true, then the penalty value is computed by mulitplying the weight times the delta, and then squaring. If false, then square before multiplying. This only effects non-linear scaling. The order does not change the result in linear scaling.The default value is false, which is the original Patchworks behaviour.
-
getPreMultiply
boolean getPreMultiply()Obtain the current setting for non-linear scaling penalty calculation. See thesetPreMultiply(boolean)
method description for details. -
getObjectiveValue
double getObjectiveValue()Get the contribution of this target towards the objective function value. -
getObjectiveValue
double getObjectiveValue(int period)Get the contribution of this target towards the objective function value in the specified period. -
getShortage
double getShortage(int period)Get the shortage between the target and the current value. If the target is a upper limit, then the excess will be reported as a negative number. -
addObserver
Add anObserver
to be notified when target settings have been changed. -
deleteObserver
Remove theObserver
on this target.
-