Eclipse SUMO - Simulation of Urban MObility
MSCFModel_Rail.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2012-2022 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// <description missing>
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23
24#include "MSCFModel.h"
25
26
27
28class MSCFModel_Rail : public MSCFModel {
29
30public:
34 MSCFModel_Rail(const MSVehicleType* vtype);
35
36 double followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed,
37 double predMaxDecel, const MSVehicle* const pred = 0, const CalcReason usage = CalcReason::CURRENT) const;
38
39 virtual int getModelID() const;
40
41 virtual MSCFModel* duplicate(const MSVehicleType* vtype) const;
42
43
44
45 virtual ~MSCFModel_Rail();
46
47 virtual double maxNextSpeed(double speed, const MSVehicle* const veh) const;
48
49 virtual double minNextSpeed(double speed, const MSVehicle* const veh) const;
50
51 virtual double minNextSpeedEmergency(double speed, const MSVehicle* const veh = 0) const;
52
53 double getSpeedAfterMaxDecel(double v) const;
54
56
57 double finalizeSpeed(MSVehicle* const veh, double vPos) const;
58
59 double freeSpeed(const MSVehicle* const veh, double speed, double seen, double maxSpeed,
60 const bool onInsertion, const CalcReason usage = CalcReason::CURRENT) const;
61
62private:
63
64
65 typedef std::map<double, double> LookUpMap;
66
67 struct TrainParams {
68 double weight;
69 double mf;
70 double length;
71 double decl;
72 double vmax;
73 double recovery;
74 double rotWeight;
77 };
78
79 double getInterpolatedValueFromLookUpMap(double speed, const LookUpMap* lookUpMap) const;
80
81
82public:
83 double stopSpeed(const MSVehicle* const veh, const double speed, double gap, double decel, const CalcReason usage = CalcReason::CURRENT) const;
84
85// class VehicleVariables : public MSCFModel::VehicleVariables {
86//
87// public:
88//
89// const std::string getTrainType() const { return myTrainType; };
90//
91// void setTrainType(std::string trainType) { myTrainType = trainType; }
92//
93// bool isNotYetInitialized() {
94// return notYetInitialized;
95// }
96//
97// void setInitialized() {
98// notYetInitialized = false;
99// }
100//
101// private:
102// std::string myTrainType;
103// bool notYetInitialized = true;
104//
105//
106// };
107
108private:
109
110
112
113 LookUpMap initNGT400Traction() const { // early version of NGT 400
114 LookUpMap map;
115 map[0] = 716.0;
116 map[10] = 700.0;
117 map[20] = 684.0;
118 map[30] = 669.0;
119 map[40] = 653.0;
120 map[50] = 637.0;
121 map[60] = 622.0;
122 map[70] = 606.0;
123 map[80] = 590.0;
124 map[90] = 574.0;
125 map[100] = 559.0;
126 map[110] = 543.0;
127 map[120] = 527.0;
128 map[130] = 507.0;
129 map[140] = 471.0;
130 map[150] = 439.0;
131 map[160] = 412.0;
132 map[170] = 388.0;
133 map[180] = 366.0;
134 map[190] = 347.0;
135 map[200] = 329.0;
136 map[210] = 314.0;
137 map[220] = 299.0;
138 map[230] = 286.0;
139 map[240] = 275.0;
140 map[250] = 264.0;
141 map[260] = 253.0;
142 map[270] = 244.0;
143 map[280] = 235.0;
144 map[290] = 227.0;
145 map[300] = 220.0;
146 map[310] = 213.0;
147 map[320] = 206.0;
148 map[330] = 200.0;
149 map[340] = 194.0;
150 map[350] = 188.0;
151 map[360] = 183.0;
152 map[370] = 178.0;
153 map[380] = 173.0;
154 map[390] = 169.0;
155 map[400] = 165.0;
156 map[410] = 160.6;
157 map[420] = 156.8;
158 map[430] = 153.2;
159 map[440] = 149.7;
160 map[450] = 146.4;
161 map[460] = 143.2;
162 map[470] = 140.1;
163 map[480] = 137.2;
164 return map;
165 }
166
167 LookUpMap initNGT400Resistance() const { // early version of NGT 400
168 LookUpMap map;
169 map[0] = 1.9;
170 map[10] = 2.1;
171 map[20] = 2.4;
172 map[30] = 2.9;
173 map[40] = 3.5;
174 map[50] = 4.2;
175 map[60] = 5.0;
176 map[70] = 6.0;
177 map[80] = 7.0;
178 map[90] = 8.2;
179 map[100] = 9.6;
180 map[110] = 11.0;
181 map[120] = 12.6;
182 map[130] = 14.3;
183 map[140] = 16.1;
184 map[150] = 18.0;
185 map[160] = 20.1;
186 map[170] = 22.3;
187 map[180] = 24.6;
188 map[190] = 27.0;
189 map[200] = 29.5;
190 map[210] = 32.2;
191 map[220] = 35.0;
192 map[230] = 37.9;
193 map[240] = 40.9;
194 map[250] = 44.1;
195 map[260] = 47.4;
196 map[270] = 50.8;
197 map[280] = 54.3;
198 map[290] = 58.0;
199 map[300] = 61.7;
200 map[310] = 65.6;
201 map[320] = 69.7;
202 map[330] = 73.8;
203 map[340] = 78.1;
204 map[350] = 82.4;
205 map[360] = 86.9;
206 map[370] = 91.6;
207 map[380] = 96.3;
208 map[390] = 101.2;
209 map[400] = 106.2;
210 map[410] = 111.3;
211 map[420] = 116.6;
212 map[430] = 121.9;
213 map[440] = 127.4;
214 map[450] = 133.0;
215 map[460] = 138.7;
216 map[470] = 144.6;
217 map[480] = 150.6;
218 return map;
219 }
220
222 TrainParams params;
223 params.weight = 384;
224 params.mf = 1.04;
225 params.length = 200;
226 params.decl = 0.9;
227 params.vmax = 500 / 3.6;
228 params.recovery = 0.6;
229 params.rotWeight = params.weight * params.mf;
230 params.traction = initNGT400Traction();
232 return params;
233 }
234
236 LookUpMap map;
237 map[0] = 274.5;
238 map[10] = 274.5;
239 map[20] = 274.5;
240 map[30] = 274.5;
241 map[40] = 274.5;
242 map[50] = 274.5;
243 map[60] = 274.5;
244 map[70] = 274.5;
245 map[80] = 274.5;
246 map[90] = 274.5;
247 map[100] = 274.5;
248 map[110] = 274.5;
249 map[120] = 274.5;
250 map[130] = 274.5;
251 map[140] = 274.5;
252 map[150] = 274.5;
253 map[160] = 274.5;
254 map[170] = 274.5;
255 map[180] = 274.5;
256 map[190] = 274.5;
257 map[200] = 274.5;
258 map[210] = 273;
259 map[220] = 262.3;
260 map[230] = 250;
261 map[240] = 239;
262 map[250] = 229;
263 map[260] = 222;
264 map[270] = 213;
265 map[280] = 205;
266 map[290] = 198;
267 map[300] = 191;
268 map[310] = 186;
269 map[320] = 180;
270 map[330] = 174;
271 map[340] = 169;
272 map[350] = 165;
273 map[360] = 160;
274 map[370] = 155.5;
275 map[380] = 151;
276 map[390] = 148;
277 map[400] = 144;
278 map[410] = 140;
279 map[420] = 136;
280 map[430] = 134;
281 map[440] = 131;
282 map[450] = 128;
283 map[460] = 125;
284 map[470] = 123;
285 return map;
286 }
287
289 LookUpMap map;
290 map[0] = 5.71;
291 map[10] = 6.01;
292 map[20] = 6.4;
293 map[30] = 7.0;
294 map[40] = 7.51;
295 map[50] = 8.34;
296 map[60] = 9.2;
297 map[70] = 10.4;
298 map[80] = 11.3;
299 map[90] = 12.58;
300 map[100] = 14.05;
301 map[110] = 15.5;
302 map[120] = 16.9;
303 map[130] = 18.75;
304 map[140] = 20.77;
305 map[150] = 22.9;
306 map[160] = 25.0;
307 map[170] = 26.9;
308 map[180] = 29.38;
309 map[190] = 32.0;
310 map[200] = 34.5;
311 map[210] = 37.0;
312 map[220] = 39.91;
313 map[230] = 43.11;
314 map[240] = 46.4;
315 map[250] = 49.3;
316 map[260] = 52.4;
317 map[270] = 56.09;
318 map[280] = 59.8;
319 map[290] = 63.7;
320 map[300] = 66.8;
321 map[310] = 71.0;
322 map[320] = 75.39;
323 map[330] = 79.9;
324 map[340] = 84.1;
325 map[350] = 87.9;
326 map[360] = 92.7;
327 map[370] = 97.6;
328 map[380] = 102.0;
329 map[390] = 107.0;
330 map[400] = 112.0;
331 map[410] = 117.5;
332 map[420] = 123.0;
333 map[430] = 128.3;
334 map[440] = 133.3;
335 map[450] = 139.2;
336 map[460] = 145.5;
337 map[470] = 150.0;
338 return map;
339 }
340
342 TrainParams params;
343 params.weight = 384;
344 params.mf = 1.04;
345 params.length = 200;
346 params.decl = 0.9;
347 params.vmax = 430 / 3.6;
348 params.recovery = 0.6;
349 params.rotWeight = params.weight * params.mf;
352 return params;
353 }
354
356 LookUpMap map;
357 map[0] = 400;
358 map[10] = 394;
359 map[20] = 388;
360 map[30] = 382;
361 map[40] = 377;
362 map[50] = 372;
363 map[60] = 369;
364 map[70] = 366;
365 map[80] = 363;
366 map[90] = 361;
367 map[100] = 349;
368 map[110] = 317;
369 map[120] = 290;
370 map[130] = 268;
371 map[140] = 249;
372 map[150] = 232;
373 map[160] = 217;
374 map[170] = 205;
375 map[180] = 193;
376 map[190] = 183;
377 map[200] = 174;
378 map[210] = 165;
379 map[220] = 158;
380 map[230] = 151;
381 map[240] = 145;
382 map[250] = 139;
383 return map;
384 }
385
387 LookUpMap map;
388 map[0] = 10.7;
389 map[10] = 12.3;
390 map[20] = 14.2;
391 map[30] = 16.4;
392 map[40] = 18.7;
393 map[50] = 21.3;
394 map[60] = 24.2;
395 map[70] = 27.3;
396 map[80] = 30.6;
397 map[90] = 34.1;
398 map[100] = 37.9;
399 map[110] = 41.9;
400 map[120] = 46.2;
401 map[130] = 50.6;
402 map[140] = 55.4;
403 map[150] = 60.4;
404 map[160] = 65.6;
405 map[170] = 71.1;
406 map[180] = 76.7;
407 map[190] = 82.6;
408 map[200] = 88.8;
409 map[210] = 95.2;
410 map[220] = 101.8;
411 map[230] = 108.7;
412 map[240] = 115.8;
413 map[250] = 123.1;
414 return map;
415 }
416
418 TrainParams params;
419 params.weight = 876;
420 params.mf = 1.1;
421 params.length = 358;
422 params.decl = 0.5;
423 params.vmax = 250 / 3.6;
424 params.recovery = 0.1;
425 params.rotWeight = params.weight * params.mf;
426 params.traction = initICE1Traction();
428 return params;
429 }
430
432 TrainParams params;
433 params.weight = 420;
434 params.mf = 1.04;
435 params.length = 200;
436 params.decl = 0.5;
437 params.vmax = 300 / 3.6;
438 params.recovery = 0.6;
439 params.rotWeight = params.weight * params.mf;
440 params.traction = initICE3Traction();
442 return params;
443 }
444
446 LookUpMap map;
447 map[0] = 300;
448 map[10] = 298;
449 map[20] = 297;
450 map[30] = 295;
451 map[40] = 293;
452 map[50] = 292;
453 map[60] = 290;
454 map[70] = 288;
455 map[80] = 286.5;
456 map[90] = 285;
457 map[100] = 283;
458 map[110] = 262;
459 map[120] = 240;
460 map[130] = 221;
461 map[140] = 206;
462 map[150] = 192;
463 map[160] = 180;
464 map[170] = 169;
465 map[180] = 160;
466 map[190] = 152;
467 map[200] = 144;
468 map[210] = 137;
469 map[220] = 131;
470 map[230] = 125;
471 map[240] = 120;
472 map[250] = 115;
473 map[260] = 111;
474 map[270] = 107;
475 map[280] = 103;
476 map[290] = 99;
477 map[300] = 96;
478 return map;
479 }
480
482 LookUpMap map;
483 map[0] = 7.4;
484 map[10] = 7.6;
485 map[20] = 8.0;
486 map[30] = 8.4;
487 map[40] = 9.1;
488 map[50] = 9.8;
489 map[60] = 10.7;
490 map[70] = 11.7;
491 map[80] = 12.8;
492 map[90] = 14.1;
493 map[100] = 15.5;
494 map[110] = 17.1;
495 map[120] = 18.8;
496 map[130] = 20.6;
497 map[140] = 22.6;
498 map[150] = 24.6;
499 map[160] = 26.9;
500 map[170] = 29.2;
501 map[180] = 31.7;
502 map[190] = 34.3;
503 map[200] = 37.1;
504 map[210] = 40.0;
505 map[220] = 43.1;
506 map[230] = 46.2;
507 map[240] = 49.6;
508 map[250] = 53.0;
509 map[260] = 56.6;
510 map[270] = 60.3;
511 map[280] = 64.1;
512 map[290] = 68.1;
513 map[300] = 71.8;
514 return map;
515 }
516
518 TrainParams params;
519 params.weight = 425.5;
520 params.mf = 1.1;
521 params.length = 207;
522 params.decl = 0.5;
523 params.vmax = 160 / 3.6;
524 params.recovery = 0.1;
525 params.rotWeight = params.weight * params.mf;
528 return params;
529 }
530
532 LookUpMap map;
533 map[0] = 300;
534 map[10] = 300;
535 map[20] = 300;
536 map[30] = 300;
537 map[40] = 300;
538 map[50] = 300;
539 map[60] = 300;
540 map[70] = 289;
541 map[80] = 253;
542 map[90] = 224;
543 map[100] = 202;
544 map[110] = 183;
545 map[120] = 168;
546 map[130] = 155;
547 map[140] = 144;
548 map[150] = 134;
549 map[160] = 125;
550 return map;
551 }
552
554 LookUpMap map;
555 map[0] = 8.5;
556 map[10] = 8.9;
557 map[20] = 9.5;
558 map[30] = 10.4;
559 map[40] = 11.4;
560 map[50] = 12.7;
561 map[60] = 14.1;
562 map[70] = 15.8;
563 map[80] = 17.7;
564 map[90] = 19.8;
565 map[100] = 22.6;
566 map[110] = 24.6;
567 map[120] = 27.3;
568 map[130] = 30.2;
569 map[140] = 33.3;
570 map[150] = 36.6;
571 map[160] = 40.2;
572 return map;
573 }
574
576 TrainParams params;
577 params.weight = 72.2;
578 params.mf = 1.04;
579 params.length = 46;
580 params.decl = 0.5;
581 params.vmax = 120 / 3.6;
582 params.recovery = 0;
583 params.rotWeight = params.weight * params.mf;
584 params.traction = initRB628Traction();
586 return params;
587 }
588
590 LookUpMap map;
591 map[0] = 60;
592 map[10] = 53.8;
593 map[20] = 47.6;
594 map[30] = 36.9;
595 map[40] = 28.7;
596 map[50] = 23.5;
597 map[60] = 20.0;
598 map[70] = 17.5;
599 map[80] = 15.2;
600 map[90] = 13.9;
601 map[100] = 12.8;
602 map[110] = 11.7;
603 map[120] = 10.8;
604 return map;
605 }
606
608 LookUpMap map;
609 map[0] = 1.29;
610 map[10] = 1.46;
611 map[20] = 1.73;
612 map[30] = 2.08;
613 map[40] = 2.52;
614 map[50] = 3.05;
615 map[60] = 3.66;
616 map[70] = 4.36;
617 map[80] = 5.16;
618 map[90] = 6.03;
619 map[100] = 7.00;
620 map[110] = 8.06;
621 map[120] = 9.2;
622 return map;
623 }
624
626 TrainParams params;
627 params.weight = 1440;
628 params.mf = 1.06;
629 params.length = 512;
630 params.decl = 0.3;
631 params.vmax = 120 / 3.6;
632 params.recovery = 0.05;
633 params.rotWeight = params.weight * params.mf;
634 params.traction = initFreightTraction();
636 return params;
637 }
638
640 LookUpMap map;
641 map[0] = 300;
642 map[10] = 296;
643 map[20] = 293;
644 map[30] = 289;
645 map[40] = 286;
646 map[50] = 282;
647 map[60] = 279;
648 map[70] = 275;
649 map[80] = 272;
650 map[90] = 255;
651 map[100] = 230;
652 map[110] = 209;
653 map[120] = 190;//guessed value
654 return map;
655 }
656
658 LookUpMap map;
659 map[0] = 1.9;
660 map[10] = 4.3;
661 map[20] = 8.5;
662 map[30] = 14.3;
663 map[40] = 21.7;
664 map[50] = 30.8;
665 map[60] = 41.5;
666 map[70] = 53.8;
667 map[80] = 67.8;
668 map[90] = 83.5;
669 map[100] = 110.7;
670 map[110] = 119.6;
671 map[120] = 140.2;
672 return map;
673 }
674
676 LookUpMap map;
677 map[0] = 150;
678 map[10] = 150;
679 map[20] = 150;
680 map[30] = 150;
681 map[40] = 150;
682 map[50] = 150;
683 map[60] = 140;
684 map[70] = 120;
685 map[80] = 105;
686 map[90] = 93;
687 map[100] = 84;
688 map[110] = 75;
689 map[120] = 70;
690 map[130] = 56;
691 map[140] = 52;
692 map[150] = 46;
693 map[160] = 40;
694 return map;
695 }
696
698 LookUpMap map;
699 map[0] = 2.6;
700 map[10] = 2.9;
701 map[20] = 3.3;
702 map[30] = 3.7;
703 map[40] = 4.3;
704 map[50] = 4.9;
705 map[60] = 5.7;
706 map[70] = 6.6;
707 map[80] = 7.5;
708 map[90] = 8.6;
709 map[100] = 9.7;
710 map[110] = 11.0;
711 map[120] = 12.3;
712 map[130] = 13.8;
713 map[140] = 15.3;
714 map[150] = 16.9;
715 map[160] = 18.7;
716 return map;
717 }
718
720 TrainParams params;
721 params.weight = 138;
722 params.mf = 1.04;
723 params.length = 67.5;
724 params.decl = 1.0;
725 params.vmax = 160 / 3.6;
726 params.recovery = 0.6;
727 params.rotWeight = params.weight * params.mf;
728 params.traction = initRB425Traction();
730 return params;
731 }
732
733// void initVehicleVariables(const MSVehicle *const pVehicle, MSCFModel_Rail::VehicleVariables *pVariables)const;
734
735};
736
737
TrainParams initICE3Params() const
TrainParams initNGT400_16Params() const
virtual ~MSCFModel_Rail()
LookUpMap initNGT400Traction() const
TrainParams initREDosto7Params() const
LookUpMap initRB628Traction() const
LookUpMap initRB628Resistance() const
MSCFModel::VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting.
virtual double minNextSpeedEmergency(double speed, const MSVehicle *const veh=0) const
Returns the minimum speed after emergency braking, given the current speed (depends on the numerical ...
LookUpMap initICE3Traction() const
TrainParams initICE1Params() const
MSCFModel_Rail(const MSVehicleType *vtype)
Constructor.
double freeSpeed(const MSVehicle *const veh, double speed, double seen, double maxSpeed, const bool onInsertion, const CalcReason usage=CalcReason::CURRENT) const
Computes the vehicle's safe speed without a leader.
TrainParams initRB628Params() const
double getInterpolatedValueFromLookUpMap(double speed, const LookUpMap *lookUpMap) const
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
LookUpMap initNGT400Resistance() const
LookUpMap initRB425Traction() const
LookUpMap initICE1Resistance() const
virtual int getModelID() const
Returns the model's ID; the XML-Tag number is used.
LookUpMap initICE1Traction() const
LookUpMap initNGT400_16Traction() const
double getSpeedAfterMaxDecel(double v) const
Returns the velocity after maximum deceleration.
TrainParams myTrainParams
virtual double minNextSpeed(double speed, const MSVehicle *const veh) const
Returns the minimum speed given the current speed (depends on the numerical update scheme and its ste...
LookUpMap initRB425Resistance() const
LookUpMap initREDosto7Resistance() const
double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle *const pred=0, const CalcReason usage=CalcReason::CURRENT) const
Computes the vehicle's follow speed (no dawdling)
LookUpMap initNGT400_16Resistance() const
TrainParams initRB425Params() const
TrainParams initFreightParams() const
LookUpMap initFreightResistance() const
LookUpMap initREDosto7Traction() const
virtual double maxNextSpeed(double speed, const MSVehicle *const veh) const
Returns the maximum speed given the current speed.
TrainParams initNGT400Params() const
LookUpMap initICE3Resistance() const
LookUpMap initFreightTraction() const
std::map< double, double > LookUpMap
double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences. Called at most once per simulation...
double stopSpeed(const MSVehicle *const veh, const double speed, double gap, double decel, const CalcReason usage=CalcReason::CURRENT) const
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling)
The car-following model abstraction.
Definition: MSCFModel.h:55
CalcReason
What the return value of stop/follow/free-Speed is used for.
Definition: MSCFModel.h:77
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:77
The car-following model and parameter.
Definition: MSVehicleType.h:63