/usr/share/mozart/doc/demo/node29.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>Distance and route computation: Country.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="node28.html#code.transportation.agents"><< Prev</A></TD><TD><A href="transportation.html">- Up -</A></TD><TD><A href="node30.html#code.transportation.configure">Next >></A></TD></TR></TABLE><DIV class="unnumbered" id="code.transportation.country"><H3><A name="code.transportation.country">Distance and route computation: <CODE>Country.oz</CODE></A></H3><P class="margin"><A href="Transport/Country.oz">Source File</A></P><P> </P><BLOCKQUOTE><PRE><SPAN class="keyword">functor</SPAN> <BR> <BR><SPAN class="keyword">export</SPAN> <BR> GetDist<BR> GetDetourDist<BR> GetRoute<BR> <BR> Cities<BR> IsCity<BR> GetGraph<BR> <BR> width: GermanyWidth<BR> height: GermanyHeight<BR> GetCoord<BR> <BR><SPAN class="keyword">prepare</SPAN> <BR> <BR> Germany = <SPAN class="reference">\insert </SPAN><SPAN class="string">'Germany.oz'</SPAN> <BR> <BR> GermanyWidth = Germany<SPAN class="keyword">.</SPAN>width<BR> GermanyHeight = Germany<SPAN class="keyword">.</SPAN>height<BR> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">GetDist</SPAN> Src Dst}<BR> <SPAN class="keyword">if</SPAN> Src<SPAN class="keyword">==</SPAN>Dst <SPAN class="keyword">then</SPAN> 0<BR> <SPAN class="keyword">else</SPAN> V=Germany<SPAN class="keyword">.</SPAN>map<SPAN class="keyword">.</SPAN>Src<SPAN class="keyword">.</SPAN>Dst <SPAN class="keyword">in</SPAN> <BR> <SPAN class="keyword">if</SPAN> {IsInt V} <SPAN class="keyword">then</SPAN> V <SPAN class="keyword">else</SPAN> V<SPAN class="keyword">.</SPAN>1 <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">GetDetourDist</SPAN> Src Via Dst}<BR> <SPAN class="keyword">if</SPAN> Via<SPAN class="keyword">==</SPAN>Dst <SPAN class="keyword">orelse</SPAN> Via<SPAN class="keyword">==</SPAN>Src <SPAN class="keyword">then</SPAN> 0<BR> <SPAN class="keyword">elseif</SPAN> Src<SPAN class="keyword">==</SPAN>Dst <SPAN class="keyword">then</SPAN> 2<SPAN class="keyword">*</SPAN>{GetDist Src Via}<BR> <SPAN class="keyword">else</SPAN> <BR> %% <SPAN class="comment">Due to sampling errors in the map data the detour might be<BR></SPAN> %% <SPAN class="comment">negative!<BR></SPAN> {Max {GetDist Src Via} <SPAN class="keyword">+</SPAN> {GetDist Via Dst} <SPAN class="keyword">-</SPAN> {GetDist Src Dst} 0}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">GetRoute</SPAN> Src Dst}<BR> <SPAN class="keyword">if</SPAN> Src<SPAN class="keyword">==</SPAN>Dst <SPAN class="keyword">then</SPAN> [Dst<SPAN class="keyword">#</SPAN>0]<BR> <SPAN class="keyword">else</SPAN> SrcDst=Germany<SPAN class="keyword">.</SPAN>map<SPAN class="keyword">.</SPAN>Src<SPAN class="keyword">.</SPAN>Dst <SPAN class="keyword">in</SPAN> <BR> <SPAN class="keyword">if</SPAN> {IsInt SrcDst} <SPAN class="keyword">then</SPAN> [Src<SPAN class="keyword">#</SPAN>SrcDst Dst<SPAN class="keyword">#</SPAN>0]<BR> <SPAN class="keyword">else</SPAN> Via=SrcDst<SPAN class="keyword">.</SPAN>2 <SPAN class="keyword">in</SPAN> Src<SPAN class="keyword">#</SPAN>Germany<SPAN class="keyword">.</SPAN>map<SPAN class="keyword">.</SPAN>Src<SPAN class="keyword">.</SPAN>Via<SPAN class="keyword">|</SPAN>{GetRoute Via Dst}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <BR> Cities = {Arity Germany<SPAN class="keyword">.</SPAN>map}<BR> <BR> <SPAN class="keyword">local</SPAN> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">MkSrc</SPAN> Cs F}<BR> <SPAN class="keyword">case</SPAN> Cs <SPAN class="keyword">of</SPAN> nil <SPAN class="keyword">then</SPAN> nil<BR> <SPAN class="keyword">[]</SPAN> C<SPAN class="keyword">|</SPAN>Cr <SPAN class="keyword">then</SPAN> <BR> <SPAN class="keyword">if</SPAN> {IsInt Germany<SPAN class="keyword">.</SPAN>map<SPAN class="keyword">.</SPAN>F<SPAN class="keyword">.</SPAN>C} <SPAN class="keyword">then</SPAN> Germany<SPAN class="keyword">.</SPAN>coord<SPAN class="keyword">.</SPAN>C<SPAN class="keyword">|</SPAN>{MkSrc Cr F}<BR> <SPAN class="keyword">else</SPAN> {MkSrc Cr F}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">MkGraph</SPAN> Cs}<BR> <SPAN class="keyword">case</SPAN> Cs <SPAN class="keyword">of</SPAN> nil <SPAN class="keyword">then</SPAN> nil<BR> <SPAN class="keyword">[]</SPAN> C<SPAN class="keyword">|</SPAN>Cr <SPAN class="keyword">then</SPAN> C<SPAN class="keyword">#</SPAN>Germany<SPAN class="keyword">.</SPAN>coord<SPAN class="keyword">.</SPAN>C<SPAN class="keyword">#</SPAN>{MkSrc Cr C}<SPAN class="keyword">|</SPAN>{MkGraph Cr}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">in</SPAN> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">GetGraph</SPAN>}<BR> {MkGraph Cities}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">IsCity</SPAN> A}<BR> {HasFeature Germany<SPAN class="keyword">.</SPAN>map A}<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <BR> <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">GetCoord</SPAN> C ?X ?Y}<BR> X<SPAN class="keyword">#</SPAN>Y=Germany<SPAN class="keyword">.</SPAN>coord<SPAN class="keyword">.</SPAN>C<BR> <SPAN class="keyword">end</SPAN> <BR> <BR><SPAN class="keyword">end</SPAN> <BR> <BR></PRE></BLOCKQUOTE><P></P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node28.html#code.transportation.agents"><< Prev</A></TD><TD><A href="transportation.html">- Up -</A></TD><TD><A href="node30.html#code.transportation.configure">Next >></A></TD></TR></TABLE><HR><ADDRESS><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|