Package org.opt4j.core
Class Objective
- java.lang.Object
-
- org.opt4j.core.Criterion
-
- org.opt4j.core.Objective
-
- All Implemented Interfaces:
Comparable<Objective>
public class Objective extends Criterion implements Comparable<Objective>
The
Objectiveis the identifier for a single objective in theObjectives. It is specified by the following properties:- Name
- Minimization or Maximization
- Rank (use for ordering)
Each
Evaluatorsets a specific amount ofObjective-Valuepairs.Use the
ObjectivesMonitorto get allObjectives of the optimization task.- See Also:
Objectives,ObjectivesMonitor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classObjective.SignThe sign of the objective.
-
Field Summary
Fields Modifier and Type Field Description static Value<?>INFEASIBLEIdentifier for infeasible results (null).protected intrankstatic intRANK_ERRORHigh priority rank (-100).static intRANK_OBJECTIVEStandard rank of an objective (0).protected Objective.Signsign
-
Constructor Summary
Constructors Constructor Description Objective(String name)Constructs anObjectivewith a given name, sign=MIN, and rank=RANK_OBJECTIVE(0).Objective(String name, Objective.Sign sign)Constructs anObjectivewith a given name, sign, and rank=RANK_OBJECTIVE(0).Objective(String name, Objective.Sign sign, int rank)Constructs anObjectivewith a given name, sign, and rank.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Objective other)intgetRank()Returns the rank.Objective.SigngetSign()Returns the sign.StringtoString()
-
-
-
Field Detail
-
RANK_OBJECTIVE
public static final int RANK_OBJECTIVE
Standard rank of an objective (0).- See Also:
- Constant Field Values
-
RANK_ERROR
public static final int RANK_ERROR
High priority rank (-100).- See Also:
- Constant Field Values
-
INFEASIBLE
public static final Value<?> INFEASIBLE
Identifier for infeasible results (null).
-
sign
protected final Objective.Sign sign
-
rank
protected final int rank
-
-
Constructor Detail
-
Objective
public Objective(String name)
Constructs anObjectivewith a given name, sign=MIN, and rank=RANK_OBJECTIVE(0).- Parameters:
name- the name
-
Objective
public Objective(String name, Objective.Sign sign)
Constructs anObjectivewith a given name, sign, and rank=RANK_OBJECTIVE(0).- Parameters:
name- the namesign- the sign of the objective
-
Objective
public Objective(String name, Objective.Sign sign, int rank)
Constructs anObjectivewith a given name, sign, and rank.- Parameters:
name- the namesign- the sign of the objectiverank- the rank
-
-
Method Detail
-
getSign
public Objective.Sign getSign()
Returns the sign.- Returns:
- the sign
-
getRank
public int getRank()
Returns the rank.- Returns:
- the rank
-
compareTo
public int compareTo(Objective other)
- Specified by:
compareToin interfaceComparable<Objective>
-
-