Hi,

Thank you very much Raphael. I can't really say at the moment how many of the preferences would be conflicting as I'm working with a small amount of test data, but I see your point.

I'll try your suggestion and then when I get a larger data sample, I'll compare the two versions.

Thanks once again for all your help.

Regards

Mark


Raphael Collet wrote:
Dear Mark,

I wrote "simple", because this solution might be very efficient if many of the preferences are conflicting. The issue is that a propagator like

   B = (X =<: Y)

will perform no propagation until either B is known, or both X and Y are known. To get maximal performance, you need to have as much propagation as possible. A good heuristics might be to determine the B's as soon as possible. Something like

Bs = for X in Scenes collect:Collect do
        for Y in Scenes do
           if X\=Y andthen {IsPreced X Y} then %X is a precedent of Y
              {Collect (Position.X=<:Position.Y)}
           end
        end
     end
{FD.sum Bs '=:' NumPrec}

%% determine NumPrec, then the Bs, trying high values first, then the positions
{FD.distribute generic(order:naive value:max) NumPrec|Bs}
{FD.distribute ff Position}

I haven't tried it, but that's something you could give a try at.

Cheers,
Raphael

On Thu, Feb 25, 2010 at 1:00 PM, mark richardson <[email protected] <mailto:[email protected]>> wrote:

    Hi,

    Thank you so much for your help with this.
    I did have another small problem that I have now solved - I had
    {IsPreced X Y} returning true if Y had no precedences at all which
    was causing chaos.
    (Oh and I deliberately left the distribution of the position
    vector out of the message, but thank you for your reminder :+) )

    You say that this approach is a 'simple way to maximize the number
    of preferences'.
    I might regret asking this, but is there a way which is less
    simple, but perhaps better?


    Regards

    Mark


    Raphael Collet wrote:
    Dear Mark,

    Yes, I think you got it right.  That is a simple way to maximize
    the number of preferences.  (Just don't forget to distribute the
    vector Position in your script.)

    Cheers,
    Raphael

    On Thu, Feb 25, 2010 at 12:26 PM, mark richardson
    <[email protected] <mailto:[email protected]>> wrote:

        Hi,

        I've modified the script slightly to this:

        {FD.sum
         for X in Scenes collect:Collect do

            for Y in Scenes do
               if X\=Y andthen {IsPreced X Y} then %X is a precedent of Y
                  {Collect (Position.X=<:Position.Y)}
               end
            end
          end '=:' NumPrec}

        I realised the mistake I was making with X and Y instead of
        Position.X and Position.Y and mistyping 'and' instead of
        'andthen'

        Regards

        Mark


-- Mark Richardson MBCS
        Research Assistant
        University of Teesside, UK
        Email: [email protected]
        <mailto:[email protected]>
             [email protected] <mailto:[email protected]>
        Skype: mark.richardson.

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


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


-- Mark Richardson MBCS
    Research Assistant
    University of Teesside, UK
    Email: [email protected] <mailto:[email protected]>
           [email protected] <mailto:[email protected]>
    Skype: mark.richardson.

    
_________________________________________________________________________________
mozart-users mailing list [email protected] <mailto:[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


--
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

Reply via email to