Difference between [0,5] and {0..5}?

18 views
Skip to first unread message

wkau...@gmail.com

unread,
Dec 27, 2020, 4:26:34 AM12/27/20
to choco-solver
In my program, I declare two variable R and G like that:
 IntVar R = model.intVar("Red", 0,5);
IntVar G = model.intVar("Green", 0, 5);

When I print my model,  I notice that :
  domain(R) = [0,5] and domain(G)={0..5}. That is why I would like to know the difference between the two notation: [0,5] and {0..5}

Thank you
Austin 

cpru...@gmail.com

unread,
Apr 20, 2021, 11:12:57 AM4/20/21
to choco-solver
Hi

I suppose you change domain size because in your case you should have {0...5} for both variables.
Answer to your question is in the documentation, specifically have a look at bounded and enumerated variables.

Hope that helps
CP
Reply all
Reply to author
Forward
0 new messages