Hello and thanks to help me!
The question that I do next Ive done in the forum and some of the received suggestions Im using now.
It's correct to measure the time as shows script, that is to say, I want to
measure the time used in finding the solution.
In the script I calculate (T0.user + T0.system) and (T1.user + T1.system). Then, the idea is to calculate the total time required to find a solution of the following form:
(T0.user + T0.system) - (T1.user + T1.system)
functor
import
Open
Search
FD
Application
Property
OS
define
ArchivoSalida = 'Salida.txt'
Solution
T0
T1
proc {EscribeArchivo Arc}
H={New Open.file init(name:Arc flags:[write text create truncate])}
in
{H write(vs:{Value.toVirtualString Solution 1000 1000}#'\n')}
{H
write(vs:(T0.user+T0.system)#'\n')}
{H write(vs:(T1.user+T1.system)#'\n')}
{H close}
end
proc {Robert
Root}
D O N A L G E R B T
in
Root = sol(d:D o:O n:N a:A l:L g:G e:E r:R b:B t:T)
Root:::0#9
{FD.distinct Root}
D \=: 0
G \=: 0
100000*D + 10000*O + 1000*N + 100*A +
10*L + D
+ 100000*G + 10000*E + 1000*R + 100*A + 10*L + D
=: 100000*R + 10000*O + 1000*B + 100*E + 10*R + T
{FD.distribute naive
Root}
end
in
T0 = {Property.get time}
Solution={List.last {Search.base.one Robert}}
T1 = {Property.get time}
{EscribeArchivo ArchivoSalida}
{Application.exit 0}
end
Any suggestion or commentary will be welcome
Greetings!
Mary
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com
_________________________________________________________________________________ mozart-users mailing list mozart-users@ps.uni-sb.de http://www.mozart-oz.org/mailman/listinfo/mozart-users