SolutionType
- solution type to be evaluated, required to extend Solution
DataType
- underlying data typepublic class NormalizedObjective<SolutionType extends org.jamesframework.core.problems.sol.Solution,DataType> extends Object implements org.jamesframework.core.problems.objectives.Objective<SolutionType,DataType>
NormalizedEvaluation
.Constructor and Description |
---|
NormalizedObjective(org.jamesframework.core.problems.objectives.Objective<? super SolutionType,? super DataType> obj,
double min,
double max)
Create a normalized objective that wraps the given objective and normalizes all produced
evaluation from [min, max] to [0, 1].
|
Modifier and Type | Method and Description |
---|---|
<ActualSolutionType extends SolutionType> |
evaluate(org.jamesframework.core.search.neigh.Move<? super ActualSolutionType> move,
ActualSolutionType curSolution,
org.jamesframework.core.problems.objectives.evaluations.Evaluation curEvaluation,
DataType data)
Computes the normalized evaluation of the solution obtained by applying the given move
to the current solution.
|
NormalizedEvaluation |
evaluate(SolutionType solution,
DataType data)
Computes the normalized evaluation of the given solution.
|
double |
getMax()
Get upper bound of normalization interval
|
double |
getMin()
Get lower bound of normalization interval.
|
org.jamesframework.core.problems.objectives.Objective<? super SolutionType,? super DataType> |
getUnnormalizedObjective()
Get the original, unnormalized objective.
|
boolean |
isMinimizing()
Indicates whether the produced evaluations are to be minimized.
|
String |
toString()
Create string representation of normalized objective, indicating
the original, unnormalized objective and normalization interval.
|
public NormalizedObjective(org.jamesframework.core.problems.objectives.Objective<? super SolutionType,? super DataType> obj, double min, double max)
obj
- original, unnormalized objectivemin
- lower bound of normalization intervalmax
- upper bound of normalization intervalNullPointerException
- if obj
is null
public org.jamesframework.core.problems.objectives.Objective<? super SolutionType,? super DataType> getUnnormalizedObjective()
public double getMin()
public double getMax()
public NormalizedEvaluation evaluate(SolutionType solution, DataType data)
NormalizedEvaluation
.evaluate
in interface org.jamesframework.core.problems.objectives.Objective<SolutionType extends org.jamesframework.core.problems.sol.Solution,DataType>
solution
- solution to evaluatedata
- underlying datapublic <ActualSolutionType extends SolutionType> NormalizedEvaluation evaluate(org.jamesframework.core.search.neigh.Move<? super ActualSolutionType> move, ActualSolutionType curSolution, org.jamesframework.core.problems.objectives.evaluations.Evaluation curEvaluation, DataType data)
NormalizedEvaluation
.evaluate
in interface org.jamesframework.core.problems.objectives.Objective<SolutionType extends org.jamesframework.core.problems.sol.Solution,DataType>
ActualSolutionType
- the actual solution type of the problem that is being solved;
a subtype of the solution types of both the objective and the applied movemove
- move to evaluatecurSolution
- current solutioncurEvaluation
- evaluation of current solutiondata
- underlying data used for evaluationorg.jamesframework.core.exceptions.IncompatibleDeltaEvaluationException
- if the delta evaluation of the original objective
is not compatible with the received move typepublic boolean isMinimizing()
isMinimizing
in interface org.jamesframework.core.problems.objectives.Objective<SolutionType extends org.jamesframework.core.problems.sol.Solution,DataType>
true
if evaluations are to be minimized,
false
if they are to be maximizedCopyright © 2016. All rights reserved.