|
@ -5,6 +5,9 @@ class SquareType(Enum): |
|
|
SEAT = 1 |
|
|
SEAT = 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
height=7 |
|
|
|
|
|
width=33 |
|
|
|
|
|
|
|
|
class GridSquare: |
|
|
class GridSquare: |
|
|
def __init__(self, typ, occupant): |
|
|
def __init__(self, typ, occupant): |
|
|
self.typ = typ |
|
|
self.typ = typ |
|
@ -12,11 +15,9 @@ class GridSquare: |
|
|
def __str__(self): |
|
|
def __str__(self): |
|
|
return "(%s|%s)" % (str(typ), str(occupant)) |
|
|
return "(%s|%s)" % (str(typ), str(occupant)) |
|
|
|
|
|
|
|
|
def makeGrid(height, width): |
|
|
def makeGrid(): |
|
|
return [[GridSquare(SquareType.AISLE, 0) for x in range(0,width)] for y in range(0,height)] |
|
|
return [[GridSquare(SquareType.AISLE, 0) for x in range(0,width)] for y in range(0,height)] |
|
|
|
|
|
|
|
|
grid=makeGrid(7,33) |
|
|
|
|
|
|
|
|
|
|
|
class Passenger: |
|
|
class Passenger: |
|
|
#dest and curr are both 2-tuples |
|
|
#dest and curr are both 2-tuples |
|
|
def __init__(self, dest, curr): |
|
|
def __init__(self, dest, curr): |
|
@ -36,6 +37,8 @@ def nextSquare(passenger, grid): |
|
|
def GenPassList(): |
|
|
def GenPassList(): |
|
|
return [] |
|
|
return [] |
|
|
|
|
|
|
|
|
|
|
|
grid=makeGrid() |
|
|
|
|
|
|
|
|
passengers = GenPassList() |
|
|
passengers = GenPassList() |
|
|
|
|
|
|
|
|
def tick(): |
|
|
def tick(): |
|
|