@Override protected void checkConsistency(Config config) { // to make available to tests super.checkConsistency(config); }
@Override protected void checkConsistency(Config config) { super.checkConsistency(config); // if ( this.insertingAccessEgressWalk ) { // // we need scoring parameters for each resulting interaction activity // for ( String mode : this.getNetworkModes() ) { // String interactionActivityType = mode + " interaction" ; // PlanCalcScoreConfigGroup.ActivityParams actParams = config.planCalcScore().getActivityParams(interactionActivityType); // if ( actParams==null ) { // final String msg = "You have specified to insert access and egress walk, but there are no scoring parameters to " + // "score the resulting interaction activity for mode = " + mode; // throw new RuntimeException(msg) ; // } // } // } // these are now added in the config consistency checker of PlanCalcScoreConfigGroup, // so there is no point in checking here since the checker here might be called // earlier. kai, jan'18 } }
/** Check if the set values go well together. This method is usually called after reading the * configuration from a file. If an inconsistency is found, a warning or error should be issued * and (optionally) a RuntimeException being thrown. * @param config TODO */ protected void checkConsistency(Config config) { // (I added Config as a parameter, since there are many occasions where the validity of a ConfigGroup can only be checked when other // material is known. Could put all of this in the "global" config consistency checker, but if it conceptually belongs into the // ConfigGroup, I think it is easier to have it more local. Wasn't a big problem, since this method is _only_ called from the global config // itself, which obviously can just pass on a "this" pointer. kai, jan'17) // default: just call this method on parameter sets for ( Collection<? extends ConfigGroup> sets : getParameterSets().values() ) { for ( ConfigGroup set : sets ) set.checkConsistency(config); } } @Deprecated // please try to use the "typed" access structures. kai, nov'16
/** * Checks each module for consistency, e.g. if the parameters that are * currently set make sense in their combination. */ public void checkConsistency() { for (ConfigGroup m : this.modules.values()) { m.checkConsistency(this); } for (ConfigConsistencyChecker c : this.consistencyCheckers) { c.checkConsistency(this); } // for (Module m : this.modules.values()) { // if (m.getClass() == Module.class) { // throw new RuntimeException("Config group " + m.getName() + " is present, but has never been read." + // "This is probably an error: You may be expecting functionality which is not available." + // "Maybe you need to add something to the Controler?"); // } // } }
@Override protected final void checkConsistency(final Config config) { super.checkConsistency(config);
super.checkConsistency(config); boolean hasOpeningAndClosingTime = false; boolean hasOpeningTimeAndLatePenalty = false ;