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
Objective
is the identifier for a single objective in theObjectives
. It is specified by the following properties:- Name
- Minimization or Maximization
- Rank (use for ordering)
Each
Evaluator
sets a specific amount ofObjective
-Value
pairs.Use the
ObjectivesMonitor
to get allObjective
s of the optimization task.- See Also:
Objectives
,ObjectivesMonitor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Objective.Sign
The sign of the objective.
-
Field Summary
Fields Modifier and Type Field Description static Value<?>
INFEASIBLE
Identifier for infeasible results (null
).protected int
rank
static int
RANK_ERROR
High priority rank (-100).static int
RANK_OBJECTIVE
Standard rank of an objective (0).protected Objective.Sign
sign
-
Constructor Summary
Constructors Constructor Description Objective(String name)
Constructs anObjective
with a given name, sign=MIN, and rank=RANK_OBJECTIVE(0).Objective(String name, Objective.Sign sign)
Constructs anObjective
with a given name, sign, and rank=RANK_OBJECTIVE(0).Objective(String name, Objective.Sign sign, int rank)
Constructs anObjective
with a given name, sign, and rank.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Objective other)
int
getRank()
Returns the rank.Objective.Sign
getSign()
Returns the sign.String
toString()
-
-
-
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 anObjective
with a given name, sign=MIN, and rank=RANK_OBJECTIVE(0).- Parameters:
name
- the name
-
Objective
public Objective(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
-
Objective
public Objective(String name, Objective.Sign sign, int rank)
Constructs anObjective
with 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:
compareTo
in interfaceComparable<Objective>
-
-