def __init__(self, boardfilename, physicsfilename, draw=False, maxSpeed=None, maxPosAcc=None, maxNegAcc=None): Board.__init__(self, boardfilename, draw) if maxSpeed==None and maxPosAcc==None and maxNegAcc==None: self.moves = readPhysics(physicsfilename) else: try: file = open(physicsfilename, 'r') self.moves = cPickle.load(file) except IOError: self.moves = physics.getAllowedMoves(maxSpeed=maxSpeed, maxPosAcc=maxPosAcc, maxNegAcc=maxNegAcc, vis=False) file = open(physicsfilename, 'w') cPickle.dump(self.moves, file)