Hi,

I was just in the process of typing this question about the reification part when your email arrived. I haven't got the function to determine if a scene is a valid precedent of another scene implemented fully yet and so I can't test this properly. But if I assume I have a function {IsPreced X Y} which returns true if X is a valid precedence of Y, then would the following be the correct way to reify <=: ?

(I've only just changed the way I was going to do collect following your latest message so I'm not sure if {Collect (X=<:Y)} will work properly)

NumPrec={FD.decl} %number of satisfied precedences

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

and then

{FD.distribute generic(order:naive value:max) [NumPrec]}

Many thanks for your help on this.

Mark

Raphael Collet wrote:
Hi,

About the reification bit. FD.reified.sum is the stuff to use. You just have to know that Mozart provides some syntactic sugar for it. An FD equation that is used as a term is translated as a reified constraint. For instance,

   B = (X =<: Y)

reifies the constraint X =< Y, with the boolean value B, which consequently has domain 0#1.

Cheers,
Raphael

On Wed, Feb 24, 2010 at 9:01 PM, Wolfgang Meyer <[email protected] <mailto:[email protected]>> wrote:

    Hi Mark,
    I was just testing your example code (before your last message),
    and it seemed to work fine with the test data I used. But when I
    tried different test data where the same start time appears twice
    (for scenes A and B), there was a problem, because then both
    Position.A =<: Position B
    and
    Position.B =<: Position.A
    must be true which creates a conflict with
    {FD.distinct Position}

    BTW, in case you are wondering how to reify a constraint like X
    =<: Y, take a look at FD.reified.sum.

    Cheers,
      Wolfgang


    On Wed, Feb 24, 2010 at 8:34 PM, mark richardson
    <[email protected] <mailto:[email protected]>> wrote:

        Hi,

        Please ignore my last question. I must have changed two things
        at the same time without realising.
        I've just replaced the =<'s with <'s and everything seems to
        work.


        Regards

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


------------------------------------------------------------------------

_________________________________________________________________________________
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