[gecode-users] newbie's question about distribution
Christian Schulte
cschulte at kth.se
Tue Sep 18 22:04:56 CEST 2007
Dear Adriano,
thanks for the nice deduction puzzle... You don't say which language or
version you use. Apparently, you are using an interface to Gecode we have no
knowledge (well I can have an educated guess) about and that we do not
support.
Please contact the people who did that interface.
People who did the interface: please clarify the relation to Gecode. Either
get in touch with us to host your interface or put up a clarification of
your interface to Gecode proper. Thanks.
Christian
--
Christian Schulte, www.ict.kth.se/~schulte/
-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of volpadri at alice.it
Sent: Tuesday, September 18, 2007 9:34 PM
To: users at gecode.org
Subject: [gecode-users] newbie's question about distribution
Hi to you all,
I am playing with the Eclipse + Jython environment and setup the simple
problem:
==================================================================
from org.gecode import *
class MySpace(Space):
def __init__(self):
self.vars = VarArray()
def copy(self,share):
new = MySpace()
new.vars = VarArray(new,share,self.vars)
return new
def intVar(self, fromto):
v = IntVar(self, fromto[0], fromto[1])
self.vars.add(v)
return v
def intVarList(self,n,fromto):
lst = map(lambda i: self.intVar(fromto), range(n))
return lst
def linear_eq(self,vlst,term):
varray = VarArray(vlst)
Gecode.linear(self,varray,IntRelType.IRT_EQ,term)
def dom(self,v,lo,hi):
Gecode.dom(self,v,lo,hi)
############################################################################
###
if __name__ == "__main__":
s = MySpace()
v1 = s.intVar((0,9))
v2 = s.intVar((0,9))
s.linear_eq([v1,v2],2 ) # v1 + v2 := 2
s.dom(v1,1,2)
search = DFSSearch(s)
sol = search.next()
while sol:
print sol.vars
sol = search.next()
==================================================================
the result is:
>>> [[1..2],[0..1]]
but at this point I can't understand how to distribute on the vars.
Can you help me?
Thanks,
Adriano Volpones
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20070918/e9be480f/attachment.htm>
More information about the gecode-users
mailing list