Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions examples/emperor_dilemma/model.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import random

from agents import EmperorAgent
from mesa import Model
from mesa.datacollection import DataCollector
from mesa.discrete_space.grid import OrthogonalMooreGrid

from .agents import EmperorAgent


class EmperorModel(Model):
"""The Emperor's Dilemma Model.
Expand Down
7 changes: 3 additions & 4 deletions examples/hex_ant/model.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import mesa
from agent import Ant
from mesa.discrete_space import HexGrid

from .agent import Ant


class AntForaging(mesa.Model):
"""
Expand Down Expand Up @@ -57,9 +56,9 @@ def _init_environment(self):
# Create the Nest in the center
center = (self.grid.width // 2, self.grid.height // 2)
# Spike the 'home' pheromone at the nest so ants can find it initially
self.grid.pheromone_home[center] = 1.0
self.grid.pheromone_home.data[center] = 1.0
# Mark the home location
self.grid.home[center] = 1
self.grid.home.data[center] = 1

# Scatter some Food Sources
# Create 3 big clusters of food
Expand Down
3 changes: 1 addition & 2 deletions examples/hex_snowflake/hex_snowflake/model.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import mesa
from cell import Cell
from mesa.discrete_space import HexGrid

from .cell import Cell


class HexSnowflake(mesa.Model):
"""Represents the hex grid of cells. The grid is represented by a 2-dimensional array
Expand Down