/** Assigns links to each activity in the plan. */ @Override public void run(final Plan plan) { processPlan(plan); }
@Override public void run(final Plan plan) { mutatePlan(plan); }
private boolean isMassConserving(final Subtour subtour) { for (String mode : chainBasedModes) { if (!isMassConserving(subtour, mode)) { return false; } } return true; }
@Override public final void handlePlan(final Plan plan) { if (this.directAlgo == null) { this.algothreads[this.count % this.numOfThreads].addPlanToThread(plan); this.count++; } else { this.directAlgo.run(plan); } }
@Override public PlanAlgorithm getPlanAlgoInstance() { ChooseRandomSingleLegMode algo = new ChooseRandomSingleLegMode(this.availableModes, MatsimRandom.getLocalInstance(), this.allowSwitchFromListedModesOnly ); algo.setIgnoreCarAvailability(this.ignoreCarAvailability); return algo; }
@Override public PlanAlgorithm getPlanAlgoInstance() { ChooseRandomLegMode algo = new ChooseRandomLegMode(this.availableModes, MatsimRandom.getLocalInstance(), false); algo.setIgnoreCarAvailability(this.ignoreCarAvailability); return algo; }
@Override public PlanAlgorithm getPlanAlgoInstance() { PlanAlgorithm pmta; switch (this.activityDurationInterpretation) { case minOfDurationAndEndTime: pmta = new TripPlanMutateTimeAllocation(this.tripRouterProvider.get().getStageActivityTypes(), this.mutationRange, this.affectingDuration, MatsimRandom.getLocalInstance(), this.subpopulationAttribute, this.personAttributes, this.subpopulationMutationRanges, this.subpopulationAffectingDuration); break; default: pmta = new PlanMutateTimeAllocationSimplified( this.tripRouterProvider.get().getStageActivityTypes(), this.mutationRange, this.affectingDuration, MatsimRandom.getLocalInstance()); } return pmta; } }
@Override public void run() { for (Person person : this.persons) { this.personAlgo.run(person); counter.incCounter(); } } }
/** * Handles each person of the given <code>population</code> with the specified <code>algorithm</code>, * using up to <code>numberOfThreads</code> threads to speed things up. Use this method only if the given * algorithm is thread-safe! Otherwise, use {@link #run(Population, int, PersonAlgorithmProvider)}. * * @param population * @param numberOfThreads * @param algorithm */ public static void run(final Population population, final int numberOfThreads, final PersonAlgorithm algorithm) { run(population, numberOfThreads, new PersonAlgorithmProvider() { @Override public PersonAlgorithm getPersonAlgorithm() { return algorithm; } }); }
private boolean isMassConserving( final Subtour subtour, final String mode) { final Activity firstOrigin = findFirstOriginOfMode( subtour.getTrips(), mode); if (firstOrigin == null) { return true; } final Activity lastDestination = findLastDestinationOfMode( subtour.getTrips(), mode); return atSameLocation(firstOrigin, lastDestination); }
@Override public AbstractPersonAlgorithm getPersonAlgorithm() { return new PersonPrepareForSim(new PlanRouter(tripRouterProvider.get(), activityFacilities), scenario, carOnlyNetwork ); } // yyyyyy This prepared network is only used for computing the distance. So the full network would
@Override public void run(final Plan plan) { mutatePlan(plan); }
@Override public void run(final Person person) { for (Plan plan : person.getPlans()) { run(plan); } }
@Override public void run(final Plan plan) { List<PlanElement> tour = plan.getPlanElements(); changeToRandomLegMode(tour, plan); }
private void setRandomLegMode(final Leg leg, final boolean forbidCar) { leg.setMode(chooseModeOtherThan(leg.getMode(), forbidCar)); Route route = leg.getRoute() ; if ( route != null && route instanceof NetworkRoute) { ((NetworkRoute)route).setVehicleId(null); } }
@Override public void run() { for (Plan plan : this.plans) { this.planAlgo.run(plan); this.counter.incCounter(); } } }
@Override public void run(Person person) { if (judge(person)) { count(); this.nextAlgorithm.run(person); } }
@Override public AbstractPersonAlgorithm getPersonAlgorithm() { return new PersonPrepareForSim(new PlanRouter(tripRouterProvider.get(), activityFacilities), scenario, carOnlyNetwork); } }
/** Assigns links to each activity in all plans of the person. */ @Override public void run(final Person person) { for (Plan plan : person.getPlans()) { processPlan(plan); } }
@Override public void run(final Plan plan) { if (judge(plan)) { count(); this.nextAlgorithm.run(plan); } }