Skip to content

Commit

Permalink
fixed index issue - using the powers of reading comprehension and hel…
Browse files Browse the repository at this point in the history
  • Loading branch information
GondekNP committed Jan 11, 2025
1 parent 721f187 commit 2204884
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 0 additions & 3 deletions vegetation/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@ def cell_portrayal(agent):
# life stage of any Joshua Tree agent in the cell. If there are no agents,
# we color based on elevation.

# patch_life_stages = [agent.life_stage for agent in agent.jotr_agents]

if agent.jotr_max_life_stage and agent.jotr_max_life_stage > 0:

# max_stage = max(patch_life_stages)
rgba = LIFE_STAGE_RGB_VIZ_MAP[agent.jotr_max_life_stage]

else:
Expand Down
9 changes: 6 additions & 3 deletions vegetation/patch/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,13 @@ def __init__(self, model, geometry, crs, age=None, parent_id=None):
# pos = (np.float64(geometry.x), np.float64(geometry.y))
# self._pos = pos

self.indices = (int(self.float_indices[0]), int(self.float_indices[1]))
self.indices = (
int(self.float_indices[0]),
self.model.space.raster_layer.height - int(self.float_indices[1]),
)
self._pos = (
self.indices[0],
self.model.space.raster_layer.height - self.indices[1],
int(self.float_indices[0]),
int(self.float_indices[1]),
)

# TODO: Figure out how to set the life stage on init
Expand Down

0 comments on commit 2204884

Please sign in to comment.