Commit d6c1dc4
committed
Enhance train routing logic and memory management
- Added search radius
- Updated several properties in TrainStation class to be readonly for better immutability and clarity.
- Introduced heat decay interval and factor for more flexible heat management.
- pre-computed decay factors avoiding Math.pow in critical paths.
- Enhance logging
- Refined routing logic
- removed journeyPreviousStation property
- removed RecentArrivals
- unbounded StationTraffic.heat -> score can now be negative1 parent fda1d39 commit d6c1dc4
File tree
4 files changed
+155
-98
lines changed- src/core
- execution
- game
4 files changed
+155
-98
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | | - | |
| 33 | + | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 41 | + | |
45 | 42 | | |
46 | 43 | | |
47 | 44 | | |
| |||
283 | 280 | | |
284 | 281 | | |
285 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
324 | 323 | | |
325 | 324 | | |
326 | 325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
| 715 | + | |
715 | 716 | | |
716 | 717 | | |
717 | 718 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
| 82 | + | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
464 | 465 | | |
465 | 466 | | |
466 | 467 | | |
467 | | - | |
468 | | - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
469 | 471 | | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
| 472 | + | |
| 473 | + | |
481 | 474 | | |
482 | 475 | | |
483 | 476 | | |
| |||
487 | 480 | | |
488 | 481 | | |
489 | 482 | | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
| 483 | + | |
| 484 | + | |
494 | 485 | | |
495 | 486 | | |
496 | 487 | | |
| |||
502 | 493 | | |
503 | 494 | | |
504 | 495 | | |
505 | | - | |
| 496 | + | |
506 | 497 | | |
507 | 498 | | |
508 | 499 | | |
509 | 500 | | |
510 | 501 | | |
| 502 | + | |
511 | 503 | | |
512 | 504 | | |
513 | | - | |
| 505 | + | |
514 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
515 | 511 | | |
516 | 512 | | |
517 | 513 | | |
| |||
0 commit comments