bodice-ripping
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.2 KiB

#!/usr/bin/env python3
import random as rnd
from enum import Enum
class SquareType(Enum):
AISLE = 0
SEAT = 1
height=7
width=32
class GridSquare:
#typ: SquareType, occupant: index
def __init__(self, typ, occupant):
self.typ = typ
self.occupant = occupant
def __str__(self):
return "(%s|%s)" % (str(typ), str(occupant))
def makeGrid():
return [[GridSquare(SquareType.AISLE, 0) for x in range(0,width)] for y in range(0,height)]
class Passenger:
#dest and curr are both 2-tuples
def __init__(self, dest, curr):
self.dest = dest
self.curr = curr
def manhattanDistance(pos1, pos2):
return abs(pos1[0] - pos2[0]) + abs(pos1[1] - pos2[1])
def mooreNeighbourhood(pos):
def nextSquare(passenger, grid):
#simple behaviour for now
for i in
def GenPassList():
border = [Passenger((0, a),(-1,-1)) for a in range(0,3)]
for x in range(1,width):
border.append([Passenger((x, a),(-1,-1)) for a in range(0,3)])
border.append([Passenger((x, a),(-1,-1)) for a in range(4,7)])
return border
grid=makeGrid()
#boarding order
passengers = GenPassList()
def tick():
# print grid
print(grid)