MCPcopy Create free account
hub / github.com/PJLab-ADG/OASim / run

Method run

hmi/routeEdit/gui.py:71–94  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

69 self.planner = TrafficManager(model)
70
71 def run(self):
72 self.model.start()
73 while not self.model.tpEnd and self.model.is_gui_running:
74 self.model.moveStep()
75 # if self.model.timeStep % 2 == 0:
76 self.updateWindow.emit()
77 time.sleep(0.01)
78 if self.model.timeStep % 5 == 0:
79 roadgraph, vehicles = self.model.exportSce()
80 if self.model.tpStart and roadgraph:
81 trajectories = self.planner.plan(
82 self.model.timeStep * 0.1, roadgraph, vehicles
83 )
84 if len(trajectories) == 0:
85 self.planningError.emit()
86 # print('Sorry. Route planning failed. Please choose another route.')
87 break
88 self.model.setTrajectories(trajectories)
89 else:
90 self.model.ego.exitControlMode()
91 self.model.updateVeh()
92
93 self.model.destroy()
94 self.finished.emit()
95
96
97class myQGraphicsPolygonItem(QGraphicsPolygonItem):

Callers

nothing calls this directly

Calls 8

exitControlModeMethod · 0.80
startMethod · 0.45
moveStepMethod · 0.45
exportSceMethod · 0.45
planMethod · 0.45
setTrajectoriesMethod · 0.45
updateVehMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected