This commit is contained in:
noncomputable 2018-09-27 12:52:29 -04:00
parent f8e0d47f1d
commit 4e473fe9ce
34 changed files with 4598 additions and 185 deletions

View File

@ -36,7 +36,8 @@
</div>
<script type="text/javascript" src="../../resources/interface.js"></script>
<script type="text/javascript" src="../../resources/map_data.js"></script>
<script type="text/javascript" src="../../resources/units_data.js"></script>
<script type="text/javascript" src="../../resources/street_features.js"></script>
<script type="text/javascript" src="../../resources/unit_features.js"></script>
<script type="text/javascript" src="../../dist/agentmaps.js"></script>
<script type="text/javascript" src="epidemic.js"></script>
<script>

View File

@ -31,7 +31,7 @@ var agentmap = L.A.agentmap(map);
function setup() {
//Generate and display streets and units on the map.
//Load the units from units_data instead of generating them from scratch to speed things up.
agentmap.buildingify(bounding_box, map_data, undefined, {"color": "black", "weight": 1.5, "opacity": .6}, units_data);
agentmap.buildingify(bounding_box, map_data, undefined, {"color": "black", "weight": 1.5, "opacity": .6}, units_data, streets_data);
//Split the map's units into residential and commercial zones.
var residential_streets = ["Wythe Lane", "Heyward Lane", "Lynch Lane", "Clymer Lane"],

View File

@ -6001,13 +6001,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:34 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:10 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -927,7 +927,7 @@
<h4 class="name" id="buildingify"><span class="type-signature"></span>buildingify<span class="signature">(bounding_box, streets_data, street_options<span class="signature-attributes">opt</span>, unit_options<span class="signature-attributes">opt</span>, units_data<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<h4 class="name" id="buildingify"><span class="type-signature"></span>buildingify<span class="signature">(bounding_box, OSM_data, street_options<span class="signature-attributes">opt</span>, unit_options<span class="signature-attributes">opt</span>, unit_layers<span class="signature-attributes">opt</span>, street_layers<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
@ -1004,7 +1004,7 @@
<tr>
<td class="name"><code>streets_data</code></td>
<td class="name"><code>OSM_data</code></td>
<td class="type">
@ -1287,7 +1287,7 @@
<tr>
<td class="name"><code>units_data</code></td>
<td class="name"><code>unit_layers</code></td>
<td class="type">
@ -1313,7 +1313,40 @@
<td class="description last">If you want to load a previously generated AgentMaps.units object instead of generating one from scarch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.</td>
<td class="description last">If you want to load a previously generated AgentMaps.units object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.</td>
</tr>
<tr>
<td class="name"><code>street_layers</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">If you want to load a previously generated AgentMaps.streets object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.streets featureGroup.</td>
</tr>
@ -1354,7 +1387,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line27">line 27</a>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line28">line 28</a>
</li></ul></dd>
@ -3063,13 +3096,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:34 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:10 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -89,10 +89,18 @@ agentmap.buildingify(my_data, [[43.3071, -88.0158], [43.2884, -87.9759]]);
`Agentmap.buildingify` accepts more arguments specifying the dimension and appearance of the units and streets it will build. For more on that, see the section on [Feature Styling](#feature-styling).
`Agentmap.buildingify` does a lot of work checking for and removing overlapping units, and so the bigger your neighborhood, the noticeably longer it will take.
To compensate for this and help make your simulation more responsive, `Agentmap.buildingify`'s last parameter, after the styling options, accepts a `units_data` object: a GeoJSON FeatureGroup of units.
If one is passed as an argument, instead of generating the units from scratch, `Agentmap.buildingify` will more quickly just use the blueprints in `units_data`.
To compensate for this and help make your simulation more responsive, `Agentmap.buildingify`'s last two parameters, after the styling options, accept a `unit_layers` object and `street_layers` object respectively: a GeoJSON FeatureGroup of units or streets exported from a previous AgentMaps simulation.
If either of these is passed as an argument, instead of generating the unit or street layers from scratch, `Agentmap.buildingify` will more quickly just use the blueprints in `unit_layers` and `street_layers`.
How do you get a `units_data` object? Agentmaps have an [Agentmap.downloadUnits](./Agentmap.html#downloadUnits) method which, when called, will generate a *js* file containing a single variable named `units_data` defined as the vale of `Agentmap.units.toGeoJSON()`.
How do you get a `unit_layers` or `street_layers` object? Agentmaps have an
[Agentmap.downloadUnits](./Agentmap.html#downloadUnits) method and a [Agentmap.downloadStreets](./Agentmap.html#downloadStreets)
method which, when called, will generate a *js* file containing a single variable named `unit_data` or `street_data` defined as the vale of `Agentmap.units.toGeoJSON(20)` or `Agentmap.streets.toGeoJSON(20)` respectively.
What if your OSM street data is too big for a browser to feasibly generate all the appropriate building layers?
The npm package comes with a command line tool named "featuretool" which, given the bounding coordinates and path to a file containing OSM-style GeoJSON, generates all the appropriate layers and exports them to files similar to those that `Agentmap.downloadUnits` and `Agentmap.downloadStreets` generate.
To use it, you need to have installed AgentMaps globally with `npm install -g AgentMaps`.
To use featuretool, you'd do something like this: `featuretool --bbox [[39.9058,-86.0910],[39.8992,-86.1017]] --streets data/townmap.js`.
## <a name="navigating-streets"></a>Navigating Streets

View File

@ -337,13 +337,13 @@ exports.agentmap = agentmapFactory;
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:34 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:10 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -816,13 +816,13 @@ exports.agent = agent;
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:34 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:10 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -43,30 +43,30 @@ getPathFinder = require('./routing').getPathFinder;
* @instance
*
* @param {Array.&lt;Array.&lt;number>>} bounding_box - The map's top-left and bottom-right coordinates.
* @param {object} streets_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {object} OSM_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {object} [street_options] - An object containing the Leaflet styling options for streets. See available options here: {@link https://leafletjs.com/reference-1.3.2.html#polyline-l-polyline}.
* @param {object} [unit_options] - An object containing the Leaflet &amp; AgentMaps styling options for units.&lt;br/>See available Leaflet options here: {@link https://leafletjs.com/reference-1.3.2.html#polygon-l-polygon}&lt;br/>Additional AgentMaps-specific options are described below.
* @param {number} [unit_options.front_buffer = 6] - The number of meters beetween the front of unit and its street.
* @param {number} [unit_options.side_buffer = 3] - The number of meters between two units on the same street.
* @param {number} [unit_options.length = 14] - The length of the unit in meters along the street.
* @param {number} [unit_options.depth = 18] - The depth of the unit in meters out from its front.
* @param {object} [units_data]- If you want to load a previously generated AgentMaps.units object instead of generating one from scarch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.
* @param {object} [unit_layers]- If you want to load a previously generated AgentMaps.units object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.
* @param {object} [street_layers]- If you want to load a previously generated AgentMaps.streets object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.streets featureGroup.
*/
function buildingify(bounding_box, streets_data, street_options, unit_options, units_data) {
setupStreetFeatures.call(this, streets_data, street_options);
setupUnitFeatures.call(this, bounding_box, streets_data, unit_options, units_data);
function buildingify(bounding_box, OSM_data, street_options, unit_options, unit_layers, street_layers) {
setupStreetFeatures.call(this, OSM_data, street_options);
setupUnitFeatures.call(this, bounding_box, OSM_data, unit_options, unit_layers);
}
/**
* Generate and setup streets based on the provided GeoJSON data.
*
* @param {object} streets_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {object} OSM_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {object} street_options - An object containing the Leaflet styling options for streets.
* @param {object} [street_layers] - If you want to load a previously generated AgentMaps.streets object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.streets featureGroup.
*/
function setupStreetFeatures(streets_data, street_options) {
let street_features = getStreetFeatures(streets_data);
default_options = {
function setupStreetFeatures(OSM_data, street_options, street_layers) {
let default_options = {
"color": "yellow",
"weight": 4,
"opacity": .5
@ -74,10 +74,19 @@ function setupStreetFeatures(streets_data, street_options) {
street_options = Object.assign(default_options, street_options);
let street_feature_collection = {
type: "FeatureCollection",
features: street_features
};
let street_feature_collection;
if (typeof(street_layers) === "undefined") {
let street_features = getStreetFeatures(OSM_data);
street_feature_collection = {
type: "FeatureCollection",
features: street_features
};
}
else {
street_feature_collection = street_layers;
}
this.streets = L.geoJSON(
street_feature_collection,
@ -86,18 +95,18 @@ function setupStreetFeatures(streets_data, street_options) {
//Map streets' OSM IDs to their Leaflet IDs.
this.streets.id_map = {};
//Having added the streets as layers to the map, do any processing that requires access to those layers.
this.streets.eachLayer(function(street) {
this.streets.id_map[street.feature.id] = street._leaflet_id;
addStreetLayerIntersections.call(this, street);
}, this);
//Add general graph-making and path-finder-making methods to Agentmap, in case streets are added, removed, or modified mid-simulation.
this.streetsToGraph = streetsToGraph,
this.getPathFinder = getPathFinder;
this.getPathFinder = getPathFinder;
this.streets.graph = streetsToGraph(this.streets),
this.pathfinder = getPathFinder(this.streets.graph);
}
@ -106,15 +115,15 @@ function setupStreetFeatures(streets_data, street_options) {
* Get all streets from the GeoJSON data.
* @private
*
* @param {Object} streets_data - A GeoJSON Feature Collection object containing the OSM streets inside the bounding box.
* @param {Object} OSM_data - A GeoJSON Feature Collection object containing the OSM streets inside the bounding box.
* @returns {Array&lt;Feature>} - array of street features.
*/
function getStreetFeatures(streets_data) {
function getStreetFeatures(OSM_data) {
let street_features = [];
for (let i = 0; i &lt; streets_data.features.length; ++i) {
let feature = streets_data.features[i];
for (let i = 0; i &lt; OSM_data.features.length; ++i) {
let feature = OSM_data.features[i];
if (feature.geometry.type === "LineString" &amp;&amp; feature.properties.highway) {
let street_feature = feature;
@ -161,11 +170,11 @@ function addStreetLayerIntersections(street) {
* Generate and setup building units based on the provided GeoJSON data.
*
* @param {Array.&lt;Array.&lt;number>>} bounding_box - The map's top-left and bottom-right coordinates.
* @param {object} streets_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {object} OSM_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {object} unit_options - An object containing the Leaflet &amp; AgentMaps styling options for units.
* @param {object} [units_data] - If you want to load a previously generated AgentMaps.units object instead of generating one from scarch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.
* @param {object} [unit_layers] - If you want to load a previously generated AgentMaps.units object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.
*/
function setupUnitFeatures(bounding_box, streets_data, unit_options = {}, units_data) {
function setupUnitFeatures(bounding_box, OSM_data, unit_options = {}, unit_layers) {
let default_options = {
"color": "green",
"weight": 1,
@ -180,10 +189,10 @@ function setupUnitFeatures(bounding_box, streets_data, unit_options = {}, units_
let unit_feature_collection;
//If no units_data is supplied, generate the units from scratch.
if (typeof(units_data) === "undefined") {
//If no unit_layers is supplied, generate the units from scratch.
if (typeof(unit_layers) === "undefined") {
//Bind getUnitFeatures to "this" so it can access the agentmap as "this.agentmap".
let unit_features = getUnitFeatures.bind(this)(bounding_box, streets_data, unit_options);
let unit_features = getUnitFeatures.bind(this)(bounding_box, OSM_data, unit_options);
unit_feature_collection = {
type: "FeatureCollection",
@ -191,7 +200,7 @@ function setupUnitFeatures(bounding_box, streets_data, unit_options = {}, units_
};
}
else {
unit_feature_collection = units_data;
unit_feature_collection = unit_layers;
}
this.units = L.geoJSON(
@ -201,7 +210,7 @@ function setupUnitFeatures(bounding_box, streets_data, unit_options = {}, units_
//Having added the units as layers to the map, do any processing that requires access to those layers.
this.units.eachLayer(function(unit) {
if (typeof(units_data) === "undefined") {
if (typeof(unit_layers) === "undefined") {
unit.street_id = unit.feature.properties.street_id;
}
else {
@ -248,11 +257,11 @@ function getUnitNeighborLayerIDs(neighbors) {
* @private
*
* @param {Array.&lt;Array.&lt;number>>} bounding_box - The map's top-left and bottom-right coordinates.
* @param {Object} streets_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {Object} OSM_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {object} unit_options - An object containing the AgentMaps styling options for units.
* @returns {Array&lt;Feature>} - array of features representing real estate units.
* @returns {Array&lt;Feature>} - Array of features representing real estate units.
*/
function getUnitFeatures(bounding_box, streets_data, unit_options) {
function getUnitFeatures(bounding_box, OSM_data, unit_options) {
let proposed_unit_features = [];
this.streets.eachLayer(function(layer) {
@ -438,7 +447,6 @@ function unitsOutOfStreets(unit_features, street_layers) {
* @returns {boolean} - Whether the polygon_feature overlaps with any one in the array.
*/
function noOverlaps(reference_polygon_feature, polygon_feature_array) {
//return true;
for (feature_array_element of polygon_feature_array) {
let overlap_exists = intersect(reference_polygon_feature, feature_array_element);
if (overlap_exists) {
@ -450,6 +458,7 @@ function noOverlaps(reference_polygon_feature, polygon_feature_array) {
}
Agentmap.prototype.buildingify = buildingify;
exports.buildingify = buildingify;
</code></pre>
</article>
</section>
@ -460,13 +469,13 @@ Agentmap.prototype.buildingify = buildingify;
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:34 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:10 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -271,7 +271,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line106">line 106</a>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line115">line 115</a>
</li></ul></dd>
@ -1286,7 +1286,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line256">line 256</a>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line265">line 265</a>
</li></ul></dd>
@ -1702,7 +1702,7 @@
<h4 class="name" id="getStreetFeatures"><span class="type-signature">(private) </span>getStreetFeatures<span class="signature">(streets_data)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="global.html#Feature">Feature</a>>}</span></h4>
<h4 class="name" id="getStreetFeatures"><span class="type-signature">(private) </span>getStreetFeatures<span class="signature">(OSM_data)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="global.html#Feature">Feature</a>>}</span></h4>
@ -1746,7 +1746,7 @@
<tr>
<td class="name"><code>streets_data</code></td>
<td class="name"><code>OSM_data</code></td>
<td class="type">
@ -1803,7 +1803,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line84">line 84</a>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line93">line 93</a>
</li></ul></dd>
@ -1983,7 +1983,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line349">line 349</a>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line358">line 358</a>
</li></ul></dd>
@ -2039,7 +2039,7 @@
<h4 class="name" id="getUnitFeatures"><span class="type-signature">(private) </span>getUnitFeatures<span class="signature">(bounding_box, streets_data, unit_options)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="global.html#Feature">Feature</a>>}</span></h4>
<h4 class="name" id="getUnitFeatures"><span class="type-signature">(private) </span>getUnitFeatures<span class="signature">(bounding_box, OSM_data, unit_options)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="global.html#Feature">Feature</a>>}</span></h4>
@ -2106,7 +2106,7 @@
<tr>
<td class="name"><code>streets_data</code></td>
<td class="name"><code>OSM_data</code></td>
<td class="type">
@ -2186,7 +2186,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line227">line 227</a>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line236">line 236</a>
</li></ul></dd>
@ -2213,7 +2213,7 @@
<div class="param-desc">
- array of features representing real estate units.
- Array of features representing real estate units.
</div>
@ -2343,7 +2343,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line197">line 197</a>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line206">line 206</a>
</li></ul></dd>
@ -2680,7 +2680,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line412">line 412</a>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line421">line 421</a>
</li></ul></dd>
@ -3056,7 +3056,7 @@
<h4 class="name" id="setupStreetFeatures"><span class="type-signature"></span>setupStreetFeatures<span class="signature">(streets_data, street_options)</span><span class="type-signature"></span></h4>
<h4 class="name" id="setupStreetFeatures"><span class="type-signature"></span>setupStreetFeatures<span class="signature">(OSM_data, street_options, street_layers<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
@ -3088,6 +3088,8 @@
<th>Type</th>
<th>Attributes</th>
@ -3100,7 +3102,7 @@
<tr>
<td class="name"><code>streets_data</code></td>
<td class="name"><code>OSM_data</code></td>
<td class="type">
@ -3113,6 +3115,14 @@
</td>
<td class="attributes">
</td>
@ -3136,6 +3146,14 @@
</td>
<td class="attributes">
</td>
@ -3143,6 +3161,39 @@
</tr>
<tr>
<td class="name"><code>street_layers</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">If you want to load a previously generated AgentMaps.streets object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.streets featureGroup.</td>
</tr>
</tbody>
</table>
@ -3180,7 +3231,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line38">line 38</a>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line40">line 40</a>
</li></ul></dd>
@ -3214,7 +3265,7 @@
<h4 class="name" id="setupUnitFeatures"><span class="type-signature"></span>setupUnitFeatures<span class="signature">(bounding_box, streets_data, unit_options, units_data<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<h4 class="name" id="setupUnitFeatures"><span class="type-signature"></span>setupUnitFeatures<span class="signature">(bounding_box, OSM_data, unit_options, unit_layers<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
@ -3291,7 +3342,7 @@
<tr>
<td class="name"><code>streets_data</code></td>
<td class="name"><code>OSM_data</code></td>
<td class="type">
@ -3353,7 +3404,7 @@
<tr>
<td class="name"><code>units_data</code></td>
<td class="name"><code>unit_layers</code></td>
<td class="type">
@ -3379,7 +3430,7 @@
<td class="description last">If you want to load a previously generated AgentMaps.units object instead of generating one from scarch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.</td>
<td class="description last">If you want to load a previously generated AgentMaps.units object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.</td>
</tr>
@ -3420,7 +3471,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line140">line 140</a>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line149">line 149</a>
</li></ul></dd>
@ -3893,7 +3944,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line385">line 385</a>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line394">line 394</a>
</li></ul></dd>
@ -4836,13 +4887,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:34 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:10 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -96,9 +96,15 @@ These FeatureGroups can be looped through like any other Leaflet FeatureGroup (u
stored in a variable <code>my_data</code> and the coordinates of the top left and bottom right corners of the bounding rectangle are <code>[43.3071, -88.0158]</code> and <code>[43.2884, -87.9759]</code> respectively, the corresponding call to <code>Agentmap.buildingify</code> would look something like:</p>
<pre class="prettyprint source lang-javascript"><code>agentmap.buildingify(my_data, [[43.3071, -88.0158], [43.2884, -87.9759]]);</code></pre><p><code>Agentmap.buildingify</code> accepts more arguments specifying the dimension and appearance of the units and streets it will build. For more on that, see the section on <a href="#feature-styling">Feature Styling</a>.</p>
<p><code>Agentmap.buildingify</code> does a lot of work checking for and removing overlapping units, and so the bigger your neighborhood, the noticeably longer it will take.
To compensate for this and help make your simulation more responsive, <code>Agentmap.buildingify</code>'s last parameter, after the styling options, accepts a <code>units_data</code> object: a GeoJSON FeatureGroup of units.
If one is passed as an argument, instead of generating the units from scratch, <code>Agentmap.buildingify</code> will more quickly just use the blueprints in <code>units_data</code>.</p>
<p>How do you get a <code>units_data</code> object? Agentmaps have an <a href="./Agentmap.html#downloadUnits">Agentmap.downloadUnits</a> method which, when called, will generate a <em>js</em> file containing a single variable named <code>units_data</code> defined as the vale of <code>Agentmap.units.toGeoJSON()</code>.</p>
To compensate for this and help make your simulation more responsive, <code>Agentmap.buildingify</code>'s last two parameters, after the styling options, accept a <code>unit_layers</code> object and <code>street_layers</code> object respectively: a GeoJSON FeatureGroup of units or streets exported from a previous AgentMaps simulation.
If either of these is passed as an argument, instead of generating the unit or street layers from scratch, <code>Agentmap.buildingify</code> will more quickly just use the blueprints in <code>unit_layers</code> and <code>street_layers</code>.</p>
<p>How do you get a <code>unit_layers</code> or <code>street_layers</code> object? Agentmaps have an
<a href="./Agentmap.html#downloadUnits">Agentmap.downloadUnits</a> method and a <a href="./Agentmap.html#downloadStreets">Agentmap.downloadStreets</a>
method which, when called, will generate a <em>js</em> file containing a single variable named <code>unit_data</code> or <code>street_data</code> defined as the vale of <code>Agentmap.units.toGeoJSON(20)</code> or <code>Agentmap.streets.toGeoJSON(20)</code> respectively.</p>
<p>What if your OSM street data is too big for a browser to feasibly generate all the appropriate building layers?
The npm package comes with a command line tool named &quot;featuretool&quot; which, given the bounding coordinates and path to a file containing OSM-style GeoJSON, generates all the appropriate layers and exports them to files similar to those that <code>Agentmap.downloadUnits</code> and <code>Agentmap.downloadStreets</code> generate.
To use it, you need to have installed AgentMaps globally with <code>npm install -g AgentMaps</code>.</p>
<p>To use featuretool, you'd do something like this: <code>featuretool --bbox [[39.9058,-86.0910],[39.8992,-86.1017]] --streets data/townmap.js</code>.</p>
<h2><a name="navigating-streets"></a>Navigating Streets</h2><p>Given a neighborhood's streets in GeoJSON, AgentMaps extracts a street network and converts it to a <a href="https://en.wikipedia.org/wiki/Graph_(discrete_mathematics">graph</a> with the help of the <a href="https://github.com/anvaka/ngraph.graph">ngraph.graph</a> library. Then, it uses <a href="https://github.com/anvaka/ngraph.path">ngraph.path</a> to find an (approximately) shortest path. The graph itself is made out of the start point, end point, and intersections of each street.</p>
<p>The graph is stored in the <code>Agentmap.streets.graph</code> property. It is a symmetric graph; for each edge between two points, an inversely directed edge between them also exists. That is, by default, there are no one-way streets. However, if you'd like to remove some of the directed edges of certain streets from the graph (i.e. for making one-way streets), a very accessible guide to manipulating the graphs is available in the ngraph.graph <a href="https://github.com/anvaka/ngraph.graph/blob/master/README.md">README</a>.</p>
<h2><a name="navigating-within-units"></a>Navigating Within Units</h2><p>Every Agentmap has an <a href="./Agentmap.html#.getUnitPoint">Agentmap.getUnitPoint</a> method which makes it easy to specify a position inside of a unit, relative to one of its corners, and get back the global coordinates of that spot. </p>
@ -235,13 +241,13 @@ and a new animation frame will be requested to do the same thing over again.</p>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:34 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:10 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -74,13 +74,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:34 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:10 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -314,13 +314,13 @@ exports.encodeLatLng = encodeLatLng;
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:34 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:10 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -48,7 +48,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:34 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:51:19 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -123,13 +123,13 @@ controller function, outside of the 300 tick condition:</p>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:34 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:10 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -158,13 +158,13 @@ exports.pointToCoordinateArray = pointToCoordinateArray;
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addStreetLayerIntersections">addStreetLayerIntersections</a></li><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#checkEndExcess">checkEndExcess</a></li><li><a href="global.html#checkStartExcess">checkStartExcess</a></li><li><a href="global.html#decodeCoordString">decodeCoordString</a></li><li><a href="global.html#encodeLatLng">encodeLatLng</a></li><li><a href="global.html#generateUnitFeatures">generateUnitFeatures</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#getStreetFeatures">getStreetFeatures</a></li><li><a href="global.html#getUnitAnchors">getUnitAnchors</a></li><li><a href="global.html#getUnitFeatures">getUnitFeatures</a></li><li><a href="global.html#getUnitNeighborLayerIDs">getUnitNeighborLayerIDs</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#noOverlaps">noOverlaps</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li><li><a href="global.html#unitsOutOfStreets">unitsOutOfStreets</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:34 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:10 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

2
dist/agentmaps.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1858,13 +1858,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:32 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:08 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -792,7 +792,7 @@
<h4 class="name" id="buildingify"><span class="type-signature"></span>buildingify<span class="signature">(bounding_box, streets_data, street_options<span class="signature-attributes">opt</span>, unit_options<span class="signature-attributes">opt</span>, units_data<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<h4 class="name" id="buildingify"><span class="type-signature"></span>buildingify<span class="signature">(bounding_box, OSM_data, street_options<span class="signature-attributes">opt</span>, unit_options<span class="signature-attributes">opt</span>, unit_layers<span class="signature-attributes">opt</span>, street_layers<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
@ -869,7 +869,7 @@
<tr>
<td class="name"><code>streets_data</code></td>
<td class="name"><code>OSM_data</code></td>
<td class="type">
@ -1152,7 +1152,7 @@
<tr>
<td class="name"><code>units_data</code></td>
<td class="name"><code>unit_layers</code></td>
<td class="type">
@ -1178,7 +1178,40 @@
<td class="description last">If you want to load a previously generated AgentMaps.units object instead of generating one from scarch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.</td>
<td class="description last">If you want to load a previously generated AgentMaps.units object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.</td>
</tr>
<tr>
<td class="name"><code>street_layers</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">If you want to load a previously generated AgentMaps.streets object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.streets featureGroup.</td>
</tr>
@ -1219,7 +1252,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line27">line 27</a>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line28">line 28</a>
</li></ul></dd>
@ -2525,13 +2558,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:32 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:08 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -337,13 +337,13 @@ exports.agentmap = agentmapFactory;
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:32 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:08 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -816,13 +816,13 @@ exports.agent = agent;
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:32 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:08 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -43,30 +43,30 @@ getPathFinder = require('./routing').getPathFinder;
* @instance
*
* @param {Array.&lt;Array.&lt;number>>} bounding_box - The map's top-left and bottom-right coordinates.
* @param {object} streets_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {object} OSM_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {object} [street_options] - An object containing the Leaflet styling options for streets. See available options here: {@link https://leafletjs.com/reference-1.3.2.html#polyline-l-polyline}.
* @param {object} [unit_options] - An object containing the Leaflet &amp; AgentMaps styling options for units.&lt;br/>See available Leaflet options here: {@link https://leafletjs.com/reference-1.3.2.html#polygon-l-polygon}&lt;br/>Additional AgentMaps-specific options are described below.
* @param {number} [unit_options.front_buffer = 6] - The number of meters beetween the front of unit and its street.
* @param {number} [unit_options.side_buffer = 3] - The number of meters between two units on the same street.
* @param {number} [unit_options.length = 14] - The length of the unit in meters along the street.
* @param {number} [unit_options.depth = 18] - The depth of the unit in meters out from its front.
* @param {object} [units_data]- If you want to load a previously generated AgentMaps.units object instead of generating one from scarch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.
* @param {object} [unit_layers]- If you want to load a previously generated AgentMaps.units object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.
* @param {object} [street_layers]- If you want to load a previously generated AgentMaps.streets object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.streets featureGroup.
*/
function buildingify(bounding_box, streets_data, street_options, unit_options, units_data) {
setupStreetFeatures.call(this, streets_data, street_options);
setupUnitFeatures.call(this, bounding_box, streets_data, unit_options, units_data);
function buildingify(bounding_box, OSM_data, street_options, unit_options, unit_layers, street_layers) {
setupStreetFeatures.call(this, OSM_data, street_options);
setupUnitFeatures.call(this, bounding_box, OSM_data, unit_options, unit_layers);
}
/**
* Generate and setup streets based on the provided GeoJSON data.
*
* @param {object} streets_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {object} OSM_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {object} street_options - An object containing the Leaflet styling options for streets.
* @param {object} [street_layers] - If you want to load a previously generated AgentMaps.streets object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.streets featureGroup.
*/
function setupStreetFeatures(streets_data, street_options) {
let street_features = getStreetFeatures(streets_data);
default_options = {
function setupStreetFeatures(OSM_data, street_options, street_layers) {
let default_options = {
"color": "yellow",
"weight": 4,
"opacity": .5
@ -74,10 +74,19 @@ function setupStreetFeatures(streets_data, street_options) {
street_options = Object.assign(default_options, street_options);
let street_feature_collection = {
type: "FeatureCollection",
features: street_features
};
let street_feature_collection;
if (typeof(street_layers) === "undefined") {
let street_features = getStreetFeatures(OSM_data);
street_feature_collection = {
type: "FeatureCollection",
features: street_features
};
}
else {
street_feature_collection = street_layers;
}
this.streets = L.geoJSON(
street_feature_collection,
@ -86,18 +95,18 @@ function setupStreetFeatures(streets_data, street_options) {
//Map streets' OSM IDs to their Leaflet IDs.
this.streets.id_map = {};
//Having added the streets as layers to the map, do any processing that requires access to those layers.
this.streets.eachLayer(function(street) {
this.streets.id_map[street.feature.id] = street._leaflet_id;
addStreetLayerIntersections.call(this, street);
}, this);
//Add general graph-making and path-finder-making methods to Agentmap, in case streets are added, removed, or modified mid-simulation.
this.streetsToGraph = streetsToGraph,
this.getPathFinder = getPathFinder;
this.getPathFinder = getPathFinder;
this.streets.graph = streetsToGraph(this.streets),
this.pathfinder = getPathFinder(this.streets.graph);
}
@ -106,15 +115,15 @@ function setupStreetFeatures(streets_data, street_options) {
* Get all streets from the GeoJSON data.
* @private
*
* @param {Object} streets_data - A GeoJSON Feature Collection object containing the OSM streets inside the bounding box.
* @param {Object} OSM_data - A GeoJSON Feature Collection object containing the OSM streets inside the bounding box.
* @returns {Array&lt;Feature>} - array of street features.
*/
function getStreetFeatures(streets_data) {
function getStreetFeatures(OSM_data) {
let street_features = [];
for (let i = 0; i &lt; streets_data.features.length; ++i) {
let feature = streets_data.features[i];
for (let i = 0; i &lt; OSM_data.features.length; ++i) {
let feature = OSM_data.features[i];
if (feature.geometry.type === "LineString" &amp;&amp; feature.properties.highway) {
let street_feature = feature;
@ -161,11 +170,11 @@ function addStreetLayerIntersections(street) {
* Generate and setup building units based on the provided GeoJSON data.
*
* @param {Array.&lt;Array.&lt;number>>} bounding_box - The map's top-left and bottom-right coordinates.
* @param {object} streets_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {object} OSM_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {object} unit_options - An object containing the Leaflet &amp; AgentMaps styling options for units.
* @param {object} [units_data] - If you want to load a previously generated AgentMaps.units object instead of generating one from scarch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.
* @param {object} [unit_layers] - If you want to load a previously generated AgentMaps.units object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.
*/
function setupUnitFeatures(bounding_box, streets_data, unit_options = {}, units_data) {
function setupUnitFeatures(bounding_box, OSM_data, unit_options = {}, unit_layers) {
let default_options = {
"color": "green",
"weight": 1,
@ -180,10 +189,10 @@ function setupUnitFeatures(bounding_box, streets_data, unit_options = {}, units_
let unit_feature_collection;
//If no units_data is supplied, generate the units from scratch.
if (typeof(units_data) === "undefined") {
//If no unit_layers is supplied, generate the units from scratch.
if (typeof(unit_layers) === "undefined") {
//Bind getUnitFeatures to "this" so it can access the agentmap as "this.agentmap".
let unit_features = getUnitFeatures.bind(this)(bounding_box, streets_data, unit_options);
let unit_features = getUnitFeatures.bind(this)(bounding_box, OSM_data, unit_options);
unit_feature_collection = {
type: "FeatureCollection",
@ -191,7 +200,7 @@ function setupUnitFeatures(bounding_box, streets_data, unit_options = {}, units_
};
}
else {
unit_feature_collection = units_data;
unit_feature_collection = unit_layers;
}
this.units = L.geoJSON(
@ -201,7 +210,7 @@ function setupUnitFeatures(bounding_box, streets_data, unit_options = {}, units_
//Having added the units as layers to the map, do any processing that requires access to those layers.
this.units.eachLayer(function(unit) {
if (typeof(units_data) === "undefined") {
if (typeof(unit_layers) === "undefined") {
unit.street_id = unit.feature.properties.street_id;
}
else {
@ -248,11 +257,11 @@ function getUnitNeighborLayerIDs(neighbors) {
* @private
*
* @param {Array.&lt;Array.&lt;number>>} bounding_box - The map's top-left and bottom-right coordinates.
* @param {Object} streets_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {Object} OSM_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
* @param {object} unit_options - An object containing the AgentMaps styling options for units.
* @returns {Array&lt;Feature>} - array of features representing real estate units.
* @returns {Array&lt;Feature>} - Array of features representing real estate units.
*/
function getUnitFeatures(bounding_box, streets_data, unit_options) {
function getUnitFeatures(bounding_box, OSM_data, unit_options) {
let proposed_unit_features = [];
this.streets.eachLayer(function(layer) {
@ -438,7 +447,6 @@ function unitsOutOfStreets(unit_features, street_layers) {
* @returns {boolean} - Whether the polygon_feature overlaps with any one in the array.
*/
function noOverlaps(reference_polygon_feature, polygon_feature_array) {
//return true;
for (feature_array_element of polygon_feature_array) {
let overlap_exists = intersect(reference_polygon_feature, feature_array_element);
if (overlap_exists) {
@ -450,6 +458,7 @@ function noOverlaps(reference_polygon_feature, polygon_feature_array) {
}
Agentmap.prototype.buildingify = buildingify;
exports.buildingify = buildingify;
</code></pre>
</article>
</section>
@ -460,13 +469,13 @@ Agentmap.prototype.buildingify = buildingify;
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:32 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:08 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -89,10 +89,18 @@ agentmap.buildingify(my_data, [[43.3071, -88.0158], [43.2884, -87.9759]]);
`Agentmap.buildingify` accepts more arguments specifying the dimension and appearance of the units and streets it will build. For more on that, see the section on [Feature Styling](#feature-styling).
`Agentmap.buildingify` does a lot of work checking for and removing overlapping units, and so the bigger your neighborhood, the noticeably longer it will take.
To compensate for this and help make your simulation more responsive, `Agentmap.buildingify`'s last parameter, after the styling options, accepts a `units_data` object: a GeoJSON FeatureGroup of units.
If one is passed as an argument, instead of generating the units from scratch, `Agentmap.buildingify` will more quickly just use the blueprints in `units_data`.
To compensate for this and help make your simulation more responsive, `Agentmap.buildingify`'s last two parameters, after the styling options, accept a `unit_layers` object and `street_layers` object respectively: a GeoJSON FeatureGroup of units or streets exported from a previous AgentMaps simulation.
If either of these is passed as an argument, instead of generating the unit or street layers from scratch, `Agentmap.buildingify` will more quickly just use the blueprints in `unit_layers` and `street_layers`.
How do you get a `units_data` object? Agentmaps have an [Agentmap.downloadUnits](./Agentmap.html#downloadUnits) method which, when called, will generate a *js* file containing a single variable named `units_data` defined as the vale of `Agentmap.units.toGeoJSON()`.
How do you get a `unit_layers` or `street_layers` object? Agentmaps have an
[Agentmap.downloadUnits](./Agentmap.html#downloadUnits) method and a [Agentmap.downloadStreets](./Agentmap.html#downloadStreets)
method which, when called, will generate a *js* file containing a single variable named `unit_data` or `street_data` defined as the vale of `Agentmap.units.toGeoJSON(20)` or `Agentmap.streets.toGeoJSON(20)` respectively.
What if your OSM street data is too big for a browser to feasibly generate all the appropriate building layers?
The npm package comes with a command line tool named "featuretool" which, given the bounding coordinates and path to a file containing OSM-style GeoJSON, generates all the appropriate layers and exports them to files similar to those that `Agentmap.downloadUnits` and `Agentmap.downloadStreets` generate.
To use it, you need to have installed AgentMaps globally with `npm install -g AgentMaps`.
To use featuretool, you'd do something like this: `featuretool --bbox [[39.9058,-86.0910],[39.8992,-86.1017]] --streets data/townmap.js`.
## <a name="navigating-streets"></a>Navigating Streets

View File

@ -1188,7 +1188,7 @@
<h4 class="name" id="setupStreetFeatures"><span class="type-signature"></span>setupStreetFeatures<span class="signature">(streets_data, street_options)</span><span class="type-signature"></span></h4>
<h4 class="name" id="setupStreetFeatures"><span class="type-signature"></span>setupStreetFeatures<span class="signature">(OSM_data, street_options, street_layers<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
@ -1220,6 +1220,8 @@
<th>Type</th>
<th>Attributes</th>
@ -1232,7 +1234,7 @@
<tr>
<td class="name"><code>streets_data</code></td>
<td class="name"><code>OSM_data</code></td>
<td class="type">
@ -1245,6 +1247,14 @@
</td>
<td class="attributes">
</td>
@ -1268,6 +1278,14 @@
</td>
<td class="attributes">
</td>
@ -1275,6 +1293,39 @@
</tr>
<tr>
<td class="name"><code>street_layers</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">If you want to load a previously generated AgentMaps.streets object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.streets featureGroup.</td>
</tr>
</tbody>
</table>
@ -1312,7 +1363,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line38">line 38</a>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line40">line 40</a>
</li></ul></dd>
@ -1346,7 +1397,7 @@
<h4 class="name" id="setupUnitFeatures"><span class="type-signature"></span>setupUnitFeatures<span class="signature">(bounding_box, streets_data, unit_options, units_data<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<h4 class="name" id="setupUnitFeatures"><span class="type-signature"></span>setupUnitFeatures<span class="signature">(bounding_box, OSM_data, unit_options, unit_layers<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
@ -1423,7 +1474,7 @@
<tr>
<td class="name"><code>streets_data</code></td>
<td class="name"><code>OSM_data</code></td>
<td class="type">
@ -1485,7 +1536,7 @@
<tr>
<td class="name"><code>units_data</code></td>
<td class="name"><code>unit_layers</code></td>
<td class="type">
@ -1511,7 +1562,7 @@
<td class="description last">If you want to load a previously generated AgentMaps.units object instead of generating one from scarch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.</td>
<td class="description last">If you want to load a previously generated AgentMaps.units object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.</td>
</tr>
@ -1552,7 +1603,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line140">line 140</a>
<a href="buildings.js.html">buildings.js</a>, <a href="buildings.js.html#line149">line 149</a>
</li></ul></dd>
@ -2788,13 +2839,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:32 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:08 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -1,14 +0,0 @@
# Extra
This file will keep track of extensions to and applications of AgentMaps.
## Applications
Here are some applications people have made using AgentMaps:
* [Simple](https://noncomputable.github.io/AgentMaps/demos/simple/simple.html) by Andrew: Shows all the different ways agents can travel around a map.
* [Epidemic](https://noncomputable.github.io/AgentMaps/demos/epidemic/epidemic.html) by Andrew: Agents commute between different parts of a neighborhood while an infection spreads between them.
## Extensions
Here are some extensions people have made, which improve or broaden the AgentMaps library:

View File

@ -96,9 +96,15 @@ These FeatureGroups can be looped through like any other Leaflet FeatureGroup (u
stored in a variable <code>my_data</code> and the coordinates of the top left and bottom right corners of the bounding rectangle are <code>[43.3071, -88.0158]</code> and <code>[43.2884, -87.9759]</code> respectively, the corresponding call to <code>Agentmap.buildingify</code> would look something like:</p>
<pre class="prettyprint source lang-javascript"><code>agentmap.buildingify(my_data, [[43.3071, -88.0158], [43.2884, -87.9759]]);</code></pre><p><code>Agentmap.buildingify</code> accepts more arguments specifying the dimension and appearance of the units and streets it will build. For more on that, see the section on <a href="#feature-styling">Feature Styling</a>.</p>
<p><code>Agentmap.buildingify</code> does a lot of work checking for and removing overlapping units, and so the bigger your neighborhood, the noticeably longer it will take.
To compensate for this and help make your simulation more responsive, <code>Agentmap.buildingify</code>'s last parameter, after the styling options, accepts a <code>units_data</code> object: a GeoJSON FeatureGroup of units.
If one is passed as an argument, instead of generating the units from scratch, <code>Agentmap.buildingify</code> will more quickly just use the blueprints in <code>units_data</code>.</p>
<p>How do you get a <code>units_data</code> object? Agentmaps have an <a href="./Agentmap.html#downloadUnits">Agentmap.downloadUnits</a> method which, when called, will generate a <em>js</em> file containing a single variable named <code>units_data</code> defined as the vale of <code>Agentmap.units.toGeoJSON()</code>.</p>
To compensate for this and help make your simulation more responsive, <code>Agentmap.buildingify</code>'s last two parameters, after the styling options, accept a <code>unit_layers</code> object and <code>street_layers</code> object respectively: a GeoJSON FeatureGroup of units or streets exported from a previous AgentMaps simulation.
If either of these is passed as an argument, instead of generating the unit or street layers from scratch, <code>Agentmap.buildingify</code> will more quickly just use the blueprints in <code>unit_layers</code> and <code>street_layers</code>.</p>
<p>How do you get a <code>unit_layers</code> or <code>street_layers</code> object? Agentmaps have an
<a href="./Agentmap.html#downloadUnits">Agentmap.downloadUnits</a> method and a <a href="./Agentmap.html#downloadStreets">Agentmap.downloadStreets</a>
method which, when called, will generate a <em>js</em> file containing a single variable named <code>unit_data</code> or <code>street_data</code> defined as the vale of <code>Agentmap.units.toGeoJSON(20)</code> or <code>Agentmap.streets.toGeoJSON(20)</code> respectively.</p>
<p>What if your OSM street data is too big for a browser to feasibly generate all the appropriate building layers?
The npm package comes with a command line tool named &quot;featuretool&quot; which, given the bounding coordinates and path to a file containing OSM-style GeoJSON, generates all the appropriate layers and exports them to files similar to those that <code>Agentmap.downloadUnits</code> and <code>Agentmap.downloadStreets</code> generate.
To use it, you need to have installed AgentMaps globally with <code>npm install -g AgentMaps</code>.</p>
<p>To use featuretool, you'd do something like this: <code>featuretool --bbox [[39.9058,-86.0910],[39.8992,-86.1017]] --streets data/townmap.js</code>.</p>
<h2><a name="navigating-streets"></a>Navigating Streets</h2><p>Given a neighborhood's streets in GeoJSON, AgentMaps extracts a street network and converts it to a <a href="https://en.wikipedia.org/wiki/Graph_(discrete_mathematics">graph</a> with the help of the <a href="https://github.com/anvaka/ngraph.graph">ngraph.graph</a> library. Then, it uses <a href="https://github.com/anvaka/ngraph.path">ngraph.path</a> to find an (approximately) shortest path. The graph itself is made out of the start point, end point, and intersections of each street.</p>
<p>The graph is stored in the <code>Agentmap.streets.graph</code> property. It is a symmetric graph; for each edge between two points, an inversely directed edge between them also exists. That is, by default, there are no one-way streets. However, if you'd like to remove some of the directed edges of certain streets from the graph (i.e. for making one-way streets), a very accessible guide to manipulating the graphs is available in the ngraph.graph <a href="https://github.com/anvaka/ngraph.graph/blob/master/README.md">README</a>.</p>
<h2><a name="navigating-within-units"></a>Navigating Within Units</h2><p>Every Agentmap has an <a href="./Agentmap.html#.getUnitPoint">Agentmap.getUnitPoint</a> method which makes it easy to specify a position inside of a unit, relative to one of its corners, and get back the global coordinates of that spot. </p>
@ -235,13 +241,13 @@ and a new animation frame will be requested to do the same thing over again.</p>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:32 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:08 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -74,13 +74,13 @@
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:32 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:08 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -314,13 +314,13 @@ exports.encodeLatLng = encodeLatLng;
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:32 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:08 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -48,7 +48,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:32 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:51:17 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -123,13 +123,13 @@ controller function, outside of the 300 tick condition:</p>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:32 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:08 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -158,13 +158,13 @@ exports.pointToCoordinateArray = pointToCoordinateArray;
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-extra.html">extra</a></li><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Agent.html">Agent</a></li><li><a href="Agentmap.html">Agentmap</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-quickstart.html">quickstart</a></li></ul><h3>Global</h3><ul><li><a href="global.html#agent">agent</a></li><li><a href="global.html#agentmap">agentmap</a></li><li><a href="global.html#getIntersections">getIntersections</a></li><li><a href="global.html#getPathFinder">getPathFinder</a></li><li><a href="global.html#isPointCoordinates">isPointCoordinates</a></li><li><a href="global.html#pointToCoordinateArray">pointToCoordinateArray</a></li><li><a href="global.html#reversedCoordinates">reversedCoordinates</a></li><li><a href="global.html#setupStreetFeatures">setupStreetFeatures</a></li><li><a href="global.html#setupUnitFeatures">setupUnitFeatures</a></li><li><a href="global.html#streetsToGraph">streetsToGraph</a></li><li><a href="global.html#streetToGraph">streetToGraph</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Sep 12 2018 22:42:32 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Sep 27 2018 12:52:08 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>

View File

@ -40,7 +40,9 @@ You can find the corresponding code under _/demos_ in the gh-pages branch [here]
### Plugins
[Spritegents](https://github.com/noncomputable/AgentMaps-Spritegents): Lets you depict agents with custom icons instead of circles.
[IconAgents](https://github.com/noncomputable/AgentMaps-IconAgents): Lets you depict agents with custom icons instead of circles.
---
Thank you to anyone who somehow benefits from this.

File diff suppressed because one or more lines are too long

4208
resources/tool_map_data.js Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long