20 lines
616 B
Python
20 lines
616 B
Python
|
from model import GameMap
|
||
|
from mesa.visualization.modules import CanvasGrid
|
||
|
from mesa.visualization.ModularVisualization import ModularServer
|
||
|
|
||
|
|
||
|
def box_representation(box):
|
||
|
portrayal = {"Shape": "circle",
|
||
|
"Filled": "true",
|
||
|
"Layer": 0,
|
||
|
"Color": "red",
|
||
|
"r": 0.5}
|
||
|
return portrayal
|
||
|
|
||
|
grid = CanvasGrid(box_representation, 10, 10, 500, 500)
|
||
|
server = ModularServer(GameMap,
|
||
|
[grid],
|
||
|
"Map",
|
||
|
{"x":10, "y":10, "boxes_number":5})
|
||
|
server.port = 8521
|
||
|
server.launch()
|