LCOV - code coverage report
Current view: top level - src/microsim/cfmodels - MSCFModel_Rail.h (source / functions) Coverage Total Hit
Test: lcov.info Lines: 98.5 % 675 665
Test Date: 2024-11-20 15:55:46 Functions: 100.0 % 31 31

            Line data    Source code
       1              : /****************************************************************************/
       2              : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
       3              : // Copyright (C) 2012-2024 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              : /****************************************************************************/
      14              : /// @file    MSCFModel_Rail.h
      15              : /// @author  Gregor Laemmel
      16              : /// @date    Tue, 08 Feb 2017
      17              : ///
      18              : // <description missing>
      19              : /****************************************************************************/
      20              : #pragma once
      21              : #include <config.h>
      22              : 
      23              : #include <utils/common/LinearApproxHelpers.h>
      24              : #include "MSCFModel.h"
      25              : 
      26              : 
      27              : 
      28              : class MSCFModel_Rail : public MSCFModel {
      29              : 
      30              : public:
      31              :     /** @brief Constructor
      32              :      *  @param[in] vtype the type for which this model is built and also the parameter object to configure this model
      33              :      */
      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              : 
      55              :     MSCFModel::VehicleVariables* createVehicleVariables() const;
      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              : 
      62        12492 :     bool startupDelayStopped() const {
      63              :         // starup delay in trains is dominated by inertia + brake delay and thus applies to any kind of stopping
      64        12492 :         return true;
      65              :     }
      66              : 
      67              : private:
      68              : 
      69              :     struct TrainParams {
      70              :         // the vehicle mass in tons
      71              :         double weight;  // tons
      72              :         // the mass factor
      73              :         double mf;
      74              :         double length;
      75              :         double decl;
      76              :         double vmax;
      77              :         double recovery;
      78              :         LinearApproxHelpers::LinearApproxMap traction;  // m/s -> kN
      79              :         LinearApproxHelpers::LinearApproxMap resistance;  // m/s -> kN
      80              :         double maxPower;  // kN
      81              :         double maxTraction; // kN
      82              :         double resCoef_constant; // kN
      83              :         double resCoef_linear;  // kN / (km/h)
      84              :         double resCoef_quadratic; // kN / (km/h)^2
      85              : 
      86              :         double getRotWeight() const {
      87      2313329 :             return weight * mf;
      88              :         }
      89              : 
      90              :         double getResistance(double speed) const;
      91              :         double getTraction(double speed) const;
      92              :     };
      93              : 
      94              :     std::vector<double> getValueTable(const MSVehicleType* vtype, SumoXMLAttr attr);
      95              : 
      96              : 
      97              : public:
      98              :     double stopSpeed(const MSVehicle* const veh, const double speed, double gap, double decel, const CalcReason usage = CalcReason::CURRENT) const;
      99              : 
     100              : //    class VehicleVariables : public MSCFModel::VehicleVariables {
     101              : //
     102              : //    public:
     103              : //
     104              : //        const std::string getTrainType() const { return myTrainType; };
     105              : //
     106              : //        void setTrainType(std::string trainType) { myTrainType = trainType; }
     107              : //
     108              : //        bool isNotYetInitialized() {
     109              : //            return notYetInitialized;
     110              : //        }
     111              : //
     112              : //        void setInitialized() {
     113              : //            notYetInitialized = false;
     114              : //        }
     115              : //
     116              : //    private:
     117              : //        std::string myTrainType;
     118              : //        bool notYetInitialized = true;
     119              : //
     120              : //
     121              : //    };
     122              : 
     123              : private:
     124              : 
     125              :     TrainParams myTrainParams;
     126              : 
     127          116 :     LinearApproxHelpers::LinearApproxMap initNGT400Traction() const { // early version of NGT 400
     128              :         LinearApproxHelpers::LinearApproxMap map;
     129          116 :         map[0] = 716.0;
     130          116 :         map[10] = 700.0;
     131          116 :         map[20] = 684.0;
     132          116 :         map[30] = 669.0;
     133          116 :         map[40] = 653.0;
     134          116 :         map[50] = 637.0;
     135          116 :         map[60] = 622.0;
     136          116 :         map[70] = 606.0;
     137          116 :         map[80] = 590.0;
     138          116 :         map[90] = 574.0;
     139          116 :         map[100] = 559.0;
     140          116 :         map[110] = 543.0;
     141          116 :         map[120] = 527.0;
     142          116 :         map[130] = 507.0;
     143          116 :         map[140] = 471.0;
     144          116 :         map[150] = 439.0;
     145          116 :         map[160] = 412.0;
     146          116 :         map[170] = 388.0;
     147          116 :         map[180] = 366.0;
     148          116 :         map[190] = 347.0;
     149          116 :         map[200] = 329.0;
     150          116 :         map[210] = 314.0;
     151          116 :         map[220] = 299.0;
     152          116 :         map[230] = 286.0;
     153          116 :         map[240] = 275.0;
     154          116 :         map[250] = 264.0;
     155          116 :         map[260] = 253.0;
     156          116 :         map[270] = 244.0;
     157          116 :         map[280] = 235.0;
     158          116 :         map[290] = 227.0;
     159          116 :         map[300] = 220.0;
     160          116 :         map[310] = 213.0;
     161          116 :         map[320] = 206.0;
     162          116 :         map[330] = 200.0;
     163          116 :         map[340] = 194.0;
     164          116 :         map[350] = 188.0;
     165          116 :         map[360] = 183.0;
     166          116 :         map[370] = 178.0;
     167          116 :         map[380] = 173.0;
     168          116 :         map[390] = 169.0;
     169          116 :         map[400] = 165.0;
     170          116 :         map[410] = 160.6;
     171          116 :         map[420] = 156.8;
     172          116 :         map[430] = 153.2;
     173          116 :         map[440] = 149.7;
     174          116 :         map[450] = 146.4;
     175          116 :         map[460] = 143.2;
     176          116 :         map[470] = 140.1;
     177          116 :         map[480] = 137.2;
     178          116 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     179          116 :         return map;
     180              :     }
     181              : 
     182          116 :     LinearApproxHelpers::LinearApproxMap initNGT400Resistance() const { // early version of NGT 400
     183              :         LinearApproxHelpers::LinearApproxMap map;
     184          116 :         map[0] = 1.9;
     185          116 :         map[10] = 2.1;
     186          116 :         map[20] = 2.4;
     187          116 :         map[30] = 2.9;
     188          116 :         map[40] = 3.5;
     189          116 :         map[50] = 4.2;
     190          116 :         map[60] = 5.0;
     191          116 :         map[70] = 6.0;
     192          116 :         map[80] = 7.0;
     193          116 :         map[90] = 8.2;
     194          116 :         map[100] = 9.6;
     195          116 :         map[110] = 11.0;
     196          116 :         map[120] = 12.6;
     197          116 :         map[130] = 14.3;
     198          116 :         map[140] = 16.1;
     199          116 :         map[150] = 18.0;
     200          116 :         map[160] = 20.1;
     201          116 :         map[170] = 22.3;
     202          116 :         map[180] = 24.6;
     203          116 :         map[190] = 27.0;
     204          116 :         map[200] = 29.5;
     205          116 :         map[210] = 32.2;
     206          116 :         map[220] = 35.0;
     207          116 :         map[230] = 37.9;
     208          116 :         map[240] = 40.9;
     209          116 :         map[250] = 44.1;
     210          116 :         map[260] = 47.4;
     211          116 :         map[270] = 50.8;
     212          116 :         map[280] = 54.3;
     213          116 :         map[290] = 58.0;
     214          116 :         map[300] = 61.7;
     215          116 :         map[310] = 65.6;
     216          116 :         map[320] = 69.7;
     217          116 :         map[330] = 73.8;
     218          116 :         map[340] = 78.1;
     219          116 :         map[350] = 82.4;
     220          116 :         map[360] = 86.9;
     221          116 :         map[370] = 91.6;
     222          116 :         map[380] = 96.3;
     223          116 :         map[390] = 101.2;
     224          116 :         map[400] = 106.2;
     225          116 :         map[410] = 111.3;
     226          116 :         map[420] = 116.6;
     227          116 :         map[430] = 121.9;
     228          116 :         map[440] = 127.4;
     229          116 :         map[450] = 133.0;
     230          116 :         map[460] = 138.7;
     231          116 :         map[470] = 144.6;
     232          116 :         map[480] = 150.6;
     233          116 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     234          116 :         return map;
     235              :     }
     236              : 
     237          116 :     TrainParams initNGT400Params() const {
     238              :         TrainParams params;
     239          116 :         params.weight = 384;
     240          116 :         params.mf = 1.04;
     241          116 :         params.length = 200;
     242          116 :         params.decl = 0.9;
     243          116 :         params.vmax = 500 / 3.6;
     244          116 :         params.recovery = 0.6;
     245          116 :         params.traction = initNGT400Traction();
     246          116 :         params.resistance = initNGT400Resistance();
     247          116 :         return params;
     248            0 :     }
     249              : 
     250            4 :     LinearApproxHelpers::LinearApproxMap initNGT400_16Traction() const {
     251              :         LinearApproxHelpers::LinearApproxMap map;
     252            4 :         map[0] = 274.5;
     253            4 :         map[10] = 274.5;
     254            4 :         map[20] = 274.5;
     255            4 :         map[30] = 274.5;
     256            4 :         map[40] = 274.5;
     257            4 :         map[50] = 274.5;
     258            4 :         map[60] = 274.5;
     259            4 :         map[70] = 274.5;
     260            4 :         map[80] = 274.5;
     261            4 :         map[90] = 274.5;
     262            4 :         map[100] = 274.5;
     263            4 :         map[110] = 274.5;
     264            4 :         map[120] = 274.5;
     265            4 :         map[130] = 274.5;
     266            4 :         map[140] = 274.5;
     267            4 :         map[150] = 274.5;
     268            4 :         map[160] = 274.5;
     269            4 :         map[170] = 274.5;
     270            4 :         map[180] = 274.5;
     271            4 :         map[190] = 274.5;
     272            4 :         map[200] = 274.5;
     273            4 :         map[210] = 273;
     274            4 :         map[220] = 262.3;
     275            4 :         map[230] = 250;
     276            4 :         map[240] = 239;
     277            4 :         map[250] = 229;
     278            4 :         map[260] = 222;
     279            4 :         map[270] = 213;
     280            4 :         map[280] = 205;
     281            4 :         map[290] = 198;
     282            4 :         map[300] = 191;
     283            4 :         map[310] = 186;
     284            4 :         map[320] = 180;
     285            4 :         map[330] = 174;
     286            4 :         map[340] = 169;
     287            4 :         map[350] = 165;
     288            4 :         map[360] = 160;
     289            4 :         map[370] = 155.5;
     290            4 :         map[380] = 151;
     291            4 :         map[390] = 148;
     292            4 :         map[400] = 144;
     293            4 :         map[410] = 140;
     294            4 :         map[420] = 136;
     295            4 :         map[430] = 134;
     296            4 :         map[440] = 131;
     297            4 :         map[450] = 128;
     298            4 :         map[460] = 125;
     299            4 :         map[470] = 123;
     300            4 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     301            4 :         return map;
     302              :     }
     303              : 
     304            4 :     LinearApproxHelpers::LinearApproxMap initNGT400_16Resistance() const {
     305              :         LinearApproxHelpers::LinearApproxMap map;
     306            4 :         map[0] = 5.71;
     307            4 :         map[10] = 6.01;
     308            4 :         map[20] = 6.4;
     309            4 :         map[30] = 7.0;
     310            4 :         map[40] = 7.51;
     311            4 :         map[50] = 8.34;
     312            4 :         map[60] = 9.2;
     313            4 :         map[70] = 10.4;
     314            4 :         map[80] = 11.3;
     315            4 :         map[90] = 12.58;
     316            4 :         map[100] = 14.05;
     317            4 :         map[110] = 15.5;
     318            4 :         map[120] = 16.9;
     319            4 :         map[130] = 18.75;
     320            4 :         map[140] = 20.77;
     321            4 :         map[150] = 22.9;
     322            4 :         map[160] = 25.0;
     323            4 :         map[170] = 26.9;
     324            4 :         map[180] = 29.38;
     325            4 :         map[190] = 32.0;
     326            4 :         map[200] = 34.5;
     327            4 :         map[210] = 37.0;
     328            4 :         map[220] = 39.91;
     329            4 :         map[230] = 43.11;
     330            4 :         map[240] = 46.4;
     331            4 :         map[250] = 49.3;
     332            4 :         map[260] = 52.4;
     333            4 :         map[270] = 56.09;
     334            4 :         map[280] = 59.8;
     335            4 :         map[290] = 63.7;
     336            4 :         map[300] = 66.8;
     337            4 :         map[310] = 71.0;
     338            4 :         map[320] = 75.39;
     339            4 :         map[330] = 79.9;
     340            4 :         map[340] = 84.1;
     341            4 :         map[350] = 87.9;
     342            4 :         map[360] = 92.7;
     343            4 :         map[370] = 97.6;
     344            4 :         map[380] = 102.0;
     345            4 :         map[390] = 107.0;
     346            4 :         map[400] = 112.0;
     347            4 :         map[410] = 117.5;
     348            4 :         map[420] = 123.0;
     349            4 :         map[430] = 128.3;
     350            4 :         map[440] = 133.3;
     351            4 :         map[450] = 139.2;
     352            4 :         map[460] = 145.5;
     353            4 :         map[470] = 150.0;
     354            4 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     355            4 :         return map;
     356              :     }
     357              : 
     358            4 :     TrainParams initNGT400_16Params() const {
     359              :         TrainParams params;
     360            4 :         params.weight = 384;
     361            4 :         params.mf = 1.04;
     362            4 :         params.length = 200;
     363            4 :         params.decl = 0.9;
     364            4 :         params.vmax = 430 / 3.6;
     365            4 :         params.recovery = 0.6;
     366            4 :         params.traction = initNGT400_16Traction();
     367            4 :         params.resistance = initNGT400_16Resistance();
     368            4 :         return params;
     369            0 :     }
     370              : 
     371            9 :     LinearApproxHelpers::LinearApproxMap initICE1Traction() const {
     372              :         LinearApproxHelpers::LinearApproxMap map;
     373            9 :         map[0] = 400;
     374            9 :         map[10] = 394;
     375            9 :         map[20] = 388;
     376            9 :         map[30] = 382;
     377            9 :         map[40] = 377;
     378            9 :         map[50] = 372;
     379            9 :         map[60] = 369;
     380            9 :         map[70] = 366;
     381            9 :         map[80] = 363;
     382            9 :         map[90] = 361;
     383            9 :         map[100] = 349;
     384            9 :         map[110] = 317;
     385            9 :         map[120] = 290;
     386            9 :         map[130] = 268;
     387            9 :         map[140] = 249;
     388            9 :         map[150] = 232;
     389            9 :         map[160] = 217;
     390            9 :         map[170] = 205;
     391            9 :         map[180] = 193;
     392            9 :         map[190] = 183;
     393            9 :         map[200] = 174;
     394            9 :         map[210] = 165;
     395            9 :         map[220] = 158;
     396            9 :         map[230] = 151;
     397            9 :         map[240] = 145;
     398            9 :         map[250] = 139;
     399            9 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     400            9 :         return map;
     401              :     }
     402              : 
     403            9 :     LinearApproxHelpers::LinearApproxMap initICE1Resistance() const {
     404              :         LinearApproxHelpers::LinearApproxMap map;
     405            9 :         map[0] = 10.7;
     406            9 :         map[10] = 12.3;
     407            9 :         map[20] = 14.2;
     408            9 :         map[30] = 16.4;
     409            9 :         map[40] = 18.7;
     410            9 :         map[50] = 21.3;
     411            9 :         map[60] = 24.2;
     412            9 :         map[70] = 27.3;
     413            9 :         map[80] = 30.6;
     414            9 :         map[90] = 34.1;
     415            9 :         map[100] = 37.9;
     416            9 :         map[110] = 41.9;
     417            9 :         map[120] = 46.2;
     418            9 :         map[130] = 50.6;
     419            9 :         map[140] = 55.4;
     420            9 :         map[150] = 60.4;
     421            9 :         map[160] = 65.6;
     422            9 :         map[170] = 71.1;
     423            9 :         map[180] = 76.7;
     424            9 :         map[190] = 82.6;
     425            9 :         map[200] = 88.8;
     426            9 :         map[210] = 95.2;
     427            9 :         map[220] = 101.8;
     428            9 :         map[230] = 108.7;
     429            9 :         map[240] = 115.8;
     430            9 :         map[250] = 123.1;
     431            9 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     432            9 :         return map;
     433              :     }
     434              : 
     435            9 :     TrainParams initICE1Params() const {
     436              :         TrainParams params;
     437            9 :         params.weight = 876;
     438            9 :         params.mf = 1.1;
     439            9 :         params.length = 358;
     440            9 :         params.decl = 0.5;
     441            9 :         params.vmax = 250 / 3.6;
     442            9 :         params.recovery = 0.1;
     443            9 :         params.traction = initICE1Traction();
     444            9 :         params.resistance = initICE1Resistance();
     445            9 :         return params;
     446            0 :     }
     447              : 
     448            5 :     TrainParams initICE3Params() const {
     449              :         TrainParams params;
     450            5 :         params.weight = 420;
     451            5 :         params.mf = 1.04;
     452            5 :         params.length = 200;
     453            5 :         params.decl = 0.5;
     454            5 :         params.vmax = 300 / 3.6;
     455            5 :         params.recovery = 0.6;
     456            5 :         params.traction = initICE3Traction();
     457            5 :         params.resistance = initICE3Resistance();
     458            5 :         return params;
     459            0 :     }
     460              : 
     461            5 :     LinearApproxHelpers::LinearApproxMap initICE3Traction() const {
     462              :         LinearApproxHelpers::LinearApproxMap map;
     463            5 :         map[0] = 300;
     464            5 :         map[10] = 298;
     465            5 :         map[20] = 297;
     466            5 :         map[30] = 295;
     467            5 :         map[40] = 293;
     468            5 :         map[50] = 292;
     469            5 :         map[60] = 290;
     470            5 :         map[70] = 288;
     471            5 :         map[80] = 286.5;
     472            5 :         map[90] = 285;
     473            5 :         map[100] = 283;
     474            5 :         map[110] = 262;
     475            5 :         map[120] = 240;
     476            5 :         map[130] = 221;
     477            5 :         map[140] = 206;
     478            5 :         map[150] = 192;
     479            5 :         map[160] = 180;
     480            5 :         map[170] = 169;
     481            5 :         map[180] = 160;
     482            5 :         map[190] = 152;
     483            5 :         map[200] = 144;
     484            5 :         map[210] = 137;
     485            5 :         map[220] = 131;
     486            5 :         map[230] = 125;
     487            5 :         map[240] = 120;
     488            5 :         map[250] = 115;
     489            5 :         map[260] = 111;
     490            5 :         map[270] = 107;
     491            5 :         map[280] = 103;
     492            5 :         map[290] = 99;
     493            5 :         map[300] = 96;
     494            5 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     495            5 :         return map;
     496              :     }
     497              : 
     498            5 :     LinearApproxHelpers::LinearApproxMap initICE3Resistance() const {
     499              :         LinearApproxHelpers::LinearApproxMap map;
     500            5 :         map[0] = 7.4;
     501            5 :         map[10] = 7.6;
     502            5 :         map[20] = 8.0;
     503            5 :         map[30] = 8.4;
     504            5 :         map[40] = 9.1;
     505            5 :         map[50] = 9.8;
     506            5 :         map[60] = 10.7;
     507            5 :         map[70] = 11.7;
     508            5 :         map[80] = 12.8;
     509            5 :         map[90] = 14.1;
     510            5 :         map[100] = 15.5;
     511            5 :         map[110] = 17.1;
     512            5 :         map[120] = 18.8;
     513            5 :         map[130] = 20.6;
     514            5 :         map[140] = 22.6;
     515            5 :         map[150] = 24.6;
     516            5 :         map[160] = 26.9;
     517            5 :         map[170] = 29.2;
     518            5 :         map[180] = 31.7;
     519            5 :         map[190] = 34.3;
     520            5 :         map[200] = 37.1;
     521            5 :         map[210] = 40.0;
     522            5 :         map[220] = 43.1;
     523            5 :         map[230] = 46.2;
     524            5 :         map[240] = 49.6;
     525            5 :         map[250] = 53.0;
     526            5 :         map[260] = 56.6;
     527            5 :         map[270] = 60.3;
     528            5 :         map[280] = 64.1;
     529            5 :         map[290] = 68.1;
     530            5 :         map[300] = 71.8;
     531            5 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     532            5 :         return map;
     533              :     }
     534              : 
     535           89 :     TrainParams initREDosto7Params() const {
     536              :         TrainParams params;
     537           89 :         params.weight = 425.5;
     538           89 :         params.mf = 1.1;
     539           89 :         params.length = 207;
     540           89 :         params.decl = 0.5;
     541           89 :         params.vmax = 160 / 3.6;
     542           89 :         params.recovery = 0.1;
     543           89 :         params.traction = initREDosto7Traction();
     544           89 :         params.resistance = initREDosto7Resistance();
     545           89 :         return params;
     546            0 :     }
     547              : 
     548           89 :     LinearApproxHelpers::LinearApproxMap initREDosto7Traction() const {
     549              :         LinearApproxHelpers::LinearApproxMap map;
     550           89 :         map[0] = 300;
     551           89 :         map[10] = 300;
     552           89 :         map[20] = 300;
     553           89 :         map[30] = 300;
     554           89 :         map[40] = 300;
     555           89 :         map[50] = 300;
     556           89 :         map[60] = 300;
     557           89 :         map[70] = 289;
     558           89 :         map[80] = 253;
     559           89 :         map[90] = 224;
     560           89 :         map[100] = 202;
     561           89 :         map[110] = 183;
     562           89 :         map[120] = 168;
     563           89 :         map[130] = 155;
     564           89 :         map[140] = 144;
     565           89 :         map[150] = 134;
     566           89 :         map[160] = 125;
     567           89 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     568           89 :         return map;
     569              :     }
     570              : 
     571           89 :     LinearApproxHelpers::LinearApproxMap initREDosto7Resistance() const {
     572              :         LinearApproxHelpers::LinearApproxMap map;
     573           89 :         map[0] = 8.5;
     574           89 :         map[10] = 8.9;
     575           89 :         map[20] = 9.5;
     576           89 :         map[30] = 10.4;
     577           89 :         map[40] = 11.4;
     578           89 :         map[50] = 12.7;
     579           89 :         map[60] = 14.1;
     580           89 :         map[70] = 15.8;
     581           89 :         map[80] = 17.7;
     582           89 :         map[90] = 19.8;
     583           89 :         map[100] = 22.6;
     584           89 :         map[110] = 24.6;
     585           89 :         map[120] = 27.3;
     586           89 :         map[130] = 30.2;
     587           89 :         map[140] = 33.3;
     588           89 :         map[150] = 36.6;
     589           89 :         map[160] = 40.2;
     590           89 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     591           89 :         return map;
     592              :     }
     593              : 
     594           19 :     TrainParams initRB628Params() const {
     595              :         TrainParams params;
     596           19 :         params.weight = 72.2;
     597           19 :         params.mf = 1.04;
     598           19 :         params.length = 46;
     599           19 :         params.decl = 0.5;
     600           19 :         params.vmax = 120 / 3.6;
     601           19 :         params.recovery = 0;
     602           19 :         params.traction = initRB628Traction();
     603           19 :         params.resistance = initRB628Resistance();
     604           19 :         return params;
     605            0 :     }
     606              : 
     607           19 :     LinearApproxHelpers::LinearApproxMap initRB628Traction() const {
     608              :         LinearApproxHelpers::LinearApproxMap map;
     609           19 :         map[0] = 60;
     610           19 :         map[10] = 53.8;
     611           19 :         map[20] = 47.6;
     612           19 :         map[30] = 36.9;
     613           19 :         map[40] = 28.7;
     614           19 :         map[50] = 23.5;
     615           19 :         map[60] = 20.0;
     616           19 :         map[70] = 17.5;
     617           19 :         map[80] = 15.2;
     618           19 :         map[90] = 13.9;
     619           19 :         map[100] = 12.8;
     620           19 :         map[110] = 11.7;
     621           19 :         map[120] = 10.8;
     622           19 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     623           19 :         return map;
     624              :     }
     625              : 
     626           19 :     LinearApproxHelpers::LinearApproxMap initRB628Resistance() const {
     627              :         LinearApproxHelpers::LinearApproxMap map;
     628           19 :         map[0] = 1.29;
     629           19 :         map[10] = 1.46;
     630           19 :         map[20] = 1.73;
     631           19 :         map[30] = 2.08;
     632           19 :         map[40] = 2.52;
     633           19 :         map[50] = 3.05;
     634           19 :         map[60] = 3.66;
     635           19 :         map[70] = 4.36;
     636           19 :         map[80] = 5.16;
     637           19 :         map[90] = 6.03;
     638           19 :         map[100] = 7.00;
     639           19 :         map[110] = 8.06;
     640           19 :         map[120] = 9.2;
     641           19 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     642           19 :         return map;
     643              :     }
     644              : 
     645           38 :     TrainParams initFreightParams() const {
     646              :         TrainParams params;
     647           38 :         params.weight = 1440;
     648           38 :         params.mf = 1.06;
     649           38 :         params.length = 512;
     650           38 :         params.decl = 0.3;
     651           38 :         params.vmax = 120 / 3.6;
     652           38 :         params.recovery = 0.05;
     653           38 :         params.traction = initFreightTraction();
     654           38 :         params.resistance = initFreightResistance();
     655           38 :         return params;
     656            0 :     }
     657              : 
     658           38 :     LinearApproxHelpers::LinearApproxMap initFreightTraction() const {
     659              :         LinearApproxHelpers::LinearApproxMap map;
     660           38 :         map[0] = 300;
     661           38 :         map[10] = 296;
     662           38 :         map[20] = 293;
     663           38 :         map[30] = 289;
     664           38 :         map[40] = 286;
     665           38 :         map[50] = 282;
     666           38 :         map[60] = 279;
     667           38 :         map[70] = 275;
     668           38 :         map[80] = 272;
     669           38 :         map[90] = 255;
     670           38 :         map[100] = 230;
     671           38 :         map[110] = 209;
     672           38 :         map[120] = 190;//guessed value
     673           38 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     674           38 :         return map;
     675              :     }
     676              : 
     677           38 :     LinearApproxHelpers::LinearApproxMap initFreightResistance() const {
     678              :         LinearApproxHelpers::LinearApproxMap map;
     679           38 :         map[0] = 1.9;
     680           38 :         map[10] = 4.3;
     681           38 :         map[20] = 8.5;
     682           38 :         map[30] = 14.3;
     683           38 :         map[40] = 21.7;
     684           38 :         map[50] = 30.8;
     685           38 :         map[60] = 41.5;
     686           38 :         map[70] = 53.8;
     687           38 :         map[80] = 67.8;
     688           38 :         map[90] = 83.5;
     689           38 :         map[100] = 110.7;
     690           38 :         map[110] = 119.6;
     691           38 :         map[120] = 140.2;
     692           38 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     693           38 :         return map;
     694              :     }
     695              : 
     696           38 :     LinearApproxHelpers::LinearApproxMap initRB425Traction() const {
     697              :         LinearApproxHelpers::LinearApproxMap map;
     698           38 :         map[0] = 150;
     699           38 :         map[10] = 150;
     700           38 :         map[20] = 150;
     701           38 :         map[30] = 150;
     702           38 :         map[40] = 150;
     703           38 :         map[50] = 150;
     704           38 :         map[60] = 140;
     705           38 :         map[70] = 120;
     706           38 :         map[80] = 105;
     707           38 :         map[90] = 93;
     708           38 :         map[100] = 84;
     709           38 :         map[110] = 75;
     710           38 :         map[120] = 70;
     711           38 :         map[130] = 56;
     712           38 :         map[140] = 52;
     713           38 :         map[150] = 46;
     714           38 :         map[160] = 40;
     715           38 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     716           38 :         return map;
     717              :     }
     718              : 
     719           38 :     LinearApproxHelpers::LinearApproxMap initRB425Resistance() const {
     720              :         LinearApproxHelpers::LinearApproxMap map;
     721           38 :         map[0] = 2.6;
     722           38 :         map[10] = 2.9;
     723           38 :         map[20] = 3.3;
     724           38 :         map[30] = 3.7;
     725           38 :         map[40] = 4.3;
     726           38 :         map[50] = 4.9;
     727           38 :         map[60] = 5.7;
     728           38 :         map[70] = 6.6;
     729           38 :         map[80] = 7.5;
     730           38 :         map[90] = 8.6;
     731           38 :         map[100] = 9.7;
     732           38 :         map[110] = 11.0;
     733           38 :         map[120] = 12.3;
     734           38 :         map[130] = 13.8;
     735           38 :         map[140] = 15.3;
     736           38 :         map[150] = 16.9;
     737           38 :         map[160] = 18.7;
     738           38 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     739           38 :         return map;
     740              :     }
     741              : 
     742           38 :     TrainParams initRB425Params() const {
     743              :         TrainParams params;
     744           38 :         params.weight = 138;
     745           38 :         params.mf = 1.04;
     746           38 :         params.length = 67.5;
     747           38 :         params.decl = 1.0;
     748           38 :         params.vmax = 160 / 3.6;
     749           38 :         params.recovery = 0.6;
     750           38 :         params.traction = initRB425Traction();
     751           38 :         params.resistance = initRB425Resistance();
     752           38 :         return params;
     753            0 :     }
     754              : 
     755            4 :     LinearApproxHelpers::LinearApproxMap initMireoPlusB2TTraction() const {
     756              :         LinearApproxHelpers::LinearApproxMap map;
     757            4 :         map[0] = 106.15;
     758            4 :         map[10] = 106.15;
     759            4 :         map[20] = 106.15;
     760            4 :         map[30] = 106.15;
     761            4 :         map[40] = 106.15;
     762            4 :         map[50] = 106.15;
     763            4 :         map[60] = 103.73;
     764            4 :         map[70] = 88.70;
     765            4 :         map[80] = 77.47;
     766            4 :         map[90] = 68.76;
     767            4 :         map[100] = 61.82;
     768            4 :         map[110] = 56.15;
     769            4 :         map[120] = 51.43;
     770            4 :         map[130] = 47.44;
     771            4 :         map[140] = 44.03;
     772            4 :         map[150] = 41.07;
     773            4 :         map[160] = 38.49;
     774            4 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     775            4 :         return map;
     776              :     }
     777              : 
     778              : 
     779            4 :     LinearApproxHelpers::LinearApproxMap initMireoPlusB2TResistance() const {
     780              :         LinearApproxHelpers::LinearApproxMap map;
     781            4 :         map[0] = 1.01;
     782            4 :         map[10] = 1.09;
     783            4 :         map[20] = 1.27;
     784            4 :         map[30] = 1.55;
     785            4 :         map[40] = 1.93;
     786            4 :         map[50] = 2.41;
     787            4 :         map[60] = 2.99;
     788            4 :         map[70] = 3.67;
     789            4 :         map[80] = 4.46;
     790            4 :         map[90] = 5.34;
     791            4 :         map[100] = 6.34;
     792            4 :         map[110] = 7.44;
     793            4 :         map[120] = 8.64;
     794            4 :         map[130] = 9.96;
     795            4 :         map[140] = 11.38;
     796            4 :         map[150] = 12.91;
     797            4 :         map[160] = 14.56;
     798            4 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     799            4 :         return map;
     800              :     }
     801              : 
     802            4 :     TrainParams initMireoPlusB2TParams() const {
     803              :         TrainParams params;
     804            4 :         params.weight = 105.5;
     805            4 :         params.mf = 1.05;
     806            4 :         params.length = 46.56;
     807            4 :         params.decl = 1.1;
     808            4 :         params.vmax = 160 / 3.6;
     809            4 :         params.recovery = 0.3;
     810            4 :         params.traction = initMireoPlusB2TTraction();
     811            4 :         params.resistance = initMireoPlusB2TResistance();
     812            4 :         return params;
     813            0 :     }
     814              : 
     815            4 :     LinearApproxHelpers::LinearApproxMap initMireoPlusH2TTraction() const {
     816              :         LinearApproxHelpers::LinearApproxMap map;
     817            4 :         map[0] = 104.50;
     818            4 :         map[10] = 104.50;
     819            4 :         map[20] = 104.50;
     820            4 :         map[30] = 104.50;
     821            4 :         map[40] = 104.50;
     822            4 :         map[50] = 104.50;
     823            4 :         map[60] = 102.00;
     824            4 :         map[70] = 87.43;
     825            4 :         map[80] = 76.50;
     826            4 :         map[90] = 68.00;
     827            4 :         map[100] = 61.20;
     828            4 :         map[110] = 55.64;
     829            4 :         map[120] = 51.00;
     830            4 :         map[130] = 47.08;
     831            4 :         map[140] = 43.71;
     832            4 :         map[150] = 40.80;
     833            4 :         map[160] = 38.25;
     834            4 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     835            4 :         return map;
     836              :     }
     837              : 
     838              : 
     839            4 :     LinearApproxHelpers::LinearApproxMap initMireoPlusH2TResistance() const {
     840              :         LinearApproxHelpers::LinearApproxMap map;
     841            4 :         map[0] = 1.01;
     842            4 :         map[10] = 1.09;
     843            4 :         map[20] = 1.27;
     844            4 :         map[30] = 1.55;
     845            4 :         map[40] = 1.93;
     846            4 :         map[50] = 2.41;
     847            4 :         map[60] = 2.99;
     848            4 :         map[70] = 3.67;
     849            4 :         map[80] = 4.45;
     850            4 :         map[90] = 5.34;
     851            4 :         map[100] = 6.34;
     852            4 :         map[110] = 7.43;
     853            4 :         map[120] = 8.64;
     854            4 :         map[130] = 9.95;
     855            4 :         map[140] = 11.38;
     856            4 :         map[150] = 12.91;
     857            4 :         map[160] = 14.56;
     858            4 :         LinearApproxHelpers::scalePoints(map, 1 / 3.6, 1);
     859            4 :         return map;
     860              :     }
     861              : 
     862            4 :     TrainParams initMireoPlusH2TParams() const {
     863              :         TrainParams params;
     864            4 :         params.weight = 105.4;
     865            4 :         params.mf = 1.05;
     866            4 :         params.length = 46.56;
     867            4 :         params.decl = 1.1;
     868            4 :         params.vmax = 160 / 3.6;
     869            4 :         params.recovery = 0.3;
     870            4 :         params.traction = initMireoPlusH2TTraction();
     871            4 :         params.resistance = initMireoPlusH2TResistance();
     872            4 :         return params;
     873            0 :     }
     874              : 
     875              :     TrainParams initCustomParams() const {
     876              :         TrainParams params;
     877           12 :         params.weight = 100;
     878           12 :         params.mf = 1.05;
     879           12 :         params.length = 100;
     880           12 :         params.decl = 1;
     881           12 :         params.vmax = 200 / 3.6;
     882           12 :         params.recovery = 0.3;
     883              :         return params;
     884              :     }
     885              : //    void initVehicleVariables(const MSVehicle *const pVehicle, MSCFModel_Rail::VehicleVariables *pVariables)const;
     886              : 
     887              : };
        

Generated by: LCOV version 2.0-1