Skip to content

Commit

Permalink
resistance coefficients are now in kN. refs #14258
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Feb 28, 2024
1 parent 8650a61 commit fce8692
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/microsim/cfmodels/MSCFModel_Rail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
#include <microsim/lcmodels/MSAbstractLaneChangeModel.h>
#include "MSCFModel_Rail.h"

#define N2kN 0.001

// ===========================================================================
// trainParams method definitions
// ===========================================================================
Expand Down Expand Up @@ -148,13 +146,8 @@ MSCFModel_Rail::MSCFModel_Rail(const MSVehicleType* vtype) :
const bool hasAllResCoef = (myTrainParams.resCoef_constant != INVALID_DOUBLE
&& myTrainParams.resCoef_linear != INVALID_DOUBLE
&& myTrainParams.resCoef_quadratic != INVALID_DOUBLE);
if (hasSomeResCoef) {
if (!hasAllResCoef) {
throw ProcessError(TLF("Some undefined resistance coefficients for vType '%' (requires resCoef_constant, resCoef_linear and resCoef_quadratic)", vtype->getID()));
}
myTrainParams.resCoef_constant *= N2kN;
myTrainParams.resCoef_linear *= N2kN;
myTrainParams.resCoef_quadratic *= N2kN;
if (hasSomeResCoef && !hasAllResCoef) {
throw ProcessError(TLF("Some undefined resistance coefficients for vType '%' (requires resCoef_constant, resCoef_linear and resCoef_quadratic)", vtype->getID()));
}
if (myTrainParams.resCoef_constant != INVALID_DOUBLE && resistanceTable.size() > 0) {
WRITE_WARNING(TLF("Ignoring resistanceTable because resistance coefficents are set for vType '%'.", vtype->getID()));
Expand Down

0 comments on commit fce8692

Please sign in to comment.