Class LessThanOrEqual
java.lang.Object
org.moeaframework.core.constraint.AbstractConstraint
org.moeaframework.core.constraint.ThresholdConstraint
org.moeaframework.core.constraint.LessThanOrEqual
- All Implemented Interfaces:
Serializable,Comparable<Constraint>,Constraint,Copyable<Constraint>,Defined,Named
The less than or equal to constraint, or
<value> <= <threshold>.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.moeaframework.core.Defined
Defined.ConstructorComparator -
Field Summary
Fields inherited from class org.moeaframework.core.constraint.ThresholdConstraint
epsilon, thresholdFields inherited from class org.moeaframework.core.constraint.AbstractConstraint
name, value -
Constructor Summary
ConstructorsConstructorDescriptionLessThanOrEqual(double threshold) Constructs a new less than or equal to constraint.LessThanOrEqual(double threshold, double epsilon) Constructs a new less than or equal to constraint.LessThanOrEqual(String name, double threshold) Constructs a new less than or equal to constraint.LessThanOrEqual(String name, double threshold, double epsilon) Constructs a new less than or equal to constraint.Constructs a copy of a less than or equal to constraint. -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates and returns a copy of this object.doubleReturns the magnitude of constraint violation as a non-negative number, with0.0representing satisfied or feasible constraints.static LessThanOrEqualto(double threshold) Constructs a new less than or equal to constraint.static LessThanOrEqualto(double threshold, double epsilon) Constructs a new less than or equal to constraint.static LessThanOrEqualConstructs a new less than or equal to constraint.static LessThanOrEqualConstructs a new less than or equal to constraint.Methods inherited from class org.moeaframework.core.constraint.ThresholdConstraint
equals, getDefinition, getEpsilon, getThreshold, hashCode, toStringMethods inherited from class org.moeaframework.core.constraint.AbstractConstraint
getName, getValue, setValueMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.moeaframework.core.constraint.Constraint
compareTo, isViolation, withValue
-
Constructor Details
-
LessThanOrEqual
public LessThanOrEqual(double threshold) Constructs a new less than or equal to constraint.- Parameters:
threshold- the threshold value
-
LessThanOrEqual
public LessThanOrEqual(double threshold, double epsilon) Constructs a new less than or equal to constraint.- Parameters:
threshold- the threshold valueepsilon- the epsilon value
-
LessThanOrEqual
Constructs a new less than or equal to constraint.- Parameters:
name- the namethreshold- the threshold value
-
LessThanOrEqual
Constructs a new less than or equal to constraint.- Parameters:
name- the namethreshold- the threshold valueepsilon- the epsilon value
-
LessThanOrEqual
Constructs a copy of a less than or equal to constraint.- Parameters:
copy- the constraint to copy
-
-
Method Details
-
getMagnitudeOfViolation
public double getMagnitudeOfViolation()Description copied from interface:ConstraintReturns the magnitude of constraint violation as a non-negative number, with0.0representing satisfied or feasible constraints. When comparing two constraints, smaller magnitudes are considered better.- Returns:
- the magnitude of constraint violation
-
copy
Description copied from interface:CopyableCreates and returns a copy of this object. It is required thatx.copy()is completely independent fromx. This means any method invoked onx.copy()in no way alters the state ofxand vice versa. It is typically the case thatx.copy().getClass() == x.getClass()andx.copy().equals(x).- Returns:
- the copy
-
to
Constructs a new less than or equal to constraint.- Parameters:
threshold- the threshold value- Returns:
- the constraint
-
to
Constructs a new less than or equal to constraint.- Parameters:
threshold- the threshold valueepsilon- the epsilon value- Returns:
- the constraint
-
to
Constructs a new less than or equal to constraint.- Parameters:
name- the namethreshold- the threshold value- Returns:
- the constraint
-
to
Constructs a new less than or equal to constraint.- Parameters:
name- the namethreshold- the threshold valueepsilon- the epsilon value- Returns:
- the constraint
-