Dear Mark,

I understand that one of your questions is: how do I combine FD and FS constraints in a single script. What I am doing is the following: I use both FD and FS variables and propagators. However, I only use an FD distributor, no FS distribution at all. So, I use (a version of) FD.distribute and only hand it over FD variables. However, in all my constraint problems all FS are determined if all FD are determined, so it is sufficient to distribute the latter.

If this is not the case for your problem, then it might be possible to artificially turn it into such a problem with FS.int.match.

Another approach is to have two distributors, one for FD variables and one for FS variables. However, that way the distribution becomes two-dimensional and if I remember it correctly this means that the search always first determines the variables of the first distributor -- which might be the wrong (inefficient) variable ordering for you.

Concerning feature constraints: I would also be interested in such an example, but I don't think there ever was the notion of a solver or distributor for feature constraints..

Best
Torsten

On Jul 6, 2009, at 8:19 PM, mark richardson wrote:

Hi,

I thought I was doing quite well at learning FD's/FS's but I suddenly
feel like an amateur again.

I have a small script that works fine with just FD's.
The solution I have at the moment is this:

I have five virtual characters (as class objects)  indexed by integer
values. I also have four actions (as class objects) again indexed by
integers which have attributes which determine which characters can
interact and how. The propagators are unifications of the form (some
test)=true in separate threads. My solution script assigns 'Root' the
tuple 'A#B#C' which represents character A initiates interaction C with
character B and where A,B and C are all FD integers.

At the moment this only represents binary interactions but I need to
allow B to be a list of 1..n characters.

Can I successfully assign 'Root' to a tuple 'A#B#C' where A and C are FD
integers but B is a FS? or something similar?

If so, how do I then distribute the variables - I presume there would be
a problem using {FD.distribute generic Root} when one member of 'Root'
is not a FD variable?

I know in principle how I can obtain a FS of all the characters that
match a given action (I would effectively just manually tell the FS
which characters could partake in the action and set the cardinality
accordingly), but if for example an action can be between character 1
and characters 2,3 and 4, how could I get all the possible permutations
of this action, such as {{1#2} {1#2,3} {1#2,3,4} {1#2,4} {1#3} {1#3,4}
{1#4}}?

Sorry for the number of questions :+)

Oh, and if anyone has any examples of how to actually use feature
constraints (beyond the two html screens in the documentation) and
if/how they can be employed as a main script component I would be
eternally grateful. I've looked at the disk packing example but the
feature constraints come after the search is complete (if I'm not
mistaken) - is that all they can do?

Regards

Mark

--
Torsten Anders
Interdisciplinary Centre for Computer Music Research
University of Plymouth
Office: +44-1752-586219
Private: +44-1752-558917
http://strasheela.sourceforge.net
http://www.torsten-anders.de


_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to