diff --git a/ForkliftModel.py b/ForkliftModel.py index abc590c..dbe2d44 100644 --- a/ForkliftModel.py +++ b/ForkliftModel.py @@ -25,17 +25,17 @@ class ForkliftModel(Model): agent = ForkliftAgent(0, self) self.schedule.add(agent) # Add the agent to a random grid cell - x = 3 - y = 2 + x = 5 + y = 5 self.grid.place_agent(agent, (x, y)) agent = PatchAgent(1, self, PatchType.pickUp) self.schedule.add(agent) - self.grid.place_agent(agent, (0, self.grid.height-1)) + self.grid.place_agent(agent, (self.grid.width-1, self.grid.height-1)) agent = PatchAgent(2, self, PatchType.dropOff) self.schedule.add(agent) - self.grid.place_agent(agent, (self.grid.width-1, self.grid.height-1)) + self.grid.place_agent(agent, (0, self.grid.height-1)) for i in range(3): a = PatchAgent(i+3, self, PatchType.item) diff --git a/clock.png b/clock.png new file mode 100644 index 0000000..3e01bbb Binary files /dev/null and b/clock.png differ diff --git a/data/CATEGORY.py b/data/CATEGORY.py new file mode 100644 index 0000000..f7afe7b --- /dev/null +++ b/data/CATEGORY.py @@ -0,0 +1,7 @@ +from enum import Enum + + +class CATEGORY(Enum): + PIZZA = 1 + PASTA = 2 + EGG = 3 \ No newline at end of file diff --git a/data/Game.py b/data/Game.py new file mode 100644 index 0000000..1434394 --- /dev/null +++ b/data/Game.py @@ -0,0 +1,16 @@ +from data.Item import Item +from data.Order import Order + + +class Game: + def __init__(self, id: int, agentPos: (int, int), deliveryPos: (int, int), orderPos: (int,int), stockPilePos: [(int,int)], + deliveryItem: Item, agentHandId: int, orderStock:[id], orderList: [Order] ): + self.id = id + self.agentPos = agentPos + self.deliveryPos = deliveryPos + self.orderPos = orderPos + self.stockPilePos = stockPilePos + self.deliveryItem = deliveryItem + self.agentHandId = agentHandId + self.orderStock = orderStock + self.orderList = orderList \ No newline at end of file diff --git a/data/Item.py b/data/Item.py new file mode 100644 index 0000000..9ba86eb --- /dev/null +++ b/data/Item.py @@ -0,0 +1,7 @@ +from data.CATEGORY import CATEGORY + + +class Item: + def __init__(self, id: int, category: CATEGORY): + self.id = id + self.category = category \ No newline at end of file diff --git a/data/JOB.py b/data/JOB.py new file mode 100644 index 0000000..3374c0c --- /dev/null +++ b/data/JOB.py @@ -0,0 +1,7 @@ +from enum import Enum + + +class JOB(Enum): + FISHERMAN = 1 + FIREFIGHTER = 2 + POLICEMAN = 3 \ No newline at end of file diff --git a/data/Order.py b/data/Order.py new file mode 100644 index 0000000..7407b96 --- /dev/null +++ b/data/Order.py @@ -0,0 +1,8 @@ +from data.JOB import JOB + + +class Order: + def __init__(self, id: int, money: int, job: JOB): + self.id = id + self.money = money + self.job = job \ No newline at end of file diff --git a/data/StockPile.py b/data/StockPile.py new file mode 100644 index 0000000..4581a35 --- /dev/null +++ b/data/StockPile.py @@ -0,0 +1,9 @@ +from data.CATEGORY import CATEGORY +from data.Item import Item + + +class StockPile: + def __init__(self, id: int, category: CATEGORY, itemList: [Item]): + self.id = id + self.category = category + self.itemList = itemList \ No newline at end of file diff --git a/main.py b/main.py index 3ebe508..92eb7fa 100644 --- a/main.py +++ b/main.py @@ -22,12 +22,12 @@ def agent_portrayal(agent): if isinstance(agent, PatchAgent): color = colors[0] if agent.type == PatchType.dropOff: - color = colors[1] + portrayal = {"Shape": "truck.png", "scale": 1.0, "Layer": 0} elif agent.type == PatchType.pickUp: - color = colors[2] + portrayal = {"Shape": "okB00mer.png", "scale": 1.0, "Layer": 0} else: color = colors[random.randrange(13)+3] - portrayal = {"Shape": "rect", + portrayal = {"Shape": "rect", "Filled": "true", "Layer": 0, "Color": color, @@ -36,8 +36,8 @@ def agent_portrayal(agent): return portrayal base = 512 -gridWidth = 6 -gridHeight = 4 +gridWidth = 10 +gridHeight = 10 scale = base/gridWidth grid = CanvasGrid(agent_portrayal, gridWidth, gridHeight, scale*gridWidth, scale*gridHeight) diff --git a/milk.png b/milk.png new file mode 100644 index 0000000..595505d Binary files /dev/null and b/milk.png differ diff --git a/okB00mer.png b/okB00mer.png new file mode 100644 index 0000000..41a47a1 Binary files /dev/null and b/okB00mer.png differ diff --git a/tomatoe.png b/tomatoe.png new file mode 100644 index 0000000..3b68449 Binary files /dev/null and b/tomatoe.png differ diff --git a/truck.png b/truck.png new file mode 100644 index 0000000..8be59f5 Binary files /dev/null and b/truck.png differ