test_flatland_envs_sparse_rail_generator.py 76.1 KB
Newer Older
1
2
import unittest
import warnings
3
4
5

import numpy as np

6
from flatland.core.grid.grid_utils import Vec2dOperations as Vec2d
7
8
from flatland.envs.observations import GlobalObsForRailEnv
from flatland.envs.rail_env import RailEnv
9
from flatland.envs.rail_generators import sparse_rail_generator
10
from flatland.envs.line_generators import sparse_line_generator
11
from flatland.utils.rendertools import RenderTool
Erik Nygren's avatar
Erik Nygren committed
12

Egli Adrian (IT-SCI-API-PFI)'s avatar
test    
Egli Adrian (IT-SCI-API-PFI) committed
13

14
def test_sparse_rail_generator():
15
16
    env = RailEnv(width=50, height=50, rail_generator=sparse_rail_generator(max_num_cities=10,
                                                                            max_rails_between_cities=3,
Dipam Chakraborty's avatar
Dipam Chakraborty committed
17
                                                                            seed=1,
18
19
                                                                            grid_mode=False
                                                                            ),
20
                  line_generator=sparse_line_generator(), number_of_agents=10,
Dipam Chakraborty's avatar
Dipam Chakraborty committed
21
22
                  obs_builder_object=GlobalObsForRailEnv(),
                  random_seed=1)
23
    env.reset(False, False)
Dipam Chakraborty's avatar
Dipam Chakraborty committed
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
    # for r in range(env.height):
    #     for c in range(env.width):
    #         if env.rail.grid[r][c] > 0:
    #             print("expected_grid_map[{}][{}] = {}".format(r, c, env.rail.grid[r][c]))
    expected_grid_map = env.rail.grid
    expected_grid_map[4][9] = 16386
    expected_grid_map[4][10] = 1025
    expected_grid_map[4][11] = 1025
    expected_grid_map[4][12] = 1025
    expected_grid_map[4][13] = 1025
    expected_grid_map[4][14] = 1025
    expected_grid_map[4][15] = 1025
    expected_grid_map[4][16] = 1025
    expected_grid_map[4][17] = 1025
    expected_grid_map[4][18] = 1025
    expected_grid_map[4][19] = 1025
    expected_grid_map[4][20] = 1025
    expected_grid_map[4][21] = 1025
    expected_grid_map[4][22] = 17411
    expected_grid_map[4][23] = 17411
    expected_grid_map[4][24] = 1025
    expected_grid_map[4][25] = 1025
    expected_grid_map[4][26] = 1025
    expected_grid_map[4][27] = 1025
    expected_grid_map[4][28] = 5633
    expected_grid_map[4][29] = 5633
    expected_grid_map[4][30] = 4608
    expected_grid_map[5][9] = 49186
52
53
54
    expected_grid_map[5][10] = 1025
    expected_grid_map[5][11] = 1025
    expected_grid_map[5][12] = 1025
Dipam Chakraborty's avatar
Dipam Chakraborty committed
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
    expected_grid_map[5][13] = 1025
    expected_grid_map[5][14] = 1025
    expected_grid_map[5][15] = 1025
    expected_grid_map[5][16] = 1025
    expected_grid_map[5][17] = 1025
    expected_grid_map[5][18] = 1025
    expected_grid_map[5][19] = 1025
    expected_grid_map[5][20] = 1025
    expected_grid_map[5][21] = 1025
    expected_grid_map[5][22] = 2064
    expected_grid_map[5][23] = 32800
    expected_grid_map[5][28] = 32800
    expected_grid_map[5][29] = 32800
    expected_grid_map[5][30] = 32800
    expected_grid_map[6][9] = 49186
    expected_grid_map[6][10] = 1025
    expected_grid_map[6][11] = 1025
    expected_grid_map[6][12] = 1025
    expected_grid_map[6][13] = 1025
    expected_grid_map[6][14] = 1025
    expected_grid_map[6][15] = 1025
    expected_grid_map[6][16] = 1025
    expected_grid_map[6][17] = 1025
    expected_grid_map[6][18] = 1025
    expected_grid_map[6][19] = 1025
    expected_grid_map[6][20] = 1025
    expected_grid_map[6][21] = 1025
    expected_grid_map[6][22] = 1025
    expected_grid_map[6][23] = 2064
    expected_grid_map[6][28] = 32800
    expected_grid_map[6][29] = 32872
    expected_grid_map[6][30] = 37408
    expected_grid_map[7][9] = 32800
    expected_grid_map[7][28] = 32800
    expected_grid_map[7][29] = 32800
    expected_grid_map[7][30] = 32800
    expected_grid_map[8][9] = 32872
    expected_grid_map[8][10] = 4608
    expected_grid_map[8][28] = 49186
    expected_grid_map[8][29] = 34864
    expected_grid_map[8][30] = 32872
    expected_grid_map[8][31] = 4608
    expected_grid_map[9][9] = 49186
    expected_grid_map[9][10] = 34864
    expected_grid_map[9][28] = 32800
    expected_grid_map[9][29] = 32800
    expected_grid_map[9][30] = 32800
    expected_grid_map[9][31] = 32800
    expected_grid_map[10][9] = 32800
    expected_grid_map[10][10] = 32800
    expected_grid_map[10][28] = 32872
    expected_grid_map[10][29] = 37408
    expected_grid_map[10][30] = 49186
    expected_grid_map[10][31] = 2064
    expected_grid_map[11][9] = 32800
    expected_grid_map[11][10] = 32800
    expected_grid_map[11][28] = 32800
    expected_grid_map[11][29] = 32800
    expected_grid_map[11][30] = 32800
    expected_grid_map[12][9] = 32800
    expected_grid_map[12][10] = 32800
    expected_grid_map[12][28] = 32800
    expected_grid_map[12][29] = 49186
    expected_grid_map[12][30] = 34864
    expected_grid_map[12][33] = 16386
    expected_grid_map[12][34] = 1025
    expected_grid_map[12][35] = 1025
    expected_grid_map[12][36] = 1025
    expected_grid_map[12][37] = 1025
    expected_grid_map[12][38] = 5633
    expected_grid_map[12][39] = 17411
    expected_grid_map[12][40] = 1025
    expected_grid_map[12][41] = 1025
    expected_grid_map[12][42] = 1025
    expected_grid_map[12][43] = 5633
    expected_grid_map[12][44] = 17411
    expected_grid_map[12][45] = 1025
    expected_grid_map[12][46] = 4608
    expected_grid_map[13][9] = 32872
    expected_grid_map[13][10] = 37408
    expected_grid_map[13][28] = 32800
    expected_grid_map[13][29] = 32800
    expected_grid_map[13][30] = 32800
    expected_grid_map[13][33] = 32800
    expected_grid_map[13][38] = 72
    expected_grid_map[13][39] = 3089
    expected_grid_map[13][40] = 1025
    expected_grid_map[13][41] = 1025
    expected_grid_map[13][42] = 1025
    expected_grid_map[13][43] = 1097
    expected_grid_map[13][44] = 2064
    expected_grid_map[13][46] = 32800
    expected_grid_map[14][9] = 49186
    expected_grid_map[14][10] = 2064
    expected_grid_map[14][24] = 16386
    expected_grid_map[14][25] = 17411
    expected_grid_map[14][26] = 1025
    expected_grid_map[14][27] = 1025
    expected_grid_map[14][28] = 34864
    expected_grid_map[14][29] = 32800
    expected_grid_map[14][30] = 32872
    expected_grid_map[14][31] = 1025
    expected_grid_map[14][32] = 1025
    expected_grid_map[14][33] = 2064
    expected_grid_map[14][46] = 32800
    expected_grid_map[15][9] = 32800
    expected_grid_map[15][24] = 32800
    expected_grid_map[15][25] = 49186
    expected_grid_map[15][26] = 1025
    expected_grid_map[15][27] = 1025
    expected_grid_map[15][28] = 3089
    expected_grid_map[15][29] = 3089
    expected_grid_map[15][30] = 2064
    expected_grid_map[15][46] = 32800
    expected_grid_map[16][8] = 16386
    expected_grid_map[16][9] = 52275
    expected_grid_map[16][10] = 4608
    expected_grid_map[16][24] = 32800
    expected_grid_map[16][25] = 32800
    expected_grid_map[16][46] = 32800
    expected_grid_map[17][8] = 32800
176
177
    expected_grid_map[17][9] = 32800
    expected_grid_map[17][10] = 32800
Dipam Chakraborty's avatar
Dipam Chakraborty committed
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
    expected_grid_map[17][24] = 32872
    expected_grid_map[17][25] = 37408
    expected_grid_map[17][44] = 16386
    expected_grid_map[17][45] = 17411
    expected_grid_map[17][46] = 34864
    expected_grid_map[18][8] = 32800
    expected_grid_map[18][9] = 32800
    expected_grid_map[18][10] = 32800
    expected_grid_map[18][24] = 49186
    expected_grid_map[18][25] = 34864
    expected_grid_map[18][44] = 32800
    expected_grid_map[18][45] = 32800
    expected_grid_map[18][46] = 32800
    expected_grid_map[19][8] = 32800
    expected_grid_map[19][9] = 32800
    expected_grid_map[19][10] = 32800
    expected_grid_map[19][23] = 16386
    expected_grid_map[19][24] = 34864
    expected_grid_map[19][25] = 32872
    expected_grid_map[19][26] = 4608
    expected_grid_map[19][44] = 32800
    expected_grid_map[19][45] = 32800
    expected_grid_map[19][46] = 32800
    expected_grid_map[20][8] = 32800
    expected_grid_map[20][9] = 32872
    expected_grid_map[20][10] = 37408
    expected_grid_map[20][23] = 32800
    expected_grid_map[20][24] = 32800
    expected_grid_map[20][25] = 32800
    expected_grid_map[20][26] = 32800
    expected_grid_map[20][44] = 32800
    expected_grid_map[20][45] = 32800
    expected_grid_map[20][46] = 32800
    expected_grid_map[21][8] = 32800
212
213
    expected_grid_map[21][9] = 32800
    expected_grid_map[21][10] = 32800
Dipam Chakraborty's avatar
Dipam Chakraborty committed
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
    expected_grid_map[21][23] = 72
    expected_grid_map[21][24] = 37408
    expected_grid_map[21][25] = 49186
    expected_grid_map[21][26] = 2064
    expected_grid_map[21][44] = 32800
    expected_grid_map[21][45] = 32800
    expected_grid_map[21][46] = 32800
    expected_grid_map[22][8] = 49186
    expected_grid_map[22][9] = 34864
    expected_grid_map[22][10] = 32872
    expected_grid_map[22][11] = 4608
    expected_grid_map[22][24] = 32872
    expected_grid_map[22][25] = 37408
    expected_grid_map[22][43] = 16386
    expected_grid_map[22][44] = 2064
    expected_grid_map[22][45] = 32800
    expected_grid_map[22][46] = 32800
    expected_grid_map[23][8] = 32800
    expected_grid_map[23][9] = 32800
    expected_grid_map[23][10] = 32800
    expected_grid_map[23][11] = 32800
    expected_grid_map[23][24] = 49186
    expected_grid_map[23][25] = 34864
    expected_grid_map[23][42] = 16386
    expected_grid_map[23][43] = 33825
    expected_grid_map[23][44] = 17411
    expected_grid_map[23][45] = 3089
    expected_grid_map[23][46] = 2064
    expected_grid_map[24][8] = 32872
    expected_grid_map[24][9] = 37408
    expected_grid_map[24][10] = 49186
    expected_grid_map[24][11] = 2064
    expected_grid_map[24][24] = 32800
    expected_grid_map[24][25] = 32800
    expected_grid_map[24][42] = 32800
    expected_grid_map[24][43] = 32800
    expected_grid_map[24][44] = 32800
    expected_grid_map[25][8] = 32800
252
253
    expected_grid_map[25][9] = 32800
    expected_grid_map[25][10] = 32800
Dipam Chakraborty's avatar
Dipam Chakraborty committed
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
    expected_grid_map[25][24] = 32800
    expected_grid_map[25][25] = 32800
    expected_grid_map[25][42] = 32800
    expected_grid_map[25][43] = 32872
    expected_grid_map[25][44] = 37408
    expected_grid_map[26][8] = 32800
    expected_grid_map[26][9] = 49186
    expected_grid_map[26][10] = 34864
    expected_grid_map[26][24] = 49186
    expected_grid_map[26][25] = 2064
    expected_grid_map[26][42] = 32800
    expected_grid_map[26][43] = 32800
    expected_grid_map[26][44] = 32800
    expected_grid_map[27][8] = 32800
    expected_grid_map[27][9] = 32800
    expected_grid_map[27][10] = 32800
Erik Nygren's avatar
Erik Nygren committed
270
    expected_grid_map[27][24] = 32800
Dipam Chakraborty's avatar
Dipam Chakraborty committed
271
272
273
274
    expected_grid_map[27][42] = 49186
    expected_grid_map[27][43] = 34864
    expected_grid_map[27][44] = 32872
    expected_grid_map[27][45] = 4608
275
276
    expected_grid_map[28][8] = 32800
    expected_grid_map[28][9] = 32800
Dipam Chakraborty's avatar
Dipam Chakraborty committed
277
278
279
280
281
282
283
    expected_grid_map[28][10] = 32800
    expected_grid_map[28][24] = 32872
    expected_grid_map[28][25] = 4608
    expected_grid_map[28][42] = 32800
    expected_grid_map[28][43] = 32800
    expected_grid_map[28][44] = 32800
    expected_grid_map[28][45] = 32800
284
285
    expected_grid_map[29][8] = 32800
    expected_grid_map[29][9] = 32800
Dipam Chakraborty's avatar
Dipam Chakraborty committed
286
287
288
289
290
291
292
    expected_grid_map[29][10] = 32800
    expected_grid_map[29][24] = 49186
    expected_grid_map[29][25] = 34864
    expected_grid_map[29][42] = 32872
    expected_grid_map[29][43] = 37408
    expected_grid_map[29][44] = 49186
    expected_grid_map[29][45] = 2064
293
294
    expected_grid_map[30][8] = 32800
    expected_grid_map[30][9] = 32800
Dipam Chakraborty's avatar
Dipam Chakraborty committed
295
296
297
298
299
300
301
302
    expected_grid_map[30][10] = 32800
    expected_grid_map[30][23] = 16386
    expected_grid_map[30][24] = 34864
    expected_grid_map[30][25] = 32872
    expected_grid_map[30][26] = 4608
    expected_grid_map[30][42] = 32800
    expected_grid_map[30][43] = 32800
    expected_grid_map[30][44] = 32800
Erik Nygren's avatar
Erik Nygren committed
303
    expected_grid_map[31][8] = 32800
Dipam Chakraborty's avatar
Dipam Chakraborty committed
304
305
    expected_grid_map[31][9] = 32872
    expected_grid_map[31][10] = 37408
Erik Nygren's avatar
Erik Nygren committed
306
307
308
    expected_grid_map[31][23] = 32800
    expected_grid_map[31][24] = 32800
    expected_grid_map[31][25] = 32800
Dipam Chakraborty's avatar
Dipam Chakraborty committed
309
310
311
312
    expected_grid_map[31][26] = 32800
    expected_grid_map[31][42] = 32800
    expected_grid_map[31][43] = 49186
    expected_grid_map[31][44] = 34864
Erik Nygren's avatar
Erik Nygren committed
313
    expected_grid_map[32][8] = 32800
314
    expected_grid_map[32][9] = 32800
Dipam Chakraborty's avatar
Dipam Chakraborty committed
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
    expected_grid_map[32][10] = 32800
    expected_grid_map[32][23] = 72
    expected_grid_map[32][24] = 37408
    expected_grid_map[32][25] = 49186
    expected_grid_map[32][26] = 2064
    expected_grid_map[32][42] = 32800
    expected_grid_map[32][43] = 32800
    expected_grid_map[32][44] = 32800
    expected_grid_map[33][8] = 49186
    expected_grid_map[33][9] = 34864
    expected_grid_map[33][10] = 32872
    expected_grid_map[33][11] = 4608
    expected_grid_map[33][24] = 32872
    expected_grid_map[33][25] = 37408
    expected_grid_map[33][41] = 16386
    expected_grid_map[33][42] = 34864
    expected_grid_map[33][43] = 32800
    expected_grid_map[33][44] = 32800
    expected_grid_map[34][8] = 32800
    expected_grid_map[34][9] = 32800
    expected_grid_map[34][10] = 32800
    expected_grid_map[34][11] = 32800
    expected_grid_map[34][24] = 49186
    expected_grid_map[34][25] = 2064
    expected_grid_map[34][41] = 32800
    expected_grid_map[34][42] = 49186
    expected_grid_map[34][43] = 2064
    expected_grid_map[34][44] = 32800
    expected_grid_map[35][8] = 32872
    expected_grid_map[35][9] = 37408
    expected_grid_map[35][10] = 49186
    expected_grid_map[35][11] = 2064
347
    expected_grid_map[35][24] = 32800
Dipam Chakraborty's avatar
Dipam Chakraborty committed
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
    expected_grid_map[35][41] = 32800
    expected_grid_map[35][42] = 32800
    expected_grid_map[35][43] = 16386
    expected_grid_map[35][44] = 2064
    expected_grid_map[36][8] = 32800
    expected_grid_map[36][9] = 32800
    expected_grid_map[36][10] = 32800
    expected_grid_map[36][18] = 16386
    expected_grid_map[36][19] = 17411
    expected_grid_map[36][20] = 1025
    expected_grid_map[36][21] = 1025
    expected_grid_map[36][22] = 1025
    expected_grid_map[36][23] = 17411
    expected_grid_map[36][24] = 52275
    expected_grid_map[36][25] = 5633
    expected_grid_map[36][26] = 5633
    expected_grid_map[36][27] = 4608
    expected_grid_map[36][41] = 32800
    expected_grid_map[36][42] = 32800
    expected_grid_map[36][43] = 32800
    expected_grid_map[37][8] = 32800
    expected_grid_map[37][9] = 49186
    expected_grid_map[37][10] = 34864
    expected_grid_map[37][13] = 16386
    expected_grid_map[37][14] = 1025
    expected_grid_map[37][15] = 1025
    expected_grid_map[37][16] = 1025
    expected_grid_map[37][17] = 1025
    expected_grid_map[37][18] = 2064
    expected_grid_map[37][19] = 32800
    expected_grid_map[37][20] = 16386
    expected_grid_map[37][21] = 1025
    expected_grid_map[37][22] = 1025
    expected_grid_map[37][23] = 2064
    expected_grid_map[37][24] = 72
    expected_grid_map[37][25] = 37408
    expected_grid_map[37][26] = 32800
    expected_grid_map[37][27] = 32800
    expected_grid_map[37][41] = 32800
    expected_grid_map[37][42] = 32800
    expected_grid_map[37][43] = 32800
    expected_grid_map[38][8] = 32800
    expected_grid_map[38][9] = 32800
    expected_grid_map[38][10] = 32800
    expected_grid_map[38][13] = 49186
    expected_grid_map[38][14] = 1025
    expected_grid_map[38][15] = 1025
    expected_grid_map[38][16] = 1025
    expected_grid_map[38][17] = 1025
    expected_grid_map[38][18] = 1025
    expected_grid_map[38][19] = 2064
    expected_grid_map[38][20] = 32800
    expected_grid_map[38][25] = 32800
    expected_grid_map[38][26] = 32800
    expected_grid_map[38][27] = 32800
    expected_grid_map[38][41] = 32800
    expected_grid_map[38][42] = 32800
    expected_grid_map[38][43] = 32800
    expected_grid_map[39][8] = 72
    expected_grid_map[39][9] = 1097
    expected_grid_map[39][10] = 1097
    expected_grid_map[39][11] = 1025
    expected_grid_map[39][12] = 1025
    expected_grid_map[39][13] = 3089
    expected_grid_map[39][14] = 1025
    expected_grid_map[39][15] = 1025
    expected_grid_map[39][16] = 1025
    expected_grid_map[39][17] = 1025
    expected_grid_map[39][18] = 1025
    expected_grid_map[39][19] = 1025
    expected_grid_map[39][20] = 2064
    expected_grid_map[39][25] = 32800
    expected_grid_map[39][26] = 32872
    expected_grid_map[39][27] = 37408
    expected_grid_map[39][41] = 32800
    expected_grid_map[39][42] = 32800
    expected_grid_map[39][43] = 32800
    expected_grid_map[40][25] = 32800
    expected_grid_map[40][26] = 32800
    expected_grid_map[40][27] = 32800
    expected_grid_map[40][41] = 32800
    expected_grid_map[40][42] = 32800
    expected_grid_map[40][43] = 32800
    expected_grid_map[41][25] = 49186
    expected_grid_map[41][26] = 34864
    expected_grid_map[41][27] = 32872
    expected_grid_map[41][28] = 4608
    expected_grid_map[41][41] = 32800
    expected_grid_map[41][42] = 32800
    expected_grid_map[41][43] = 32800
    expected_grid_map[42][25] = 32800
    expected_grid_map[42][26] = 32800
    expected_grid_map[42][27] = 32800
    expected_grid_map[42][28] = 32800
    expected_grid_map[42][41] = 32800
    expected_grid_map[42][42] = 32800
    expected_grid_map[42][43] = 32800
    expected_grid_map[43][25] = 32872
    expected_grid_map[43][26] = 37408
    expected_grid_map[43][27] = 49186
    expected_grid_map[43][28] = 2064
    expected_grid_map[43][41] = 32800
    expected_grid_map[43][42] = 32800
    expected_grid_map[43][43] = 32800
    expected_grid_map[44][25] = 32800
    expected_grid_map[44][26] = 32800
    expected_grid_map[44][27] = 32800
    expected_grid_map[44][30] = 16386
    expected_grid_map[44][31] = 17411
    expected_grid_map[44][32] = 1025
    expected_grid_map[44][33] = 5633
    expected_grid_map[44][34] = 17411
    expected_grid_map[44][35] = 1025
    expected_grid_map[44][36] = 1025
    expected_grid_map[44][37] = 1025
    expected_grid_map[44][38] = 5633
    expected_grid_map[44][39] = 17411
    expected_grid_map[44][40] = 1025
    expected_grid_map[44][41] = 3089
    expected_grid_map[44][42] = 3089
    expected_grid_map[44][43] = 2064
    expected_grid_map[45][25] = 32800
    expected_grid_map[45][26] = 49186
    expected_grid_map[45][27] = 34864
472
473
    expected_grid_map[45][30] = 32800
    expected_grid_map[45][31] = 32800
Dipam Chakraborty's avatar
Dipam Chakraborty committed
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
    expected_grid_map[45][33] = 72
    expected_grid_map[45][34] = 3089
    expected_grid_map[45][35] = 1025
    expected_grid_map[45][36] = 1025
    expected_grid_map[45][37] = 1025
    expected_grid_map[45][38] = 1097
    expected_grid_map[45][39] = 2064
    expected_grid_map[46][25] = 32800
    expected_grid_map[46][26] = 32800
    expected_grid_map[46][27] = 32800
    expected_grid_map[46][30] = 32800
    expected_grid_map[46][31] = 32800
    expected_grid_map[47][25] = 72
    expected_grid_map[47][26] = 1097
    expected_grid_map[47][27] = 1097
    expected_grid_map[47][28] = 1025
    expected_grid_map[47][29] = 1025
    expected_grid_map[47][30] = 3089
492
    expected_grid_map[47][31] = 2064
493
494
495

    # Attention, once we have fixed the generator this needs to be changed!!!!
    expected_grid_map = env.rail.grid
496
497
    assert np.array_equal(env.rail.grid, expected_grid_map), "actual={}, expected={}".format(env.rail.grid,
                                                                                             expected_grid_map)
498
499
500
    s0 = 0
    s1 = 0
    for a in range(env.get_num_agents()):
u214892's avatar
u214892 committed
501
502
        s0 = Vec2d.get_manhattan_distance(env.agents[a].initial_position, (0, 0))
        s1 = Vec2d.get_chebyshev_distance(env.agents[a].initial_position, (0, 0))
Dipam Chakraborty's avatar
Dipam Chakraborty committed
503
504
    assert s0 == 46, "actual={}".format(s0)
    assert s1 == 26, "actual={}".format(s1)
u214892's avatar
u214892 committed
505
506


u214892's avatar
u214892 committed
507
508
509
510
511
512
513
514
def test_sparse_rail_generator_deterministic():
    """Check that sparse_rail_generator runs deterministic over different python versions!"""

    speed_ration_map = {1.: 1.,  # Fast passenger train
                        1. / 2.: 0.,  # Fast freight train
                        1. / 3.: 0.,  # Slow commuter train
                        1. / 4.: 0.}  # Slow freight train

515
516
517
518
519
    env = RailEnv(width=25, height=30, rail_generator=sparse_rail_generator(max_num_cities=5,
                                                                            max_rails_between_cities=3,
                                                                            seed=215545,  # Random seed
                                                                            grid_mode=True
                                                                            ),
Dipam Chakraborty's avatar
Dipam Chakraborty committed
520
                  line_generator=sparse_line_generator(speed_ration_map), number_of_agents=1, random_seed=1)
521
    env.reset()
Erik Nygren's avatar
Erik Nygren committed
522
    # for r in range(env.height):
Dipam Chakraborty's avatar
Dipam Chakraborty committed
523
524
    #     for c in range(env.width):
    #         print("assert env.rail.get_full_transitions({}, {}) == {}, \"[{}][{}]\"".format(r, c,
525
526
    #                                                                                     env.rail.get_full_transitions(
    #                                                                                          r, c), r, c))
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
    assert env.rail.get_full_transitions(0, 1) == 0, "[0][1]"
    assert env.rail.get_full_transitions(0, 2) == 0, "[0][2]"
    assert env.rail.get_full_transitions(0, 3) == 0, "[0][3]"
    assert env.rail.get_full_transitions(0, 4) == 0, "[0][4]"
    assert env.rail.get_full_transitions(0, 5) == 0, "[0][5]"
    assert env.rail.get_full_transitions(0, 6) == 0, "[0][6]"
    assert env.rail.get_full_transitions(0, 7) == 0, "[0][7]"
    assert env.rail.get_full_transitions(0, 8) == 0, "[0][8]"
    assert env.rail.get_full_transitions(0, 9) == 0, "[0][9]"
    assert env.rail.get_full_transitions(0, 10) == 0, "[0][10]"
    assert env.rail.get_full_transitions(0, 11) == 0, "[0][11]"
    assert env.rail.get_full_transitions(0, 12) == 0, "[0][12]"
    assert env.rail.get_full_transitions(0, 13) == 0, "[0][13]"
    assert env.rail.get_full_transitions(0, 14) == 0, "[0][14]"
    assert env.rail.get_full_transitions(0, 15) == 0, "[0][15]"
    assert env.rail.get_full_transitions(0, 16) == 0, "[0][16]"
    assert env.rail.get_full_transitions(0, 17) == 0, "[0][17]"
    assert env.rail.get_full_transitions(0, 18) == 0, "[0][18]"
    assert env.rail.get_full_transitions(0, 19) == 0, "[0][19]"
    assert env.rail.get_full_transitions(0, 20) == 0, "[0][20]"
    assert env.rail.get_full_transitions(0, 21) == 0, "[0][21]"
    assert env.rail.get_full_transitions(0, 22) == 0, "[0][22]"
    assert env.rail.get_full_transitions(0, 23) == 0, "[0][23]"
    assert env.rail.get_full_transitions(0, 24) == 0, "[0][24]"
    assert env.rail.get_full_transitions(1, 0) == 0, "[1][0]"
    assert env.rail.get_full_transitions(1, 1) == 0, "[1][1]"
    assert env.rail.get_full_transitions(1, 2) == 0, "[1][2]"
    assert env.rail.get_full_transitions(1, 3) == 0, "[1][3]"
    assert env.rail.get_full_transitions(1, 4) == 0, "[1][4]"
    assert env.rail.get_full_transitions(1, 5) == 0, "[1][5]"
    assert env.rail.get_full_transitions(1, 6) == 0, "[1][6]"
    assert env.rail.get_full_transitions(1, 7) == 0, "[1][7]"
    assert env.rail.get_full_transitions(1, 8) == 0, "[1][8]"
    assert env.rail.get_full_transitions(1, 9) == 0, "[1][9]"
    assert env.rail.get_full_transitions(1, 10) == 0, "[1][10]"
562
563
    assert env.rail.get_full_transitions(1, 11) == 16386, "[1][11]"
    assert env.rail.get_full_transitions(1, 12) == 1025, "[1][12]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
564
    assert env.rail.get_full_transitions(1, 13) == 17411, "[1][13]"
565
566
567
568
569
    assert env.rail.get_full_transitions(1, 14) == 17411, "[1][14]"
    assert env.rail.get_full_transitions(1, 15) == 1025, "[1][15]"
    assert env.rail.get_full_transitions(1, 16) == 1025, "[1][16]"
    assert env.rail.get_full_transitions(1, 17) == 1025, "[1][17]"
    assert env.rail.get_full_transitions(1, 18) == 1025, "[1][18]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
570
571
572
    assert env.rail.get_full_transitions(1, 19) == 5633, "[1][19]"
    assert env.rail.get_full_transitions(1, 20) == 5633, "[1][20]"
    assert env.rail.get_full_transitions(1, 21) == 4608, "[1][21]"
573
574
575
576
577
578
579
580
581
582
583
584
585
586
    assert env.rail.get_full_transitions(1, 22) == 0, "[1][22]"
    assert env.rail.get_full_transitions(1, 23) == 0, "[1][23]"
    assert env.rail.get_full_transitions(1, 24) == 0, "[1][24]"
    assert env.rail.get_full_transitions(2, 0) == 0, "[2][0]"
    assert env.rail.get_full_transitions(2, 1) == 0, "[2][1]"
    assert env.rail.get_full_transitions(2, 2) == 0, "[2][2]"
    assert env.rail.get_full_transitions(2, 3) == 0, "[2][3]"
    assert env.rail.get_full_transitions(2, 4) == 0, "[2][4]"
    assert env.rail.get_full_transitions(2, 5) == 0, "[2][5]"
    assert env.rail.get_full_transitions(2, 6) == 0, "[2][6]"
    assert env.rail.get_full_transitions(2, 7) == 0, "[2][7]"
    assert env.rail.get_full_transitions(2, 8) == 0, "[2][8]"
    assert env.rail.get_full_transitions(2, 9) == 0, "[2][9]"
    assert env.rail.get_full_transitions(2, 10) == 0, "[2][10]"
587
    assert env.rail.get_full_transitions(2, 11) == 32800, "[2][11]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
588
589
    assert env.rail.get_full_transitions(2, 12) == 16386, "[2][12]"
    assert env.rail.get_full_transitions(2, 13) == 34864, "[2][13]"
590
    assert env.rail.get_full_transitions(2, 14) == 32800, "[2][14]"
591
592
593
594
    assert env.rail.get_full_transitions(2, 15) == 0, "[2][15]"
    assert env.rail.get_full_transitions(2, 16) == 0, "[2][16]"
    assert env.rail.get_full_transitions(2, 17) == 0, "[2][17]"
    assert env.rail.get_full_transitions(2, 18) == 0, "[2][18]"
595
    assert env.rail.get_full_transitions(2, 19) == 32800, "[2][19]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
596
597
    assert env.rail.get_full_transitions(2, 20) == 32800, "[2][20]"
    assert env.rail.get_full_transitions(2, 21) == 32800, "[2][21]"
598
599
600
601
602
603
604
605
606
607
608
609
610
611
    assert env.rail.get_full_transitions(2, 22) == 0, "[2][22]"
    assert env.rail.get_full_transitions(2, 23) == 0, "[2][23]"
    assert env.rail.get_full_transitions(2, 24) == 0, "[2][24]"
    assert env.rail.get_full_transitions(3, 0) == 0, "[3][0]"
    assert env.rail.get_full_transitions(3, 1) == 0, "[3][1]"
    assert env.rail.get_full_transitions(3, 2) == 0, "[3][2]"
    assert env.rail.get_full_transitions(3, 3) == 0, "[3][3]"
    assert env.rail.get_full_transitions(3, 4) == 0, "[3][4]"
    assert env.rail.get_full_transitions(3, 5) == 0, "[3][5]"
    assert env.rail.get_full_transitions(3, 6) == 0, "[3][6]"
    assert env.rail.get_full_transitions(3, 7) == 0, "[3][7]"
    assert env.rail.get_full_transitions(3, 8) == 0, "[3][8]"
    assert env.rail.get_full_transitions(3, 9) == 0, "[3][9]"
    assert env.rail.get_full_transitions(3, 10) == 0, "[3][10]"
612
    assert env.rail.get_full_transitions(3, 11) == 32800, "[3][11]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
613
614
    assert env.rail.get_full_transitions(3, 12) == 32800, "[3][12]"
    assert env.rail.get_full_transitions(3, 13) == 32800, "[3][13]"
615
    assert env.rail.get_full_transitions(3, 14) == 32800, "[3][14]"
616
617
618
619
    assert env.rail.get_full_transitions(3, 15) == 0, "[3][15]"
    assert env.rail.get_full_transitions(3, 16) == 0, "[3][16]"
    assert env.rail.get_full_transitions(3, 17) == 0, "[3][17]"
    assert env.rail.get_full_transitions(3, 18) == 0, "[3][18]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
620
621
622
    assert env.rail.get_full_transitions(3, 19) == 32800, "[3][19]"
    assert env.rail.get_full_transitions(3, 20) == 32872, "[3][20]"
    assert env.rail.get_full_transitions(3, 21) == 37408, "[3][21]"
623
624
625
626
627
628
629
630
631
632
633
634
635
636
    assert env.rail.get_full_transitions(3, 22) == 0, "[3][22]"
    assert env.rail.get_full_transitions(3, 23) == 0, "[3][23]"
    assert env.rail.get_full_transitions(3, 24) == 0, "[3][24]"
    assert env.rail.get_full_transitions(4, 0) == 0, "[4][0]"
    assert env.rail.get_full_transitions(4, 1) == 0, "[4][1]"
    assert env.rail.get_full_transitions(4, 2) == 0, "[4][2]"
    assert env.rail.get_full_transitions(4, 3) == 0, "[4][3]"
    assert env.rail.get_full_transitions(4, 4) == 0, "[4][4]"
    assert env.rail.get_full_transitions(4, 5) == 0, "[4][5]"
    assert env.rail.get_full_transitions(4, 6) == 0, "[4][6]"
    assert env.rail.get_full_transitions(4, 7) == 0, "[4][7]"
    assert env.rail.get_full_transitions(4, 8) == 0, "[4][8]"
    assert env.rail.get_full_transitions(4, 9) == 0, "[4][9]"
    assert env.rail.get_full_transitions(4, 10) == 0, "[4][10]"
637
    assert env.rail.get_full_transitions(4, 11) == 32800, "[4][11]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
638
639
    assert env.rail.get_full_transitions(4, 12) == 32800, "[4][12]"
    assert env.rail.get_full_transitions(4, 13) == 32800, "[4][13]"
640
    assert env.rail.get_full_transitions(4, 14) == 32800, "[4][14]"
641
642
643
644
    assert env.rail.get_full_transitions(4, 15) == 0, "[4][15]"
    assert env.rail.get_full_transitions(4, 16) == 0, "[4][16]"
    assert env.rail.get_full_transitions(4, 17) == 0, "[4][17]"
    assert env.rail.get_full_transitions(4, 18) == 0, "[4][18]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
645
646
647
    assert env.rail.get_full_transitions(4, 19) == 32800, "[4][19]"
    assert env.rail.get_full_transitions(4, 20) == 32800, "[4][20]"
    assert env.rail.get_full_transitions(4, 21) == 32800, "[4][21]"
648
649
650
651
652
653
654
655
656
657
658
659
    assert env.rail.get_full_transitions(4, 22) == 0, "[4][22]"
    assert env.rail.get_full_transitions(4, 23) == 0, "[4][23]"
    assert env.rail.get_full_transitions(4, 24) == 0, "[4][24]"
    assert env.rail.get_full_transitions(5, 0) == 0, "[5][0]"
    assert env.rail.get_full_transitions(5, 1) == 0, "[5][1]"
    assert env.rail.get_full_transitions(5, 2) == 0, "[5][2]"
    assert env.rail.get_full_transitions(5, 3) == 0, "[5][3]"
    assert env.rail.get_full_transitions(5, 4) == 0, "[5][4]"
    assert env.rail.get_full_transitions(5, 5) == 0, "[5][5]"
    assert env.rail.get_full_transitions(5, 6) == 0, "[5][6]"
    assert env.rail.get_full_transitions(5, 7) == 0, "[5][7]"
    assert env.rail.get_full_transitions(5, 8) == 0, "[5][8]"
660
661
    assert env.rail.get_full_transitions(5, 9) == 0, "[5][9]"
    assert env.rail.get_full_transitions(5, 10) == 0, "[5][10]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
662
663
664
    assert env.rail.get_full_transitions(5, 11) == 49186, "[5][11]"
    assert env.rail.get_full_transitions(5, 12) == 3089, "[5][12]"
    assert env.rail.get_full_transitions(5, 13) == 2064, "[5][13]"
665
    assert env.rail.get_full_transitions(5, 14) == 32800, "[5][14]"
Erik Nygren's avatar
Erik Nygren committed
666
    assert env.rail.get_full_transitions(5, 15) == 0, "[5][15]"
667
668
    assert env.rail.get_full_transitions(5, 16) == 0, "[5][16]"
    assert env.rail.get_full_transitions(5, 17) == 0, "[5][17]"
669
    assert env.rail.get_full_transitions(5, 18) == 0, "[5][18]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
670
671
672
673
    assert env.rail.get_full_transitions(5, 19) == 49186, "[5][19]"
    assert env.rail.get_full_transitions(5, 20) == 34864, "[5][20]"
    assert env.rail.get_full_transitions(5, 21) == 32872, "[5][21]"
    assert env.rail.get_full_transitions(5, 22) == 4608, "[5][22]"
674
675
    assert env.rail.get_full_transitions(5, 23) == 0, "[5][23]"
    assert env.rail.get_full_transitions(5, 24) == 0, "[5][24]"
Erik Nygren's avatar
Erik Nygren committed
676
677
678
679
680
681
682
683
684
685
686
    assert env.rail.get_full_transitions(6, 0) == 16386, "[6][0]"
    assert env.rail.get_full_transitions(6, 1) == 17411, "[6][1]"
    assert env.rail.get_full_transitions(6, 2) == 1025, "[6][2]"
    assert env.rail.get_full_transitions(6, 3) == 5633, "[6][3]"
    assert env.rail.get_full_transitions(6, 4) == 17411, "[6][4]"
    assert env.rail.get_full_transitions(6, 5) == 1025, "[6][5]"
    assert env.rail.get_full_transitions(6, 6) == 1025, "[6][6]"
    assert env.rail.get_full_transitions(6, 7) == 1025, "[6][7]"
    assert env.rail.get_full_transitions(6, 8) == 5633, "[6][8]"
    assert env.rail.get_full_transitions(6, 9) == 17411, "[6][9]"
    assert env.rail.get_full_transitions(6, 10) == 1025, "[6][10]"
687
    assert env.rail.get_full_transitions(6, 11) == 3089, "[6][11]"
Erik Nygren's avatar
Erik Nygren committed
688
689
    assert env.rail.get_full_transitions(6, 12) == 1025, "[6][12]"
    assert env.rail.get_full_transitions(6, 13) == 1025, "[6][13]"
690
691
692
693
694
695
696
    assert env.rail.get_full_transitions(6, 14) == 2064, "[6][14]"
    assert env.rail.get_full_transitions(6, 15) == 0, "[6][15]"
    assert env.rail.get_full_transitions(6, 16) == 0, "[6][16]"
    assert env.rail.get_full_transitions(6, 17) == 0, "[6][17]"
    assert env.rail.get_full_transitions(6, 18) == 0, "[6][18]"
    assert env.rail.get_full_transitions(6, 19) == 32800, "[6][19]"
    assert env.rail.get_full_transitions(6, 20) == 32800, "[6][20]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
697
698
    assert env.rail.get_full_transitions(6, 21) == 32800, "[6][21]"
    assert env.rail.get_full_transitions(6, 22) == 32800, "[6][22]"
699
700
    assert env.rail.get_full_transitions(6, 23) == 0, "[6][23]"
    assert env.rail.get_full_transitions(6, 24) == 0, "[6][24]"
Erik Nygren's avatar
Erik Nygren committed
701
702
703
704
705
    assert env.rail.get_full_transitions(7, 0) == 32800, "[7][0]"
    assert env.rail.get_full_transitions(7, 1) == 32800, "[7][1]"
    assert env.rail.get_full_transitions(7, 2) == 0, "[7][2]"
    assert env.rail.get_full_transitions(7, 3) == 72, "[7][3]"
    assert env.rail.get_full_transitions(7, 4) == 3089, "[7][4]"
706
707
708
    assert env.rail.get_full_transitions(7, 5) == 1025, "[7][5]"
    assert env.rail.get_full_transitions(7, 6) == 1025, "[7][6]"
    assert env.rail.get_full_transitions(7, 7) == 1025, "[7][7]"
Erik Nygren's avatar
Erik Nygren committed
709
710
711
712
713
714
715
    assert env.rail.get_full_transitions(7, 8) == 1097, "[7][8]"
    assert env.rail.get_full_transitions(7, 9) == 2064, "[7][9]"
    assert env.rail.get_full_transitions(7, 10) == 0, "[7][10]"
    assert env.rail.get_full_transitions(7, 11) == 0, "[7][11]"
    assert env.rail.get_full_transitions(7, 12) == 0, "[7][12]"
    assert env.rail.get_full_transitions(7, 13) == 0, "[7][13]"
    assert env.rail.get_full_transitions(7, 14) == 0, "[7][14]"
Erik Nygren's avatar
Erik Nygren committed
716
    assert env.rail.get_full_transitions(7, 15) == 0, "[7][15]"
717
718
719
    assert env.rail.get_full_transitions(7, 16) == 0, "[7][16]"
    assert env.rail.get_full_transitions(7, 17) == 0, "[7][17]"
    assert env.rail.get_full_transitions(7, 18) == 0, "[7][18]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
720
721
722
723
    assert env.rail.get_full_transitions(7, 19) == 32872, "[7][19]"
    assert env.rail.get_full_transitions(7, 20) == 37408, "[7][20]"
    assert env.rail.get_full_transitions(7, 21) == 49186, "[7][21]"
    assert env.rail.get_full_transitions(7, 22) == 2064, "[7][22]"
724
    assert env.rail.get_full_transitions(7, 23) == 0, "[7][23]"
725
    assert env.rail.get_full_transitions(7, 24) == 0, "[7][24]"
726
    assert env.rail.get_full_transitions(8, 0) == 32800, "[8][0]"
Erik Nygren's avatar
Erik Nygren committed
727
    assert env.rail.get_full_transitions(8, 1) == 32800, "[8][1]"
728
    assert env.rail.get_full_transitions(8, 2) == 0, "[8][2]"
Erik Nygren's avatar
Erik Nygren committed
729
730
731
732
733
734
735
736
737
    assert env.rail.get_full_transitions(8, 3) == 0, "[8][3]"
    assert env.rail.get_full_transitions(8, 4) == 0, "[8][4]"
    assert env.rail.get_full_transitions(8, 5) == 0, "[8][5]"
    assert env.rail.get_full_transitions(8, 6) == 0, "[8][6]"
    assert env.rail.get_full_transitions(8, 7) == 0, "[8][7]"
    assert env.rail.get_full_transitions(8, 8) == 0, "[8][8]"
    assert env.rail.get_full_transitions(8, 9) == 0, "[8][9]"
    assert env.rail.get_full_transitions(8, 10) == 0, "[8][10]"
    assert env.rail.get_full_transitions(8, 11) == 0, "[8][11]"
Erik Nygren's avatar
Erik Nygren committed
738
    assert env.rail.get_full_transitions(8, 12) == 0, "[8][12]"
Erik Nygren's avatar
Erik Nygren committed
739
740
    assert env.rail.get_full_transitions(8, 13) == 0, "[8][13]"
    assert env.rail.get_full_transitions(8, 14) == 0, "[8][14]"
Erik Nygren's avatar
Erik Nygren committed
741
    assert env.rail.get_full_transitions(8, 15) == 0, "[8][15]"
742
743
    assert env.rail.get_full_transitions(8, 16) == 0, "[8][16]"
    assert env.rail.get_full_transitions(8, 17) == 0, "[8][17]"
744
    assert env.rail.get_full_transitions(8, 18) == 0, "[8][18]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
745
746
747
    assert env.rail.get_full_transitions(8, 19) == 32800, "[8][19]"
    assert env.rail.get_full_transitions(8, 20) == 32800, "[8][20]"
    assert env.rail.get_full_transitions(8, 21) == 32800, "[8][21]"
748
749
    assert env.rail.get_full_transitions(8, 22) == 0, "[8][22]"
    assert env.rail.get_full_transitions(8, 23) == 0, "[8][23]"
750
    assert env.rail.get_full_transitions(8, 24) == 0, "[8][24]"
751
    assert env.rail.get_full_transitions(9, 0) == 32800, "[9][0]"
Erik Nygren's avatar
Erik Nygren committed
752
    assert env.rail.get_full_transitions(9, 1) == 32800, "[9][1]"
753
754
755
756
757
758
759
760
761
762
    assert env.rail.get_full_transitions(9, 2) == 0, "[9][2]"
    assert env.rail.get_full_transitions(9, 3) == 0, "[9][3]"
    assert env.rail.get_full_transitions(9, 4) == 0, "[9][4]"
    assert env.rail.get_full_transitions(9, 5) == 0, "[9][5]"
    assert env.rail.get_full_transitions(9, 6) == 0, "[9][6]"
    assert env.rail.get_full_transitions(9, 7) == 0, "[9][7]"
    assert env.rail.get_full_transitions(9, 8) == 0, "[9][8]"
    assert env.rail.get_full_transitions(9, 9) == 0, "[9][9]"
    assert env.rail.get_full_transitions(9, 10) == 0, "[9][10]"
    assert env.rail.get_full_transitions(9, 11) == 0, "[9][11]"
Erik Nygren's avatar
Erik Nygren committed
763
    assert env.rail.get_full_transitions(9, 12) == 0, "[9][12]"
Erik Nygren's avatar
Erik Nygren committed
764
765
    assert env.rail.get_full_transitions(9, 13) == 0, "[9][13]"
    assert env.rail.get_full_transitions(9, 14) == 0, "[9][14]"
766
767
768
769
    assert env.rail.get_full_transitions(9, 15) == 0, "[9][15]"
    assert env.rail.get_full_transitions(9, 16) == 0, "[9][16]"
    assert env.rail.get_full_transitions(9, 17) == 0, "[9][17]"
    assert env.rail.get_full_transitions(9, 18) == 0, "[9][18]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
770
771
772
    assert env.rail.get_full_transitions(9, 19) == 32800, "[9][19]"
    assert env.rail.get_full_transitions(9, 20) == 49186, "[9][20]"
    assert env.rail.get_full_transitions(9, 21) == 34864, "[9][21]"
773
774
    assert env.rail.get_full_transitions(9, 22) == 0, "[9][22]"
    assert env.rail.get_full_transitions(9, 23) == 0, "[9][23]"
775
    assert env.rail.get_full_transitions(9, 24) == 0, "[9][24]"
776
    assert env.rail.get_full_transitions(10, 0) == 32800, "[10][0]"
Erik Nygren's avatar
Erik Nygren committed
777
    assert env.rail.get_full_transitions(10, 1) == 32800, "[10][1]"
778
779
780
781
782
783
784
785
786
787
    assert env.rail.get_full_transitions(10, 2) == 0, "[10][2]"
    assert env.rail.get_full_transitions(10, 3) == 0, "[10][3]"
    assert env.rail.get_full_transitions(10, 4) == 0, "[10][4]"
    assert env.rail.get_full_transitions(10, 5) == 0, "[10][5]"
    assert env.rail.get_full_transitions(10, 6) == 0, "[10][6]"
    assert env.rail.get_full_transitions(10, 7) == 0, "[10][7]"
    assert env.rail.get_full_transitions(10, 8) == 0, "[10][8]"
    assert env.rail.get_full_transitions(10, 9) == 0, "[10][9]"
    assert env.rail.get_full_transitions(10, 10) == 0, "[10][10]"
    assert env.rail.get_full_transitions(10, 11) == 0, "[10][11]"
Erik Nygren's avatar
Erik Nygren committed
788
    assert env.rail.get_full_transitions(10, 12) == 0, "[10][12]"
Erik Nygren's avatar
Erik Nygren committed
789
790
    assert env.rail.get_full_transitions(10, 13) == 0, "[10][13]"
    assert env.rail.get_full_transitions(10, 14) == 0, "[10][14]"
791
792
793
794
    assert env.rail.get_full_transitions(10, 15) == 0, "[10][15]"
    assert env.rail.get_full_transitions(10, 16) == 0, "[10][16]"
    assert env.rail.get_full_transitions(10, 17) == 0, "[10][17]"
    assert env.rail.get_full_transitions(10, 18) == 0, "[10][18]"
795
    assert env.rail.get_full_transitions(10, 19) == 32800, "[10][19]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
796
797
    assert env.rail.get_full_transitions(10, 20) == 32800, "[10][20]"
    assert env.rail.get_full_transitions(10, 21) == 32800, "[10][21]"
798
799
    assert env.rail.get_full_transitions(10, 22) == 0, "[10][22]"
    assert env.rail.get_full_transitions(10, 23) == 0, "[10][23]"
800
    assert env.rail.get_full_transitions(10, 24) == 0, "[10][24]"
801
    assert env.rail.get_full_transitions(11, 0) == 32800, "[11][0]"
Erik Nygren's avatar
Erik Nygren committed
802
    assert env.rail.get_full_transitions(11, 1) == 32800, "[11][1]"
803
804
805
806
807
808
809
810
811
812
    assert env.rail.get_full_transitions(11, 2) == 0, "[11][2]"
    assert env.rail.get_full_transitions(11, 3) == 0, "[11][3]"
    assert env.rail.get_full_transitions(11, 4) == 0, "[11][4]"
    assert env.rail.get_full_transitions(11, 5) == 0, "[11][5]"
    assert env.rail.get_full_transitions(11, 6) == 0, "[11][6]"
    assert env.rail.get_full_transitions(11, 7) == 0, "[11][7]"
    assert env.rail.get_full_transitions(11, 8) == 0, "[11][8]"
    assert env.rail.get_full_transitions(11, 9) == 0, "[11][9]"
    assert env.rail.get_full_transitions(11, 10) == 0, "[11][10]"
    assert env.rail.get_full_transitions(11, 11) == 0, "[11][11]"
Erik Nygren's avatar
Erik Nygren committed
813
    assert env.rail.get_full_transitions(11, 12) == 0, "[11][12]"
Erik Nygren's avatar
Erik Nygren committed
814
815
    assert env.rail.get_full_transitions(11, 13) == 0, "[11][13]"
    assert env.rail.get_full_transitions(11, 14) == 0, "[11][14]"
816
817
818
819
    assert env.rail.get_full_transitions(11, 15) == 0, "[11][15]"
    assert env.rail.get_full_transitions(11, 16) == 0, "[11][16]"
    assert env.rail.get_full_transitions(11, 17) == 0, "[11][17]"
    assert env.rail.get_full_transitions(11, 18) == 0, "[11][18]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
820
821
822
    assert env.rail.get_full_transitions(11, 19) == 32800, "[11][19]"
    assert env.rail.get_full_transitions(11, 20) == 32800, "[11][20]"
    assert env.rail.get_full_transitions(11, 21) == 32800, "[11][21]"
823
    assert env.rail.get_full_transitions(11, 22) == 0, "[11][22]"
824
825
    assert env.rail.get_full_transitions(11, 23) == 0, "[11][23]"
    assert env.rail.get_full_transitions(11, 24) == 0, "[11][24]"
826
    assert env.rail.get_full_transitions(12, 0) == 32800, "[12][0]"
Erik Nygren's avatar
Erik Nygren committed
827
    assert env.rail.get_full_transitions(12, 1) == 32800, "[12][1]"
828
829
830
831
832
833
834
835
836
837
    assert env.rail.get_full_transitions(12, 2) == 0, "[12][2]"
    assert env.rail.get_full_transitions(12, 3) == 0, "[12][3]"
    assert env.rail.get_full_transitions(12, 4) == 0, "[12][4]"
    assert env.rail.get_full_transitions(12, 5) == 0, "[12][5]"
    assert env.rail.get_full_transitions(12, 6) == 0, "[12][6]"
    assert env.rail.get_full_transitions(12, 7) == 0, "[12][7]"
    assert env.rail.get_full_transitions(12, 8) == 0, "[12][8]"
    assert env.rail.get_full_transitions(12, 9) == 0, "[12][9]"
    assert env.rail.get_full_transitions(12, 10) == 0, "[12][10]"
    assert env.rail.get_full_transitions(12, 11) == 0, "[12][11]"
Erik Nygren's avatar
Erik Nygren committed
838
    assert env.rail.get_full_transitions(12, 12) == 0, "[12][12]"
Erik Nygren's avatar
Erik Nygren committed
839
840
    assert env.rail.get_full_transitions(12, 13) == 0, "[12][13]"
    assert env.rail.get_full_transitions(12, 14) == 0, "[12][14]"
841
842
843
844
    assert env.rail.get_full_transitions(12, 15) == 0, "[12][15]"
    assert env.rail.get_full_transitions(12, 16) == 0, "[12][16]"
    assert env.rail.get_full_transitions(12, 17) == 0, "[12][17]"
    assert env.rail.get_full_transitions(12, 18) == 0, "[12][18]"
845
846
847
    assert env.rail.get_full_transitions(12, 19) == 32800, "[12][19]"
    assert env.rail.get_full_transitions(12, 20) == 32800, "[12][20]"
    assert env.rail.get_full_transitions(12, 21) == 32800, "[12][21]"
848
    assert env.rail.get_full_transitions(12, 22) == 0, "[12][22]"
849
850
    assert env.rail.get_full_transitions(12, 23) == 0, "[12][23]"
    assert env.rail.get_full_transitions(12, 24) == 0, "[12][24]"
851
    assert env.rail.get_full_transitions(13, 0) == 32800, "[13][0]"
Erik Nygren's avatar
Erik Nygren committed
852
    assert env.rail.get_full_transitions(13, 1) == 32800, "[13][1]"
853
854
855
856
857
858
859
860
861
862
    assert env.rail.get_full_transitions(13, 2) == 0, "[13][2]"
    assert env.rail.get_full_transitions(13, 3) == 0, "[13][3]"
    assert env.rail.get_full_transitions(13, 4) == 0, "[13][4]"
    assert env.rail.get_full_transitions(13, 5) == 0, "[13][5]"
    assert env.rail.get_full_transitions(13, 6) == 0, "[13][6]"
    assert env.rail.get_full_transitions(13, 7) == 0, "[13][7]"
    assert env.rail.get_full_transitions(13, 8) == 0, "[13][8]"
    assert env.rail.get_full_transitions(13, 9) == 0, "[13][9]"
    assert env.rail.get_full_transitions(13, 10) == 0, "[13][10]"
    assert env.rail.get_full_transitions(13, 11) == 0, "[13][11]"
Erik Nygren's avatar
Erik Nygren committed
863
    assert env.rail.get_full_transitions(13, 12) == 0, "[13][12]"
Erik Nygren's avatar
Erik Nygren committed
864
865
    assert env.rail.get_full_transitions(13, 13) == 0, "[13][13]"
    assert env.rail.get_full_transitions(13, 14) == 0, "[13][14]"
866
867
868
869
    assert env.rail.get_full_transitions(13, 15) == 0, "[13][15]"
    assert env.rail.get_full_transitions(13, 16) == 0, "[13][16]"
    assert env.rail.get_full_transitions(13, 17) == 0, "[13][17]"
    assert env.rail.get_full_transitions(13, 18) == 0, "[13][18]"
870
871
872
    assert env.rail.get_full_transitions(13, 19) == 32800, "[13][19]"
    assert env.rail.get_full_transitions(13, 20) == 32800, "[13][20]"
    assert env.rail.get_full_transitions(13, 21) == 32800, "[13][21]"
873
    assert env.rail.get_full_transitions(13, 22) == 0, "[13][22]"
874
875
    assert env.rail.get_full_transitions(13, 23) == 0, "[13][23]"
    assert env.rail.get_full_transitions(13, 24) == 0, "[13][24]"
876
    assert env.rail.get_full_transitions(14, 0) == 32800, "[14][0]"
Erik Nygren's avatar
Erik Nygren committed
877
    assert env.rail.get_full_transitions(14, 1) == 32800, "[14][1]"
878
879
880
881
882
883
884
885
886
887
    assert env.rail.get_full_transitions(14, 2) == 0, "[14][2]"
    assert env.rail.get_full_transitions(14, 3) == 0, "[14][3]"
    assert env.rail.get_full_transitions(14, 4) == 0, "[14][4]"
    assert env.rail.get_full_transitions(14, 5) == 0, "[14][5]"
    assert env.rail.get_full_transitions(14, 6) == 0, "[14][6]"
    assert env.rail.get_full_transitions(14, 7) == 0, "[14][7]"
    assert env.rail.get_full_transitions(14, 8) == 0, "[14][8]"
    assert env.rail.get_full_transitions(14, 9) == 0, "[14][9]"
    assert env.rail.get_full_transitions(14, 10) == 0, "[14][10]"
    assert env.rail.get_full_transitions(14, 11) == 0, "[14][11]"
Erik Nygren's avatar
Erik Nygren committed
888
    assert env.rail.get_full_transitions(14, 12) == 0, "[14][12]"
Erik Nygren's avatar
Erik Nygren committed
889
890
    assert env.rail.get_full_transitions(14, 13) == 0, "[14][13]"
    assert env.rail.get_full_transitions(14, 14) == 0, "[14][14]"
891
892
893
894
    assert env.rail.get_full_transitions(14, 15) == 0, "[14][15]"
    assert env.rail.get_full_transitions(14, 16) == 0, "[14][16]"
    assert env.rail.get_full_transitions(14, 17) == 0, "[14][17]"
    assert env.rail.get_full_transitions(14, 18) == 0, "[14][18]"
895
896
897
    assert env.rail.get_full_transitions(14, 19) == 32800, "[14][19]"
    assert env.rail.get_full_transitions(14, 20) == 32800, "[14][20]"
    assert env.rail.get_full_transitions(14, 21) == 32800, "[14][21]"
898
    assert env.rail.get_full_transitions(14, 22) == 0, "[14][22]"
899
900
    assert env.rail.get_full_transitions(14, 23) == 0, "[14][23]"
    assert env.rail.get_full_transitions(14, 24) == 0, "[14][24]"
901
    assert env.rail.get_full_transitions(15, 0) == 32800, "[15][0]"
Erik Nygren's avatar
Erik Nygren committed
902
    assert env.rail.get_full_transitions(15, 1) == 32800, "[15][1]"
903
904
905
906
907
908
909
910
911
912
    assert env.rail.get_full_transitions(15, 2) == 0, "[15][2]"
    assert env.rail.get_full_transitions(15, 3) == 0, "[15][3]"
    assert env.rail.get_full_transitions(15, 4) == 0, "[15][4]"
    assert env.rail.get_full_transitions(15, 5) == 0, "[15][5]"
    assert env.rail.get_full_transitions(15, 6) == 0, "[15][6]"
    assert env.rail.get_full_transitions(15, 7) == 0, "[15][7]"
    assert env.rail.get_full_transitions(15, 8) == 0, "[15][8]"
    assert env.rail.get_full_transitions(15, 9) == 0, "[15][9]"
    assert env.rail.get_full_transitions(15, 10) == 0, "[15][10]"
    assert env.rail.get_full_transitions(15, 11) == 0, "[15][11]"
Erik Nygren's avatar
Erik Nygren committed
913
    assert env.rail.get_full_transitions(15, 12) == 0, "[15][12]"
Erik Nygren's avatar
Erik Nygren committed
914
915
    assert env.rail.get_full_transitions(15, 13) == 0, "[15][13]"
    assert env.rail.get_full_transitions(15, 14) == 0, "[15][14]"
916
917
918
919
    assert env.rail.get_full_transitions(15, 15) == 0, "[15][15]"
    assert env.rail.get_full_transitions(15, 16) == 0, "[15][16]"
    assert env.rail.get_full_transitions(15, 17) == 0, "[15][17]"
    assert env.rail.get_full_transitions(15, 18) == 0, "[15][18]"
920
921
922
    assert env.rail.get_full_transitions(15, 19) == 32800, "[15][19]"
    assert env.rail.get_full_transitions(15, 20) == 32800, "[15][20]"
    assert env.rail.get_full_transitions(15, 21) == 32800, "[15][21]"
923
    assert env.rail.get_full_transitions(15, 22) == 0, "[15][22]"
924
925
    assert env.rail.get_full_transitions(15, 23) == 0, "[15][23]"
    assert env.rail.get_full_transitions(15, 24) == 0, "[15][24]"
Erik Nygren's avatar
Erik Nygren committed
926
927
    assert env.rail.get_full_transitions(16, 0) == 32800, "[16][0]"
    assert env.rail.get_full_transitions(16, 1) == 32800, "[16][1]"
928
929
930
931
932
933
934
935
936
937
    assert env.rail.get_full_transitions(16, 2) == 0, "[16][2]"
    assert env.rail.get_full_transitions(16, 3) == 0, "[16][3]"
    assert env.rail.get_full_transitions(16, 4) == 0, "[16][4]"
    assert env.rail.get_full_transitions(16, 5) == 0, "[16][5]"
    assert env.rail.get_full_transitions(16, 6) == 0, "[16][6]"
    assert env.rail.get_full_transitions(16, 7) == 0, "[16][7]"
    assert env.rail.get_full_transitions(16, 8) == 0, "[16][8]"
    assert env.rail.get_full_transitions(16, 9) == 0, "[16][9]"
    assert env.rail.get_full_transitions(16, 10) == 0, "[16][10]"
    assert env.rail.get_full_transitions(16, 11) == 0, "[16][11]"
Erik Nygren's avatar
Erik Nygren committed
938
    assert env.rail.get_full_transitions(16, 12) == 0, "[16][12]"
Erik Nygren's avatar
Erik Nygren committed
939
940
    assert env.rail.get_full_transitions(16, 13) == 0, "[16][13]"
    assert env.rail.get_full_transitions(16, 14) == 0, "[16][14]"
941
942
943
944
    assert env.rail.get_full_transitions(16, 15) == 0, "[16][15]"
    assert env.rail.get_full_transitions(16, 16) == 0, "[16][16]"
    assert env.rail.get_full_transitions(16, 17) == 0, "[16][17]"
    assert env.rail.get_full_transitions(16, 18) == 0, "[16][18]"
945
946
947
    assert env.rail.get_full_transitions(16, 19) == 32800, "[16][19]"
    assert env.rail.get_full_transitions(16, 20) == 32800, "[16][20]"
    assert env.rail.get_full_transitions(16, 21) == 32800, "[16][21]"
948
    assert env.rail.get_full_transitions(16, 22) == 0, "[16][22]"
949
950
    assert env.rail.get_full_transitions(16, 23) == 0, "[16][23]"
    assert env.rail.get_full_transitions(16, 24) == 0, "[16][24]"
Erik Nygren's avatar
Erik Nygren committed
951
    assert env.rail.get_full_transitions(17, 0) == 32800, "[17][0]"
Erik Nygren's avatar
Erik Nygren committed
952
    assert env.rail.get_full_transitions(17, 1) == 32800, "[17][1]"
953
954
955
956
957
958
959
960
961
962
    assert env.rail.get_full_transitions(17, 2) == 0, "[17][2]"
    assert env.rail.get_full_transitions(17, 3) == 0, "[17][3]"
    assert env.rail.get_full_transitions(17, 4) == 0, "[17][4]"
    assert env.rail.get_full_transitions(17, 5) == 0, "[17][5]"
    assert env.rail.get_full_transitions(17, 6) == 0, "[17][6]"
    assert env.rail.get_full_transitions(17, 7) == 0, "[17][7]"
    assert env.rail.get_full_transitions(17, 8) == 0, "[17][8]"
    assert env.rail.get_full_transitions(17, 9) == 0, "[17][9]"
    assert env.rail.get_full_transitions(17, 10) == 0, "[17][10]"
    assert env.rail.get_full_transitions(17, 11) == 0, "[17][11]"
Erik Nygren's avatar
Erik Nygren committed
963
    assert env.rail.get_full_transitions(17, 12) == 0, "[17][12]"
Erik Nygren's avatar
Erik Nygren committed
964
    assert env.rail.get_full_transitions(17, 13) == 0, "[17][13]"
965
966
967
968
969
    assert env.rail.get_full_transitions(17, 14) == 0, "[17][14]"
    assert env.rail.get_full_transitions(17, 15) == 0, "[17][15]"
    assert env.rail.get_full_transitions(17, 16) == 0, "[17][16]"
    assert env.rail.get_full_transitions(17, 17) == 0, "[17][17]"
    assert env.rail.get_full_transitions(17, 18) == 0, "[17][18]"
970
971
972
    assert env.rail.get_full_transitions(17, 19) == 32800, "[17][19]"
    assert env.rail.get_full_transitions(17, 20) == 32800, "[17][20]"
    assert env.rail.get_full_transitions(17, 21) == 32800, "[17][21]"
973
    assert env.rail.get_full_transitions(17, 22) == 0, "[17][22]"
974
975
    assert env.rail.get_full_transitions(17, 23) == 0, "[17][23]"
    assert env.rail.get_full_transitions(17, 24) == 0, "[17][24]"
Erik Nygren's avatar
Erik Nygren committed
976
977
    assert env.rail.get_full_transitions(18, 0) == 72, "[18][0]"
    assert env.rail.get_full_transitions(18, 1) == 37408, "[18][1]"
Erik Nygren's avatar
Erik Nygren committed
978
979
980
981
982
983
984
985
986
987
988
    assert env.rail.get_full_transitions(18, 2) == 0, "[18][2]"
    assert env.rail.get_full_transitions(18, 3) == 0, "[18][3]"
    assert env.rail.get_full_transitions(18, 4) == 0, "[18][4]"
    assert env.rail.get_full_transitions(18, 5) == 0, "[18][5]"
    assert env.rail.get_full_transitions(18, 6) == 0, "[18][6]"
    assert env.rail.get_full_transitions(18, 7) == 0, "[18][7]"
    assert env.rail.get_full_transitions(18, 8) == 0, "[18][8]"
    assert env.rail.get_full_transitions(18, 9) == 0, "[18][9]"
    assert env.rail.get_full_transitions(18, 10) == 0, "[18][10]"
    assert env.rail.get_full_transitions(18, 11) == 0, "[18][11]"
    assert env.rail.get_full_transitions(18, 12) == 0, "[18][12]"
Erik Nygren's avatar
Erik Nygren committed
989
    assert env.rail.get_full_transitions(18, 13) == 0, "[18][13]"
Erik Nygren's avatar
Erik Nygren committed
990
991
992
993
994
    assert env.rail.get_full_transitions(18, 14) == 0, "[18][14]"
    assert env.rail.get_full_transitions(18, 15) == 0, "[18][15]"
    assert env.rail.get_full_transitions(18, 16) == 0, "[18][16]"
    assert env.rail.get_full_transitions(18, 17) == 0, "[18][17]"
    assert env.rail.get_full_transitions(18, 18) == 0, "[18][18]"
995
996
997
    assert env.rail.get_full_transitions(18, 19) == 32800, "[18][19]"
    assert env.rail.get_full_transitions(18, 20) == 32800, "[18][20]"
    assert env.rail.get_full_transitions(18, 21) == 32800, "[18][21]"
998
    assert env.rail.get_full_transitions(18, 22) == 0, "[18][22]"
999
1000
    assert env.rail.get_full_transitions(18, 23) == 0, "[18][23]"
    assert env.rail.get_full_transitions(18, 24) == 0, "[18][24]"
1001
    assert env.rail.get_full_transitions(19, 0) == 0, "[19][0]"
Erik Nygren's avatar
Erik Nygren committed
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
    assert env.rail.get_full_transitions(19, 1) == 32800, "[19][1]"
    assert env.rail.get_full_transitions(19, 2) == 0, "[19][2]"
    assert env.rail.get_full_transitions(19, 3) == 0, "[19][3]"
    assert env.rail.get_full_transitions(19, 4) == 0, "[19][4]"
    assert env.rail.get_full_transitions(19, 5) == 0, "[19][5]"
    assert env.rail.get_full_transitions(19, 6) == 0, "[19][6]"
    assert env.rail.get_full_transitions(19, 7) == 0, "[19][7]"
    assert env.rail.get_full_transitions(19, 8) == 0, "[19][8]"
    assert env.rail.get_full_transitions(19, 9) == 0, "[19][9]"
    assert env.rail.get_full_transitions(19, 10) == 0, "[19][10]"
Erik Nygren's avatar
Erik Nygren committed
1012
1013
    assert env.rail.get_full_transitions(19, 11) == 0, "[19][11]"
    assert env.rail.get_full_transitions(19, 12) == 0, "[19][12]"
Erik Nygren's avatar
Erik Nygren committed
1014
    assert env.rail.get_full_transitions(19, 13) == 0, "[19][13]"
1015
1016
1017
1018
1019
    assert env.rail.get_full_transitions(19, 14) == 16386, "[19][14]"
    assert env.rail.get_full_transitions(19, 15) == 1025, "[19][15]"
    assert env.rail.get_full_transitions(19, 16) == 1025, "[19][16]"
    assert env.rail.get_full_transitions(19, 17) == 1025, "[19][17]"
    assert env.rail.get_full_transitions(19, 18) == 1025, "[19][18]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
1020
1021
1022
    assert env.rail.get_full_transitions(19, 19) == 38505, "[19][19]"
    assert env.rail.get_full_transitions(19, 20) == 3089, "[19][20]"
    assert env.rail.get_full_transitions(19, 21) == 2064, "[19][21]"
1023
    assert env.rail.get_full_transitions(19, 22) == 0, "[19][22]"
1024
1025
    assert env.rail.get_full_transitions(19, 23) == 0, "[19][23]"
    assert env.rail.get_full_transitions(19, 24) == 0, "[19][24]"
1026
    assert env.rail.get_full_transitions(20, 0) == 0, "[20][0]"
Erik Nygren's avatar
Erik Nygren committed
1027
    assert env.rail.get_full_transitions(20, 1) == 32800, "[20][1]"
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
    assert env.rail.get_full_transitions(20, 2) == 0, "[20][2]"
    assert env.rail.get_full_transitions(20, 3) == 0, "[20][3]"
    assert env.rail.get_full_transitions(20, 4) == 0, "[20][4]"
    assert env.rail.get_full_transitions(20, 5) == 0, "[20][5]"
    assert env.rail.get_full_transitions(20, 6) == 0, "[20][6]"
    assert env.rail.get_full_transitions(20, 7) == 0, "[20][7]"
    assert env.rail.get_full_transitions(20, 8) == 0, "[20][8]"
    assert env.rail.get_full_transitions(20, 9) == 0, "[20][9]"
    assert env.rail.get_full_transitions(20, 10) == 0, "[20][10]"
    assert env.rail.get_full_transitions(20, 11) == 0, "[20][11]"
    assert env.rail.get_full_transitions(20, 12) == 0, "[20][12]"
Erik Nygren's avatar
Erik Nygren committed
1039
    assert env.rail.get_full_transitions(20, 13) == 0, "[20][13]"
1040
    assert env.rail.get_full_transitions(20, 14) == 32800, "[20][14]"
1041
1042
1043
1044
    assert env.rail.get_full_transitions(20, 15) == 0, "[20][15]"
    assert env.rail.get_full_transitions(20, 16) == 0, "[20][16]"
    assert env.rail.get_full_transitions(20, 17) == 0, "[20][17]"
    assert env.rail.get_full_transitions(20, 18) == 0, "[20][18]"
1045
    assert env.rail.get_full_transitions(20, 19) == 32800, "[20][19]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
1046
1047
    assert env.rail.get_full_transitions(20, 20) == 0, "[20][20]"
    assert env.rail.get_full_transitions(20, 21) == 0, "[20][21]"
1048
1049
    assert env.rail.get_full_transitions(20, 22) == 0, "[20][22]"
    assert env.rail.get_full_transitions(20, 23) == 0, "[20][23]"
1050
    assert env.rail.get_full_transitions(20, 24) == 0, "[20][24]"
1051
    assert env.rail.get_full_transitions(21, 0) == 0, "[21][0]"
Erik Nygren's avatar
Erik Nygren committed
1052
    assert env.rail.get_full_transitions(21, 1) == 32800, "[21][1]"
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
    assert env.rail.get_full_transitions(21, 2) == 0, "[21][2]"
    assert env.rail.get_full_transitions(21, 3) == 0, "[21][3]"
    assert env.rail.get_full_transitions(21, 4) == 0, "[21][4]"
    assert env.rail.get_full_transitions(21, 5) == 0, "[21][5]"
    assert env.rail.get_full_transitions(21, 6) == 0, "[21][6]"
    assert env.rail.get_full_transitions(21, 7) == 0, "[21][7]"
    assert env.rail.get_full_transitions(21, 8) == 0, "[21][8]"
    assert env.rail.get_full_transitions(21, 9) == 0, "[21][9]"
    assert env.rail.get_full_transitions(21, 10) == 0, "[21][10]"
    assert env.rail.get_full_transitions(21, 11) == 0, "[21][11]"
    assert env.rail.get_full_transitions(21, 12) == 0, "[21][12]"
Erik Nygren's avatar
Erik Nygren committed
1064
    assert env.rail.get_full_transitions(21, 13) == 0, "[21][13]"
1065
    assert env.rail.get_full_transitions(21, 14) == 32800, "[21][14]"
1066
1067
1068
1069
    assert env.rail.get_full_transitions(21, 15) == 0, "[21][15]"
    assert env.rail.get_full_transitions(21, 16) == 0, "[21][16]"
    assert env.rail.get_full_transitions(21, 17) == 0, "[21][17]"
    assert env.rail.get_full_transitions(21, 18) == 0, "[21][18]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
1070
1071
1072
    assert env.rail.get_full_transitions(21, 19) == 32872, "[21][19]"
    assert env.rail.get_full_transitions(21, 20) == 4608, "[21][20]"
    assert env.rail.get_full_transitions(21, 21) == 0, "[21][21]"
1073
1074
    assert env.rail.get_full_transitions(21, 22) == 0, "[21][22]"
    assert env.rail.get_full_transitions(21, 23) == 0, "[21][23]"
1075
    assert env.rail.get_full_transitions(21, 24) == 0, "[21][24]"
1076
    assert env.rail.get_full_transitions(22, 0) == 0, "[22][0]"
Erik Nygren's avatar
Erik Nygren committed
1077
    assert env.rail.get_full_transitions(22, 1) == 32800, "[22][1]"
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
    assert env.rail.get_full_transitions(22, 2) == 0, "[22][2]"
    assert env.rail.get_full_transitions(22, 3) == 0, "[22][3]"
    assert env.rail.get_full_transitions(22, 4) == 0, "[22][4]"
    assert env.rail.get_full_transitions(22, 5) == 0, "[22][5]"
    assert env.rail.get_full_transitions(22, 6) == 0, "[22][6]"
    assert env.rail.get_full_transitions(22, 7) == 0, "[22][7]"
    assert env.rail.get_full_transitions(22, 8) == 0, "[22][8]"
    assert env.rail.get_full_transitions(22, 9) == 0, "[22][9]"
    assert env.rail.get_full_transitions(22, 10) == 0, "[22][10]"
    assert env.rail.get_full_transitions(22, 11) == 0, "[22][11]"
    assert env.rail.get_full_transitions(22, 12) == 0, "[22][12]"
Erik Nygren's avatar
Erik Nygren committed
1089
    assert env.rail.get_full_transitions(22, 13) == 0, "[22][13]"
1090
    assert env.rail.get_full_transitions(22, 14) == 32800, "[22][14]"
1091
1092
1093
1094
    assert env.rail.get_full_transitions(22, 15) == 0, "[22][15]"
    assert env.rail.get_full_transitions(22, 16) == 0, "[22][16]"
    assert env.rail.get_full_transitions(22, 17) == 0, "[22][17]"
    assert env.rail.get_full_transitions(22, 18) == 0, "[22][18]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
1095
1096
1097
    assert env.rail.get_full_transitions(22, 19) == 49186, "[22][19]"
    assert env.rail.get_full_transitions(22, 20) == 34864, "[22][20]"
    assert env.rail.get_full_transitions(22, 21) == 0, "[22][21]"
1098
1099
    assert env.rail.get_full_transitions(22, 22) == 0, "[22][22]"
    assert env.rail.get_full_transitions(22, 23) == 0, "[22][23]"
1100
    assert env.rail.get_full_transitions(22, 24) == 0, "[22][24]"
1101
    assert env.rail.get_full_transitions(23, 0) == 0, "[23][0]"
Erik Nygren's avatar
Erik Nygren committed
1102
1103
1104
1105
    assert env.rail.get_full_transitions(23, 1) == 32800, "[23][1]"
    assert env.rail.get_full_transitions(23, 2) == 0, "[23][2]"
    assert env.rail.get_full_transitions(23, 3) == 0, "[23][3]"
    assert env.rail.get_full_transitions(23, 4) == 0, "[23][4]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
1106
1107
1108
    assert env.rail.get_full_transitions(23, 5) == 16386, "[23][5]"
    assert env.rail.get_full_transitions(23, 6) == 1025, "[23][6]"
    assert env.rail.get_full_transitions(23, 7) == 4608, "[23][7]"
Erik Nygren's avatar
Erik Nygren committed
1109
1110
1111
1112
1113
1114
    assert env.rail.get_full_transitions(23, 8) == 0, "[23][8]"
    assert env.rail.get_full_transitions(23, 9) == 0, "[23][9]"
    assert env.rail.get_full_transitions(23, 10) == 0, "[23][10]"
    assert env.rail.get_full_transitions(23, 11) == 0, "[23][11]"
    assert env.rail.get_full_transitions(23, 12) == 0, "[23][12]"
    assert env.rail.get_full_transitions(23, 13) == 0, "[23][13]"
1115
    assert env.rail.get_full_transitions(23, 14) == 32800, "[23][14]"
1116
1117
1118
    assert env.rail.get_full_transitions(23, 15) == 0, "[23][15]"
    assert env.rail.get_full_transitions(23, 16) == 0, "[23][16]"
    assert env.rail.get_full_transitions(23, 17) == 0, "[23][17]"
Dipam Chakraborty's avatar
Dipam Chakraborty committed
1119
1120
1121
1122
1123
    assert env.rail.get_full_transitions(23, 18) == 16386, "[23][18]"
    assert env.rail.get_full_transitions(23, 19) == 34864, "[23][19]"
    assert env.rail.get_full_transitions(23, 20) == 32872, "[23][20]"
    assert env.rail.get_full_transitions(23, 21) == 4608, "[23][21]"
    assert env.rail.get_full_transitions(23, 22) == 0, "[23][22]"
1124
    assert env.rail.get_full_transitions(23, 23) == 0, "[23][23]"
1125
    assert env.rail.get_full_transitions(23, 24) == 0, "[23][24]"
1126
    assert env.rail.get_full_transitions(24, 0) == 0, "[24][0]"