-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
54 lines (42 loc) · 1019 Bytes
/
config.py
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import random
import bus_line
import bus_stop
import lane
STREETS = 5
BLOCK_LENGTH = 100
ROAD_LENGTH = STREETS * 100
CHANCES_TO_ADD_AT_BEGINNING = 0.6
DELAY_PER_PERSON = 1
MIN_LANES_OCCUPIED = 4
MIN_CARS_PER_LANE = 10
config_lanes = [
lane.Lane(),
lane.Lane(True),
lane.Lane(),
lane.Lane(),
]
config_lanes[0].exclusive = True
config_lanes[1].exclusive = True
line_1 = bus_line.BusLine([
bus_stop.BusStop(i) for i in range(40, ROAD_LENGTH, 200)
], 70)
line_2 = bus_line.BusLine([
bus_stop.BusStop(i) for i in range(140, ROAD_LENGTH, 200)
], 120)
line_3 = bus_line.BusLine([
bus_stop.BusStop(i) for i in range(80, ROAD_LENGTH, 200)
], 110)
line_4 = bus_line.BusLine([
bus_stop.BusStop(i) for i in range(180, ROAD_LENGTH, 200)
], 230)
config_lines = [line_1, line_2, line_3, line_4]
def get_random_people_for_private_car():
p = random.random()
if p < 0.5:
return 1
elif p < 0.8:
return 2
elif p < 0.9:
return 3
else:
return 4