Skip to content

Commit

Permalink
Fix spatial bug when corner connections but no wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
charwick committed Jul 4, 2024
1 parent f9157a9 commit 962c563
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion helipad/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from helipad.agent import Agent, baseAgent
from helipad import utility

__version__ = "1.6.1"
__version__ = "1.6.2"
4 changes: 3 additions & 1 deletion helipad/spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ def at(self, x, y): return self[round(x), round(y)]
def neighbors(self, model):
for patch in model.agents['patch']:
neighbors = [(patch.right, 1), (patch.down, 1)]
if self.corners: neighbors += [(patch.down.right, self.corners), (patch.left.down, self.corners)]
if self.corners:
if patch.down and patch.down.right: neighbors.append((patch.down.right, self.corners))
if patch.left and patch.left.down: neighbors.append((patch.left.down, self.corners))
for n, weight in neighbors:
if n: patch.edges.add(n, 'space', weight=weight)

Expand Down
4 changes: 2 additions & 2 deletions meta.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% set name = "helipad" %}
{% set version = "1.6.1" %}
{% set version = "1.6.2" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/helipad-{{ version }}.tar.gz
sha256: b3baa09f1891a08dd4e47ebf414f62f7612a7b8c139eb0b9b2ce2c801b013f71
sha256: 5b5801daa7fbe8d435dc96504b65eed5670a21709845b113e17453877b366242

build:
noarch: python
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "helipad"
version = "1.6.1"
version = "1.6.2"
authors = [
{ name="C Harwick", email="[email protected]" },
]
Expand Down

0 comments on commit 962c563

Please sign in to comment.