Helipad 1.5 comes with the big improvement of supporting multiple coordinate systems with
model.patches now defining a coordinate system with subclasses of
Patches2D. Helipad comes bundled with a rectangular and (now) a polar coordinate system, along with visualizers for each. Spatial models are initialized by default with rectangular geometry, but can be changed to polar by passing
model.spatial(). Pictured right is the standard sheep and grass population model, but on an 8×16 polar rather than a rectangular grid.
In addition, Helipad 1.5 comes with numerous other improvements to spatial models and more.
- For rectangular geometries, wrapping can now be toggled on a per-axis basis (allowing cylindrical geometries in addition to toroidal) by passing
agent.distanceFrom()now take the shorter path if they can cross a wrap boundary.
- A new setting allows angles to be expressed and set using either degrees or radians. This can be set globally with the static property
baseAgent.angle, which can be set to
'rad'. (This does not modify individual agent objects: orientation is stored internally in radians either way, but
agent.orientationwill report the angle in the units specified by the setting.)
agent.rotateare now available and can be set before a spatial model is initialized. Patches return an orientation of
Nonerather than raising a
RuntimeErrorwill still be raised when trying to set a patch orientation).
model.spatial()has been renamed to
corners, as this generalizes better to non-rectangular geometries. The
diagargument has been deprecated, but aliases
- Rows of patches can be retrieved with
model.patches[None, rownum]. Columns and individual patches continue to be accessed as before using one or two arguments respectively.
'wrap'parameters are deprecated. These settings are now stored in the
model.patches. They are thus no longer settable in the control panel by default, though this behavior can be restored with an additional two lines of code.
- Helipad objects now have more informative
__repr__methods. For example, calling a patch will now display
<Patch at 5,5>rather than
<helipad.agent.Patch object at 0x120c9e490>.
model.timerwill now update the same line when launched from an interactive console, rather than accumulating lines.
- Helipad now remembers the size and position of the visualization window for new model runs.
- Fixed a bug where
selected=Falsewould sometimes be ignored when adding a plot to the
- Localization now no longer installs
_into the global scope.
API Changes in Version 1.5
- ⚠️ spatialRenamed the
cornersin order to accommodate non-square grids.
Agent.orientationto be expressed in either degrees or radians depending on the value of
wrapargument can now take
(False, True)values to set horizontal and vertical wrapping independently.
- baseAgentAdded the
- patchDataReturns a Numpy array rather than a Pandas dataframe.
- checkEntryRenamed the
datatypeto avoid name conflict.