public class DepthHardObjective extends BaseObjective
Modifier and Type | Field and Description |
---|---|
protected int |
maxDepth |
protected int |
minDepth |
comparator, fitnessConstraint, fitnessConstraintComparator, isThereFitnessConstraint, level, name
Constructor and Description |
---|
DepthHardObjective() |
DepthHardObjective(int minDepth) |
DepthHardObjective(int minDepth,
int maxDepth) |
DepthHardObjective(java.lang.String name) |
DepthHardObjective(java.lang.String name,
int minDepth) |
DepthHardObjective(java.lang.String name,
int minDepth,
int maxDepth) |
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.
|
DepthHardObjective |
withMaxDepth(int maxDepth) |
DepthHardObjective |
withMinDepth(int minDepth) |
equals, getComparator, getLevel, getName, hashCode, setComparator, setLevel, toString, withComparator, withHardConstraintOnFitness, withHardConstraintOnFitness, withLevel
public DepthHardObjective()
public DepthHardObjective(java.lang.String name)
public DepthHardObjective(int minDepth)
public DepthHardObjective(java.lang.String name, int minDepth)
public DepthHardObjective(int minDepth, int maxDepth)
public DepthHardObjective(java.lang.String name, int minDepth, int maxDepth)
public DepthHardObjective withMinDepth(int minDepth)
public DepthHardObjective withMaxDepth(int maxDepth)
public void init(ThreadContext context)
IObjective
init
in interface IObjective
init
in class BaseObjective
context
- The ThreadContext
.public java.lang.Double getFitness(ThreadContext context)
IObjective
context
- The ThreadContext
public boolean isHardObjective()
IObjective
IObjective.satisifiesHardObjective(Double)
is called.isHardObjective
in interface IObjective
isHardObjective
in class BaseObjective
IObjective.satisifiesHardObjective(Double)
,
IObjective
public boolean satisifiesHardObjective(java.lang.Double fitness)
IObjective
satisifiesHardObjective
in interface IObjective
satisifiesHardObjective
in class BaseObjective
fitness
- The fitness value of a solution.IObjective
public IObjective createNew()
IObjective
IObjective
. If it returns the same instance, all the methods has to be thread
save as they are called concurrently.