public class ObjectiveFactory extends Object
SolutionEvaluator.Objectives from usual
situations.| Constructor and Description |
|---|
ObjectiveFactory() |
| Modifier and Type | Method and Description |
|---|---|
<Solution> Collection<SolutionEvaluator.Objective<Solution,?>> |
createFromGetters(Class<Solution> solutionClass)
This method retrieves all the values accessible through a getter (
getX() method) in order to build the corresponding set of
SolutionEvaluator.Objectives. |
<Solution> Collection<SolutionEvaluator.Objective<Solution,?>> |
createFromGettersWithoutSetters(Class<Solution> solutionClass)
This method retrieves all the values accessible through a getter (
getX() method) in order to build the corresponding set of
SolutionEvaluator.Objectives. |
public <Solution> Collection<SolutionEvaluator.Objective<Solution,?>> createFromGetters(Class<Solution> solutionClass)
getX() method) in order to build the corresponding set of
SolutionEvaluator.Objectives. Notice that SolutionEvaluator.Objectives are supposed to
represent evaluations of a Solution, so if the Solution
has other kinds of information accessible through getters, they will also
be retrieved as SolutionEvaluator.Objectives. In such a case, you should filter the
returned SolutionEvaluator.Objectives, rely on more advanced methods, or generate
the SolutionEvaluator.Objectives manually.solutionClass - the Solution class to analyzeSolutionEvaluator.Objectives retrieved from this class#createFromLonelyGetters(Class)public <Solution> Collection<SolutionEvaluator.Objective<Solution,?>> createFromGettersWithoutSetters(Class<Solution> solutionClass)
getX() method) in order to build the corresponding set of
SolutionEvaluator.Objectives. At the opposite of createFromGetters(Class),
an additional filter is used: we build an SolutionEvaluator.Objective for each
getter which does not correspond to a setter (setX() method
with the same X than the getter). This method is adapted for
Solution implementations which provide setters only for their
fundamental values (e.g. the path of a TSP Solution) and use
getters only for the computed values (e.g. the length of such a path).SolutionEvaluator.Objectives will not be retrieved. On the opposite,
any additional getter which does not correspond to a relevant
SolutionEvaluator.Objective will be mistakenly retrieved. So be sure that the
relevant elements (and only these ones) have their getter (and no
setter). Otherwise, you should use a different method or generate the
SolutionEvaluator.Objectives manually.solutionClass - the Solution class to analyzeSolutionEvaluator.Objectives retrieved from this classCopyright © 2017. All rights reserved.