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
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
|
2
|
3
|
4
|
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
|
12
|
13
|
14
|
15
|
16
|
17
(4) |
18
(2) |
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
|
26
|
27
|
28
|
29
|
30
|
|
|
|
From: Guillaume R. <Gui...@em...> - 2006-11-18 02:53:44
|
Hi,
Yes, it seems there are errors if you use sparse domains and constraints=20
defined in extension. We will correct this problem...
Thank you for your help :)
-Guillaume
Varun Jain a =E9crit :
>
> Hi again,
>
> I thought I should give you my test code so that you can run it=20
> yourself. I have included the code at the bottom. Note that the CSP=20
> problem I was experimenting with has changed a bit (however, the=20
> strange behaviour still remains) Heres the new CSP problem:
>
> Variables:
> Variable0, Domain: {4, 2}
> Variable1, Domain: {5, 1, 4}
> Variable2, Domain: {3, 4, 6}
> Variable3, Domain: {1, 2}
> Variable4, Domain: {7, 8, 6, 1}
> Constraints:
> Constraint0, on variables 3 , Allowed tuples:
> 1
> Constraint1, on variables 2, 4 , Allowed tuples:
> 6, 7
> Constraint2, on variables 2 , Allowed tuples:
> 3
> 4
> Constraint3, on variables 4, 1 , Allowed tuples:
> 7, 1
> 8, 1
> 6, 5
> 1, 5
>
> Heres the output of running the program given below:
>
> Choco Solutions
> 2, 1, 3, 1, 8,
> 4, 1, 3, 1, 8,
>
> As you can see, none of the solutions satisfy constraint1. Still choco=20
> returns these solutions.
> Heres my code (BTW, Thanks for taking time out to help me.. I really=20
> appreciate it :-)):
>
> import choco.Problem;
> import choco.Constraint;
> import choco.integer.IntDomainVar;
> import choco.integer.IntVar;
> import java.util.ArrayList;
>
> /**
> * @author Varun Jain (vj)
> * @version $Revision$, $Date$
> * @created Nov 17, 2006
> */
> public class ChocoTest {
> public static void main(String args[]) {
> Problem chocoCSP =3D new Problem();
> IntDomainVar[] vars =3D new IntDomainVar[5];
> Constraint[] cons =3D new Constraint[4];
> //-----Construct all variables
> int id =3D 0;
> vars[id] =3D chocoCSP.makeEnumIntVar("v" + id++, new int[]{4, 2});
> vars[id] =3D chocoCSP.makeEnumIntVar("v" + id++, new int[]{5, 1, 4}=
);
> vars[id] =3D chocoCSP.makeEnumIntVar("v" + id++, new int[]{3, 4, 6}=
);
> vars[id] =3D chocoCSP.makeEnumIntVar("v" + id++, new int[]{1, 2});
> vars[id] =3D chocoCSP.makeEnumIntVar("v" + id++, new int[]{7, 8, 6,=
1});
> id =3D 0;
> ArrayList<int[]> tuples;
>
> //-----Now construct all constraints
> //-----Constraint0
> tuples =3D new ArrayList<int[]>();
> tuples.add(new int[]{1});
> cons[id] =3D chocoCSP.makeTupleFC(new IntVar[]{vars[3]}, tuples, tr=
ue);
> chocoCSP.post(cons[id++]);
>
> //-----Constraint1
> tuples =3D new ArrayList<int[]>();
> tuples.add(new int[]{6, 7});
> cons[id] =3D chocoCSP.makeTupleFC(new IntVar[]{vars[2], vars[4]},=20
> tuples, true);
> chocoCSP.post(cons[id++]);
>
> //-----Constraint2
> tuples =3D new ArrayList<int[]>();
> tuples.add(new int[]{3});
> tuples.add(new int[]{4});
> cons[id] =3D chocoCSP.makeTupleFC(new IntVar[]{vars[2]}, tuples, tr=
ue);
> chocoCSP.post(cons[id++]);
>
> //-----Constraint3
> tuples =3D new ArrayList<int[]>();
> tuples.add(new int[]{7, 1});
> tuples.add(new int[]{8, 1});
> tuples.add(new int[]{6, 5});
> tuples.add(new int[]{1, 5});
> cons[id] =3D chocoCSP.makeTupleFC(new IntVar[]{vars[4], vars[1]},=20
> tuples, true);
> chocoCSP.post(cons[id++]);
>
> //-----Now get solutions
> System.out.println("Choco Solutions");
> if(chocoCSP.solve() =3D=3D Boolean.TRUE) {
> do {
> for(int i =3D 0; i < chocoCSP.getNbIntVars(); i ++) {
> =20
> System.out.print(((IntDomainVar)chocoCSP.getIntVar(i)).getVal() + ", ")=
;
> }
> System.out.println();
> } while(chocoCSP.nextSolution() =3D=3D Boolean.TRUE);
> }
> }
> }
>
>
>
>
>
>
> > Date: Sat, 18 Nov 2006 00:28:23 +0100
> > From: Gui...@em...
> > To: cho...@li...
> > Subject: Re: [Choco-users] solveAll() bug?
> >
> > Hi,
> >
> > This strange behavior is due to the fact that you use SolveAll() befo=
re
> > Solve(). SolveAll() and Solve()+nextSolution()'s loop are equivalents
> > (in other words you search for all the solutions twice), so usually w=
e
> > don't do that :) What do you want to do ?
> >
> > -Guillaume
> >
> > Varun Jain a =E9crit :
> > > Hi,
> > >
> > > Thank you very much for your quick reply. I guess the real question=
I
> > > wanted to ask was that if choco could return results even when the
> > > problem is infeasible. I did my experiment with the following probl=
em:
> > >
> > > ------------------------------------------------
> > > Variables:
> > > Variable0, Domain: {3, 1, 4}
> > > Variable1, Domain: {2, 4, 6}
> > > Variable2, Domain: {2, 1}
> > > Variable3, Domain: {3, 1}
> > > Variable4, Domain: {6, 2, 5}
> > >
> > > Constraints:
> > > Constraint0, on variables 2 , Allowed values:
> > > 2
> > > Constraint1, on variables 2, 4 , Allowed values:
> > > 1, 6
> > > 2, 2
> > > Constraint2, on variables 4, 2 , Allowed values:
> > > 5, 2
> > > Constraint3, on variables 1, 3 , Allowed values:
> > > 2, 3
> > > ------------------------------------------------------
> > >
> > > All the constraints were created using Problem.makeTupleFC(IntVar[]
> > > varList, ArrayList tuples, boolean feasible). For example, the firs=
t
> > > constraint can be created as follows:
> > >
> > > ------------------------------------------
> > > Problem chocoCSP;
> > > /**
> > > * Set up the variables using chocoCSP.makeEnumIntVar()
> > > */
> > > IntVar[] varList =3D new IntVar[1];
> > > varList[0] =3D variables[2];
> > > ArrayList<int[]> tuples =3D new ArrayList<int[]>();
> > > tuples.add(new int[]{2});
> > > chocoCSP.makeTupleFC(varList, tuples, true);
> > > -------------------------------------------------
> > >
> > > To obtain solutions, I did the following:
> > >
> > > -----------------------------------------------
> > > System.out.println("SolveAll says: " + chocoCSP.solveAll());
> > > System.out.println("isFeasible says: " + chocoCSP.isFeasible());
> > > System.out.println("Choco Solutions");
> > > if(chocoCSP.solve() =3D=3D Boolean.TRUE) {
> > > do {
> > > for(int i =3D 0; i < chocoCSP.getNbIntVars(); i ++) {
> > > System.out.print(((IntDomainVar)
> > > chocoCSP.getIntVar(i)).getVal() + ", ");
> > > }
> > > System.out.println();
> > > } while(chocoCSP.nextSolution() =3D=3D Boolean.TRUE);
> > > }
> > > -----------------------------------------------
> > >
> > > Here is the output:
> > >
> > > SolveAll says: true
> > > isFeasible says: false
> > > Choco Solutions
> > > 1,2,2,3,5,
> > > 3,2,2,3,5,
> > > 4,2,2,3,5,
> > >
> > >
> > > Clearly, the solutions do not satisfy all the constraints. For
> > > instance, none of the solutions satisfy Constraint1. Is this expect=
ed
> > > behaviour??
> > >
> > > Thanks again,
> > > -Varun.
> > >
> > >
> > >
> > >
> > >=20
> -----------------------------------------------------------------------=
-
> > > > Date: Fri, 17 Nov 2006 11:31:40 +0100
> > > > From: Gui...@em...
> > > > To: jai...@ho...
> > > > Subject: Re: [Choco-users] solveAll() bug?
> > > >
> > > > Hi,
> > > >
> > > > I am not sure to understand what you try to do but i have some
> > > answers :)
> > > > -SolveAll still return true (it is hardcoded) but you can modify =
the
> > > > function solveAll() in choco.Problem
> > > >
> > > > In choco.Problem:
> > > > public Boolean solveAll() {
> > > > solver.firstSolution =3D false;
> > > > solver.generateSearchSolver(this);
> > > > solver.launch();
> > > > return Boolean.TRUE;
> > > > }
> > > >
> > > > -What kind of error do you have ? How do you implement the
> > > > nextSolution() loop ?
> > > > BTW, if you use nextSolution() to display solutions, you can use
> > > instead:
> > > >
> > > > "Solver.setVerbosity(Solver.SOLUTION);" before to begin to solve
> > > > and "Solver.flushLogs();" to print solutions
> > > >
> > > > else:
> > > >
> > > > if (pb.solve() =3D=3D Boolean.TRUE) {
> > > >
> > > > do {
> > > > //Code
> > > > }
> > > > } while(pb.nextSolution() =3D=3D Boolean.TRUE);
> > > > }
> > > >
> > > >
> > > > I hope it helps you... :)
> > > > -Guillaume
> > > >
> > > > Varun Jain a =E9crit :
> > > > > Hi..
> > > > > Is there any reason why the solveAll() method will return true
> > > even if
> > > > > there is no solution that satisfies all constraints. I was gett=
ing
> > > > > this behaviour so I did a little experiment: I set up a simple
> > > problem
> > > > > and executed the following:
> > > > >
> > > > > Problem chocoCSP;
> > > > > //...............
> > > > > //-----Set up the problem
> > > > > //...............
> > > > > System.out.println("SolveAll says: " + chocoCSP.solveAll());
> > > > > System.out.println("isFeasible says: " + chocoCSP.isFeasible())=
;
> > > > >
> > > > > The following was the output
> > > > >
> > > > > SolveAll says: true
> > > > > isFeasible says: false
> > > > >
> > > > > I thought solveAll() returns false if no solution exists.=20
> Also, for
> > > > > this problem, the solutions I get from the nextSolution()=20
> method do
> > > > > not satisfy all constraints. Any explainations would be really
> > > helpful?
> > > > >
> > > > > Thanks,
> > > > > -Varun.
> > > >
> > >=20
> -----------------------------------------------------------------------=
-
> > > Be one of the first to try Windows Live Mail.
> > >=20
> <http://ideas.live.com/programpage.aspx?versionId=3D5d21c51a-b161-4314-=
9b0e-4911fb2b2e6d>=20
>
> > >
> > >=20
> -----------------------------------------------------------------------=
-
> > >
> > >=20
> -----------------------------------------------------------------------=
--
> > > Take Surveys. Earn Cash. Influence the Future of IT
> > > Join SourceForge.net's Techsay panel and you'll get the chance to=20
> share your
> > > opinions on IT & business topics through brief surveys - and earn c=
ash
> > >=20
> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDEV
> > >=20
> -----------------------------------------------------------------------=
-
> > >
> > > _______________________________________________
> > > Choco-users mailing list
> > > Cho...@li...
> > > https://lists.sourceforge.net/lists/listinfo/choco-users
> > >
> >
> >
> >=20
> -----------------------------------------------------------------------=
--
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to=20
> share your
> > opinions on IT & business topics through brief surveys - and earn cas=
h
> >=20
> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDEV
> > _______________________________________________
> > Choco-users mailing list
> > Cho...@li...
> > https://lists.sourceforge.net/lists/listinfo/choco-users
>
> -----------------------------------------------------------------------=
-
> Be one of the first to try Windows Live Mail.=20
> <http://ideas.live.com/programpage.aspx?versionId=3D5d21c51a-b161-4314-=
9b0e-4911fb2b2e6d>=20
>
> -----------------------------------------------------------------------=
-
>
> -----------------------------------------------------------------------=
--
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share=
your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDEV
> -----------------------------------------------------------------------=
-
>
> _______________________________________________
> Choco-users mailing list
> Cho...@li...
> https://lists.sourceforge.net/lists/listinfo/choco-users
> =20
|
|
From: Varun J. <jai...@ho...> - 2006-11-18 00:34:44
|
Hi again,I thought I should give you my test code so that you can run it yo=
urself. I have included the code at the bottom. Note that the CSP problem I=
was experimenting with has changed a bit (however, the strange behaviour s=
till remains) Heres the new CSP problem:Variables:Variable0, Domain: {4, 2}=
Variable1, Domain: {5, 1, 4}Variable2, Domain: {3, 4, 6}Variable3, Domain: =
{1, 2}Variable4, Domain: {7, 8, 6, 1}Constraints:Constraint0, on variables =
3 , Allowed tuples:1Constraint1, on variables 2, 4 , Allowed tuples:6, 7Con=
straint2, on variables 2 , Allowed tuples:34Constraint3, on variables 4, 1 =
, Allowed tuples:7, 18, 16, 51, 5Heres the output of running the program gi=
ven below:Choco Solutions2, 1, 3, 1, 8, 4, 1, 3, 1, 8, As you can see, none=
of the solutions satisfy constraint1. Still choco returns these solutions.=
Heres my code (BTW, Thanks for taking time out to help me.. I really apprec=
iate it :-)):import choco.Problem;import choco.Constraint;import choco.inte=
ger.IntDomainVar;import choco.integer.IntVar;import java.util.ArrayList;/**=
* @author Varun Jain (vj) * @version $Revision$, $Date$ * @created Nov 17,=
2006 */public class ChocoTest { public static void main(String args[]) { =
Problem chocoCSP =3D new Problem(); IntDomainVar[] vars =3D new IntDo=
mainVar[5]; Constraint[] cons =3D new Constraint[4]; //-----Construct=
all variables int id =3D 0; vars[id] =3D chocoCSP.makeEnumIntVar("v"=
+ id++, new int[]{4, 2}); vars[id] =3D chocoCSP.makeEnumIntVar("v" + id=
++, new int[]{5, 1, 4}); vars[id] =3D chocoCSP.makeEnumIntVar("v" + id++=
, new int[]{3, 4, 6}); vars[id] =3D chocoCSP.makeEnumIntVar("v" + id++, =
new int[]{1, 2}); vars[id] =3D chocoCSP.makeEnumIntVar("v" + id++, new i=
nt[]{7, 8, 6, 1}); id =3D 0; ArrayList<int[]> tuples; //-----Now c=
onstruct all constraints //-----Constraint0 tuples =3D new ArrayList<=
int[]>(); tuples.add(new int[]{1}); cons[id] =3D chocoCSP.makeTupleFC=
(new IntVar[]{vars[3]}, tuples, true); chocoCSP.post(cons[id++]); //-=
----Constraint1=0A=
tuples =3D new ArrayList<int[]>(); tuples.add(new int[]{6, 7}); c=
ons[id] =3D chocoCSP.makeTupleFC(new IntVar[]{vars[2], vars[4]}, tuples, tr=
ue); chocoCSP.post(cons[id++]); //-----Constraint2=0A=
tuples =3D new ArrayList<int[]>(); tuples.add(new int[]{3}); tupl=
es.add(new int[]{4}); cons[id] =3D chocoCSP.makeTupleFC(new IntVar[]{var=
s[2]}, tuples, true); chocoCSP.post(cons[id++]); //-----Constraint3=
=0A=
tuples =3D new ArrayList<int[]>(); tuples.add(new int[]{7, 1}); t=
uples.add(new int[]{8, 1}); tuples.add(new int[]{6, 5}); tuples.add(n=
ew int[]{1, 5}); cons[id] =3D chocoCSP.makeTupleFC(new IntVar[]{vars[4],=
vars[1]}, tuples, true); chocoCSP.post(cons[id++]); //-----Now get s=
olutions System.out.println("Choco Solutions"); if(chocoCSP.solve() =
=3D=3D Boolean.TRUE) { do { for(int i =3D 0; i < chocoCSP.getNb=
IntVars(); i ++) { System.out.print(((IntDomainVar)chocoCSP.getInt=
Var(i)).getVal() + ", "); } System.out.println(); } whil=
e(chocoCSP.nextSolution() =3D=3D Boolean.TRUE); } }}> Date: Sat, 18 Nov=
2006 00:28:23 +0100> From: Gui...@em...> To: choco-users@lists=
.sourceforge.net> Subject: Re: [Choco-users] solveAll() bug?> > Hi,> > This=
strange behavior is due to the fact that you use SolveAll() before > Solve=
(). SolveAll() and Solve()+nextSolution()'s loop are equivalents > (in o=
ther words you search for all the solutions twice), so usually we > don't =
do that :) What do you want to do ?> > -Guillaume> > Varun Jain a =E9crit :=
> > Hi,> >> > Thank you very much for your quick reply. I guess the real qu=
estion I > > wanted to ask was that if choco could return results even when=
the > > problem is infeasible. I did my experiment with the following prob=
lem:> >> > ------------------------------------------------> > Variables:> =
> Variable0, Domain: {3, 1, 4}> > Variable1, Domain: {2, 4, 6}> > Variable2=
, Domain: {2, 1}> > Variable3, Domain: {3, 1}> > Variable4, Domain: {6, 2, =
5}> >> > Constraints:> > Constraint0, on variables 2 , Allowed values:> > 2=
> > Constraint1, on variables 2, 4 , Allowed values:> > 1, 6> > 2, 2> > Con=
straint2, on variables 4, 2 , Allowed values:> > 5, 2> > Constraint3, on va=
riables 1, 3 , Allowed values:> > 2, 3> > ---------------------------------=
---------------------> >> > All the constraints were created using Problem.=
makeTupleFC(IntVar[] > > varList, ArrayList tuples, boolean feasible). For =
example, the first > > constraint can be created as follows:> >> > --------=
----------------------------------> > Problem chocoCSP;> > /**> > * Set up=
the variables using chocoCSP.makeEnumIntVar()> > */> > IntVar[] varList =
=3D new IntVar[1];> > varList[0] =3D variables[2];> > ArrayList<int[]> tupl=
es =3D new ArrayList<int[]>();> > tuples.add(new int[]{2});> > chocoCSP.mak=
eTupleFC(varList, tuples, true);> > ---------------------------------------=
----------> >> > To obtain solutions, I did the following:> >> > ----------=
-------------------------------------> > System.out.println("SolveAll s=
ays: " + chocoCSP.solveAll());> > System.out.println("isFeasible says: =
" + chocoCSP.isFeasible());> > System.out.println("Choco Solutions");> =
> if(chocoCSP.solve() =3D=3D Boolean.TRUE) {> > do {> > f=
or(int i =3D 0; i < chocoCSP.getNbIntVars(); i ++) {> > System.ou=
t.print(((IntDomainVar) > > chocoCSP.getIntVar(i)).getVal() + ", ");> > =
}> > System.out.println();> > } while(chocoCSP.nextSolut=
ion() =3D=3D Boolean.TRUE);> > }> > -----------------------------------=
------------> >> > Here is the output:> >> > SolveAll says: true> > isFeasi=
ble says: false> > Choco Solutions> > 1,2,2,3,5,> > 3,2,2,3,5,> > 4,2,2,3,5=
,> >> >> > Clearly, the solutions do not satisfy all the constraints. For >=
> instance, none of the solutions satisfy Constraint1. Is this expected > =
> behaviour??> >> > Thanks again,> > -Varun.> >> >> >> >> > ---------------=
---------------------------------------------------------> > > Date: Fri, 1=
7 Nov 2006 11:31:40 +0100> > > From: Gui...@em...> > > To: jain=
_v...@ho...> > > Subject: Re: [Choco-users] solveAll() bug?> > >> > =
> Hi,> > >> > > I am not sure to understand what you try to do but i have s=
ome > > answers :)> > > -SolveAll still return true (it is hardcoded) but y=
ou can modify the> > > function solveAll() in choco.Problem> > >> > > In ch=
oco.Problem:> > > public Boolean solveAll() {> > > solver.firstSolution =3D=
false;> > > solver.generateSearchSolver(this);> > > solver.launch();> > > =
return Boolean.TRUE;> > > }> > >> > > -What kind of error do you have ? How=
do you implement the> > > nextSolution() loop ?> > > BTW, if you use nextS=
olution() to display solutions, you can use > > instead:> > >> > > "Solver.=
setVerbosity(Solver.SOLUTION);" before to begin to solve> > > and "Solver.f=
lushLogs();" to print solutions> > >> > > else:> > >> > > if (pb.solve() =
=3D=3D Boolean.TRUE) {> > >> > > do {> > > //Code> > > }> > > } while(pb.ne=
xtSolution() =3D=3D Boolean.TRUE);> > > }> > >> > >> > > I hope it helps yo=
u... :)> > > -Guillaume> > >> > > Varun Jain a =E9crit :> > > > Hi..> > > >=
Is there any reason why the solveAll() method will return true > > even if=
> > > > there is no solution that satisfies all constraints. I was getting>=
> > > this behaviour so I did a little experiment: I set up a simple > > p=
roblem> > > > and executed the following:> > > >> > > > Problem chocoCSP;> =
> > > //...............> > > > //-----Set up the problem> > > > //.........=
......> > > > System.out.println("SolveAll says: " + chocoCSP.solveAll());>=
> > > System.out.println("isFeasible says: " + chocoCSP.isFeasible());> > =
> >> > > > The following was the output> > > >> > > > SolveAll says: true> =
> > > isFeasible says: false> > > >> > > > I thought solveAll() returns fal=
se if no solution exists. Also, for> > > > this problem, the solutions I ge=
t from the nextSolution() method do> > > > not satisfy all constraints. Any=
explainations would be really > > helpful?> > > >> > > > Thanks,> > > > -V=
arun.> > >> > -------------------------------------------------------------=
-----------> > Be one of the first to try Windows Live Mail. > > <http://id=
eas.live.com/programpage.aspx?versionId=3D5d21c51a-b161-4314-9b0e-4911fb2b2=
e6d> > >> > ---------------------------------------------------------------=
---------> >> > -----------------------------------------------------------=
--------------> > Take Surveys. Earn Cash. Influence the Future of IT> > Jo=
in SourceForge.net's Techsay panel and you'll get the chance to share your>=
> opinions on IT & business topics through brief surveys - and earn cash> =
> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDEV> > -----------------------------------------------------------------=
-------> >> > _______________________________________________> > Choco-user=
s mailing list> > Cho...@li...> > https://lists.source=
forge.net/lists/listinfo/choco-users> > > > > ---------------------------=
----------------------------------------------> Take Surveys. Earn Cash. In=
fluence the Future of IT> Join SourceForge.net's Techsay panel and you'll g=
et the chance to share your> opinions on IT & business topics through brief=
surveys - and earn cash> http://www.techsay.com/default.php?page=3Djoin.ph=
p&p=3Dsourceforge&CID=3DDEVDEV> ___________________________________________=
____> Choco-users mailing list> Cho...@li...> https://=
lists.sourceforge.net/lists/listinfo/choco-users
_________________________________________________________________
Be one of the first to try Windows Live Mail.
http://ideas.live.com/programpage.aspx?versionId=3D5d21c51a-b161-4314-9b0e-=
4911fb2b2e6d=
|
|
From: Varun J. <jai...@ho...> - 2006-11-17 23:47:35
|
Hi,Thanks again for your reply. Actually I included SolveAll() later in an =
attempt to try and understand whats wrong. Basically, I wanted to extract a=
ll solutions if any exists. So I did the following: System.out.println("=
Choco Solutions"); if(chocoCSP.solve() =3D=3D Boolean.TRUE) { do { =
for(int i =3D 0; i < chocoCSP.getNbIntVars(); i ++) { Syste=
m.out.print(((IntDomainVar)chocoCSP.getIntVar(i)).getVal() + ", "); =
} System.out.println(); } while(chocoCSP.nextSolution() =3D=3D =
Boolean.TRUE); }And the output was still the following:Choco Solutions1,=
2,2,3,5,3,2,2,3,5,4,2,2,3,5,I included the SolveAll() and isFeasible() meth=
ods later since the above was not working. So even in the absence of SolveA=
ll() I get the strange behaviour.-Varun.> Date: Sat, 18 Nov 2006 00:28:23 +=
0100> From: Gui...@em...> To: cho...@li...=
> Subject: Re: [Choco-users] solveAll() bug?> > Hi,> > This strange behavio=
r is due to the fact that you use SolveAll() before > Solve(). SolveAll() =
and Solve()+nextSolution()'s loop are equivalents > (in other words you s=
earch for all the solutions twice), so usually we > don't do that :) What =
do you want to do ?> > -Guillaume> > Varun Jain a =E9crit :> > Hi,> >> > Th=
ank you very much for your quick reply. I guess the real question I > > wan=
ted to ask was that if choco could return results even when the > > problem=
is infeasible. I did my experiment with the following problem:> >> > -----=
-------------------------------------------> > Variables:> > Variable0, Dom=
ain: {3, 1, 4}> > Variable1, Domain: {2, 4, 6}> > Variable2, Domain: {2, 1}=
> > Variable3, Domain: {3, 1}> > Variable4, Domain: {6, 2, 5}> >> > Constra=
ints:> > Constraint0, on variables 2 , Allowed values:> > 2> > Constraint1,=
on variables 2, 4 , Allowed values:> > 1, 6> > 2, 2> > Constraint2, on var=
iables 4, 2 , Allowed values:> > 5, 2> > Constraint3, on variables 1, 3 , A=
llowed values:> > 2, 3> > -------------------------------------------------=
-----> >> > All the constraints were created using Problem.makeTupleFC(IntV=
ar[] > > varList, ArrayList tuples, boolean feasible). For example, the fir=
st > > constraint can be created as follows:> >> > ------------------------=
------------------> > Problem chocoCSP;> > /**> > * Set up the variables u=
sing chocoCSP.makeEnumIntVar()> > */> > IntVar[] varList =3D new IntVar[1]=
;> > varList[0] =3D variables[2];> > ArrayList<int[]> tuples =3D new ArrayL=
ist<int[]>();> > tuples.add(new int[]{2});> > chocoCSP.makeTupleFC(varList,=
tuples, true);> > -------------------------------------------------> >> > =
To obtain solutions, I did the following:> >> > ---------------------------=
--------------------> > System.out.println("SolveAll says: " + chocoCSP=
.solveAll());> > System.out.println("isFeasible says: " + chocoCSP.isFe=
asible());> > System.out.println("Choco Solutions");> > if(chocoCSP=
.solve() =3D=3D Boolean.TRUE) {> > do {> > for(int i =3D 0; i=
< chocoCSP.getNbIntVars(); i ++) {> > System.out.print(((IntDoma=
inVar) > > chocoCSP.getIntVar(i)).getVal() + ", ");> > }> > =
System.out.println();> > } while(chocoCSP.nextSolution() =3D=3D Bool=
ean.TRUE);> > }> > -----------------------------------------------> >> =
> Here is the output:> >> > SolveAll says: true> > isFeasible says: false> =
> Choco Solutions> > 1,2,2,3,5,> > 3,2,2,3,5,> > 4,2,2,3,5,> >> >> > Clearl=
y, the solutions do not satisfy all the constraints. For > > instance, none=
of the solutions satisfy Constraint1. Is this expected > > behaviour??> >>=
> Thanks again,> > -Varun.> >> >> >> >> > --------------------------------=
----------------------------------------> > > Date: Fri, 17 Nov 2006 11:31:=
40 +0100> > > From: Gui...@em...> > > To: jai...@ho...=
m> > > Subject: Re: [Choco-users] solveAll() bug?> > >> > > Hi,> > >> > > I=
am not sure to understand what you try to do but i have some > > answers :=
)> > > -SolveAll still return true (it is hardcoded) but you can modify the=
> > > function solveAll() in choco.Problem> > >> > > In choco.Problem:> > >=
public Boolean solveAll() {> > > solver.firstSolution =3D false;> > > solv=
er.generateSearchSolver(this);> > > solver.launch();> > > return Boolean.TR=
UE;> > > }> > >> > > -What kind of error do you have ? How do you implement=
the> > > nextSolution() loop ?> > > BTW, if you use nextSolution() to disp=
lay solutions, you can use > > instead:> > >> > > "Solver.setVerbosity(Solv=
er.SOLUTION);" before to begin to solve> > > and "Solver.flushLogs();" to p=
rint solutions> > >> > > else:> > >> > > if (pb.solve() =3D=3D Boolean.TRUE=
) {> > >> > > do {> > > //Code> > > }> > > } while(pb.nextSolution() =3D=3D=
Boolean.TRUE);> > > }> > >> > >> > > I hope it helps you... :)> > > -Guill=
aume> > >> > > Varun Jain a =E9crit :> > > > Hi..> > > > Is there any reaso=
n why the solveAll() method will return true > > even if> > > > there is no=
solution that satisfies all constraints. I was getting> > > > this behavio=
ur so I did a little experiment: I set up a simple > > problem> > > > and e=
xecuted the following:> > > >> > > > Problem chocoCSP;> > > > //...........=
....> > > > //-----Set up the problem> > > > //...............> > > > Syste=
m.out.println("SolveAll says: " + chocoCSP.solveAll());> > > > System.out.p=
rintln("isFeasible says: " + chocoCSP.isFeasible());> > > >> > > > The foll=
owing was the output> > > >> > > > SolveAll says: true> > > > isFeasible sa=
ys: false> > > >> > > > I thought solveAll() returns false if no solution e=
xists. Also, for> > > > this problem, the solutions I get from the nextSolu=
tion() method do> > > > not satisfy all constraints. Any explainations woul=
d be really > > helpful?> > > >> > > > Thanks,> > > > -Varun.> > >> > -----=
-------------------------------------------------------------------> > Be o=
ne of the first to try Windows Live Mail. > > <http://ideas.live.com/progra=
mpage.aspx?versionId=3D5d21c51a-b161-4314-9b0e-4911fb2b2e6d> > >> > -------=
-----------------------------------------------------------------> >> > ---=
----------------------------------------------------------------------> > T=
ake Surveys. Earn Cash. Influence the Future of IT> > Join SourceForge.net'=
s Techsay panel and you'll get the chance to share your> > opinions on IT &=
business topics through brief surveys - and earn cash> > http://www.techsa=
y.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV> > ---------=
---------------------------------------------------------------> >> > _____=
__________________________________________> > Choco-users mailing list> > C=
hoc...@li...> > https://lists.sourceforge.net/lists/lis=
tinfo/choco-users> > > > > ----------------------------------------------=
---------------------------> Take Surveys. Earn Cash. Influence the Future =
of IT> Join SourceForge.net's Techsay panel and you'll get the chance to sh=
are your> opinions on IT & business topics through brief surveys - and earn=
cash> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&C=
ID=3DDEVDEV> _______________________________________________> Choco-users m=
ailing list> Cho...@li...> https://lists.sourceforge.n=
et/lists/listinfo/choco-users
_________________________________________________________________
Be one of the first to try Windows Live Mail.
http://ideas.live.com/programpage.aspx?versionId=3D5d21c51a-b161-4314-9b0e-=
4911fb2b2e6d=
|
|
From: Guillaume R. <Gui...@em...> - 2006-11-17 23:29:33
|
Hi,
This strange behavior is due to the fact that you use SolveAll() before=20
Solve(). SolveAll() and Solve()+nextSolution()'s loop are equivalents=20
(in other words you search for all the solutions twice), so usually we=20
don't do that :) What do you want to do ?
-Guillaume
Varun Jain a =E9crit :
> Hi,
>
> Thank you very much for your quick reply. I guess the real question I=20
> wanted to ask was that if choco could return results even when the=20
> problem is infeasible. I did my experiment with the following problem:
>
> ------------------------------------------------
> Variables:
> Variable0, Domain: {3, 1, 4}
> Variable1, Domain: {2, 4, 6}
> Variable2, Domain: {2, 1}
> Variable3, Domain: {3, 1}
> Variable4, Domain: {6, 2, 5}
>
> Constraints:
> Constraint0, on variables 2 , Allowed values:
> 2
> Constraint1, on variables 2, 4 , Allowed values:
> 1, 6
> 2, 2
> Constraint2, on variables 4, 2 , Allowed values:
> 5, 2
> Constraint3, on variables 1, 3 , Allowed values:
> 2, 3
> ------------------------------------------------------
>
> All the constraints were created using Problem.makeTupleFC(IntVar[]=20
> varList, ArrayList tuples, boolean feasible). For example, the first=20
> constraint can be created as follows:
>
> ------------------------------------------
> Problem chocoCSP;
> /**
> * Set up the variables using chocoCSP.makeEnumIntVar()
> */
> IntVar[] varList =3D new IntVar[1];
> varList[0] =3D variables[2];
> ArrayList<int[]> tuples =3D new ArrayList<int[]>();
> tuples.add(new int[]{2});
> chocoCSP.makeTupleFC(varList, tuples, true);
> -------------------------------------------------
>
> To obtain solutions, I did the following:
>
> -----------------------------------------------
> System.out.println("SolveAll says: " + chocoCSP.solveAll());
> System.out.println("isFeasible says: " + chocoCSP.isFeasible());
> System.out.println("Choco Solutions");
> if(chocoCSP.solve() =3D=3D Boolean.TRUE) {
> do {
> for(int i =3D 0; i < chocoCSP.getNbIntVars(); i ++) {
> System.out.print(((IntDomainVar)=20
> chocoCSP.getIntVar(i)).getVal() + ", ");
> }
> System.out.println();
> } while(chocoCSP.nextSolution() =3D=3D Boolean.TRUE);
> }
> -----------------------------------------------
>
> Here is the output:
>
> SolveAll says: true
> isFeasible says: false
> Choco Solutions
> 1,2,2,3,5,
> 3,2,2,3,5,
> 4,2,2,3,5,
>
>
> Clearly, the solutions do not satisfy all the constraints. For=20
> instance, none of the solutions satisfy Constraint1. Is this expected=20
> behaviour??
>
> Thanks again,
> -Varun.
>
>
>
>
> -----------------------------------------------------------------------=
-
> > Date: Fri, 17 Nov 2006 11:31:40 +0100
> > From: Gui...@em...
> > To: jai...@ho...
> > Subject: Re: [Choco-users] solveAll() bug?
> >
> > Hi,
> >
> > I am not sure to understand what you try to do but i have some=20
> answers :)
> > -SolveAll still return true (it is hardcoded) but you can modify the
> > function solveAll() in choco.Problem
> >
> > In choco.Problem:
> > public Boolean solveAll() {
> > solver.firstSolution =3D false;
> > solver.generateSearchSolver(this);
> > solver.launch();
> > return Boolean.TRUE;
> > }
> >
> > -What kind of error do you have ? How do you implement the
> > nextSolution() loop ?
> > BTW, if you use nextSolution() to display solutions, you can use=20
> instead:
> >
> > "Solver.setVerbosity(Solver.SOLUTION);" before to begin to solve
> > and "Solver.flushLogs();" to print solutions
> >
> > else:
> >
> > if (pb.solve() =3D=3D Boolean.TRUE) {
> >
> > do {
> > //Code
> > }
> > } while(pb.nextSolution() =3D=3D Boolean.TRUE);
> > }
> >
> >
> > I hope it helps you... :)
> > -Guillaume
> >
> > Varun Jain a =E9crit :
> > > Hi..
> > > Is there any reason why the solveAll() method will return true=20
> even if
> > > there is no solution that satisfies all constraints. I was getting
> > > this behaviour so I did a little experiment: I set up a simple=20
> problem
> > > and executed the following:
> > >
> > > Problem chocoCSP;
> > > //...............
> > > //-----Set up the problem
> > > //...............
> > > System.out.println("SolveAll says: " + chocoCSP.solveAll());
> > > System.out.println("isFeasible says: " + chocoCSP.isFeasible());
> > >
> > > The following was the output
> > >
> > > SolveAll says: true
> > > isFeasible says: false
> > >
> > > I thought solveAll() returns false if no solution exists. Also, for
> > > this problem, the solutions I get from the nextSolution() method do
> > > not satisfy all constraints. Any explainations would be really=20
> helpful?
> > >
> > > Thanks,
> > > -Varun.
> >
> -----------------------------------------------------------------------=
-
> Be one of the first to try Windows Live Mail.=20
> <http://ideas.live.com/programpage.aspx?versionId=3D5d21c51a-b161-4314-=
9b0e-4911fb2b2e6d>=20
>
> -----------------------------------------------------------------------=
-
>
> -----------------------------------------------------------------------=
--
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share=
your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDEV
> -----------------------------------------------------------------------=
-
>
> _______________________________________________
> Choco-users mailing list
> Cho...@li...
> https://lists.sourceforge.net/lists/listinfo/choco-users
> =20
|
|
From: Varun J. <jai...@ho...> - 2006-11-17 19:20:35
|
=0A=
=0A=
=0A=
=0A=
=0A=
Hi,Thank you very much for your quick reply. I=0A=
guess the real question I wanted to ask was that if choco could return=0A=
results even when the problem is infeasible. I did my experiment with=0A=
the following problem:------------------------------------------------Varia=
bles:Variable0, Domain: {3, 1, 4}Variable1, Domain: {2, 4, 6}Variable2, Dom=
ain: {2, 1}Variable3, Domain: {3, 1}Variable4, Domain: {6, 2, 5}Constraints=
:Constraint0, on variables 2 , Allowed values:2Constraint1, on variables 2,=
4 , Allowed values:1, 62, 2Constraint2, on variables 4, 2 , Allowed values=
:5, 2Constraint3, on variables 1, 3 , Allowed values:2, 3------------------=
------------------------------------All=0A=
the constraints were created using Problem.makeTupleFC(IntVar[]=0A=
varList, ArrayList tuples, boolean feasible). For example, the first=0A=
constraint can be created as follows:--------------------------------------=
----Problem chocoCSP;/** * Set up the variables using chocoCSP.makeEnumIntV=
ar() */IntVar[] varList =3D new IntVar[1];varList[0] =3D variables[2];Array=
List<int[]> tuples =3D new ArrayList<int[]>();tuples.add(new int[]{2});choc=
oCSP.makeTupleFC(varList, tuples, true);-----------------------------------=
--------------To obtain solutions, I did the following:--------------------=
--------------------------- System.out.println("SolveAll says: " + choco=
CSP.solveAll()); System.out.println("isFeasible says: " + chocoCSP.isFea=
sible()); System.out.println("Choco Solutions"); if(chocoCSP.solve() =
=3D=3D Boolean.TRUE) { do { for(int i =3D 0; i < chocoCSP.getNb=
IntVars(); i ++) { System.out.print(((IntDomainVar) chocoCSP.getIn=
tVar(i)).getVal() + ", "); } System.out.println(); } whi=
le(chocoCSP.nextSolution() =3D=3D Boolean.TRUE); }----------------------=
-------------------------Here is the output:SolveAll says: trueisFeasible s=
ays: falseChoco Solutions1,2,2,3,5,3,2,2,3,5,4,2,2,3,5,Clearly,=0A=
the solutions do not satisfy all the constraints. For instance, none of=0A=
the solutions satisfy Constraint1. Is this expected behaviour??Thanks again=
,-Varun.> Date: Fri, 17 Nov 2006 11:31:40 +0100> From: Guillaume.Richaud@em=
n.fr> To: jai...@ho...> Subject: Re: [Choco-users] solveAll() bug=
?> > Hi,> > I am not sure to understand what you try to do but i have some =
answers :)> -SolveAll still return true (it is hardcoded) but you can modif=
y the > function solveAll() in choco.Problem> > In choco.Problem:> public=
Boolean solveAll() {> solver.firstSolution =3D false;> solver.gene=
rateSearchSolver(this);> solver.launch();> return Boolean.TRUE;> =
}> > -What kind of error do you have ? How do you implement the > nextSolut=
ion() loop ?> BTW, if you use nextSolution() to display solutions, you can =
use instead:> > "Solver.setVerbosity(Solver.SOLUTION);" before to begin to =
solve> and "Solver.flushLogs();" to print solutions> > else:> > if (pb.solv=
e() =3D=3D Boolean.TRUE) {> > do {> //Code> }> } while(pb.nextSolu=
tion() =3D=3D Boolean.TRUE);> }> > > I hope it helps you... :)> -Guillaume>=
> Varun Jain a =E9crit :> > Hi..> > Is there any reason why the solveAll()=
method will return true even if > > there is no solution that satisfies al=
l constraints. I was getting > > this behaviour so I did a little experimen=
t: I set up a simple problem > > and executed the following: > > > > Probl=
em chocoCSP; > > //............... > > //-----Set up the problem > > //....=
........... > > System.out.println("SolveAll says: " + chocoCSP.solveAll())=
; > > System.out.println("isFeasible says: " + chocoCSP.isFeasible()); > > =
> > The following was the output > > > > SolveAll says: true > > isFeasib=
le says: false > > > > I thought solveAll() returns false if no solution e=
xists. Also, for > > this problem, the solutions I get from the nextSolutio=
n() method do > > not satisfy all constraints. Any explainations would be r=
eally helpful? > > > > Thanks, > > -Varun. >=20
_________________________________________________________________
Be one of the first to try Windows Live Mail.
http://ideas.live.com/programpage.aspx?versionId=3D5d21c51a-b161-4314-9b0e-=
4911fb2b2e6d=
|
|
From: Varun J. <jai...@ho...> - 2006-11-17 01:33:00
|
Hi..Is there any reason why the solveAll() method will return true even if=
=0A=
there is no solution that satisfies all constraints. I was getting=0A=
this behaviour so I did a little experiment: I set up a simple problem=0A=
and executed the following: =0A=
=0A=
Problem chocoCSP; =0A=
//............... =0A=
//-----Set up the problem =0A=
//............... =0A=
System.out.println("SolveAll says: " + chocoCSP.solveAll()); =0A=
System.out.println("isFeasible says: " + chocoCSP.isFeasible()); =0A=
=0A=
The following was the output =0A=
=0A=
SolveAll says: true =0A=
isFeasible says: false =0A=
=0A=
I thought solveAll() returns false if no solution exists. Also, for=0A=
this problem, the solutions I get from the nextSolution() method do not=0A=
satisfy all constraints. Any explainations would be really helpful? =0A=
=0A=
Thanks, =0A=
-Varun.=0A=
=09
_________________________________________________________________
Be one of the first to try Windows Live Mail.
http://ideas.live.com/programpage.aspx?versionId=3D5d21c51a-b161-4314-9b0e-=
4911fb2b2e6d=
|