public class CompositeHardObjective extends BaseObjective
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_NAME |
Constructor and Description |
---|
CompositeHardObjective() |
CompositeHardObjective(java.util.List<IObjective> objectives) |
CompositeHardObjective(java.lang.String name) |
CompositeHardObjective(java.lang.String name,
java.util.List<IObjective> objectives) |
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.
|
CompositeHardObjective |
withObjective(IObjective objective)
Adds a new hard objective.
|
equals, getComparator, getLevel, getName, hashCode, setComparator, setLevel, toString, withComparator, withLevel
public static final java.lang.String DEFAULT_NAME
public CompositeHardObjective(java.lang.String name, java.util.List<IObjective> objectives)
public CompositeHardObjective(java.util.List<IObjective> objectives)
public CompositeHardObjective(java.lang.String name)
public CompositeHardObjective()
public CompositeHardObjective withObjective(IObjective objective)
objective
- public java.lang.Double getFitness(ThreadContext context)
IObjective
context
- The ThreadContext
public void init(ThreadContext context)
IObjective
context
- The ThreadContext
.public IObjective createNew()
IObjective
IObjective
. If it returns the same instance, all the methods has to be thread
save as they are called concurrently.public boolean isHardObjective()
IObjective
IObjective.satisifiesHardObjective(Double)
is called.IObjective.satisifiesHardObjective(Double)
,
IObjective
public boolean satisifiesHardObjective(java.lang.Double fitness)
IObjective
fitness
- The fitness value of a solution.IObjective