Class CarSequencing
java.lang.Object
org.jacop.examples.fd.ExampleFD
org.jacop.examples.fd.carsequencing.CarSequencing
It is program to model and solve simple problems of car sequencing problem (CSPLIB-p1).
- Version:
- 4.8
-
Field Summary
FieldsModifier and TypeFieldDescriptionint[]
The sequence length for which the maximum number restriction is specified.boolean
It specifies if one extensional constraint based on MDD created from FSM should be used.int[]
For a given sequence length then can be different maximum number of cars with a given option.int
It specifies number of cars.int
It specifies the number of different car classes.int[]
It specifies how many cars of each option should be produced.int
It specifies the no of options in the car sequencing problem.boolean
It specifies if the regular constraint should be used.boolean[][]
It specifies if the given class (the first dimension) requires given option (the second dimension).boolean
It specifies if the slide based decomposition of the regular constraint should be applied. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FSM
createFSM
(int count, IntervalDomain yes, IntervalDomain no) static void
It executes the program to solve car sequencing problem.void
model()
It specifies a standard way of modeling the problem.static String[]
problem()
A simple car sequencing problem.static String[]
It reads the problem description from the file and returns string representation of the problem.static void
readFromArray
(String[] description, CarSequencing example) It transforms string representation of the problem into an array of ints representation.static void
It executes the program to solve car sequencing problem.static String[]
toStringArray
(CarSequencing example) It creates a String representation of the problem being supplied.Methods inherited from class org.jacop.examples.fd.ExampleFD
creditSearch, getSearch, getSearchVariables, getStore, printMatrix, search, searchAllAtOnce, searchAllOptimal, searchLDS, searchMasterSlave, searchMaxRegretOptimal, searchMiddle, searchMostConstrainedStatic, searchOptimal, searchSmallestDomain, searchSmallestMedian, searchSmallestMiddle, searchSmallestMin, searchWeightedDegree, searchWithMaxRegret, searchWithRestarts, shavingSearch
-
Field Details
-
noCar
public int noCarIt specifies number of cars. -
noOption
public int noOptionIt specifies the no of options in the car sequencing problem. -
noClass
public int noClassIt specifies the number of different car classes. -
maxNoOfCarsPerOption
public int[] maxNoOfCarsPerOptionFor a given sequence length then can be different maximum number of cars with a given option. -
blockSizePerOption
public int[] blockSizePerOptionThe sequence length for which the maximum number restriction is specified. -
noOfCarsPerClass
public int[] noOfCarsPerClassIt specifies how many cars of each option should be produced. -
required
public boolean[][] requiredIt specifies if the given class (the first dimension) requires given option (the second dimension). -
slideDecomposition
public boolean slideDecompositionIt specifies if the slide based decomposition of the regular constraint should be applied. This decomposition uses ternary extensional support constraints. It achieves GAC if FSM is deterministic. -
regular
public boolean regularIt specifies if the regular constraint should be used. -
extensionalMDD
public boolean extensionalMDDIt specifies if one extensional constraint based on MDD created from FSM should be used. The translation process works if FSM is deterministic.
-
-
Constructor Details
-
CarSequencing
public CarSequencing()
-
-
Method Details
-
problem
A simple car sequencing problem.- Returns:
- problem description.
-
readFromArray
It transforms string representation of the problem into an array of ints representation. It stores the whole description in the internal attributes.- Parameters:
description
- array of strings representing the problem.example
- example in which the passed instance is stored.
-
toStringArray
It creates a String representation of the problem being supplied.- Parameters:
example
- example in which the passed instance is stored.- Returns:
- the string representation of the problem instance.
-
model
public void model()Description copied from class:ExampleFD
It specifies a standard way of modeling the problem. -
createFSM
- Parameters:
count
- The number of times a value from yes domain needs to be encountered.yes
- the values which are counted.no
- the values which are not counted.- Returns:
- FSM for simple count constraint.
-
readFile
It reads the problem description from the file and returns string representation of the problem.- Parameters:
file
- the file containing the problem description.- Returns:
- the problem description
-
main
It executes the program to solve car sequencing problem.- Parameters:
args
- parameters (none)
-
test
It executes the program to solve car sequencing problem.- Parameters:
args
- parameters (none)
-