Package org.opt4j.core
Class Objectives
java.lang.Object
org.opt4j.core.Objectives
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(String name, Objective.Sign sign, double value) Adds the objective with the specified value.voidadd(String name, Objective.Sign sign, int value) Adds the objective with the specified value.voidadd(String name, Objective.Sign sign, Value<?> value) Adds the objective with the specified value.voidAdds the objective with the specified double value.voidAdds the objective with the specified integer value.voidAdds the objective with the specified value.voidaddAll(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.doubledistance(Objectives other) Calculates the euclidean distance of twoObjectives.booleandominates(Objectives opponent) Returnstrueif 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.booleanisEqual(Objectives opponent) Returnstrueif this objectives are equal to the specified objectives.iterator()intsize()Returns the number of setObjectives.toString()booleanweaklyDominates(Objectives opponent) Returnstrueif this objectives weakly dominates the specified objectives.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 setObjectives.- 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. Returnsnullif the objective does not exist.- Parameters:
objective- the given objective- Returns:
- the value
-
get
Returns the objective that is assigned to the given value. Returnsnullif 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
Returnstrueif this objectives weakly dominates the specified objectives. This comparison is based on thearray()values.- Parameters:
opponent- other objectives- Returns:
trueif this objectives weakly dominate theopponent
-
dominates
Returnstrueif this objectives dominate the specified objectives. This comparison is based on thearray()values.- Parameters:
opponent- other objectives- Returns:
trueif these objectives dominate theopponent
-
isEqual
Returnstrueif this objectives are equal to the specified objectives. This comparison is based on thearray()values.- Parameters:
opponent- other objectives- Returns:
trueif 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
-