public class TrajectoryCostSoftObjective extends BaseObjective
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_NAME |
Constructor and Description |
---|
TrajectoryCostSoftObjective() |
TrajectoryCostSoftObjective(java.lang.String name) |
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.
|
TrajectoryCostSoftObjective |
withActivationCost(DSETransformationRule<?,?> rule,
ActivationFitnessProcessor activationCostProcessor)
Sets an activation processor for a rule.
|
TrajectoryCostSoftObjective |
withRuleCost(DSETransformationRule<?,?> rule,
double cost)
Sets the cost of a rule.
|
TrajectoryCostSoftObjective |
withTrajectoryLengthWeight(double trajectoryLengthWeight)
The length of the trajectory multiplied with given parameter will be added to the fitness value.
|
equals, getComparator, getLevel, getName, hashCode, setComparator, setLevel, toString, withComparator, withLevel
public static final java.lang.String DEFAULT_NAME
public TrajectoryCostSoftObjective(java.lang.String name)
public TrajectoryCostSoftObjective()
public TrajectoryCostSoftObjective withRuleCost(DSETransformationRule<?,?> rule, double cost)
rule
- cost
- public TrajectoryCostSoftObjective withActivationCost(DSETransformationRule<?,?> rule, ActivationFitnessProcessor activationCostProcessor)
rule
- activationCostProcessor
- public TrajectoryCostSoftObjective withTrajectoryLengthWeight(double trajectoryLengthWeight)
trajectoryLengthWeight
- The weight of a transformation rule application.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