Skip to content

Commit

Permalink
Fix brake adhesion for cogging
Browse files Browse the repository at this point in the history
  • Loading branch information
cam72cam committed Oct 18, 2023
1 parent 8a3a0d9 commit 2446498
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -490,4 +490,8 @@ public double getDirectFrictionNewtons(List<Vec3i> track) {
double pressureNewtons = getDefinition().directFrictionCoefficient * getBrakePressure() * newtons;
return retardedNewtons + independentNewtons + pressureNewtons;
}

public double getBrakeAdhesionEfficiency() {
return 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,13 @@ public double getBrakeSystemEfficiency() {
return super.getBrakeSystemEfficiency();
}

@Override
public double getBrakeAdhesionEfficiency() {
if (cogging) {
return 10;
}
return super.getBrakeAdhesionEfficiency();
}
/*
*
* Misc Helper functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public Configuration(EntityCoupleableRollingStock stock) {


double staticFriction = PhysicalMaterials.STEEL.staticFriction(PhysicalMaterials.STEEL);
this.maximumAdhesionNewtons = massKg * staticFriction * 9.8;
this.maximumAdhesionNewtons = massKg * staticFriction * 9.8 * stock.getBrakeAdhesionEfficiency();
this.designAdhesionNewtons = designMassKg * staticFriction * 9.8 * stock.getBrakeSystemEfficiency();
this.independentBrakePosition = stock.getIndependentBrake();
this.directResistanceNewtons = stock::getDirectFrictionNewtons;
Expand Down

0 comments on commit 2446498

Please sign in to comment.