public class TrajectoryCostSoftObjective extends BaseObjective
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<BatchTransformationRule<?,?>,ActivationFitnessProcessor> |
activationCostProcessors |
protected boolean |
calculateTrajectoryLengthWeight |
static java.lang.String |
DEFAULT_NAME |
protected java.util.Map<BatchTransformationRule<?,?>,java.lang.Double> |
fixCosts |
protected double |
trajectoryLengthWeight |
comparator, fitnessConstraint, fitnessConstraintComparator, isThereFitnessConstraint, level, 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.
|
TrajectoryCostSoftObjective |
withActivationCost(BatchTransformationRule<?,?> rule,
ActivationFitnessProcessor activationCostProcessor)
Sets an activation processor for a rule.
|
TrajectoryCostSoftObjective |
withRuleCost(BatchTransformationRule<?,?> 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, isHardObjective, satisifiesHardObjective, setComparator, setLevel, toString, withComparator, withHardConstraintOnFitness, withHardConstraintOnFitness, withLevel
public static final java.lang.String DEFAULT_NAME
protected java.util.Map<BatchTransformationRule<?,?>,java.lang.Double> fixCosts
protected java.util.Map<BatchTransformationRule<?,?>,ActivationFitnessProcessor> activationCostProcessors
protected double trajectoryLengthWeight
protected boolean calculateTrajectoryLengthWeight
public TrajectoryCostSoftObjective(java.lang.String name)
public TrajectoryCostSoftObjective()
public TrajectoryCostSoftObjective withRuleCost(BatchTransformationRule<?,?> rule, double cost)
rule
- cost
- public TrajectoryCostSoftObjective withActivationCost(BatchTransformationRule<?,?> 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
init
in interface IObjective
init
in class BaseObjective
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.