You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(4) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(2) |
Feb
(8) |
Mar
(13) |
Apr
(1) |
May
(2) |
Jun
(5) |
Jul
(7) |
Aug
(1) |
Sep
(1) |
Oct
(9) |
Nov
(1) |
Dec
(15) |
2006 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(1) |
May
(10) |
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(6) |
Dec
|
2007 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(14) |
Jul
(3) |
Aug
|
Sep
(7) |
Oct
(13) |
Nov
(4) |
Dec
(7) |
2008 |
Jan
(1) |
Feb
(4) |
Mar
(2) |
Apr
(7) |
May
(4) |
Jun
(17) |
Jul
(20) |
Aug
(7) |
Sep
(23) |
Oct
(18) |
Nov
(47) |
Dec
(51) |
2009 |
Jan
(35) |
Feb
(20) |
Mar
(32) |
Apr
(38) |
May
(119) |
Jun
(99) |
Jul
(65) |
Aug
(22) |
Sep
(24) |
Oct
(39) |
Nov
(9) |
Dec
(10) |
2010 |
Jan
(8) |
Feb
(8) |
Mar
(76) |
Apr
(72) |
May
(80) |
Jun
(83) |
Jul
(28) |
Aug
(57) |
Sep
(25) |
Oct
(3) |
Nov
|
Dec
(1) |
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(4) |
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Maurice D. (d. <md...@fr...> - 2005-12-24 12:57:34
|
Le 24 d=E9c. 05 =E0 03:19, Harri Pesonen a =E9crit : > Hello Maurice, combining your codes with Hadrien's gives me: > > static void test() { > Problem pb =3D new Problem(); > IntDomainVar v1 =3D pb.makeEnumIntVar("v1",1,9); > IntDomainVar v2 =3D pb.makeEnumIntVar("v2",1,9); > IntDomainVar v3 =3D pb.makeEnumIntVar("v3",1,9); > pb.post(pb.allDifferent(new IntVar[]{v1,v2,v3})); > // here is the initial state > pb.worldPush(); > try { > v1.setInf(2); // works before the problem has been solved > v1.setSup(8); > } catch (ContradictionException e) { > System.out.println(e.toString()); > } > pb.solve(); > System.out.println(" " + v1.getVal() + " " + v2.getVal() + " =20= > " + v3.getVal()); > pb.worldPop(); // I want to reset the problem to the initial =20= > state Your problem is that solve() do many worldPush(), so your last =20 worldPop() put you into some final solving state, not your original world. You have to record your one "starting state" from any current state : // at least one worldPush() should have been done here //... int baseWorld =3D pb.getWorldIndex(); while (!found) { s.pb.worldPopUntil(baseWorld); s.pb.worldPush(); // any solve(), setVar() setInf() and pb.propagate() // can be done here.. found =3D tryHeuristic(); } > try { > v1.setInf(3); // does not work Because you restored a world in which 3 is no more in v1 domain > v1.setSup(5); > } catch (ContradictionException e) { > System.out.println(e.toString()); // I get this > } > pb.solve(); > System.out.println(" " + v1.getVal() + " " + v2.getVal() + " =20= > " + v3.getVal()); > } > > Unfortunately this does not work either. Hadrien's code works but =20 > it does not do what I want. Because I want to minimize the =20 > constraint building cost, I just want to change the original =20 > constraints one variable at a time, until I get just one solution. What do you call initial "contraint" is the initial "domain" variables I suppose. I think an human solvable sudoku should be immediat to solve with choco. So another way to find solvable sudoku could be to sove over filled grid (which should raise immediately an exception), then free instanciated variable one at a time, until you reach a faisable problem. > It's not a big problem if this is not possible, but I am just =20 > wondering. > > You can see what I am doing by running this: > http://www.netsonic.fi/~kkylan05/SudokuWeb.jnlp Not be able to lauch it. > Clicking Random will generate a new random sudoku. I have a better =20 > version already, which generates more difficult sudokus, but it is =20 > much slower. I can probably make it faster by checking the number =20 > of nodes and backtracks used for solving. > > Thanks, Harri Good look, Maurice |
From: Harri P. <fu...@ni...> - 2005-12-24 02:19:03
|
Hello Maurice, combining your codes with Hadrien's gives me: static void test() { Problem pb = new Problem(); IntDomainVar v1 = pb.makeEnumIntVar("v1",1,9); IntDomainVar v2 = pb.makeEnumIntVar("v2",1,9); IntDomainVar v3 = pb.makeEnumIntVar("v3",1,9); pb.post(pb.allDifferent(new IntVar[]{v1,v2,v3})); // here is the initial state pb.worldPush(); try { v1.setInf(2); // works before the problem has been solved v1.setSup(8); } catch (ContradictionException e) { System.out.println(e.toString()); } pb.solve(); System.out.println(" " + v1.getVal() + " " + v2.getVal() + " " + v3.getVal()); pb.worldPop(); // I want to reset the problem to the initial state try { v1.setInf(3); // does not work v1.setSup(5); } catch (ContradictionException e) { System.out.println(e.toString()); // I get this } pb.solve(); System.out.println(" " + v1.getVal() + " " + v2.getVal() + " " + v3.getVal()); } Unfortunately this does not work either. Hadrien's code works but it does not do what I want. Because I want to minimize the constraint building cost, I just want to change the original constraints one variable at a time, until I get just one solution. It's not a big problem if this is not possible, but I am just wondering. You can see what I am doing by running this: http://www.netsonic.fi/~kkylan05/SudokuWeb.jnlp Clicking Random will generate a new random sudoku. I have a better version already, which generates more difficult sudokus, but it is much slower. I can probably make it faster by checking the number of nodes and backtracks used for solving. Thanks, Harri |
From: Harri P. <fu...@ni...> - 2005-12-22 19:27:37
|
Thanks a bunch, to Maurice as well! This will keep me busy for a while. You are correct, deleting these two files helped. -- Harri Hadrien wrote: > Hello, > > 1) That's true, we have a problem with the cvs right now, it does not > delete some classes correctly. I can send you the last choco.jar > if you want. Otherwise delete the concrete classes > choco.set.SetModeler and choco.integer.var.IntDomainVar, it should > compile correctly. > > 2) You can indeed add a constraint on the fly. Have look at the > following code : > > public static void main(String[] args) { > Problem pb = new Problem(); > IntDomainVar v1 = pb.makeEnumIntVar("v1",1,9); > IntDomainVar v2 = pb.makeEnumIntVar("v2",1,9); > IntDomainVar v3 = pb.makeEnumIntVar("v3",1,9); > > pb.post(pb.allDifferent(new IntVar[]{v1,v2,v3})); > pb.solve(); > System.out.println(" " + v1.getVal() + " " + v2.getVal() + " " > + v3.getVal()); > pb.postCut(pb.geq(v1,6)); > pb.nextSolution(); > System.out.println(" " + v1.getVal() + " " + v2.getVal() + " " > + v3.getVal()); > > } > > 3) I can send you a more complete documentation about search in > attachment. The whole user guide will come soon. But because choco is > changing right now, we were waiting for the new version. > > 4) There is not yet any clear api to access the number of nodes and > time spent for search. > You can use the following ugly line of code to get the number of nodes > (a proper way to access it > will come soon) : > > nodes = ((NodeLimit) > pb.getSolver().getSearchSolver().limits.get(1)).getNbTot(); > > However the number of backtrack is not provided by default. But you > can extend the limit mechanism of choco > to get it. For example create the following class : > > public class BacktLimit extends AbstractGlobalSearchLimit { > public BacktLimit(AbstractGlobalSearchSolver theSolver, int > theLimit) { > super(theSolver, theLimit); > } > > public boolean newNode(AbstractGlobalSearchSolver solver) { > return true; > } > > public boolean endNode(AbstractGlobalSearchSolver solver) { > nb++; > return true; > } > } > Then instead of calling a pb.solve() do something like : > > Solver s = pb.getSolver(); > s.setFirstSolution(true); > s.generateSearchSolver(pb); > s.getSearchSolver().limits.add(new BacktLimit (s.getSearchSolver(),-1)); > s.launch(); > > and access to your own limit by : > > backt = ((BacktLimit) > pb.getSolver().getSearchSolver().limits.get(2)).getNbTot(); > > I can send you the not yet available documentation that explains the > whole mechanism > > I hope it helps until everything will be set up > > Hadrien > > ----- Original Message ----- > > *From:* Harri Pesonen <mailto:fu...@ni...> > *To:* cho...@li... > <mailto:cho...@li...> > *Sent:* Wednesday, December 21, 2005 11:28 PM > *Subject:* [Choco-users] Re: Sudoku problem > > I tried to solve 1) by compiling from CVS, but the latest version > (in java/src) does not compile. In fact I can't find a good > version in CVS. > > I tested 2) but it is not possible to change min and max values > after a problem has been solved. > > 4) How can I get the number of nodes and backtracks? > > Harri Pesonen wrote: > >> Hello, I made a simple Java Web Start application that uses Choco >> to solve and generate sudokus, 9x9 puzzles. I have some questions: >> >> 1. Java Web Start requires that I sign the application because >> Choco uses some file io, probably in printRuntimeSatistics. >> This is unfortunate, I would like to have an application >> that runs in a sandbox. Could it be possible to change >> Choco so? >> 2. I am using Choco also to generate sudokus. This is pretty >> slow, because I just add random numbers to the 9x9 grid and >> test if it has exactly one solution or not. What is the >> fastest way to check for exactly one solution, or can I >> change the constraints on the fly, just change one variable >> min and max value, after I have already tried to solve the >> problem? Is is possible to change makeEnumIntVar min and >> max values later? >> 3. Where can I find more documentation for Choco or constraint >> programming in general? >> >> Thanks, Harri >> >> Here is the partial source code: >> >> static int sudoku(int[][] givens, int maxSolutions, int[][] >> solution) { >> Problem pb = new Problem(); >> IntVar[][] num = new IntVar[9][9]; >> for (int i=0; i<9; i++) { >> for (int j=0; j<9; j++) { >> if (givens[i][j] != 0) >> num[i][j] = pb.makeEnumIntVar("num" + i + >> "_" + j, givens[i][j], givens[i][j]); >> else >> num[i][j] = pb.makeEnumIntVar("num" + i + "_" >> + j, 1, 9); >> } >> } >> for (int j=0; j<9; j++) { >> pb.post(pb.allDifferent(num[j])); >> } >> for (int i=0; i<9; i++) { >> pb.post(pb.allDifferent(new IntVar[]{ >> num[0][i], >> num[1][i], >> num[2][i], >> num[3][i], >> num[4][i], >> num[5][i], >> num[6][i], >> num[7][i], >> num[8][i] >> })); >> } >> for (int i=0; i<3; i++) { >> for (int j=0; j<3; j++) { >> pb.post(pb.allDifferent(new IntVar[]{ >> num[0+3*i][0+3*j], num[0+3*i][1+3*j], >> num[0+3*i][2+3*j], >> num[1+3*i][0+3*j], num[1+3*i][1+3*j], >> num[1+3*i][2+3*j], >> num[2+3*i][0+3*j], num[2+3*i][1+3*j], >> num[2+3*i][2+3*j]})); >> } >> } >> int nSolutions = 0; >> if (pb.solve() == Boolean.TRUE) { >> >> > |
From: Hadrien <had...@em...> - 2005-12-22 09:29:00
|
Hello, 1) That's true, we have a problem with the cvs right now, it does not = delete some classes correctly. I can send you the last choco.jar if you want. Otherwise delete the concrete classes choco.set.SetModeler = and choco.integer.var.IntDomainVar, it should=20 compile correctly. 2) You can indeed add a constraint on the fly. Have look at the = following code : public static void main(String[] args) { Problem pb =3D new Problem(); IntDomainVar v1 =3D pb.makeEnumIntVar("v1",1,9); IntDomainVar v2 =3D pb.makeEnumIntVar("v2",1,9); IntDomainVar v3 =3D pb.makeEnumIntVar("v3",1,9); pb.post(pb.allDifferent(new IntVar[]{v1,v2,v3})); pb.solve(); System.out.println(" " + v1.getVal() + " " + v2.getVal() + " " + = v3.getVal()); pb.postCut(pb.geq(v1,6)); pb.nextSolution(); System.out.println(" " + v1.getVal() + " " + v2.getVal() + " " + = v3.getVal()); } 3) I can send you a more complete documentation about search in = attachment. The whole user guide will come soon. But because choco is = changing right now, we were waiting for the new version. 4) There is not yet any clear api to access the number of nodes and time = spent for search. You can use the following ugly line of code to get the number of nodes = (a proper way to access it will come soon) : =20 nodes =3D ((NodeLimit) = pb.getSolver().getSearchSolver().limits.get(1)).getNbTot(); However the number of backtrack is not provided by default. But you can = extend the limit mechanism of choco to get it. For example create the following class : public class BacktLimit extends AbstractGlobalSearchLimit { public BacktLimit(AbstractGlobalSearchSolver theSolver, int = theLimit) { super(theSolver, theLimit); } public boolean newNode(AbstractGlobalSearchSolver solver) { return true; } public boolean endNode(AbstractGlobalSearchSolver solver) { nb++; return true; } } Then instead of calling a pb.solve() do something like : Solver s =3D pb.getSolver(); s.setFirstSolution(true); s.generateSearchSolver(pb); s.getSearchSolver().limits.add(new BacktLimit (s.getSearchSolver(),-1)); s.launch();=20 and access to your own limit by : backt =3D ((BacktLimit) = pb.getSolver().getSearchSolver().limits.get(2)).getNbTot(); I can send you the not yet available documentation that explains the = whole mechanism I hope it helps until everything will be set up Hadrien ----- Original Message -----=20 From: Harri Pesonen=20 To: cho...@li...=20 Sent: Wednesday, December 21, 2005 11:28 PM Subject: [Choco-users] Re: Sudoku problem I tried to solve 1) by compiling from CVS, but the latest version (in = java/src) does not compile. In fact I can't find a good version in CVS. I tested 2) but it is not possible to change min and max values after = a problem has been solved. 4) How can I get the number of nodes and backtracks? Harri Pesonen wrote:=20 Hello, I made a simple Java Web Start application that uses Choco to = solve and generate sudokus, 9x9 puzzles. I have some questions: 1.. Java Web Start requires that I sign the application because = Choco uses some file io, probably in printRuntimeSatistics. This is = unfortunate, I would like to have an application that runs in a sandbox. = Could it be possible to change Choco so?=20 2.. I am using Choco also to generate sudokus. This is pretty = slow, because I just add random numbers to the 9x9 grid and test if it = has exactly one solution or not. What is the fastest way to check for = exactly one solution, or can I change the constraints on the fly, just = change one variable min and max value, after I have already tried to = solve the problem? Is is possible to change makeEnumIntVar min and max = values later?=20 3.. Where can I find more documentation for Choco or constraint = programming in general?=20 Thanks, Harri Here is the partial source code: static int sudoku(int[][] givens, int maxSolutions, int[][] = solution) { Problem pb =3D new Problem(); IntVar[][] num =3D new IntVar[9][9]; for (int i=3D0; i<9; i++) { for (int j=3D0; j<9; j++) { if (givens[i][j] !=3D 0) num[i][j] =3D pb.makeEnumIntVar("num" + i + "_" = + j, givens[i][j], givens[i][j]); else num[i][j] =3D pb.makeEnumIntVar("num" + i + "_" = + j, 1, 9); } } for (int j=3D0; j<9; j++) { pb.post(pb.allDifferent(num[j])); } for (int i=3D0; i<9; i++) { pb.post(pb.allDifferent(new IntVar[]{ num[0][i], num[1][i], num[2][i], num[3][i], num[4][i], num[5][i], num[6][i], num[7][i], num[8][i] })); } for (int i=3D0; i<3; i++) { for (int j=3D0; j<3; j++) { pb.post(pb.allDifferent(new IntVar[]{ num[0+3*i][0+3*j], num[0+3*i][1+3*j], = num[0+3*i][2+3*j], num[1+3*i][0+3*j], num[1+3*i][1+3*j], = num[1+3*i][2+3*j], num[2+3*i][0+3*j], num[2+3*i][1+3*j], = num[2+3*i][2+3*j]})); } } int nSolutions =3D 0; if (pb.solve() =3D=3D Boolean.TRUE) { |
From: Maurice D. <Mau...@en...> - 2005-12-22 08:25:38
|
Bonjour Harri, Le 21 d=E9c. 05 =E0 23:28, Harri Pesonen a =E9crit : > I tried to solve 1) by compiling from CVS, but the latest version =20 > (in java/src) does not compile. In fact I can't find a good version =20= > in CVS. I'm not sure if everybody are on holiday, but you can download a =20 relatively correct version off choco on : http://www.ensta.fr/~diam/jorlab/pub/ > I tested 2) but it is not possible to change min and max values =20 > after a problem has been solved. the setMin, getMin, ... accessors are deprecated and replaced by =20 setInf()/getInf() and setSup() / getSup() m=E9thods. Also, if the problem is solved, myVar.setInf(7) should raise a =20 ContradictionException because myVar is alreadu instanciated (to another value I suppose). So you'll have to undo the propagation and recover a previous state =20 of the problem. The following methods ca be used: pb.worldPush() pb.worldPop() pb.getWorlIndex() pb.worldPopUntil(int level) (start from 0) Choco api is available on : http://www.ensta.fr/~diam/jorlab/online/choco/ The main user class is Problem (with de worldPop() methods...) http://www.ensta.fr/~diam/jorlab/online/choco/choco/Problem.html > 4) How can I get the number of nodes and backtracks? Not sure about that. I think the general process about limit are inherited from AbstractGlobalSearchLimit A default behavior is implemented for frequent Limit such that nodelimit, timeLimit, ... Perhaps the following could help http://choco.sourceforge.net/userguide.html#Limiting+the+search+space > Harri Pesonen wrote: >> Hello, I made a simple Java Web Start application that uses Choco =20 >> to solve and generate sudokus, 9x9 puzzles. I have some questions: >> >> Java Web Start requires that I sign the application because Choco =20 >> uses some file io, probably in printRuntimeSatistics. This is =20 >> unfortunate, I would like to have an application that runs in a =20 >> sandbox. Could it be possible to change Choco so? >> I am using Choco also to generate sudokus. This is pretty slow, =20 >> because I just add random numbers to the 9x9 grid and test if it =20 >> has exactly one solution or not. What is the fastest way to check =20 >> for exactly one solution, or can I change the constraints on the =20 >> fly, just change one variable min and max value, after I have =20 >> already tried to solve the problem? Is is possible to change =20 >> makeEnumIntVar min and max values later? I think you should customise the enumeration process. Several level are availbable in choco for solving from the easiest (solve() or solveAll()) to the more customised one I should for a sudoku, you should try do do the litest customisation which the choco provided heuristed (VarSelector, ValSelector, ...) For sudoku I'd try first the MinDomain first. You can get some exemple for customising an littre KnapSack problem hier (comment and doc in French, sorry) http://www.ensta.fr/~diam/ocro/index.php?id=3Dtdchoco http://www.ensta.fr/~diam/ocro/index.php?id=3Dtutenum http://www.ensta.fr/~diam/ocro/projets/tdchoco/rando.zip Your strategy could be to limit the number solution to 2 (bad sudoku if there is to solution) then instanciated some free vars from the original problem until you get only on solution? >> Where can I find more documentation for Choco or constraint =20 >> programming in general? >> Thanks, Harri I think sourceforges will be seriously updated in the folowing weeks. And choco is more and more used in education, so tutorial/doc should come from various horizons. Sudoku should be an excellent exemple for choco. Do you have fould a suduko problem with only one solution, and where =20 choco slow to get the result ? How time long in this case ? Cordialement, Maurice Diamantini, P.S. Happy end of year ! |
From: Harri P. <fu...@ni...> - 2005-12-21 22:28:30
|
I tried to solve 1) by compiling from CVS, but the latest version (in java/src) does not compile. In fact I can't find a good version in CVS. I tested 2) but it is not possible to change min and max values after a problem has been solved. 4) How can I get the number of nodes and backtracks? Harri Pesonen wrote: > Hello, I made a simple Java Web Start application that uses Choco to > solve and generate sudokus, 9x9 puzzles. I have some questions: > > 1. Java Web Start requires that I sign the application because > Choco uses some file io, probably in printRuntimeSatistics. This > is unfortunate, I would like to have an application that runs in > a sandbox. Could it be possible to change Choco so? > 2. I am using Choco also to generate sudokus. This is pretty slow, > because I just add random numbers to the 9x9 grid and test if it > has exactly one solution or not. What is the fastest way to > check for exactly one solution, or can I change the constraints > on the fly, just change one variable min and max value, after I > have already tried to solve the problem? Is is possible to > change makeEnumIntVar min and max values later? > 3. Where can I find more documentation for Choco or constraint > programming in general? > > Thanks, Harri > > Here is the partial source code: > > static int sudoku(int[][] givens, int maxSolutions, int[][] > solution) { > Problem pb = new Problem(); > IntVar[][] num = new IntVar[9][9]; > for (int i=0; i<9; i++) { > for (int j=0; j<9; j++) { > if (givens[i][j] != 0) > num[i][j] = pb.makeEnumIntVar("num" + i + "_" + > j, givens[i][j], givens[i][j]); > else > num[i][j] = pb.makeEnumIntVar("num" + i + "_" + j, > 1, 9); > } > } > for (int j=0; j<9; j++) { > pb.post(pb.allDifferent(num[j])); > } > for (int i=0; i<9; i++) { > pb.post(pb.allDifferent(new IntVar[]{ > num[0][i], > num[1][i], > num[2][i], > num[3][i], > num[4][i], > num[5][i], > num[6][i], > num[7][i], > num[8][i] > })); > } > for (int i=0; i<3; i++) { > for (int j=0; j<3; j++) { > pb.post(pb.allDifferent(new IntVar[]{ > num[0+3*i][0+3*j], num[0+3*i][1+3*j], > num[0+3*i][2+3*j], > num[1+3*i][0+3*j], num[1+3*i][1+3*j], > num[1+3*i][2+3*j], > num[2+3*i][0+3*j], num[2+3*i][1+3*j], > num[2+3*i][2+3*j]})); > } > } > int nSolutions = 0; > if (pb.solve() == Boolean.TRUE) { > > |
From: Harri P. <fu...@ni...> - 2005-12-19 23:56:55
|
Hello, I made a simple Java Web Start application that uses Choco to solve and generate sudokus, 9x9 puzzles. I have some questions: 1. Java Web Start requires that I sign the application because Choco uses some file io, probably in printRuntimeSatistics. This is unfortunate, I would like to have an application that runs in a sandbox. Could it be possible to change Choco so? 2. I am using Choco also to generate sudokus. This is pretty slow, because I just add random numbers to the 9x9 grid and test if it has exactly one solution or not. What is the fastest way to check for exactly one solution, or can I change the constraints on the fly, just change one variable min and max value, after I have already tried to solve the problem? Is is possible to change makeEnumIntVar min and max values later? 3. Where can I find more documentation for Choco or constraint programming in general? Thanks, Harri Here is the partial source code: static int sudoku(int[][] givens, int maxSolutions, int[][] solution) { Problem pb = new Problem(); IntVar[][] num = new IntVar[9][9]; for (int i=0; i<9; i++) { for (int j=0; j<9; j++) { if (givens[i][j] != 0) num[i][j] = pb.makeEnumIntVar("num" + i + "_" + j, givens[i][j], givens[i][j]); else num[i][j] = pb.makeEnumIntVar("num" + i + "_" + j, 1, 9); } } for (int j=0; j<9; j++) { pb.post(pb.allDifferent(num[j])); } for (int i=0; i<9; i++) { pb.post(pb.allDifferent(new IntVar[]{ num[0][i], num[1][i], num[2][i], num[3][i], num[4][i], num[5][i], num[6][i], num[7][i], num[8][i] })); } for (int i=0; i<3; i++) { for (int j=0; j<3; j++) { pb.post(pb.allDifferent(new IntVar[]{ num[0+3*i][0+3*j], num[0+3*i][1+3*j], num[0+3*i][2+3*j], num[1+3*i][0+3*j], num[1+3*i][1+3*j], num[1+3*i][2+3*j], num[2+3*i][0+3*j], num[2+3*i][1+3*j], num[2+3*i][2+3*j]})); } } int nSolutions = 0; if (pb.solve() == Boolean.TRUE) { |
From: Olivier B. <Oli...@ce...> - 2005-11-04 12:01:15
|
Hi all! Here is a description of the bug. Zip file "chocosrc-1_0b003.zip" downloaded from=20 <http://choco.sourceforge.net/download.html> sept-22nd and nov-4th 2005 In Problem.java, probable bug found at l.1235-1236 in or(Constraint c0,=20 Constraint c1) method and repeated at l.1333-1334 in and(Constraint c0,=20 Constraint c1). Summary: (for the or method, can be readily transposed for the and method) if c0 is an instance of LargeDisjunction and c1 is neither a BinDisjunction= nor=20 a LargeDisjunction, the program imposes a cast to BinDisjunction on c1. The= cast=20 cannot be performed resulting in a ClassCastException. Since temporary=20 constraint array alternatives[] is correctly filled in the following lines,= the=20 proposed solution is to simply remove the two faulty lines (they might stem= from=20 copied and modified code at lines 1217-1218). Here is Problem.java file header: /* -------------------------------------------------- * CHOCO * Copyright (C) F. Laburthe, 1999-2004 * -------------------------------------------------- * an open-source Constraint Programming Kernel * for Research and Education * -------------------------------------------------- * * file: choco.Problem.java * last modified by Francois 28 ao=FBt 2003:14:59:09 */ =20 =20 Best regards =20 Olivier Bonnet-Torr=E8s Onera-CERT / DCSD Toulouse, France |
From: <fra...@ya...> - 2005-10-14 20:41:11
|
Dear Pat, obviously, we are not very good with numbering our versions ! :-) François --- Patrick Prosser <pa...@dc...> a écrit : > The problem I had was that I was using an out of > date jar. I was using 1_0b003 that I was given in > March of size 356KB, whereas the download site > 1_0b003 is of size 379KB. Obviously I was missing > something :) > ___________________________________________________________________________ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com |
From: Patrick P. <pa...@dc...> - 2005-10-14 08:56:29
|
The problem I had was that I was using an out of date jar. I was using = 1_0b003 that I was given in March of size 356KB, whereas the download = site 1_0b003 is of size 379KB. Obviously I was missing something :) Sorry to have wasted so many people's time, and thanks for the help Patrick -----Original Message----- From: cho...@li... = [mailto:cho...@li...] On Behalf Of = cho...@li... Sent: 14 October 2005 04:02 To: cho...@li... Subject: Choco-users digest, Vol 1 #44 - 1 msg Send Choco-users mailing list submissions to cho...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/choco-users or, via email, send a message with subject or body 'help' to cho...@li... You can reach the person managing the list at cho...@li... When replying, please edit your Subject line so it is more specific than = "Re: Contents of Choco-users digest..." Today's Topics: 1. RE: Pb.allDifferent(vars) is not compiling in = (=3D?iso-8859-1?q?Fran=3DE7ois=3D20Laburthe?=3D) --__--__-- Message: 1 Date: Thu, 13 Oct 2005 08:38:33 +0200 (CEST) From: =3D?iso-8859-1?q?Fran=3DE7ois=3D20Laburthe?=3D = <fra...@ya...> Subject: RE: [Choco-users] Pb.allDifferent(vars) is not compiling in To: Patrick Prosser <pa...@dc...>, = cho...@li... Dear Pat,=20 your Golomb ruler works fine for me: ---------------------- ... solution with cost tick[8]: 48 0[+1171] millis. 0[+67] nodes=20 ... solution with cost tick[8]: 46 1171[+1903] millis. 67[+166] nodes=20 ... solution with cost tick[8]: 45 3074[+1893] millis. 233[+158] nodes=20 tick[8][45,45] time: 110238 nodes: 5735 optVal 45 =20 -- solve =3D> 3 solutions -- 110238[+0] millis. -- 5735[+0] nodes ------------------------- let us see if something is missing in the jar archive Cheers Fran=E7ois =09 =09 =09 _________________________________________________________________________= __ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! = Messenger T=E9l=E9chargez cette version sur = http://fr.messenger.yahoo.com --__--__-- _______________________________________________ Choco-users mailing list Cho...@li... https://lists.sourceforge.net/lists/listinfo/choco-users End of Choco-users Digest |
From: Maurice D. <Mau...@en...> - 2005-10-14 07:20:15
|
Le 13 oct. 05 =E0 08:38, Fran=E7ois Laburthe a =E9crit : > Dear Pat, > > your Golomb ruler works fine for me: But with which choco version ? It does work for me too. I use cvs snapshot (that I renamed choco-cvs-20050924-09h19.jar) and had to add the following line (VarOrder doen't exist ?) : import choco.integer.search.StaticVarOrder; With same result nodes: 5735 optVal 45 but time vary from 30% to 300% from Fran=E7ois time, function of platform I'm using (unix: osx or linux bi-pro station) -- Maurice P.S. Patrick, thank you for this exemple for allDiff. it should be included in the choco distribution ! > ---------------------- > ... solution with cost tick[8]: 48 0[+1171] millis. > 0[+67] nodes > ... solution with cost tick[8]: 46 1171[+1903] > millis. 67[+166] nodes > ... solution with cost tick[8]: 45 3074[+1893] > millis. 233[+158] nodes > tick[8][45,45] time: 110238 nodes: 5735 optVal 45 > -- solve =3D> 3 solutions > -- 110238[+0] millis. > -- 5735[+0] nodes > ------------------------- |
From: <fra...@ya...> - 2005-10-13 06:38:44
|
Dear Pat, your Golomb ruler works fine for me: ---------------------- ... solution with cost tick[8]: 48 0[+1171] millis. 0[+67] nodes ... solution with cost tick[8]: 46 1171[+1903] millis. 67[+166] nodes ... solution with cost tick[8]: 45 3074[+1893] millis. 233[+158] nodes tick[8][45,45] time: 110238 nodes: 5735 optVal 45 -- solve => 3 solutions -- 110238[+0] millis. -- 5735[+0] nodes ------------------------- let us see if something is missing in the jar archive Cheers François ___________________________________________________________________________ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com |
From: Narendra J. <nju...@e-...> - 2005-10-07 08:21:14
|
Hi, there was indeed a bug in the api of Problem. It has been corrected and the CVS version of choco is now up to date. Thanks for pointing this out. Best regards, Narendra > -----Original Message----- > From: Sylvain Bouveret [mailto:syl...@ce...] > Sent: vendredi 7 octobre 2005 09:28 > To: Narendra Jussien > Cc: cho...@li... > Subject: Re: [Choco-users] 2+1 = 2 ? > > Thank you for your answer. > > The result is actually the same when you use pb.solve(false) > instead of pb.solve(true). Moreover, by using, instead of > Choco 1.0, Choco 0.9, that used to print each solution when > solving the problem, we get exactly the same problem : > > Pb[1 vars, 1 cons] > a{2} > > Variable a = 2 > -- solve => 1 solutions > -- 0[+0] millis. > -- 0[+0] nodes > > Thanks for any help. > Sylvain Bouveret. > > > > Narendra Jussien wrote: > > Hi, > > > > When you ask for all solutions (pb.solve(true)) the value of the > > variables at the end of the process is in an undetermined state > > (actually variables are assigned to the last partial > assignment that > > was used to prove that the search has terminated). You need > to restore > > a solution to access the values (see the web site) > > > > Another way is to compute only one solution > (pb.solve(false)) and then > > you can use th v.getVal() method to get the value of the > variable in > > that solution. > > > > Hope this helps, > > > > Narendra Jussien > > > > > > > > > |
From: Sylvain B. <syl...@ce...> - 2005-10-07 07:28:11
|
Thank you for your answer. The result is actually the same when you use pb.solve(false) instead of pb.solve(true). Moreover, by using, instead of Choco 1.0, Choco 0.9, that used to print each solution when solving the problem, we get exactly the same problem : Pb[1 vars, 1 cons] a{2} Variable a = 2 -- solve => 1 solutions -- 0[+0] millis. -- 0[+0] nodes Thanks for any help. Sylvain Bouveret. Narendra Jussien wrote: > Hi, > > When you ask for all solutions (pb.solve(true)) the value of the variables > at the end of the process is in an undetermined state (actually variables > are assigned to the last partial assignment that was used to prove that the > search has terminated). You need to restore a solution to access the values > (see the web site) > > Another way is to compute only one solution (pb.solve(false)) and then you > can use th v.getVal() method to get the value of the variable in that > solution. > > Hope this helps, > > Narendra Jussien > > > |
From: Narendra J. <nju...@e-...> - 2005-10-06 16:59:10
|
Hi, When you ask for all solutions (pb.solve(true)) the value of the variables at the end of the process is in an undetermined state (actually variables are assigned to the last partial assignment that was used to prove that the search has terminated). You need to restore a solution to access the values (see the web site) Another way is to compute only one solution (pb.solve(false)) and then you can use th v.getVal() method to get the value of the variable in that solution. Hope this helps, Narendra Jussien > -----Original Message----- > From: cho...@li... > [mailto:cho...@li...] On Behalf Of > Sylvain Bouveret > Sent: jeudi 6 octobre 2005 18:37 > To: cho...@li... > Subject: [Choco-users] 2+1 = 2 ? > > Hello, > > By trying to express some simple constraints such as a+1=2, I > was a bit surprised by what Choco answered to me. > > The following code : > > import choco.*; > import choco.integer.*; > > public class Bug { > public static void main(String[] args) { > Problem myProb = new Problem(); > > IntVar a = myProb.makeEnumIntVar("a", 0, 4); > > myProb.post(myProb.eq(myProb.plus(a, 1), 2)); > > myProb.solve(true); > System.out.println("Variable " + a + " = " + a.getVal()); > } > } > > produces the following (wrong) answer : > > Variable a = 2 > -- solve => 1 solutions > -- 19[+0] millis. > -- 1[+0] nodes > > (replacing "1" by the name of a dummy variable that can take > only the value 1 produces the right answer). > > Can anyone help me ? Do I misuse choco constraints ? > Thanks in advance, > > Sylvain Bouveret. > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, > discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Choco-users mailing list > Cho...@li... > https://lists.sourceforge.net/lists/listinfo/choco-users > > > |
From: Sylvain B. <syl...@ce...> - 2005-10-06 16:53:45
|
Hello, By trying to express some simple constraints such as a+1=2, I was a bit surprised by what Choco answered to me. The following code : import choco.*; import choco.integer.*; public class Bug { public static void main(String[] args) { Problem myProb = new Problem(); IntVar a = myProb.makeEnumIntVar("a", 0, 4); myProb.post(myProb.eq(myProb.plus(a, 1), 2)); myProb.solve(true); System.out.println("Variable " + a + " = " + a.getVal()); } } produces the following (wrong) answer : Variable a = 2 -- solve => 1 solutions -- 19[+0] millis. -- 1[+0] nodes (replacing "1" by the name of a dummy variable that can take only the value 1 produces the right answer). Can anyone help me ? Do I misuse choco constraints ? Thanks in advance, Sylvain Bouveret. |
From: sergio s. r. <ser...@ly...> - 2005-09-14 10:31:57
|
<html><head><style type="text/css">body{font:12px Arial;margin:3px;overflow-y:auto;overflow-x:auto}p{margin:0px;}blockquote, ol, ul{margin-top:0px;margin-bottom:0px;}</style></head> <body><div style="DISPLAY: block; FONT-SIZE: 12px; FONT-FAMILY: Arial"><P>Hi friends,</P> <P> </P> <P>I' d like to know how getting the number of backtracks used to solve a problem.</P> <P>Is posible get this data in Choco? HOW??</P> <P> </P> <P>Thank</P> <P> </P> <P>Sergio</P> <P> </P></br><p style="margin-top:11px;padding-top:3px;background-image: url(http://mail.lycos.co.uk/Images/Mail/_content/dot.gif);background-repeat: repeat-x;background-position: 0px 0px;"><TABLE><TBODY><TR><TD><A href="http://ads.lycos-europe.com/event.ng/Type=click&FlightID=195882&AdID=422394&TargetID=null&Segments=4604,15828,54128&Targets=null&Values=25683,243,24202,24728,227,522391&RawValues=&Redirect=http%3a%2f%2fwlan.lycos.es"><IMG alt="" src="http://www.lycos.es/advertising/graphics/telefonica/160605_footer-mail.gif" align=left border=0 NOSEND="1"></TD></TR><TR><TD><A href="http://ads.lycos-europe.com/event.ng/Type=click&FlightID=195882&AdID=422394&TargetID=null&Segments=4604,15828,54128&Targets=null&Values=25683,243,24202,24728,227,522391&RawValues=&Redirect=http%3a%2f%2fwlan.lycos.es" style="text-decoration:none"><B><font face="Trebuchet MS" size="-1" color="#1F5C94">Disfruta el mundo del internet sin cables: Todo sobre Wifi/WLAN.</B></FONT></A></TD></TR></TBOD Y></TABLE></div></body></html> |
From: Eric B. <Eri...@ce...> - 2005-08-30 12:23:41
|
hello i m looking for an implementation of an integer constraint of the type Y =3D X^2 any hints thanks Eric Bensana ************************************************************************* ONERA : Office National d'Etudes et de Recherches Aerospatiales DCSD : Departement Commande des Systemes et Dynamique du vol CERT : Centre d'Etudes et de Recherche de Toulouse 2 avenue Edouard Belin, BP 4025, 31055 Toulouse Cedex, France Tel : +33 (0)5 62 25 29 01, Fax : +33 (0)5 62 25 25 64 M=E9l : Eri...@ce... ou Eri...@on... Page Web : http://www.cert.fr/dcsd/cd/MEMBRES/bensana/index.html ************************************************************************* |
From: <Mic...@ce...> - 2005-07-20 08:52:21
|
There is a bug in choco/integer/constraints/IntLinComb.java constructor IntLinComb (choco-1_0b002), which shows up when using the construct scalar with some coefficients equal to zero. Here is the correct version : /** * Constructs the constraint with the specified variables and constant. * */ public IntLinComb(choco.integer.IntVar[] lvars, int[] lcoeffs, int c, int linOperator) { // create the appropriate data structure super(countNonNull(lcoeffs)); int nbVars = getNbVars(); // vars with non null coeff int i = 0; int j = 0; coeffs = new int[nbVars]; // fill it up with the coefficients and variables in the right order //for (i = 0; i < nbVars; i++) { <<<<<<<<<<<<<<<< bug for (i = 0; i < lvars.length; i++) { if (lcoeffs[i] > 0) { vars[j] = lvars[i]; coeffs[j] = lcoeffs[i]; j++; } } nbPosVars = j; //for (i = 0; i < nbVars; i++) { <<<<<<<<<<<<<<<< bug for (i = 0; i < lvars.length; i++) { if (lcoeffs[i] < 0) { vars[j] = lvars[i]; coeffs[j] = lcoeffs[i]; j++; } } op = linOperator; cste = c; } Michel |
From: <ig...@so...> - 2005-07-07 07:42:57
|
this is our implementation, overriding the default one we suppose that the method has to return a constraint that is true when the starting constraint is false, and vice versa public AbstractConstraint opposite() { return new BinDisjunction(new BinConjunction(const0, const1.opposite()), new BinConjunction(const0.opposite(), const1)); /* "a <==> b" is equivalent to "a ==> b AND b ==> a" that is equivalent to "(NOT(a) OR b) AND (NOT(b) OR a)" with DeMorgan (applied two times) we get "(a AND not(b)) OR (b AND not(a))" */ } if you want you can send any comment, suggestion, (insult) directly to: igorkey _at_ softhome.net |
From: <Mic...@ce...> - 2005-07-06 10:23:42
|
In the current version of chocosamples (chocosamples-0_9.jar) the demo 'U2planning.java' was not correctly translated from the Claire version. A correct and updated version of this demo can be downloaded here : http://www.cert.fr/dcsd/cd/MEMBRES/lemaitre/Choco/U2planning.java Incidentally, I discovered that Problem.feasible may remain null even if the problem is not feasible (see for example the execution of u2(3) in the demo). Is it a bug or a feature ? Michel Lema=EEtre =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D ONERA/DCSD/CD Centre de Toulouse 2 avenue Edouard Belin - B.P. 4025 - 31055 Toulouse Cedex 4, FRANCE Tel : +33 (0)5 62 25 26 60 Fax : +33 (0)5 62 25 25 64 Michel . Lemaitre @ cert . fr http://www.cert.fr/dcsd/cd/lemaitre |
From: Hadrien C. <had...@em...> - 2005-07-06 08:01:31
|
Hello, You are right, that's a bug in the storage of binary tuples when the doma= in of the two variables have different sizes and you give the smallest variable first when you post the constraint (It should = not happen on large constraints and the AC constraints are correct). I have corrected it on cvs. Let me know if you want the new .j= ar Thanks for your help Hadrien ----- Original Message -----=20 From: "Eric Bensana" <Eri...@ce...> To: <cho...@li...> Sent: Monday, July 04, 2005 4:02 PM Subject: [Choco-users] using feasPairAC constraint > I m trying to use the feasPairAC constraint to implement > a simple version of product of two IntVars (V1, V2 val) > > Here is a small program > > ------ > > import choco.integer.IntVar; > import choco.util.*; > import choco.*; > import choco.search.*; > > import java.lang.Math.*; > import java.util.List; > import java.io.*; > > public class ex1 > { > > public static boolean[][] eqProduct(IntVar v1, IntVar v2, int k) > //implements v1*v2 =3D k > { > int x1, k1; > int x2, k2; > int n1 =3D v1.getDomainSize(); > int n2 =3D v2.getDomainSize(); > boolean[][] b =3D new boolean[n1][n2]; > > k1 =3D 0; > for (IntIterator i1 =3D v1.getDomain().getIterator(); i1.hasNext(); k= 1++) > { > x1 =3D i1.next(); > k2 =3D 0; > for (IntIterator i2 =3D v2.getDomain().getIterator(); i2.hasNext= (); k2++) > { > x2 =3D i2.next(); > b[k1][k2] =3D (x1*x2 =3D=3D k); > //System.out.println(x1+"("+k1+") * "+x2+"("+k2+") =3D "+b[k1][k2]); > } > } > return b; > } > > public static void main(String[] args) > { > int val =3D Integer.parseInt(args[0]); > Problem pb =3D new Problem(); > IntVar x =3D pb.makeEnumIntVar("X", 0, 2); > IntVar y =3D pb.makeEnumIntVar("Y", 0, 4); > pb.post(pb.feasPairAC(x, y, eqProduct(x, y, val))); > > if (pb.solveAll()) > { > int n =3D pb.getSolver().getNbSolutions(); > AbstractSolver s =3D ((AbstractSolver) > pb.getSolver().getSearchSolver()); > for (int k =3D 0; k < n; k++) > { > Solution sk =3D (Solution) s.solutions.get(k); > int nbVars =3D pb.getNbIntVars(); > System.out.println((k+1)+"th solution found"); > for (int iv =3D 0; iv < nbVars; iv++) > System.out.println(pb.getIntVar(iv)+" =3D "+sk.getValue(iv)); > } > } > else > { > System.out.println("solve failed"); > } > } > } > > > -------------------- > > > > > when I try it for val =3D 1 (java ex1 1) > > i got two solutions : the expected one V1 =3D 1 V2 =3D 1 > and V1 =3D 0 V2 =3D 4 ?? > > what is wrong : is it a bug or do i misuse the feasPairAC constraint ?? > > > > > > > Eric Bensana > > ***********************************************************************= ** > ONERA : Office National d'Etudes et de Recherches Aerospatiales > DCSD : Departement Commande des Systemes et Dynamique du vol > > CERT : Centre d'Etudes et de Recherche de Toulouse > 2 avenue Edouard Belin, BP 4025, 31055 Toulouse Cedex, France > Tel : +33 (0)5 62 25 29 01, Fax : +33 (0)5 62 25 25 64 > > M=E9l : Eri...@ce... ou Eri...@on... > Page Web : http://www.cert.fr/dcsd/cd/MEMBRES/bensana/index.html > ***********************************************************************= ** > > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&op=CCk > _______________________________________________ > Choco-users mailing list > Cho...@li... > https://lists.sourceforge.net/lists/listinfo/choco-users > |
From: Eric B. <Eri...@ce...> - 2005-07-04 15:30:59
|
I m trying to use the feasPairAC constraint to implement a simple version of product of two IntVars (V1, V2 val) Here is a small program ------ import choco.integer.IntVar; import choco.util.*; import choco.*; import choco.search.*; import java.lang.Math.*; import java.util.List; import java.io.*; public class ex1 { public static boolean[][] eqProduct(IntVar v1, IntVar v2, int k) //implements v1*v2 =3D k { int x1, k1; int x2, k2; int n1 =3D v1.getDomainSize(); int n2 =3D v2.getDomainSize(); boolean[][] b =3D new boolean[n1][n2]; =20 k1 =3D 0; for (IntIterator i1 =3D v1.getDomain().getIterator(); i1.hasNext(); k1++) { x1 =3D i1.next(); k2 =3D 0; for (IntIterator i2 =3D v2.getDomain().getIterator(); i2.hasNext(); = k2++) { x2 =3D i2.next(); b[k1][k2] =3D (x1*x2 =3D=3D k); //System.out.println(x1+"("+k1+") * "+x2+"("+k2+") =3D "+b[k1][k2]); } } return b; } public static void main(String[] args) { int val =3D Integer.parseInt(args[0]); Problem pb =3D new Problem(); IntVar x =3D pb.makeEnumIntVar("X", 0, 2); IntVar y =3D pb.makeEnumIntVar("Y", 0, 4); pb.post(pb.feasPairAC(x, y, eqProduct(x, y, val))); if (pb.solveAll()) { int n =3D pb.getSolver().getNbSolutions(); AbstractSolver s =3D ((AbstractSolver)=20 pb.getSolver().getSearchSolver()); for (int k =3D 0; k < n; k++) { Solution sk =3D (Solution) s.solutions.get(k); int nbVars =3D pb.getNbIntVars(); System.out.println((k+1)+"th solution found"); for (int iv =3D 0; iv < nbVars; iv++)=20 System.out.println(pb.getIntVar(iv)+" =3D "+sk.getValue(iv)); } } else { System.out.println("solve failed"); } } } =20 =20 -------------------- when I try it for val =3D 1 (java ex1 1) i got two solutions : the expected one V1 =3D 1 V2 =3D 1 and V1 =3D 0 V2 =3D 4 ?? what is wrong : is it a bug or do i misuse the feasPairAC constraint ?? Eric Bensana ************************************************************************* ONERA : Office National d'Etudes et de Recherches Aerospatiales DCSD : Departement Commande des Systemes et Dynamique du vol CERT : Centre d'Etudes et de Recherche de Toulouse 2 avenue Edouard Belin, BP 4025, 31055 Toulouse Cedex, France Tel : +33 (0)5 62 25 29 01, Fax : +33 (0)5 62 25 25 64 M=E9l : Eri...@ce... ou Eri...@on... Page Web : http://www.cert.fr/dcsd/cd/MEMBRES/bensana/index.html ************************************************************************* |
From: Narendra J. <nju...@e-...> - 2005-07-04 14:51:11
|
You are right, the definition of the opposite method is the key to your bug. However, the piece of code you mention is the default behavior in the abstract class AbstractConstraint, opposite needs to be redefine at the constraint level (you can see one example in the BinDisjunction class). Unfortunately, it has not been written in the Equiv class (the class used when posting an IfOnlyIf relation). It will be done in the next release of Choco but in the meantime you can do it and propose it the choco community. Best regards, Narendra Jussien > we have looked into the sources of the libraries, finding > that the method "opposite" in class AbstractConstraint is > defined in this way: > > public AbstractConstraint opposite() { > throw new UnsupportedOperationException(); } > > so it's logic that every invocation of the method rises the > exception... > > now come the questions: > > why is it implemented in this way? > what should it do? > > could you give any guidelines to help implementing the method? > > > thanks in advance > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration > Strategies from IBM. Find simple to follow Roadmaps, > straightforward articles, informative Webcasts and more! Get > everything you need to get up to speed, fast. > http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > Choco-users mailing list > Cho...@li... > https://lists.sourceforge.net/lists/listinfo/choco-users > > > |
From: <ig...@so...> - 2005-07-04 09:43:54
|
we have looked into the sources of the libraries, finding that the method "opposite" in class AbstractConstraint is defined in this way: public AbstractConstraint opposite() { throw new UnsupportedOperationException(); } so it's logic that every invocation of the method rises the exception... now come the questions: why is it implemented in this way? what should it do? could you give any guidelines to help implementing the method? thanks in advance |