public class CompositeObjective extends BaseObjective
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_NAME |
protected boolean |
hardObjective |
protected java.util.List<IObjective> |
objectives |
protected java.util.List<java.lang.Double> |
weights |
comparator, fitnessConstraint, fitnessConstraintComparator, isThereFitnessConstraint, level, name| Constructor and Description |
|---|
CompositeObjective() |
CompositeObjective(java.util.List<IObjective> objectives,
java.util.List<java.lang.Double> weights) |
CompositeObjective(java.lang.String name) |
CompositeObjective(java.lang.String name,
java.util.List<IObjective> objectives,
java.util.List<java.lang.Double> weights) |
| Modifier and Type | Method and Description |
|---|---|
IObjective |
createNew()
Returns an instance of the
IObjective. |
java.lang.Double |
getFitness(ThreadContext context)
Calculates the value of the objective on a given solution (trajectory).
|
void |
init(ThreadContext context)
Initializes the objective.
|
boolean |
isHardObjective()
Returns true if the objective is a hard objective.
|
boolean |
satisifiesHardObjective(java.lang.Double fitness)
Determines if the given fitness value satisfies the hard objective.
|
CompositeObjective |
withObjective(IObjective objective)
Adds a new objective.
|
CompositeObjective |
withObjective(IObjective objective,
double weight)
Adds a new objective.
|
equals, getComparator, getLevel, getName, hashCode, setComparator, setLevel, toString, withComparator, withHardConstraintOnFitness, withHardConstraintOnFitness, withLevelpublic static final java.lang.String DEFAULT_NAME
protected java.util.List<IObjective> objectives
protected java.util.List<java.lang.Double> weights
protected boolean hardObjective
public CompositeObjective(java.lang.String name,
java.util.List<IObjective> objectives,
java.util.List<java.lang.Double> weights)
public CompositeObjective(java.util.List<IObjective> objectives, java.util.List<java.lang.Double> weights)
public CompositeObjective(java.lang.String name)
public CompositeObjective()
public CompositeObjective withObjective(IObjective objective)
objective - public CompositeObjective withObjective(IObjective objective, double weight)
objective - public java.lang.Double getFitness(ThreadContext context)
IObjectivecontext - The ThreadContextpublic void init(ThreadContext context)
IObjectiveinit in interface IObjectiveinit in class BaseObjectivecontext - The ThreadContext.public IObjective createNew()
IObjectiveIObjective. If it returns the same instance, all the methods has to be thread
save as they are called concurrently.public boolean isHardObjective()
IObjectiveIObjective.satisifiesHardObjective(Double) is called.isHardObjective in interface IObjectiveisHardObjective in class BaseObjectiveIObjective.satisifiesHardObjective(Double),
IObjectivepublic boolean satisifiesHardObjective(java.lang.Double fitness)
IObjectivesatisifiesHardObjective in interface IObjectivesatisifiesHardObjective in class BaseObjectivefitness - The fitness value of a solution.IObjective