Skip to content

Commit

Permalink
deploy: f51944c
Browse files Browse the repository at this point in the history
  • Loading branch information
harisankar95 committed Feb 12, 2024
1 parent b4d8032 commit 0d5767f
Show file tree
Hide file tree
Showing 51 changed files with 7,863 additions and 64 deletions.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/pathfinding3d.core.grid.doctree
Binary file not shown.
Binary file modified .doctrees/pathfinding3d.core.heap.doctree
Binary file not shown.
Binary file modified .doctrees/pathfinding3d.core.heuristic.doctree
Binary file not shown.
Binary file modified .doctrees/pathfinding3d.core.util.doctree
Binary file not shown.
Binary file modified .doctrees/pathfinding3d.core.world.doctree
Binary file not shown.
Binary file modified .doctrees/pathfinding3d.finder.a_star.doctree
Binary file not shown.
Binary file modified .doctrees/pathfinding3d.finder.best_first.doctree
Binary file not shown.
Binary file modified .doctrees/pathfinding3d.finder.bi_a_star.doctree
Binary file not shown.
Binary file modified .doctrees/pathfinding3d.finder.breadth_first.doctree
Binary file not shown.
Binary file modified .doctrees/pathfinding3d.finder.dijkstra.doctree
Binary file not shown.
Binary file modified .doctrees/pathfinding3d.finder.finder.doctree
Binary file not shown.
Binary file modified .doctrees/pathfinding3d.finder.ida_star.doctree
Binary file not shown.
Binary file modified .doctrees/pathfinding3d.finder.msp.doctree
Binary file not shown.
Binary file modified .doctrees/pathfinding3d.finder.theta_star.doctree
Binary file not shown.
14 changes: 14 additions & 0 deletions _modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,21 @@

<h1>All modules for which code is available</h1>
<ul><li><a href="pathfinding3d/core/diagonal_movement.html">pathfinding3d.core.diagonal_movement</a></li>
<li><a href="pathfinding3d/core/grid.html">pathfinding3d.core.grid</a></li>
<li><a href="pathfinding3d/core/heap.html">pathfinding3d.core.heap</a></li>
<li><a href="pathfinding3d/core/heuristic.html">pathfinding3d.core.heuristic</a></li>
<li><a href="pathfinding3d/core/node.html">pathfinding3d.core.node</a></li>
<li><a href="pathfinding3d/core/util.html">pathfinding3d.core.util</a></li>
<li><a href="pathfinding3d/core/world.html">pathfinding3d.core.world</a></li>
<li><a href="pathfinding3d/finder/a_star.html">pathfinding3d.finder.a_star</a></li>
<li><a href="pathfinding3d/finder/best_first.html">pathfinding3d.finder.best_first</a></li>
<li><a href="pathfinding3d/finder/bi_a_star.html">pathfinding3d.finder.bi_a_star</a></li>
<li><a href="pathfinding3d/finder/breadth_first.html">pathfinding3d.finder.breadth_first</a></li>
<li><a href="pathfinding3d/finder/dijkstra.html">pathfinding3d.finder.dijkstra</a></li>
<li><a href="pathfinding3d/finder/finder.html">pathfinding3d.finder.finder</a></li>
<li><a href="pathfinding3d/finder/ida_star.html">pathfinding3d.finder.ida_star</a></li>
<li><a href="pathfinding3d/finder/msp.html">pathfinding3d.finder.msp</a></li>
<li><a href="pathfinding3d/finder/theta_star.html">pathfinding3d.finder.theta_star</a></li>
</ul>

</div>
Expand Down
839 changes: 839 additions & 0 deletions _modules/pathfinding3d/core/grid.html

Large diffs are not rendered by default.

303 changes: 303 additions & 0 deletions _modules/pathfinding3d/core/heap.html

Large diffs are not rendered by default.

272 changes: 272 additions & 0 deletions _modules/pathfinding3d/core/heuristic.html

Large diffs are not rendered by default.

507 changes: 507 additions & 0 deletions _modules/pathfinding3d/core/util.html

Large diffs are not rendered by default.

231 changes: 231 additions & 0 deletions _modules/pathfinding3d/core/world.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>pathfinding3d.core.world &mdash; pathfinding3d</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="../../../_static/graphviz.css?v=eafc0fe6" />
<link rel="stylesheet" type="text/css" href="../../../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../../../_static/custom.css?v=71f9a9e8" />


<link rel="shortcut icon" href="../../../_static/favicon.ico"/>
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->

<script src="../../../_static/jquery.js?v=5d32c60e"></script>
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js?v=5ed476db"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=4825356b"></script>
<script src="../../../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../../../_static/copybutton.js?v=f281be69"></script>
<script src="../../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
</head>

<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" style="background: white" >



<a href="../../../index.html" class="icon icon-home">
pathfinding3d
<img src="../../../_static/logo.png" class="logo" alt="Logo"/>
</a>
<div class="version">
0.7.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../INTRO.html">Pathfinding3D</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../INTRO.html#introduction">Introduction</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../INSTALL.html">Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../INSTALL.html#requirements">Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../INSTALL.html#pypi">PyPI</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../INSTALL.html#for-development-purposes-please-use-editable-mode">For development purposes please use editable mode</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../USAGE.html">Usage</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../USAGE.html#basic-usage">Basic usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../USAGE.html#steps-portals-bridges">Steps/Portals/Bridges</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../USAGE.html#toy-example-connecting-two-building-storeys-with-a-bridge">Toy Example: Connecting Two Building Storeys with a Bridge</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../USAGE.html#visualizing-the-path">Visualizing the Path</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../USAGE.html#prerequisites">Prerequisites</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../USAGE.html#example-with-open3d">Example with Open3D</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../USAGE.html#example-with-any-angle-of-movement">Example with any angle of movement</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../CHANGELOG.html">Change Log</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../CHANGELOG.html#id1">0.7.1</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../CHANGELOG.html#id2">0.7.0</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../CHANGELOG.html#id3">0.6.2</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../CHANGELOG.html#id4">0.6.1</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../CHANGELOG.html#id5">0.6.0</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../CHANGELOG.html#id6">0.5.1</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../CHANGELOG.html#id7">0.5.0</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../CHANGELOG.html#id8">0.4.1</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../CHANGELOG.html#id9">0.4.0</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../CHANGELOG.html#id10">0.3.1</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../CHANGELOG.html#id11">0.3</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../CHANGELOG.html#id12">0.2</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../CHANGELOG.html#id13">0.1</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../modules.html">pathfinding3d</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../pathfinding3d.html">pathfinding3d package</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../pathfinding3d.html#subpackages">Subpackages</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../pathfinding3d.core.html">pathfinding3d.core package</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../pathfinding3d.finder.html">pathfinding3d.finder package</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>

</div>
</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" style="background: white" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">pathfinding3d</a>
</nav>

<div class="wy-nav-content">
<div class="rst-content style-external-links">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="../../index.html">Module code</a></li>
<li class="breadcrumb-item active">pathfinding3d.core.world</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<h1>Source code for pathfinding3d.core.world</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">List</span>

<span class="kn">from</span> <span class="nn">.grid</span> <span class="kn">import</span> <span class="n">Grid</span>
<span class="kn">from</span> <span class="nn">.node</span> <span class="kn">import</span> <span class="n">GridNode</span>


<span class="c1"># a world connects grids but can have multiple grids.</span>
<div class="viewcode-block" id="World"><a class="viewcode-back" href="../../../pathfinding3d.core.world.html#pathfinding3d.core.world.World">[docs]</a><span class="k">class</span> <span class="nc">World</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> A world connects grids but can have multiple grids.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<div class="viewcode-block" id="World.__init__"><a class="viewcode-back" href="../../../pathfinding3d.core.world.html#pathfinding3d.core.world.World.__init__">[docs]</a> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">grids</span><span class="p">:</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="n">Grid</span><span class="p">]):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Initialize a new world.</span>

<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
<span class="sd"> grids : Dict[int, Grid]</span>
<span class="sd"> grids in this world</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">grids</span> <span class="o">=</span> <span class="n">grids</span></div>

<div class="viewcode-block" id="World.neighbors"><a class="viewcode-back" href="../../../pathfinding3d.core.world.html#pathfinding3d.core.world.World.neighbors">[docs]</a> <span class="k">def</span> <span class="nf">neighbors</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">node</span><span class="p">:</span> <span class="n">GridNode</span><span class="p">,</span> <span class="n">diagonal_movement</span><span class="p">:</span> <span class="nb">int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">List</span><span class="p">[</span><span class="n">GridNode</span><span class="p">]:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Get neighbors of the given node.</span>

<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
<span class="sd"> node : GridNode</span>
<span class="sd"> node to get neighbors from</span>
<span class="sd"> diagonal_movement : int</span>
<span class="sd"> if diagonal movement is allowed</span>
<span class="sd"> (see enum in diagonal_movement)</span>

<span class="sd"> Returns</span>
<span class="sd"> -------</span>
<span class="sd"> List[GridNode]</span>
<span class="sd"> neighbors of the given node</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">grids</span><span class="p">[</span><span class="n">node</span><span class="o">.</span><span class="n">grid_id</span><span class="p">]</span><span class="o">.</span><span class="n">neighbors</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">diagonal_movement</span><span class="o">=</span><span class="n">diagonal_movement</span><span class="p">)</span></div>

<div class="viewcode-block" id="World.calc_cost"><a class="viewcode-back" href="../../../pathfinding3d.core.world.html#pathfinding3d.core.world.World.calc_cost">[docs]</a> <span class="k">def</span> <span class="nf">calc_cost</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">node_a</span><span class="p">:</span> <span class="n">GridNode</span><span class="p">,</span> <span class="n">node_b</span><span class="p">:</span> <span class="n">GridNode</span><span class="p">,</span> <span class="n">weighted</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">float</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Calculate the cost between two nodes.</span>

<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
<span class="sd"> node_a : GridNode</span>
<span class="sd"> first node</span>
<span class="sd"> node_b : GridNode</span>
<span class="sd"> second node</span>
<span class="sd"> weighted : bool</span>
<span class="sd"> wether to use weights or not</span>

<span class="sd"> Returns</span>
<span class="sd"> -------</span>
<span class="sd"> float</span>
<span class="sd"> cost between the two nodes</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># TODO: if node_a.grid_id != node_b.grid_id calculate distance between</span>
<span class="c1"># grids as well, for now we ignore switching grids</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">grids</span><span class="p">[</span><span class="n">node_a</span><span class="o">.</span><span class="n">grid_id</span><span class="p">]</span><span class="o">.</span><span class="n">calc_cost</span><span class="p">(</span><span class="n">node_a</span><span class="p">,</span> <span class="n">node_b</span><span class="p">,</span> <span class="n">weighted</span><span class="o">=</span><span class="n">weighted</span><span class="p">)</span></div>

<div class="viewcode-block" id="World.cleanup"><a class="viewcode-back" href="../../../pathfinding3d.core.world.html#pathfinding3d.core.world.World.cleanup">[docs]</a> <span class="k">def</span> <span class="nf">cleanup</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Cleanup all grids in this world.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">for</span> <span class="n">grid</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">grids</span><span class="o">.</span><span class="n">values</span><span class="p">():</span>
<span class="n">grid</span><span class="o">.</span><span class="n">cleanup</span><span class="p">()</span></div></div>
</pre></div>

</div>
</div>
<footer>

<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2024, Harisankar Babu.</p>
</div>



</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>

</body>
</html>
Loading

0 comments on commit 0d5767f

Please sign in to comment.