mark richardson wrote :
Hi,
Nice to see the users list back up and running.
I have a problem with a constraint model I'm trying to build.
Essentially I'm building a model of a virtual world.
Characters in the world are represented by FS's and actions between them
by FD integers.
I've modelled this as a record of FS's to represent recipients of an
action, the feature value being the originator of an action.
Then I've mapped a list of FD integers to this so in essence I would have
'world(.... 4:5#{2 3 5}.....)'
to represent an interaction referenced by the value 5 between character
4 and the set of characters {2 3 5}.
A shorter example of the code I'm using is below:
declare Root Recp Init Action Test
proc {Script Root}
Test={FS.var.record.bounds sol [1 2] 1#9 1#9}
Recp={FS.var.record.upperBound sol [1 2] 1#9}
Action={FD.list 2 1#3}
in
Root={Record.mapInd Recp fun {$ I A} {Nth Action I}#A end}
{FS.disjointN Recp}
%{FS.unionN Recp Test}
{FS.unionN Recp Test.1}
{FD.distinct Action}
{FD.distribute ff Action}
{FS.distribute naive Recp}
end
{Explorer.all Script}
I realise there's little propagation here, that isn't my problem.
What I want to ensure is that the union of all FS's in 'Recp' is the set
{1#9}, i.e. ALL the integers in Recp are used, whilst keeping each set
disjoint.
The contents of each FS are determined by the value of the action, but I
can ensure there is always an action available for any character.
I thought the commented line {FS.unionN Recp Test} would achieve this
but I then get no solution at all. (Regardless of how I try to define
'Test'!)
Can anyone suggest a simple way of achieving this?
The problem is that the first argument to unionN must be a vector (list
or record) of FS but the second must be a single FS. You were giving it
two vectors.
Regards
Mark R
Yves
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users