Skip to content

Commit

Permalink
fix Junc_dist default value, and let the possibility to the user to u…
Browse files Browse the repository at this point in the history
…se this junc_dist to define acceleration.
  • Loading branch information
pierromond committed Nov 4, 2024
1 parent 090df05 commit c98eaff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class RoadCnossosParameters {
private double qStudRatio; // Average ratio of the total volume of light vehicles per hour equipped with studded tyres during the period Ts_stud (in months)


private double Junc_dist; // Distance to junction
private double Junc_dist = 250; // Distance to junction
private int Junc_type; // Junction type (k=1 traffic lights, k=2 roundabout)

private double slopePercentage = 0; // slope s (in %), In the case of a bi-directional traffic flow, it is necessary to split the flow into two components and correct half for uphill and half for downhill.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public static double evaluate(RoadVehicleCnossosvarParameters parameters) throws


// Rolling noise acceleration correction
// double coefficientJunctionDistance = Math.max(1 - Math.abs(Junc_dist) / 100, 0);
//RoadLvl = RoadLvl + getCr(veh_type, Junc_type, coeffVer) * coefficientJunctionDistance;
double coefficientJunctionDistance = Math.max(1 - Math.abs(Junc_dist) / 100, 0);
RoadLvl = RoadLvl + getCr(veh_type, Junc_type, coeffVer) * coefficientJunctionDistance;


//Studied tyres
Expand Down Expand Up @@ -102,9 +102,9 @@ public static double evaluate(RoadVehicleCnossosvarParameters parameters) throws
double aMax;
switch (acc_type) {
case 1:
//if (veh_type.equals("1") || veh_type.equals("2") || veh_type.equals("3")) {
// MotorLvl = MotorLvl + getCp(veh_type, Junc_type, coeffVer) * coefficientJunctionDistance;
//}
if (veh_type.equals("1") || veh_type.equals("2") || veh_type.equals("3")) {
MotorLvl = MotorLvl + getCp(veh_type, Junc_type, coeffVer) * coefficientJunctionDistance;
}
break;
case 2:
switch (veh_type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public void T02_OneVeh() throws IOException {
rsParameters_dyn.setFrequency(FreqParam);
rsParameters_dyn.setTemperature(Temperature);
rsParameters_dyn.setRoadSurface(RoadSurface);
rsParameters_dyn.setJunc_dist(250);
double res = RoadVehicleCnossosvar.evaluate(rsParameters_dyn);
double res2 = RoadCnossos.evaluate(rsParameters_stat);
assertEquals(res2, res, EPSILON_TEST1);
Expand Down

0 comments on commit c98eaff

Please sign in to comment.