public class SimpleCartesianProductConstraintConverter extends Object implements IndexBasedConstraintConverter
Constraint objects to their TupleList representation by executing their
ConstraintFunction with every possible value combination of its
parameters. This means the cartesian product of its parameters values is used.
For example, if a constraint uses parameters "param1" with value "1" and "2" and "param2" with value "5" and "6",
then the constraint it tested with all these combinations: {"1", "5"}, {"1", "6"}, {"2", "5"} ,{"2", "6"}.
For all combinations for which the ConstraintFunction
returns false, a corresponding tuple is added to the TupleList representation.
Naturally, this is a very expensive conversion process, especially if there are many large parameters involved.| Constructor and Description |
|---|
SimpleCartesianProductConstraintConverter() |
| Modifier and Type | Method and Description |
|---|---|
List<TupleList> |
convert(List<Constraint> constraints,
List<Parameter> parameters)
Converts all constraints to tuple lists by using the index based schema explained in
ModelConverter. |
public SimpleCartesianProductConstraintConverter()
public List<TupleList> convert(List<Constraint> constraints, List<Parameter> parameters)
IndexBasedConstraintConverterModelConverter.
The constraints need to be converted in order.convert in interface IndexBasedConstraintConverterconstraints - all constraint which need to be converted. Must not be null but can be emptyparameters - the parameters containing the values for the conversion. Must not be null. Can only
be empty if constraints is empty too as otherwise parameters are constrainedCopyright © 2019. All rights reserved.