ExamplesJaCoP
Class CarSequencing

java.lang.Object
  extended by ExamplesJaCoP.Example
      extended by ExamplesJaCoP.CarSequencing

public class CarSequencing
extends Example

It is program to model and solve simple problems of car sequencing problem (CSPLIB-p1).

Author:
Radoslaw Szymanek

Field Summary
 int[] blockSizePerOption
          The sequence length for which the maximum number restriction is specified.
 boolean extensionalMDD
          It specifies if one extensional constraint based on MDD created from FSM should be used.
 int[] maxNoOfCarsPerOption
          For a given sequence length then can be different maximum number of cars with a given option.
 int noCar
          It specifies number of cars.
 int noClass
          It specifies the number of different car classes.
 int[] noOfCarsPerClass
          It specifies how many cars of each option should be produced.
 int noOption
          It specifies the no of options in the car sequencing problem.
static java.lang.String[] problem
          A simple car sequencing problem.
 boolean regular
          It specifies if the regular constraint should be used.
 boolean[][] required
          It specifies if the given class (the first dimension) requires given option (the second dimension).
 boolean slideDecomposition
          It specifies if the slide based decomposition of the regular constraint should be applied.
 
Fields inherited from class ExamplesJaCoP.Example
cost, search, store, vars
 
Constructor Summary
CarSequencing()
           
 
Method Summary
static FSM createFSM(int count, IntervalDomain yes, IntervalDomain no)
           
static void main(java.lang.String[] args)
          It executes the program to solve car sequencing problem.
 void model()
          It specifies a standard way of modeling the problem.
static java.lang.String[] readFile(java.lang.String file)
          It reads the problem description from the file and returns string representation of the problem.
static void readFromArray(java.lang.String[] description, CarSequencing example)
          It transforms string representation of the problem into an array of ints representation.
static void test(java.lang.String[] args)
          It executes the program to solve car sequencing problem.
static java.lang.String[] toStringArray(CarSequencing example)
          It creates a String representation of the problem being supplied.
 
Methods inherited from class ExamplesJaCoP.Example
creditSearch, getSearch, getSearchVariables, getStore, printMatrix, search, searchAllAtOnce, searchAllOptimal, searchLDS, searchMasterSlave, searchMaxRegretOptimal, searchMiddle, searchMostConstrainedStatic, searchOptimal, searchSmallestDomain, searchSmallestMedian, searchSmallestMiddle, searchSmallestMin, searchWeightedDegree, searchWithMaxRegret, searchWithRestarts, shavingSearch
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

problem

public static java.lang.String[] problem
A simple car sequencing problem.


noCar

public int noCar
It specifies number of cars.


noOption

public int noOption
It specifies the no of options in the car sequencing problem.


noClass

public int noClass
It specifies the number of different car classes.


maxNoOfCarsPerOption

public int[] maxNoOfCarsPerOption
For a given sequence length then can be different maximum number of cars with a given option.


blockSizePerOption

public int[] blockSizePerOption
The sequence length for which the maximum number restriction is specified.


noOfCarsPerClass

public int[] noOfCarsPerClass
It specifies how many cars of each option should be produced.


required

public boolean[][] required
It specifies if the given class (the first dimension) requires given option (the second dimension).


slideDecomposition

public boolean slideDecomposition
It 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 regular
It specifies if the regular constraint should be used.


extensionalMDD

public boolean extensionalMDD
It specifies if one extensional constraint based on MDD created from FSM should be used. The translation process works if FSM is deterministic.

Constructor Detail

CarSequencing

public CarSequencing()
Method Detail

readFromArray

public static void readFromArray(java.lang.String[] description,
                                 CarSequencing example)
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

public static java.lang.String[] toStringArray(CarSequencing example)
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: Example
It specifies a standard way of modeling the problem.

Specified by:
model in class Example

createFSM

public static FSM createFSM(int count,
                            IntervalDomain yes,
                            IntervalDomain no)
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

public static java.lang.String[] readFile(java.lang.String file)
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

public static void main(java.lang.String[] args)
It executes the program to solve car sequencing problem.

Parameters:
args -

test

public static void test(java.lang.String[] args)
It executes the program to solve car sequencing problem.

Parameters:
args -