Package org.opt4j.core
Class Objective
- java.lang.Object
-
- org.opt4j.core.Objective
-
- All Implemented Interfaces:
java.lang.Comparable<Objective>
public class Objective extends java.lang.Object implements java.lang.Comparable<Objective>
The
Objective
is the identifier for a single objective in theObjectives
. It is specified by the following properties:- Name
- Minimization or Maximization
Each
Evaluator
sets a specific amount ofObjective
-Value
pairs. Moreover, eachEvaluator
has to set the sameObjective
s for all phenotypes.- See Also:
Objectives
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Objective.Sign
The sign of theObjective
.
-
Field Summary
Fields Modifier and Type Field Description static Value<?>
INFEASIBLE
Identifier for infeasible results (null
).protected java.lang.String
name
protected Objective.Sign
sign
-
Constructor Summary
Constructors Constructor Description Objective(java.lang.String name)
Constructs anObjective
with a given name, sign=MIN, and rank=RANK_OBJECTIVE(0).Objective(java.lang.String name, Objective.Sign sign)
Constructs anObjective
with a given name, sign, and rank=RANK_OBJECTIVE(0).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Objective other)
boolean
equals(java.lang.Object obj)
java.lang.String
getName()
Returns the name.Objective.Sign
getSign()
Returns the sign.int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
INFEASIBLE
public static final Value<?> INFEASIBLE
Identifier for infeasible results (null
).
-
sign
protected final Objective.Sign sign
-
name
protected final java.lang.String name
-
-
Constructor Detail
-
Objective
public Objective(java.lang.String name)
Constructs anObjective
with a given name, sign=MIN, and rank=RANK_OBJECTIVE(0).- Parameters:
name
- the name
-
Objective
public Objective(java.lang.String name, Objective.Sign sign)
Constructs anObjective
with a given name, sign, and rank=RANK_OBJECTIVE(0).- Parameters:
name
- the namesign
- the sign of the objective
-
-
Method Detail
-
getSign
public Objective.Sign getSign()
Returns the sign.- Returns:
- the sign
-
getName
public java.lang.String getName()
Returns the name.- Returns:
- the name
-
compareTo
public int compareTo(Objective other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Objective>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-