Skip to content

Commit

Permalink
scale commercial traffic correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Dec 23, 2023
1 parent f969f30 commit 60a8121
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
import org.matsim.core.network.NetworkUtils;
import org.matsim.core.population.PopulationUtils;
import org.matsim.core.population.routes.NetworkRoute;
import org.matsim.counts.*;
import org.matsim.counts.Counts;
import org.matsim.counts.MatsimCountsReader;
import org.matsim.counts.Measurable;
import org.matsim.counts.MeasurementLocation;
import org.matsim.prepare.RunOpenBerlinCalibration;
import org.optaplanner.core.api.solver.Solver;
import org.optaplanner.core.api.solver.SolverFactory;
Expand Down Expand Up @@ -86,7 +89,7 @@ public Integer call() throws Exception {
linkMapping = new Object2IntLinkedOpenHashMap<>();

int k = 0;
for (MeasurementLocation<Link> station : countStations.values()){
for (MeasurementLocation<Link> station : countStations.values()) {
// hard coded to car calibration
Measurable volumes = station.getVolumesForMode(networkMode);
for (int i = 0; i < H; i++) {
Expand Down Expand Up @@ -166,7 +169,7 @@ private List<PlanPerson> processPopulation(Path input, Network network, Counts<L
// if other trips have been scaled, these unscaled trips are scaled as well
if (allCar)
// scale with mean of CAR_FACTOR
scale += (rnd.nextDouble() < 0.85 ? 5: 4);
scale *= (rnd.nextDouble() < 0.85 ? 5 : 4);
}

// Index for plan
Expand Down

0 comments on commit 60a8121

Please sign in to comment.