usesDeprecatedSyntax = true ; ActivityParams actParams = getActivityTypeByNumber(key.substring("activityOpeningTime_".length())); actParams.setOpeningTime(Time.parseTime(value)); } else if (key.startsWith("activityLatestStartTime_")) { log.warn( key + msg );
transitActivityParams.setOpeningTime(0.) ; transitActivityParams.setClosingTime(0.) ; ActivityUtilityParameters.Builder modeParamsBuilder = new ActivityUtilityParameters.Builder(transitActivityParams);
settings.setLatestStartTime( random.nextInt( 24*3600 ) ); settings.setMinimalDuration( random.nextInt( 24*3600 ) ); settings.setOpeningTime( random.nextInt( 24*3600 ) ); settings.setPriority( random.nextInt( 10 ) ); settings.setTypicalDuration( random.nextInt( 24*3600 ) );
wParams.setOpeningTime( 8*3600.0); // the agent arrives 30min early wParams.setClosingTime(15*3600.0); // the agent stays 1h too long double score = calcScore(f); wParams.setOpeningTime(20*3600.0); wParams.setClosingTime(21*3600.0); wParams.setOpeningTime(1*3600.0); wParams.setClosingTime(2*3600.0); wParams.setOpeningTime(8.*3600.0 + 15.*60. ); wParams.setClosingTime (8.*3600.0 + 15.*60. );
ActivityParams homeParams = new ActivityParams("home"); ActivityParams workParams = new ActivityParams("work"); workParams.setOpeningTime(7*3600); workParams.setClosingTime(19*3600); config.addActivityParams(homeParams);
private static void enrichConfig(Config c) { PlanCalcScoreConfigGroup.ActivityParams pre = new PlanCalcScoreConfigGroup.ActivityParams("origin"); pre.setTypicalDuration(49); // needs to be geq 49, otherwise when // running a simulation one gets // "java.lang.RuntimeException: zeroUtilityDuration of type pre-evac must be greater than 0.0. Did you forget to specify the typicalDuration?" // the reason is the double precision. see also comment in // ActivityUtilityParameters.java (gl) pre.setMinimalDuration(49); pre.setClosingTime(49); pre.setEarliestEndTime(49); pre.setLatestStartTime(49); pre.setOpeningTime(49); PlanCalcScoreConfigGroup.ActivityParams post = new PlanCalcScoreConfigGroup.ActivityParams("destination"); post.setTypicalDuration(49); // dito post.setMinimalDuration(49); post.setClosingTime(49); post.setEarliestEndTime(49); post.setLatestStartTime(49); post.setOpeningTime(49); c.planCalcScore().addActivityParams(pre); c.planCalcScore().addActivityParams(post); c.planCalcScore().setLateArrival_utils_hr(0.); c.planCalcScore().setPerforming_utils_hr(0.); }
/** * Test the performing part of the scoring function when an activity has an OpeningTime set. */ @Test public void testOpeningTime() { Fixture f = new Fixture(); double perf = +6.0; f.config.planCalcScore().setPerforming_utils_hr(perf); double initialScore = calcScore(f); ActivityParams wParams = f.config.planCalcScore().getActivityParams("w"); wParams.setOpeningTime(8*3600.0); // now the agent arrives 30min early to the FIRST work activity and has to wait double score = calcScore(f); // check the difference between 2.5 and 2.0 hours of working assertEquals(perf * 3.0 * Math.log(2.5 / 2.0), initialScore - score, EPSILON); }
/** * Test the waiting part of the scoring function. */ @Test public void testWaitingTime() { Fixture f = new Fixture(); double waiting = -10.0; f.config.planCalcScore().setMarginalUtlOfWaiting_utils_hr(waiting); ActivityParams wParams = f.config.planCalcScore().getActivityParams("w"); wParams.setOpeningTime( 8*3600.0); // the agent arrives 30min early wParams.setClosingTime(15*3600.0); // the agent stays 1h too long // the agent spends 1.5h waiting at the work place assertEquals(waiting * 1.5, calcScore(f), EPSILON); }
@StringSetter("openingTime") private void setOpeningTime(final String openingTime) { testForLocked(); setOpeningTime(Time.parseTime(openingTime)); }