Mark,

Your current problem must not be hard to solve, but I guess your
sample code does not show enough to help you. Depending on how things
are set up before (and inside) it, it might just as well work
perfectly...

Cheers,

Jorge.

2009/12/3 mark richardson <[email protected]>:
> Yves Jaradin wrote:
>>
>> 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}.
>>>
>> 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.
>
> Thanks for your help, by the time this message had been accepted by the list
> I'd already found out how to use partition to achieve the same thing.
> But, I do have another problem that I'm REALLY stuck on.
> My propagators are implemented as threads inside compiled functors and
> before I started using a list of FD integers they worked perfectly. They all
> take the form of:
>   if <FDint>==<some-value> then <post constraint on associated FS set>
>
> I'm stuck at the moment applying cardinality rules to each set. The
> cardinality is different depending on the value of the FD integer.
> And the FD integers are distributed using a random 'generic' strategy.
> What I can't seem to get right is how to iterate through the list of FD
> integers in a thread.
> Basically what I have at present (what is executed within the script) is:
>
> thread
>   {List.forAllInd <FD list>
>        proc {$ I X}
>            .
>        <get Min and MAX cardinality from object referenced by X}
>            .
>        {FS.cardRange Min Max <FS set>.I}
>        end}
> end
>
> I had also tried using FD reflection but couldn't get this to work either.
> I've just tried moving the 'List.forAllInd' outside the thread definition so
> that each item in the FD list gets a separate thread, but again that didn't
> work.
> I'm 99% certain my problem is to do with the iteration through the FD list +
> the FD list having undetermined values but I can't think how else to do
> this.
>
> If anyone can help I would be eternally grateful.
>
> Regards
>
> Mark
>
> --
> Mark Richardson MBCS
> Research Assistant
> University of Teesside, UK
> Email: [email protected]
>      [email protected]
> Skype: mark.richardson.
>
> _________________________________________________________________________________
> mozart-users mailing list
> [email protected]
> http://www.mozart-oz.org/mailman/listinfo/mozart-users
>
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to