walkmap/docs/codox/walkmap.routing.html
Simon Brooke 99a6c6824a
Enormous progress on routing, but not there yet.
All existing unit tests still pass, but new code is not instrumented yet.
2020-06-04 16:16:02 +01:00

3 lines
13 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>walkmap.routing documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Walkmap</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="dali-performance.html"><div class="inner"><span>Dali performance</span></div></a></li><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to walkmap</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>walkmap</span></div></div></li><li class="depth-2 branch"><a href="walkmap.edge.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>edge</span></div></a></li><li class="depth-2 branch"><a href="walkmap.id.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>id</span></div></a></li><li class="depth-2 branch"><a href="walkmap.microworld.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>microworld</span></div></a></li><li class="depth-2 branch"><a href="walkmap.ocean.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ocean</span></div></a></li><li class="depth-2 branch"><a href="walkmap.path.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>path</span></div></a></li><li class="depth-2 branch"><a href="walkmap.polygon.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>polygon</span></div></a></li><li class="depth-2 branch"><a href="walkmap.read-svg.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>read-svg</span></div></a></li><li class="depth-2 branch current"><a href="walkmap.routing.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routing</span></div></a></li><li class="depth-2 branch"><a href="walkmap.stl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>stl</span></div></a></li><li class="depth-2 branch"><a href="walkmap.superstructure.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>superstructure</span></div></a></li><li class="depth-2 branch"><a href="walkmap.svg.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>svg</span></div></a></li><li class="depth-2 branch"><a href="walkmap.tag.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tag</span></div></a></li><li class="depth-2 branch"><a href="walkmap.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-2"><a href="walkmap.vertex.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>vertex</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="walkmap.routing.html#var-*gradient-exponent*"><div class="inner"><span>*gradient-exponent*</span></div></a></li><li class="depth-1"><a href="walkmap.routing.html#var-*traversals-exponent*"><div class="inner"><span>*traversals-exponent*</span></div></a></li><li class="depth-1"><a href="walkmap.routing.html#var-barriers-crossed"><div class="inner"><span>barriers-crossed</span></div></a></li><li class="depth-1"><a href="walkmap.routing.html#var-best-road"><div class="inner"><span>best-road</span></div></a></li><li class="depth-1"><a href="walkmap.routing.html#var-crossing-penalty"><div class="inner"><span>crossing-penalty</span></div></a></li><li class="depth-1"><a href="walkmap.routing.html#var-extend-frontier"><div class="inner"><span>extend-frontier</span></div></a></li><li class="depth-1"><a href="walkmap.routing.html#var-gradient-cost"><div class="inner"><span>gradient-cost</span></div></a></li><li class="depth-1"><a href="walkmap.routing.html#var-path-traversal-cost"><div class="inner"><span>path-traversal-cost</span></div></a></li><li class="depth-1"><a href="walkmap.routing.html#var-road-bonus"><div class="inner"><span>road-bonus</span></div></a></li><li class="depth-1"><a href="walkmap.routing.html#var-route"><div class="inner"><span>route</span></div></a></li><li class="depth-1"><a href="walkmap.routing.html#var-traversable.3F"><div class="inner"><span>traversable?</span></div></a></li><li class="depth-1"><a href="walkmap.routing.html#var-traversal-cost"><div class="inner"><span>traversal-cost</span></div></a></li><li class="depth-1"><a href="walkmap.routing.html#var-vertices-traversal-cost"><div class="inner"><span>vertices-traversal-cost</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">walkmap.routing</h1><div class="doc"><div class="markdown"><p>Finding optimal routes to traverse a map.</p></div></div><div class="public anchor" id="var-*gradient-exponent*"><h3>*gradient-exponent*</h3><h4 class="dynamic">dynamic</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>The exponent to be applied to <code>(inc (:z (unit-vector from to)))</code> of a path segment to calculate the gradient-related part of the cost of traversal. Dynamic, because we will want to tune this.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/routing.clj#L24">view source</a></div></div><div class="public anchor" id="var-*traversals-exponent*"><h3>*traversals-exponent*</h3><h4 class="dynamic">dynamic</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>The (expected to be negative) exponent to be applied to the number of traversals of a path to compute the road bonus. Paths more travelled by should have larger bonuses, but not dramatically so - so the increase in bonus needs to scale significantly less than linearly with the number of traversals. Dynamic, because we will want to tune this.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/routing.clj#L30">view source</a></div></div><div class="public anchor" id="var-barriers-crossed"><h3>barriers-crossed</h3><div class="usage"><code>(barriers-crossed from to s)</code></div><div class="doc"><div class="markdown"><p>Search superstructure <code>s</code> and return a sequence of barriers, if any, which obstruct traversal from vertex <code>from</code> to vertex <code>to</code>.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/routing.clj#L64">view source</a></div></div><div class="public anchor" id="var-best-road"><h3>best-road</h3><div class="usage"><code>(best-road from to s)</code></div><div class="doc"><div class="markdown"><p>Find the best traversable path which links the vertices <code>from</code> and <code>to</code> in this superstructure <code>s</code>, or nil if there are none.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/routing.clj#L95">view source</a></div></div><div class="public anchor" id="var-crossing-penalty"><h3>crossing-penalty</h3><div class="usage"><code>(crossing-penalty barrier from to s)</code></div><div class="doc"><div class="markdown"><p>TODO: should return the cost of crossing this <code>barrier</code>, initially mainly a watercourse, on the axis from vertex <code>from</code> to vertex <code>to</code>. in the context of superstructure <code>s</code>. If theres a bridge, ferry or other crossing mechanism in <code>s</code> at the intersection of the vertex and the barrier, then the penalty should be substantially less than it would otherwise be.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/routing.clj#L71">view source</a></div></div><div class="public anchor" id="var-extend-frontier"><h3>extend-frontier</h3><div class="usage"><code>(extend-frontier frontier candidates)</code><code>(extend-frontier frontier candidates rejects)</code></div><div class="doc"><div class="markdown"><p>Return a sequence like <code>frontier</code> with all of these <code>candidates</code> which are not already members either of <code>frontier</code> or of <code>rejects</code> appended.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/routing.clj#L150">view source</a></div></div><div class="public anchor" id="var-gradient-cost"><h3>gradient-cost</h3><div class="usage"><code>(gradient-cost edge)</code></div><div class="doc"><div class="markdown"><p>Compute the per-unit-distance cost of traversing this <code>edge</code>.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/routing.clj#L81">view source</a></div></div><div class="public anchor" id="var-path-traversal-cost"><h3>path-traversal-cost</h3><div class="usage"><code>(path-traversal-cost path s)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/routing.clj#L60">view source</a></div></div><div class="public anchor" id="var-road-bonus"><h3>road-bonus</h3><div class="usage"><code>(road-bonus from to s)</code></div><div class="doc"><div class="markdown"><p>Calculate the road bonus of the edge represented by the vertices <code>from</code>, <code>to</code>, in the context of the superstructure <code>s</code>. Obviously there only is such a bonus if there actually is an existing thoroughfare to use. Road bonuses scale with some fractional exponent of the number of traversals which have been made of the road segment in question.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/routing.clj#L106">view source</a></div></div><div class="public anchor" id="var-route"><h3>route</h3><div class="usage"><code>(route from to s search-radius)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/routing.clj#L168">view source</a></div></div><div class="public anchor" id="var-traversable.3F"><h3>traversable?</h3><div class="usage"><code>(traversable? object)</code></div><div class="doc"><div class="markdown"><p>True if this object can be considered as part of the walkmap.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/routing.clj#L38">view source</a></div></div><div class="public anchor" id="var-traversal-cost"><h3>traversal-cost</h3><div class="usage"><code>(traversal-cost from to s)</code></div><div class="doc"><div class="markdown"><p>Return the traversal cost of the edge represented by the vertices <code>from</code>, <code>to</code>, in the context of the superstructure <code>s</code>. It is legitimate to pass <code>nil</code> as the <code>to</code> argument, in which case the result will be zero, in order to allow <code>reduce</code> to be used to compute total path costs.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/routing.clj#L117">view source</a></div></div><div class="public anchor" id="var-vertices-traversal-cost"><h3>vertices-traversal-cost</h3><div class="usage"><code>(vertices-traversal-cost vertices s)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/walkmap/blob/master/src/walkmap/routing.clj#L51">view source</a></div></div></div></body></html>