Solution - public interface SolutionBuilder<Solution>
SolutionBuilder allows to generate a Solution by setting
its fundamental information, in other words by providing the values of its
SolutionBuilder.Variables.| Modifier and Type | Interface and Description |
|---|---|
static interface |
SolutionBuilder.Variable<Solution,Value>
A
SolutionBuilder.Variable represents the fundamental information of a set of
homogeneous Solutions (e.g. a population of solutions returned by
an Algorithm). |
| Modifier and Type | Method and Description |
|---|---|
Solution |
build()
This method generates a valid
Solution based on all the
Values prepared by calling prepare(Variable, Object). |
Collection<SolutionBuilder.Variable<Solution,?>> |
getVariables() |
<Value> void |
prepare(SolutionBuilder.Variable<Solution,Value> variable,
Value value)
This method tells which
Value to assign to the next
Solution, generated by build(), for a given
SolutionBuilder.Variable. |
Collection<SolutionBuilder.Variable<Solution,?>> getVariables()
SolutionBuilder.Variables managed by this
SolutionBuilder<Value> void prepare(SolutionBuilder.Variable<Solution,Value> variable, Value value)
Value to assign to the next
Solution, generated by build(), for a given
SolutionBuilder.Variable. Once all the required SolutionBuilder.Variables are prepared,
build() can be called to generate the Solution. If this
method is called several time on the same SolutionBuilder.Variable before to call
build(), the last prepared Value should be considered.variable - the SolutionBuilder.Variable to considervalue - the Value to prepare for this SolutionBuilder.VariableSolution build()
Solution based on all the
Values prepared by calling prepare(Variable, Object).
Usually, all the SolutionBuilder.Variables should have been prepared before to be
able to build a valid Solution, but it depends on the definition
of the Solution (e.g. there could have SolutionBuilder.Variables
depending on each other, such that preparing one is equivalent to prepare
others). Specific implementation could provide a method to know whether
or not build() can be called, or other facilities to ensure that
a Solution is properly prepared when build() is called.Solution instanceCopyright © 2018. All rights reserved.