Class SimpleCartesianProductConstraintConverter
- java.lang.Object
-
- de.rwth.swc.coffee4j.model.converter.SimpleCartesianProductConstraintConverter
-
- All Implemented Interfaces:
IndexBasedConstraintConverter
public class SimpleCartesianProductConstraintConverter extends java.lang.Object implements IndexBasedConstraintConverter
ConvertsConstraintobjects to theirTupleListrepresentation by executing theirConstraintFunctionwith 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 theConstraintFunctionreturnsfalse, a corresponding tuple is added to theTupleListrepresentation. Naturally, this is a very expensive conversion process, especially if there are many large parameters involved.
-
-
Constructor Summary
Constructors Constructor Description SimpleCartesianProductConstraintConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<de.rwth.swc.coffee4j.engine.TupleList>convert(java.util.List<Constraint> constraints, java.util.List<Parameter> parameters)Converts all constraints to tuple lists by using the index based schema explained inModelConverter.
-
-
-
Method Detail
-
convert
public java.util.List<de.rwth.swc.coffee4j.engine.TupleList> convert(java.util.List<Constraint> constraints, java.util.List<Parameter> parameters)
Description copied from interface:IndexBasedConstraintConverterConverts all constraints to tuple lists by using the index based schema explained inModelConverter. The constraints need to be converted in order.- Specified by:
convertin interfaceIndexBasedConstraintConverter- Parameters:
constraints- all constraint which need to be converted. Must not benullbut can be emptyparameters- the parameters containing the values for the conversion. Must not benull. Can only be empty if constraints is empty too as otherwise parameters are constrained- Returns:
- the converted constraints in the same order as the given constraints
-
-