private void assignOpeningTimes() { Set<String> missingActTypes = new HashSet<>(); for (ActivityFacility af : this.facilities.getFacilities().values()) { for (ActivityOption ao : af.getActivityOptions().values()) { String actType = ao.getType(); ActivityParams params = this.planCalcScoreConfigGroup.getActivityParams(actType); if (params == null) { if (missingActTypes.add(actType)) { log.error("No information for activity type " + actType + " found in given configuration."); } } else { ao.addOpeningTime(new OpeningTimeImpl(params.getOpeningTime(), params.getClosingTime())); } } } }
&& (actType.getClosingTime() != Time.UNDEFINED_TIME)) { hasOpeningAndClosingTime = true; hasOpeningTimeAndLatePenalty = true; if (actType.getOpeningTime() == 0. && actType.getClosingTime() > 24. * 3600 - 1) { log.error("it looks like you have an activity type with opening time set to 0:00 and closing " + "time set to 24:00. This is most probably not the same as not setting them at all. "
module.addParam( "activityType_"+suffix , ""+settings.getActivityType() ); module.addParam( "activityClosingTime_"+suffix , ""+settings.getClosingTime() ); module.addParam( "activityEarliestEndTime_"+suffix , ""+settings.getEarliestEndTime() ); module.addParam( "activityLatestStartTime_"+suffix , ""+settings.getLatestStartTime() );
Assert.assertEquals( "wrong closingTime "+msg, initialSettings.getClosingTime(), inputSettings.getClosingTime(), 1e-7 ); Assert.assertEquals(
/** * Convenience constructor for main use case */ public Builder(ActivityParams ppp ) { this.type = ppp.getActivityType() ; this.priority = ppp.getPriority() ; this.typicalDuration_s = ppp.getTypicalDuration() ; this.closingTime = ppp.getClosingTime() ; this.earliestEndTime = ppp.getEarliestEndTime() ; this.latestStartTime = ppp.getLatestStartTime() ; this.minimalDuration = ppp.getMinimalDuration() ; this.openingTime = ppp.getOpeningTime() ; this.scoreAtAll = ppp.isScoringThisActivityAtAll() ; switch( ppp.getTypicalDurationScoreComputation() ) { case relative: this.zeroUtilityComputation = new SameRelativeScore() ; break; case uniform: this.zeroUtilityComputation = new SameAbsoluteScore() ; break; default: throw new RuntimeException("not defined"); } // seems to be somewhat overkill to set a computation method that is only used in the builder ... but the builder has a method to // (re)set the }
@StringGetter("closingTime") private String getClosingTimeString() { return Time.writeTime(getClosingTime()); }