forked from dsadigh/driving-interactions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·27 lines (25 loc) · 838 Bytes
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
import sys
import visualize
import world
import theano as th
from car import UserControlledCar
th.config.optimizer_verbose = True
th.config.allow_gc = False
if __name__ == '__main__':
name = sys.argv[1]
if len(sys.argv)>2 and sys.argv[2]=='fast':
th.config.optimizer = 'fast_compile'
if len(sys.argv)>2 and sys.argv[2]=='FAST':
th.config.mode = 'FAST_COMPILE'
world = getattr(world, name)()
if len(sys.argv)>3 or (len(sys.argv)>2 and sys.argv[2] not in ['fast', 'FAST']):
ctrl = eval(sys.argv[-1])
for car in world.cars:
if isinstance(car, UserControlledCar):
print 'User Car'
car.fix_control(ctrl)
vis = visualize.Visualizer(0.1, name=name)
vis.use_world(world)
vis.main_car = world.cars[0]
vis.run()