public LexicographicForCompositionExtraPlanRemover( final int maxPlansPerComposition, final int maxPlansPerAgent) { this.maxPlansPerComposition = maxPlansPerComposition; this.maxPlansPerAgent = maxPlansPerAgent; this.random = MatsimRandom.getLocalInstance(); }
public GroupStrategyManager( final IterationStopWatch stopWatch, final GroupIdentifier groupIdentifier, final GroupStrategyRegistry registry ) { this.stopWatch = stopWatch; this.groupIdentifier = groupIdentifier; this.registry = registry; this.random = MatsimRandom.getLocalInstance(); }
@Inject public DynamicGroupIdentifier(final Scenario scenario) { this.scenario = scenario; this.random = MatsimRandom.getLocalInstance(); }
@Override public GenericPlanAlgorithm<GroupPlans> createAlgorithm(ReplanningContext replanningContext) { return new OptimizeVehicleAllocationAtTourLevelAlgorithm( stageActs, MatsimRandom.getLocalInstance(), vehicleRessources, vehicularModes, allowNullRoutes); } }
@Override public GenericPlanAlgorithm<GroupPlans> createAlgorithm(ReplanningContext replanningContext) { return new MutateActivityLocationsToLocationsOfOthersAlgorithm( choiceSet, MatsimRandom.getLocalInstance()); } }
@Override public GenericPlanAlgorithm<ReplanningGroup> createAlgorithm(ReplanningContext replanningContext) { return new PrepareVehicleAllocationForSimAlgorithm( MatsimRandom.getLocalInstance(), jointPlans, vehicles, planlinks ); }
@Override public GenericPlanAlgorithm<GroupPlans> createAlgorithm(ReplanningContext replanningContext) { return new JointPlanMergingAlgorithm( factory, probAcceptance, MatsimRandom.getLocalInstance() ); } }
@Override public PlanAlgorithm getPlanAlgoInstance() { return new AllocateVehicleToSubtourAlgorithm( MatsimRandom.getLocalInstance(), mode, tripRouterProvider.get(), ressources); } }
@Override public GenericPlanAlgorithm<GroupPlans> createAlgorithm(ReplanningContext replanningContext) { return new AllocateVehicleToPlansInGroupPlanAlgorithm( MatsimRandom.getLocalInstance(), vehicleRessources, modes, allowNullRoutes, preserveAllocations); } }
@Override public GenericPlanAlgorithm<JointPlan> createAlgorithm(ReplanningContext replanningContext) { return new JointTripInsertorAndRemoverAlgorithm( sc, tripRouterFactory.get(), MatsimRandom.getLocalInstance(), true); // "iterative" }
@Override public GroupLevelPlanSelector createSelector() { return new RandomGroupLevelSelector( MatsimRandom.getLocalInstance(), incompatiblePlansIdentifierFactory ); } }
@Override public PlanAlgorithm getPlanAlgoInstance() { ChooseRandomSingleLegMode algo = new ChooseRandomSingleLegMode(this.availableModes, MatsimRandom.getLocalInstance(), this.allowSwitchFromListedModesOnly ); algo.setIgnoreCarAvailability(this.ignoreCarAvailability); return algo; }
@Override public PlanAlgorithm getPlanAlgoInstance() { TripPlanMutateTimeAllocation pmta = new TripPlanMutateTimeAllocation( tripRouterProvider.get().getStageActivityTypes(), this.mutationRange, affectingDuration, MatsimRandom.getLocalInstance()); pmta.setUseActivityDurations(this.useActivityDurations); return pmta; }
@Override public Plan selectPlan(HasPlansAndId<Plan, Person> person) { if (delegate == null) { delegate = (PlanSelector) ((GenericPlanStrategyImpl) controler.getInjector().getBinding(Key.get(PlanStrategy.class, Names.named(delegateName))).getProvider().get()).getPlanSelector(); } if (MatsimRandom.getLocalInstance().nextDouble() <= this.selectionFrequency) { Plan plan = (Plan) delegate.selectPlan(person); if (slave != null) slave.addPlansForPsim(plan); return plan; } else return person.getSelectedPlan(); }
@Override public GroupLevelPlanSelector createSelector() { return new WhoIsTheBossSelector( MatsimRandom.getLocalInstance(), incompatiblePlansIdentifierFactory , new LogitWeight( MatsimRandom.getLocalInstance(), sc.getConfig().planCalcScore().getBrainExpBeta()) ); } }
@Override public GenericPlanAlgorithm<JointPlan> createAlgorithm(ReplanningContext replanningContext) { return new JointTripInsertorAlgorithm( MatsimRandom.getLocalInstance(), (SocialNetwork) sc.getScenarioElement( SocialNetwork.ELEMENT_NAME ), (JointTripInsertorConfigGroup) sc.getConfig().getModule( JointTripInsertorConfigGroup.GROUP_NAME ), tripRouterFactory.get()); }
@Override public GroupLevelPlanSelector createSelector() { return new LogitSumSelector( MatsimRandom.getLocalInstance(), incompatiblePlansIdentifierFactory, sc.getConfig().planCalcScore().getBrainExpBeta()); } }
@Override public GroupLevelPlanSelector createSelector() { return new CoalitionSelector( new LogitWeight( MatsimRandom.getLocalInstance(), sc.getConfig().planCalcScore().getBrainExpBeta()), conflictSolver); } }
/** * Tests that the mutation range given in the constructor is respected. * * @author mrieser */ public void testMutationRangeParam() { boolean affectingDuration = true ; runMutationRangeTest(new TripPlanMutateTimeAllocation(new StageActivityTypesImpl(PtConstants.TRANSIT_ACTIVITY_TYPE ), 750, affectingDuration, MatsimRandom.getLocalInstance()), 750); runMutationRangeTest(new TripPlanMutateTimeAllocation(new StageActivityTypesImpl(PtConstants.TRANSIT_ACTIVITY_TYPE ), 7200, affectingDuration, MatsimRandom.getLocalInstance()), 7200); }
@Override public GroupLevelPlanSelector createSelector() { return new HighestWeightSelector( incompatiblePlansIdentifierFactory , new LogitWeight( new LowestScoreOfJointPlanWeight( ((JointPlans) sc.getScenarioElement( JointPlans.ELEMENT_NAME )) ), MatsimRandom.getLocalInstance(), sc.getConfig().planCalcScore().getBrainExpBeta()) ); } }