Fw: Constraints on array's

Gianni Alberti c2s.computer at interbusiness.it
Tue Feb 5 13:50:43 CET 2002


----- Original Message -----
From: "Gianni Alberti" <c2s.computer at interbusiness.it>
Newsgroups: mozart-oz.users
Sent: Tuesday, February 05, 2002 12:42 PM
Subject: Re: Constraints on array's

> Tks for Yr suggestion , but I 'm basically a programmer and short on my
> spare time.
> Tutorials are usefuls but sometimes pieces of code would help better.
> So a  part the model I'm referring to let put my questions in this way:
> 1)Do You can provide pieces of code examples on how to define a 2 dim
> array of FD variables ?
> 2)collect the variables and distribute over them : what do You mean
exactly
> ?
> Tks for other answers
> Regards
> Gianni Alberti
>
>
>
>
>
>
>
> "Denys Duchier" <Denys.Duchier at ps.uni-sb.de> ha scritto nel messaggio
> news:issn8hnwsf.fsf at elk.ps.uni-sb.de...
> > c2s.computer at interbusiness.it (Gianni Alberti) writes:
> >
> > > The problem model is based on a 2 dimensional array that
> > > for now and for simplicity whe can consider whit all elements 0#1.
> > > The constrained variables to define are all the elements of the array.
> >
> > hmm... a two-dimensional array of boolean variables... this sounds
> > like a problem that perhaps might be better modeled using sets, but I
> > can't be sure.
> >
> > > 1) How to define a 2 dim array of costrained elements ?
> >
> > for example, use nested tuples of FD boolean variables
> >
> > > 2) How to address a single element of the array (example
> > > Array.Xelem.Yelem)
> >
> > in precisely this way :-)
> >
> > > 3) How to define that the solution to identify is of all array
elements
> ?
> >
> > collect the variables and distribute over them
> >
> > > a) for each row the sum of 1 must be between 1 and N1 and equally
> distributed
> >
> > what does that mean?
> >
> > > b) for each column the sum of 1 must be bewtween 1 and N2
> >
> > use FD.sum (or a cardinality constraint if using sets).
> >
> > > c) in a row only few sequence (of fixed lenght) are allowed :
> > >
> > > example = 11000 01100 00011
> >
> > so, not all boolean assignments are admissible.  There are several
> > ways of modelling that; which to prefer may depend on the
> > restrictions.  It could be done with constraints, if there is a simple
> > constraints between the bits of a sequence that chracterize its
> > admissibility.  Or it could be done by enumerating the domain of
> > sequences (if not too large) and using FD.select or my selection
> > constraints.
> >
> > > Is really my interested to see if Mozart can be applied to this
> > > problem as well.
> >
> > It surely can; but it's best to start from the actual problem rather
> > than from the previous constraint model used in a diferent system.
> >
> > > When can I get more information ?
> >
> > For example in our tutorials "Finite Domain Constraint Programming"
> > and "Problem Solving With Finite Set Constraints".
> >
> > ... and if you could be more precise in your problem description, we
> > could be more precise in our suggestions :-)
> >
> > Cheers,
> >
> > --
> > Dr. Denys Duchier Denys.Duchier at ps.uni-sb.de
> > Forschungsbereich Programmiersysteme (Programming Systems Lab)
> > Universitaet des Saarlandes, Geb. 45 http://www.ps.uni-sb.de/~duchier
> > Postfach 15 11 50 Phone: +49 681 302 5618
> > 66041 Saarbruecken, Germany Fax:   +49 681 302 5615
> > -
> > Please send submissions to users at mozart-oz.org
> > and administriva mail to users-request at mozart-oz.org.
> > The Mozart Oz web site is at http://www.mozart-oz.org/.
>
>
-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.





More information about the mozart-users mailing list