Package org.opt4j.core
Class Objectives
java.lang.Object
org.opt4j.core.Objectives
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(String name, Objective.Sign sign, double value) Adds the objective with the specified value.void
add
(String name, Objective.Sign sign, int value) Adds the objective with the specified value.void
add
(String name, Objective.Sign sign, Value<?> value) Adds the objective with the specified value.void
Adds the objective with the specified double value.void
Adds the objective with the specified integer value.void
Adds the objective with the specified value.void
addAll
(Objectives objectives) Adds all objective with the specified value specified inObjectives
.double[]
array()
Returns an array of all values which all have to be minimized.double
distance
(Objectives other) Calculates the euclidean distance of twoObjectives
.boolean
dominates
(Objectives opponent) Returnstrue
if this objectives dominate the specified objectives.Value
<?> Returns the value that is assigned to the given objective.Returns the objective that is assigned to the given value.getKeys()
Returns all objectives.Collection
<Value<?>> Returns all values.boolean
isEqual
(Objectives opponent) Returnstrue
if this objectives are equal to the specified objectives.iterator()
int
size()
Returns the number of setObjective
s.toString()
boolean
weaklyDominates
(Objectives opponent) Returnstrue
if this objectives weakly dominates the specified objectives.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Objectives
public Objectives()
-
-
Method Details
-
iterator
-
array
Returns an array of all values which all have to be minimized. Do not call this method before all objectives were added!- Returns:
- an array containing values which have to be minimized
- See Also:
-
size
Returns the number of setObjective
s.- Returns:
- the number of set objectives
-
getKeys
Returns all objectives.- Returns:
- all objectives
-
getValues
Returns all values.- Returns:
- all values
-
get
Returns the value that is assigned to the given objective. Returnsnull
if the objective does not exist.- Parameters:
objective
- the given objective- Returns:
- the value
-
get
Returns the objective that is assigned to the given value. Returnsnull
if the value does not exist.- Parameters:
value
- the given value- Returns:
- the objective
-
add
Adds the objective with the specified value.- Parameters:
objective
- the objectivevalue
- the value
-
add
Adds the objective with the specified value.- Parameters:
name
- the name of the objectivesign
- the optimization directionvalue
- the value
-
add
Adds the objective with the specified double value.- Parameters:
objective
- the objectivevalue
- the value
-
add
Adds the objective with the specified value.- Parameters:
name
- the name of the objectivesign
- the optimization directionvalue
- the value
-
add
Adds the objective with the specified integer value.- Parameters:
objective
- the objectivevalue
- the value
-
add
Adds the objective with the specified value.- Parameters:
name
- the name of the objectivesign
- the optimization directionvalue
- the value
-
addAll
Adds all objective with the specified value specified inObjectives
.- Parameters:
objectives
- the objectives
-
weaklyDominates
Returnstrue
if this objectives weakly dominates the specified objectives. This comparison is based on thearray()
values.- Parameters:
opponent
- other objectives- Returns:
true
if this objectives weakly dominate theopponent
-
dominates
Returnstrue
if this objectives dominate the specified objectives. This comparison is based on thearray()
values.- Parameters:
opponent
- other objectives- Returns:
true
if these objectives dominate theopponent
-
isEqual
Returnstrue
if this objectives are equal to the specified objectives. This comparison is based on thearray()
values.- Parameters:
opponent
- other objectives- Returns:
true
if these objectives dominate theopponent
-
distance
Calculates the euclidean distance of twoObjectives
. This calculation is based on thearray()
values.- Parameters:
other
- the second objectives- Returns:
- the euclidean distance
-
toString
-