From pds at di.uevora.pt Mon Jun 22 05:41:35 2009 From: pds at di.uevora.pt (Pedro Salgueiro) Date: Mon, 22 Jun 2009 10:41:35 +0100 Subject: [gecoder-users] GecodeR with Gecode 3.1.0 Message-ID: <1245663695.5216.19.camel@rebirth> Hi! Will GecodeR work with Gecode 3.1.0? Thank you, Pedro Salgueiro From pds at di.uevora.pt Tue Jun 23 11:07:37 2009 From: pds at di.uevora.pt (Pedro Salgueiro) Date: Tue, 23 Jun 2009 16:07:37 +0100 Subject: [gecoder-users] Refication of element constraint Message-ID: <1245769657.5216.64.camel@rebirth> Hi! Is there any syntactic sugar for the reification of the element constraint? I tried to use it the normal way by using '|' and '&' and I got the following errors: /var/lib/gems/1.8/gems/gecoder-with-gecode-1.0.0/lib/gecoder/interface/constraints/reifiable_constraints.rb:40:in `with_reification_operands': TypeError (TypeError) from /var/lib/gems/1.8/gems/gecoder-with-gecode-1.0.0/lib/gecoder/interface/constraints/reifiable_constraints.rb:18:in `|' Using it with the ":reify" key with boolean vars it works ok. Thank you, Pedro Salgueiro From rubyforge at lokorin.org Thu Jun 25 15:45:11 2009 From: rubyforge at lokorin.org (Andreas Launila) Date: Thu, 25 Jun 2009 21:45:11 +0200 Subject: [gecoder-users] GecodeR with Gecode 3.1.0 In-Reply-To: <1245663695.5216.19.camel@rebirth> References: <1245663695.5216.19.camel@rebirth> Message-ID: <4A43D3C7.8000002@lokorin.org> On 06/22/2009 11:41 AM, Pedro Salgueiro wrote: > Will GecodeR work with Gecode 3.1.0? > Gecode/R does not currently support Gecode 3.* . Support is in the workings, but there's no telling when it will be ready. -- Andreas Launila From pds at di.uevora.pt Thu Jun 25 16:15:57 2009 From: pds at di.uevora.pt (Pedro Salgueiro) Date: Thu, 25 Jun 2009 21:15:57 +0100 Subject: [gecoder-users] GecodeR with Gecode 3.1.0 In-Reply-To: <4A43D3C7.8000002@lokorin.org> References: <1245663695.5216.19.camel@rebirth> <4A43D3C7.8000002@lokorin.org> Message-ID: <1245960957.11480.12.camel@rebirth> On Thu, 2009-06-25 at 21:45 +0200, Andreas Launila wrote: > On 06/22/2009 11:41 AM, Pedro Salgueiro wrote: > > Will GecodeR work with Gecode 3.1.0? > > > > Gecode/R does not currently support Gecode 3.* . Support is in the > workings, but there's no telling when it will be ready. Thank you, I will be waiting for a new version. Pedro Salgueiro > From rubyforge at lokorin.org Thu Jun 25 17:26:40 2009 From: rubyforge at lokorin.org (Andreas Launila) Date: Thu, 25 Jun 2009 23:26:40 +0200 Subject: [gecoder-users] Refication of element constraint In-Reply-To: <1245769657.5216.64.camel@rebirth> References: <1245769657.5216.64.camel@rebirth> Message-ID: <4A43EB90.5030908@lokorin.org> On 06/23/2009 05:07 PM, Pedro Salgueiro wrote: > Is there any syntactic sugar for the reification of the element > constraint? I tried to use it the normal way by using '|' and '&' and I > got the following errors: > > /var/lib/gems/1.8/gems/gecoder-with-gecode-1.0.0/lib/gecoder/interface/constraints/reifiable_constraints.rb:40:in `with_reification_operands': TypeError (TypeError) > > from /var/lib/gems/1.8/gems/gecoder-with-gecode-1.0.0/lib/gecoder/interface/constraints/reifiable_constraints.rb:18:in `|' > > > Using it with the ":reify" key with boolean vars it works ok. Please post your code snippet so that I can get a better idea of what you're trying to do. The following appears to work for me: require 'rubygems' require 'gecoder' solution = Gecode.solve do foo_is_an int_var_array(2, 0..9) i = int_var(0..1) (foo[i].must == 0) | (foo[i].must == 1) foo[0].must == 2 branch_on foo end p solution.foo -- Andreas Launila From zayenz at gmail.com Fri Jun 26 09:18:44 2009 From: zayenz at gmail.com (Mikael Zayenz Lagerkvist) Date: Fri, 26 Jun 2009 15:18:44 +0200 Subject: [gecoder-users] Refication of element constraint In-Reply-To: <1245769657.5216.64.camel@rebirth> References: <1245769657.5216.64.camel@rebirth> Message-ID: <63b5c8b00906260618y7d52e35lac33605835762d85@mail.gmail.com> Hi, Just as an additional note, the element constraint has no dedicated reified version in plain Gecode. For reifying element, one has to introduce copies of the variables, and to check if they can correspond to the real variables. While this is ok for an element-constraint with constants in the array (two additional int-vars, two bool vars, and two reified equalities), for an element-constrint with variables in the array it might be quite expensive. Just as a matter of interest, what do you want to use reified element-constraint for? Cheers, Mikael On Tue, Jun 23, 2009 at 5:07 PM, Pedro Salgueiro wrote: > Hi! > > Is there any syntactic sugar for the reification of the element > constraint? I tried to use it the normal way by using '|' and '&' and I > got the following errors: > > ? ? ? ?/var/lib/gems/1.8/gems/gecoder-with-gecode-1.0.0/lib/gecoder/interface/constraints/reifiable_constraints.rb:40:in `with_reification_operands': TypeError (TypeError) > > ? ? ? ?from /var/lib/gems/1.8/gems/gecoder-with-gecode-1.0.0/lib/gecoder/interface/constraints/reifiable_constraints.rb:18:in `|' > > > Using it with the ":reify" key with boolean vars it works ok. > > Thank you, > Pedro Salgueiro > > -- Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/ From gparker at gmail.com Sun Jun 28 12:26:18 2009 From: gparker at gmail.com (Gordon) Date: Sun, 28 Jun 2009 17:26:18 +0100 Subject: [gecoder-users] Limiting Search Time? Message-ID: <85f8adaf0906280926x8620b8u702d3b180a7723f2@mail.gmail.com> New to the list ... anyone have ideas on how to limit the search time for solve or optimize? In gecode (AFAIK) it's covered under this class: http://www.gecode.org/gecode-doc-latest/classGecode_1_1Search_1_1TimeStop.html Ideally, it's just an option to the search but I can't find a reference to it anywhere in gecode/R Thanks, Gordon From rubyforge at lokorin.org Sun Jun 28 14:58:34 2009 From: rubyforge at lokorin.org (Andreas Launila) Date: Sun, 28 Jun 2009 20:58:34 +0200 Subject: [gecoder-users] Limiting Search Time? In-Reply-To: <85f8adaf0906280926x8620b8u702d3b180a7723f2@mail.gmail.com> References: <85f8adaf0906280926x8620b8u702d3b180a7723f2@mail.gmail.com> Message-ID: <4A47BD5A.9060300@lokorin.org> On 06/28/2009 06:26 PM, Gordon wrote: > In gecode (AFAIK) it's covered under this class: > http://www.gecode.org/gecode-doc-latest/classGecode_1_1Search_1_1TimeStop.html > > Ideally, it's just an option to the search but I can't find a > reference to it anywhere in gecode/R > I'm afraid that's not supported by Gecode/R (although I can see the use, excluding it was not a conscious decision). From a quick look, it doesn't seem to be possible to add it through a monkey-patch on the Ruby side. The stop objects are not in the bindings, and hence not accessible on the Ruby side. If it is very important to you then I can see if I can provide instructions on how to add support. That would however involve recompiling the Gecode/R bindings, and won't necessarily be especially pretty. -- Andreas Launila