Hi,
I'm still learning about the FD aspect of Mozart-Oz (amongst other things) and I've been toying with using parallel search with the n-queens script from the documentation, but with little success. This is the code I'm using:

declare Queensdist E Xs M Host
functor Queensdist
import FD
export Script
define
  fun {Script}
     proc {$ Row}
    L1N ={MakeTuple c 200}
    LM1N={MakeTuple c 200}
     in
    {FD.tuple queens 200 1#200 Row}
    {For 1 200 1 proc {$ I}
              L1N.I=I LM1N.I=~I
           end}
    {FD.distinct Row}
    {FD.distinctOffset Row LM1N}
    {FD.distinctOffset Row L1N}
    {FD.distribute generic(value:mid) Row}
     end
  end
end

[M]={Module.apply [Queensdist]}
E={New Search.parallel init(localhost:2)}

Xs={E one(Queensdist $)}

{Browse Xs}

Browsing Xs just gives me [<P/1>]. Can anyone offer any suggestions?

I'm not certain about the use of localhost as this isn't my host name, but the actual hostname doesn't seem to be accepted at all and the documentation says that localhost refers to the host that spawned the oz process.

Before this version, I had kept the parametrised version which worked on it's own with a {Browse {SearchOne {M.script 200}}} but I amended the script to have a fixed value of 200 instead. Needless to say, the script won't work either way now??? So, can this script still be parametrised like the original n-queens script and if so how?

Regards
Mark

--
Mark Richardson
Final year undergraduate
University of Teesside
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to