/** * Override if parameter sets of a certain type need a special implementation */ @SuppressWarnings("static-method") public ConfigGroup createParameterSet(final String type) { return new ConfigGroup( type ); }
/** * Creates a new module / config-group with the specified name. * * @param name * The name of the config-group to be created. * * @return the newly created config group * @throws IllegalArgumentException * if a config-group with the specified name already exists. */ public final ConfigGroup createModule(final String name) { if (this.modules.containsKey(name)) { throw new IllegalArgumentException("Module " + name + " exists already."); } ConfigGroup m = new ConfigGroup(name); this.modules.put(name, m); return m; }
comparisonPSet = new ConfigGroup(pSet.getName()) ;
private static ConfigGroup toUnderscoredModule(final PlansCalcRouteConfigGroup initialGroup) { final ConfigGroup module = new ConfigGroup( initialGroup.getName() ); for ( Map.Entry<String, String> e : initialGroup.getParams().entrySet() ) { log.info( "add param="+e.getKey() + " with value=" + e.getValue() ); module.addParam( e.getKey() , e.getValue() ); } for ( ModeRoutingParams settings : initialGroup.getModeRoutingParams().values() ) { final String mode = settings.getMode(); module.addParam( "teleportedModeSpeed_"+mode , ""+settings.getTeleportedModeSpeed() ); module.addParam( "teleportedModeFreespeedFactor_"+mode , ""+settings.getTeleportedModeFreespeedFactor() ); } Double val = null ; boolean first = true ; for ( ModeRoutingParams settings : initialGroup.getModeRoutingParams().values() ) { if ( first ) { first = false ; val = settings.getBeelineDistanceFactor() ; } else if ( !settings.getBeelineDistanceFactor().equals( val ) ) { throw new RuntimeException( "beeline distance factor varies by mode; this cannot be covered by this test" ) ; } } module.addParam( "beelineDistanceFactor", ""+val ); return module; }
private ConfigGroup toUnderscoredModule(final StrategyConfigGroup initialGroup) { // yyyy is this method/this execution path still necessary? Maybe we need to be able to read config v1, but certainly // we don't need to WRITE it, do we? kai/mz, nov'15 final ConfigGroup module = new ConfigGroup( initialGroup.getName() ); for ( Map.Entry<String, String> e : initialGroup.getParams().entrySet() ) { log.info( "add param "+e.getKey() ); module.addParam( e.getKey() , e.getValue() ); } for ( StrategySettings settings : initialGroup.getStrategySettings() ) { final Id<StrategySettings> id = settings.getId(); module.addParam( "Module_"+id , settings.getStrategyName() ); module.addParam( "ModuleProbability_"+id , ""+settings.getWeight() ); module.addParam( "ModuleDisableAfterIteration_"+id , ""+settings.getDisableAfter() ); module.addParam( "ModuleExePath_"+id , settings.getExePath() ); module.addParam( "ModuleSubpopulation_"+id , settings.getSubpopulation() ); } return module; }
private static ConfigGroup toUnderscoredModule(final PlanCalcScoreConfigGroup initialGroup) { final ConfigGroup module = new ConfigGroup( initialGroup.getName() );
private Config createTestConfig() { final Config c = ConfigUtils.createConfig(); final ConfigGroup module = new ConfigGroup( "thisAintNoFlat" ); module.addParam( "someParam" , "someValue" ); module.addParam( "anotherParam" , "anotherValue" ); final ConfigGroup paramSet1 = module.createParameterSet( "oneType" ); module.addParameterSet( paramSet1 ); paramSet1.addParam( "something" , "gloups" ); final ConfigGroup paramSet2 = module.createParameterSet( "oneType" ); module.addParameterSet( paramSet2 ); paramSet2.addParam( "something" , "gloups" ); paramSet2.addParam( "something_else" , "glips" ); final ConfigGroup paramSet3 = module.createParameterSet( "anotherType" ); module.addParameterSet( paramSet3 ); paramSet3.addParam( "niark" , "niourk" ); c.addModule( module ); return c; } }