import java.util.*; import java.io.*; import choco.Problem; import choco.ContradictionException; import choco.integer.*; import choco.Constraint; import choco.integer.search.DecreasingDomain; import choco.Solver; import choco.Solution; import choco.search.*; public class CSP { private int noCars; // number of cars private int noOpt; // number of options private int noClass; // number of classes private int[] p; // number of cars with option i in a block private int[] q; // size of a block for option i private int[] demand; // demand for class i, i.e. number of cars of class i private int[][] option; // option[i][j] = 1 <-> class i requires option j private int[] optDemand; // demand for an option private MyProblem pb; private IntDomainVar[] position; // the car that is made in position[i] of a sequence private IntDomainVar optPos[][]; // optPos[i][j] = 1 if option i is made in position j private int[] orderedDomain; private double[] heuVal; public CSP(String fname) throws Exception { MyIo fin = new MyIo(fname); noCars = fin.getNextInt(); noOpt = fin.getNextInt(); noClass = fin.getNextInt(); p = new int[noOpt]; q = new int[noOpt]; demand = new int[noClass]; option = new int[noClass][noOpt]; optDemand = new int[noOpt]; orderedDomain = new int[noClass]; heuVal = new double[noClass]; for (int i=0;i AND(position[j]!=i) // for all positions k, where i is in v // public void redundantOptionConstraint(int j){ for (int k=1;k