def main(): # Parsing user input parser = ap.ArgumentParser() parser.add_argument( '-i', '--input', nargs='?', required=True, help='Input YAML file name with the problem parameters.') parser.add_argument('-s', '--solution', nargs='?', required=True, help='Input MDP solution file name.') args = parser.parse_args() with open(args.input, 'r') as f: problem = yaml.load(f.read()) with open(args.solution, 'r') as f: data = map(list, zip(*[row for row in csv.reader(f)])) solution = { data[0][0]: [int(d) for d in data[0][1:]], data[1][0]: [float(d) for d in data[1][1:]] } pking = Parking(problem, solution) pking.analyse()
def add(): if request.method == "POST": v_no = request.form['vehicle_number'] v_type = request.form["Type"] obj = pk.Parking(v_type, v_no) pk.get_slot(obj) print(almnt.alloted_small) return redirect(url_for("index"))
def main(): # Parsing user input parser = ap.ArgumentParser() parser.add_argument( '-i', '--input', nargs='?', required=True, help='Input YAML file name with the problem parameters.') parser.add_argument('-o', '--output', nargs='?', required=True, help='Output MDP file name.') parser.add_argument('-v', '--verbose', action='count', help='Verbose mode.') args = parser.parse_args() with open(args.input, 'r') as f: problem = yaml.load(f.read()) pking = Parking(problem) if args.verbose: print pking mdp = Mdp( T=pking.get_transitions(), R=pking.get_rewards(), n=pking.get_num_states(), m=pking.get_num_actions(), ) with open(args.output, 'w') as f: f.write(str(mdp))
def __init__(self): self.parking = Parking.Parking()
def __eq__(self, other): return self.placements == other.placements and self.prix_parking == other.prix_parking def prendre_mesures(self,voiture): tuple_mesures = self.camera.prendre_mesures(voiture) return tuple_mesures def teleporter(self,voiture,parking): self.teleporteur.teleporter(voiture,parking) if __name__=='__main__': app = QtGui.QApplication(sys.argv) acces = Acces() parking = Parking() parking.acces=acces acces.set_parking = parking borne = acces.borne borne.acces=acces borne.showMaximized() pannaux = acces.pannaux pannaux.acces = acces pannaux.mise_a_jour() pannaux.show() app.exec_()