Skip to content

Commit

Permalink
make Boid-Flockers and BankReserves standards-compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed May 14, 2018
1 parent 4bf8e5b commit 3c69896
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion examples/bank_reserves/bank_reserves/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_total_loans(model):
return np.sum(agent_loans)


class BankReservesModel(Model):
class BankReserves(Model):

# grid height
grid_h = 20
Expand Down
4 changes: 2 additions & 2 deletions examples/bank_reserves/bank_reserves/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from mesa.visualization.modules import CanvasGrid, ChartModule
from mesa.visualization.UserParam import UserSettableParameter
from bank_reserves.agents import Person
from bank_reserves.model import BankReservesModel
from bank_reserves.model import BankReserves

"""
Citation:
Expand Down Expand Up @@ -66,7 +66,7 @@ def person_portrayal(agent):
{"Label": "Middle Class", "Color": MID_COLOR}])

# create instance of Mesa ModularServer
server = ModularServer(BankReservesModel, [canvas_element, chart_element],
server = ModularServer(BankReserves, [canvas_element, chart_element],
"Bank Reserves Model",
model_params=model_params
)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from .boid import Boid


class BoidModel(Model):
class BoidFlockers(Model):
'''
Flocker model class. Handles agent creation, placement and scheduling.
'''
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from mesa.visualization.ModularVisualization import ModularServer

from .model import BoidModel
from .model import BoidServer
from .SimpleContinuousModule import SimpleCanvas


Expand All @@ -18,4 +18,4 @@ def boid_draw(agent):
"separation": 2
}

server = ModularServer(BoidModel, [boid_canvas], "Boids", model_params)
server = ModularServer(BoidServer, [boid_canvas], "Boids", model_params)
2 changes: 1 addition & 1 deletion examples/boid-flockers/run.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from boidflockers.server import server
from boid_flockers.server import server

server.launch()
12 changes: 0 additions & 12 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,6 @@ def test_examples(self):
model = Model()
(model.step() for _ in range(100))

def test_bank_reserves(self):
with self.active_example_dir('bank_reserves'):
from bank_reserves.model import BankReservesModel
model = BankReservesModel()
(model.step() for _ in range(100))

def test_boid_flockers(self):
with self.active_example_dir('boid-flockers'):
from boidflockers.model import BoidModel
model = BoidModel()
(model.step() for _ in range(100))

def test_boltzmann_wealth_model(self):
with self.active_example_dir('boltzmann_wealth_model'):
from wealth_model.model import MoneyModel
Expand Down

0 comments on commit 3c69896

Please sign in to comment.