Package org.opt4j.core
Class Objectives
- java.lang.Object
-
- org.opt4j.core.Objectives
-
-
Constructor Summary
Constructors Constructor Description Objectives()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(java.lang.String name, Objective.Sign sign, double value)
Adds the objective with the specified value.void
add(java.lang.String name, Objective.Sign sign, int value)
Adds the objective with the specified value.void
add(java.lang.String name, Objective.Sign sign, Value<?> value)
Adds the objective with the specified value.void
add(Objective objective, double value)
Adds the objective with the specified double value.void
add(Objective objective, int value)
Adds the objective with the specified integer value.void
add(Objective objective, Value<?> value)
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<?>
get(Objective objective)
Returns the value that is assigned to the given objective.Objective
get(Value<?> value)
Returns the objective that is assigned to the given value.java.util.Collection<Objective>
getKeys()
Returns all objectives.java.util.Collection<Value<?>>
getValues()
Returns all values.boolean
isEqual(Objectives opponent)
Returnstrue
if this objectives are equal to the specified objectives.java.util.Iterator<java.util.Map.Entry<Objective,Value<?>>>
iterator()
int
size()
Returns the number of setObjective
s.protected void
submit()
Calculates the array.java.lang.String
toString()
boolean
weaklyDominates(Objectives opponent)
Returnstrue
if this objectives weakly dominates the specified objectives.
-
-
-
Method Detail
-
array
public double[] 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:
Value.getDouble()
-
submit
protected void submit()
Calculates the array.
-
size
public int size()
Returns the number of setObjective
s.- Returns:
- the number of set objectives
-
getKeys
public java.util.Collection<Objective> getKeys()
Returns all objectives.- Returns:
- all objectives
-
getValues
public java.util.Collection<Value<?>> getValues()
Returns all values.- Returns:
- all values
-
get
public Value<?> get(Objective objective)
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
public Objective get(Value<?> value)
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
public void add(Objective objective, Value<?> value)
Adds the objective with the specified value.- Parameters:
objective
- the objectivevalue
- the value
-
add
public void add(java.lang.String name, Objective.Sign sign, Value<?> value)
Adds the objective with the specified value.- Parameters:
name
- the name of the objectivesign
- the optimization directionvalue
- the value
-
add
public void add(Objective objective, double value)
Adds the objective with the specified double value.- Parameters:
objective
- the objectivevalue
- the value
-
add
public void add(java.lang.String name, Objective.Sign sign, double value)
Adds the objective with the specified value.- Parameters:
name
- the name of the objectivesign
- the optimization directionvalue
- the value
-
add
public void add(Objective objective, int value)
Adds the objective with the specified integer value.- Parameters:
objective
- the objectivevalue
- the value
-
add
public void add(java.lang.String name, Objective.Sign sign, int value)
Adds the objective with the specified value.- Parameters:
name
- the name of the objectivesign
- the optimization directionvalue
- the value
-
addAll
public void addAll(Objectives objectives)
Adds all objective with the specified value specified inObjectives
.- Parameters:
objectives
- the objectives
-
weaklyDominates
public boolean weaklyDominates(Objectives opponent)
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
public boolean dominates(Objectives opponent)
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
public boolean isEqual(Objectives opponent)
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
public double distance(Objectives other)
Calculates the euclidean distance of twoObjectives
. This calculation is based on thearray()
values.- Parameters:
other
- the second objectives- Returns:
- the euclidean distance
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-