public static class AbstractTarget.ConstraintAdapter extends Object implements Appointable.Constraint, Serializable
Appointable.Constraints.| Modifier and Type | Field and Description |
|---|---|
private Number |
above
The above value in a above-below constraint.
|
private Number |
below
The below value in a above-below constraint.
|
private Number |
from
The from value in a from-to constraint.
|
private Number |
max
The maximum if specified.
|
private Number |
min
The minimum if specified.
|
private static long |
serialVersionUID |
private Number |
to
The to value in a from-to constraint.
|
private String |
valuename
The name of the parameter to test.
|
| Constructor and Description |
|---|
ConstraintAdapter(String val)
Constructs a new constraints object giving the parameter name and
specifying one parameter constraint.
|
ConstraintAdapter(String val,
Number cmin,
Number cmax,
Number cfrom,
Number cto,
Number cbelow,
Number cabove)
Constructs a new constraints object giving the parameter name and
specifying one parameter constraint.
|
| Modifier and Type | Method and Description |
|---|---|
Number |
getAbove()
Returns the upper bound of the forbiddn parameter space.
|
Number |
getBelow()
Returns the lower bound of the forbiddn parameter space.
|
Number |
getFrom()
Returns the lower bound of the allowed parameter space.
|
Number |
getMax()
Returns the maximum of the allowed parameter space.
|
Number |
getMin()
Returns the minimum of the allowed parameter space.
|
long |
getTimeForConstraint(GlobalGrouping set,
TargetDefinition target)
Returns the time remaining for this constraint.
|
Number |
getTo()
Returns the upper bound of the allowed parameter space.
|
String |
getValueName()
Returns the value name asociated with this constraint.
|
boolean |
isSatisfied(GlobalGrouping set,
TargetDefinition target)
Implements the
stella.Scheduling.Constraint method and
diverts it to calculating the remaining time. |
String |
toString()
Returns the name of the variable plus the apllied constraint.
|
private static final long serialVersionUID
private final String valuename
private final Number min
private final Number max
private final Number from
private final Number to
private final Number below
private final Number above
public ConstraintAdapter(String val)
public ConstraintAdapter(String val, Number cmin, Number cmax, Number cfrom, Number cto, Number cbelow, Number cabove)
public String getValueName()
getValueName in interface Appointable.Constraintpublic Number getMin()
getMin in interface Appointable.Constraintpublic Number getMax()
getMax in interface Appointable.Constraintpublic Number getFrom()
getFrom in interface Appointable.Constraintpublic Number getTo()
getTo in interface Appointable.Constraintpublic Number getBelow()
getBelow in interface Appointable.Constraintpublic Number getAbove()
getAbove in interface Appointable.Constraintpublic boolean isSatisfied(GlobalGrouping set, TargetDefinition target)
stella.Scheduling.Constraint method and
diverts it to calculating the remaining time. If no time is
remaining, false is returned.isSatisfied in interface Appointable.Constraintpublic long getTimeForConstraint(GlobalGrouping set, TargetDefinition target)
valuename
. Then, the type of constraint is checked and the current value of
the parameter is checked against the constraints. If the parameter is
out of bounds, zero is returned. Otherwise, the parameter is checked
for being Increasing or Decreasing. Depending on the
constraint type, this property of the parameter is used to fetch a
remaining time. If the parameter does not supply a Increasing
or Decreasing information, the maximum time is returned.getTimeForConstraint in interface Appointable.Constraint