/usr/share/mozart/doc/demo/node5.html is in mozart-doc 1.4.0-8ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Scheduling interface: Scheduler.oz</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node4.html#code.jobshop.examples"><< Prev</A></TD><TD><A href="jobshop.html">- Up -</A></TD><TD><A href="node6.html#code.jobshop.taskboard">Next >></A></TD></TR></TABLE><DIV class="unnumbered" id="code.jobshop.scheduler"><H3><A name="code.jobshop.scheduler">Scheduling interface: <CODE>Scheduler.oz</CODE></A></H3><P class="margin"><A href="JobShop/Scheduler.oz">Source File</A></P><P> </P><BLOCKQUOTE><PRE><SPAN class="keyword">functor</SPAN> <BR> <BR><SPAN class="keyword">import</SPAN> <BR> Search<BR> Tk<BR> TkTools<BR> Explorer<BR> Compiler(compile: Compile) <SPAN class="keyword">at</SPAN> <SPAN class="string">'Compiler.ozf'</SPAN> <BR> Configure(text:Helv textBold:HelvBold)<BR> <BR> <BR><SPAN class="keyword">export</SPAN> <BR> <SPAN class="string">'class'</SPAN>: Scheduler<BR> <BR><SPAN class="keyword">define</SPAN> <BR> <BR> <SPAN class="keyword">class</SPAN> <SPAN class="type">Scheduler</SPAN> <BR> <SPAN class="keyword">from</SPAN><SPAN class="type"> TkTools.note</SPAN> <BR> <SPAN class="keyword">feat</SPAN> <BR> Span Reset Next Best Stop Exp<BR> Board Solver<BR> <SPAN class="keyword">attr</SPAN> <BR> Stamp: 0<BR> Problem: <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">$</SPAN> _} <SPAN class="keyword">skip</SPAN> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">meth</SPAN> <SPAN class="functionname">tkInit</SPAN>(parent:P board:B)<BR> TkTools<SPAN class="keyword">.</SPAN>note<SPAN class="keyword">,</SPAN>tkInit(parent:P text:<SPAN class="string">'Schedule'</SPAN>)<BR> SpanL = {New Tk<SPAN class="keyword">.</SPAN>label tkInit(parent:<SPAN class="keyword">self</SPAN> text:<SPAN class="string">'Make span:'</SPAN> <BR> font:Helv)} <BR> ValL = {New Tk<SPAN class="keyword">.</SPAN>label tkInit(parent:<SPAN class="keyword">self</SPAN> text:0<BR> font:HelvBold<BR> width:5 bg:wheat relief:sunken bd:1<BR> anchor:e)}<BR> ResetB= {New Tk<SPAN class="keyword">.</SPAN>button tkInit(parent:<SPAN class="keyword">self</SPAN> text:<SPAN class="string">'Reset'</SPAN> width:9<BR> font:Helv<BR> action:<SPAN class="keyword">self#</SPAN>reset)}<BR> NextB = {New Tk<SPAN class="keyword">.</SPAN>button tkInit(parent:<SPAN class="keyword">self</SPAN> text:<SPAN class="string">'Next'</SPAN> width:9<BR> font:Helv<BR> action:<SPAN class="keyword">self#</SPAN>next<BR> state:disabled)}<BR> BestB = {New Tk<SPAN class="keyword">.</SPAN>button tkInit(parent:<SPAN class="keyword">self</SPAN> text:<SPAN class="string">'Best'</SPAN> width:9<BR> font:Helv<BR> action:<SPAN class="keyword">self#</SPAN>best<BR> state:disabled)}<BR> StopB = {New Tk<SPAN class="keyword">.</SPAN>button tkInit(parent:<SPAN class="keyword">self</SPAN> text:<SPAN class="string">'Stop'</SPAN> width:9<BR> font:Helv<BR> action:<SPAN class="keyword">self#</SPAN>stop<BR> state:disabled)}<BR> ExpB = {New Tk<SPAN class="keyword">.</SPAN>button tkInit(parent:<SPAN class="keyword">self</SPAN> text:<SPAN class="string">'Search Tree'</SPAN> width:9<BR> font:Helv<BR> action:<SPAN class="keyword">self#</SPAN>explore)}<BR> <SPAN class="keyword">in</SPAN> <BR> {Tk<SPAN class="keyword">.</SPAN>batch [grid(SpanL column:0 row:0 pady:6 padx:4)<BR> grid(ValL column:1 row:0 pady:6 padx:4)<BR> grid({New Tk<SPAN class="keyword">.</SPAN>frame tkInit(parent:<SPAN class="keyword">self</SPAN> height:5)}<BR> column:0 row:1 columnspan:2)<BR> grid(ResetB column:0 row:2 columnspan:2)<BR> grid(NextB column:0 row:3 columnspan:2)<BR> grid(BestB column:0 row:4 columnspan:2)<BR> grid(StopB column:0 row:5 columnspan:2)<BR> grid({New Tk<SPAN class="keyword">.</SPAN>frame tkInit(parent:<SPAN class="keyword">self</SPAN> height:5)}<BR> column:0 row:6 columnspan:2)<BR> grid(ExpB column:0 row:7 columnspan:2 pady:3)<BR> ]}<BR> <SPAN class="keyword">self.</SPAN>Board = B<BR> <SPAN class="keyword">self.</SPAN>Solver = {New Search<SPAN class="keyword">.</SPAN>object script(<SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">$</SPAN> _} <SPAN class="keyword">skip</SPAN> <SPAN class="keyword">end</SPAN>)}<BR> <SPAN class="keyword">self.</SPAN>Span = ValL<BR> <SPAN class="keyword">self.</SPAN>Reset = ResetB<BR> <SPAN class="keyword">self.</SPAN>Next = NextB<BR> <SPAN class="keyword">self.</SPAN>Best = BestB<BR> <SPAN class="keyword">self.</SPAN>Stop = StopB<BR> <SPAN class="keyword">self.</SPAN>Exp = ExpB<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">meth</SPAN> <SPAN class="functionname">setSol</SPAN>(I S)<BR> <SPAN class="keyword">if</SPAN> I<SPAN class="keyword">==@</SPAN>Stamp <SPAN class="keyword">then</SPAN> <BR> {<SPAN class="keyword">self.</SPAN>Stop tk(configure state:disabled)}<BR> <SPAN class="keyword">case</SPAN> S <SPAN class="keyword">of</SPAN> nil <SPAN class="keyword">then</SPAN> <BR> {<SPAN class="keyword">self.</SPAN>Next tk(configure state:disabled)}<BR> {<SPAN class="keyword">self.</SPAN>Best tk(configure state:disabled)}<BR> {<SPAN class="keyword">self.</SPAN>Span tk(configure bg:cyan4)}<BR> <SPAN class="keyword">[]</SPAN> [S] <SPAN class="keyword">then</SPAN> <BR> {<SPAN class="keyword">self.</SPAN>Next tk(configure state:normal)}<BR> {<SPAN class="keyword">self.</SPAN>Best tk(configure state:normal)}<BR> {<SPAN class="keyword">self.</SPAN>Board setSol(S)}<BR> {<SPAN class="keyword">self.</SPAN>Span tk(configure text:S<SPAN class="keyword">.</SPAN>pe)}<BR> <SPAN class="keyword">else</SPAN> <BR> {<SPAN class="keyword">self.</SPAN>Next tk(configure state:normal)}<BR> {<SPAN class="keyword">self.</SPAN>Best tk(configure state:normal)}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">meth</SPAN> <SPAN class="functionname">reset</SPAN> <BR> NS = <SPAN class="keyword">@</SPAN>Stamp<SPAN class="keyword">+</SPAN>1<BR> <SPAN class="keyword">in</SPAN> <BR> Stamp <SPAN class="keyword"><-</SPAN> NS<BR> {<SPAN class="keyword">self.</SPAN>Solver stop}<BR> {<SPAN class="keyword">self.</SPAN>Span tk(configure text:<SPAN class="string">''</SPAN> bg:wheat)}<BR> {<SPAN class="keyword">self.</SPAN>Next tk(configure state:normal)}<BR> {<SPAN class="keyword">self.</SPAN>Best tk(configure state:normal)}<BR> {<SPAN class="keyword">self.</SPAN>Stop tk(configure state:disabled)}<BR> {<SPAN class="keyword">self.</SPAN>Board setEdit}<BR> Problem <SPAN class="keyword"><-</SPAN> {Compile {<SPAN class="keyword">self.</SPAN>Board getSpec($)}}<BR> {<SPAN class="keyword">self.</SPAN>Solver script(<SPAN class="keyword">@</SPAN>Problem<BR> <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">$</SPAN> O N}<BR> O<SPAN class="keyword">.</SPAN>pe <SPAN class="keyword">>:</SPAN> N<SPAN class="keyword">.</SPAN>pe<BR> <SPAN class="keyword">end</SPAN>)} <BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">meth</SPAN> <SPAN class="functionname">next</SPAN> <BR> {<SPAN class="keyword">self.</SPAN>Next tk(configure state:disabled)}<BR> {<SPAN class="keyword">self.</SPAN>Best tk(configure state:disabled)}<BR> {<SPAN class="keyword">self.</SPAN>Stop tk(configure state:normal)}<BR> {<SPAN class="keyword">self</SPAN> setSol(<SPAN class="keyword">@</SPAN>Stamp {<SPAN class="keyword">self.</SPAN>Solver next($)})}<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">meth</SPAN> <SPAN class="functionname">SearchBest</SPAN>(S)<BR> <SPAN class="keyword">case</SPAN> {<SPAN class="keyword">self.</SPAN>Solver next($)}<BR> <SPAN class="keyword">of</SPAN> [T] <SPAN class="keyword">then</SPAN> <BR> {<SPAN class="keyword">self.</SPAN>Span tk(configure text:T<SPAN class="keyword">.</SPAN>pe)}<BR> {<SPAN class="keyword">self.</SPAN>Board setSol(T)}<BR> {<SPAN class="keyword">self</SPAN> SearchBest(S)}<BR> <SPAN class="keyword">elseof</SPAN> T <SPAN class="keyword">then</SPAN> <BR> {<SPAN class="keyword">self</SPAN> setSol(S T)}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">meth</SPAN> <SPAN class="functionname">best</SPAN> <BR> {<SPAN class="keyword">self.</SPAN>Next tk(configure state:disabled)}<BR> {<SPAN class="keyword">self.</SPAN>Best tk(configure state:disabled)}<BR> {<SPAN class="keyword">self.</SPAN>Stop tk(configure state:normal)}<BR> {<SPAN class="keyword">self</SPAN> SearchBest(<SPAN class="keyword">@</SPAN>Stamp)}<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">meth</SPAN> <SPAN class="functionname">stop</SPAN> <BR> {<SPAN class="keyword">self.</SPAN>Solver stop}<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">meth</SPAN> <SPAN class="functionname">explore</SPAN> <BR> {Explorer<SPAN class="keyword">.</SPAN>object all(<SPAN class="keyword">@</SPAN>Problem <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">$</SPAN> O N}<BR> O<SPAN class="keyword">.</SPAN>pe <SPAN class="keyword">>:</SPAN> N<SPAN class="keyword">.</SPAN>pe<BR> <SPAN class="keyword">end</SPAN>)}<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">meth</SPAN> <SPAN class="functionname">setSpan</SPAN>(S)<BR> {<SPAN class="keyword">self.</SPAN>Span tk(configure text:S<SPAN class="keyword">.</SPAN>pe)}<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">meth</SPAN> <SPAN class="functionname">toTop</SPAN> <BR> Scheduler<SPAN class="keyword">,</SPAN> reset<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">end</SPAN> <BR> <BR><SPAN class="keyword">end</SPAN> <BR></PRE></BLOCKQUOTE><P></P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node4.html#code.jobshop.examples"><< Prev</A></TD><TD><A href="jobshop.html">- Up -</A></TD><TD><A href="node6.html#code.jobshop.taskboard">Next >></A></TD></TR></TABLE><HR><ADDRESS><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|