Package org.matsim.core.config
Class Config
- java.lang.Object
-
- org.matsim.core.config.Config
-
- All Implemented Interfaces:
MatsimExtensionPoint
public final class Config extends Object implements MatsimExtensionPoint
Stores all configuration settings specified in a configuration file and provides access to the settings at runtime.- Author:
- mrieser
- See Also:
CreateFullConfig
-
-
Constructor Summary
Constructors Constructor Description Config()
-
Method Summary
-
-
-
Constructor Detail
-
Config
public Config()
-
-
Method Detail
-
addCoreModules
public void addCoreModules()
Adds all the commonly used config-groups, also known as "core modules", to this config-instance. This should be called before reading any configuration from file.
-
checkConsistency
public void checkConsistency()
Checks each module for consistency, e.g. if the parameters that are currently set make sense in their combination.
-
createModule
public final ConfigGroup createModule(String name)
Creates a new module / config-group with the specified name.- Parameters:
name
- The name of the config-group to be created.- Returns:
- the newly created config group
- Throws:
IllegalArgumentException
- if a config-group with the specified name already exists.
-
addModule
public final void addModule(ConfigGroup specializedConfigModule)
Adds the specified module / config-group with the specified name to the configuration. This is the typical way to "materialize" material that, so far, exists only as Map, into a specialized module.- Parameters:
specializedConfigModule
-- Throws:
IllegalArgumentException
- if a config-group with the specified name already exists.
-
removeModule
public final void removeModule(String name)
Removes the specified module / config-group with the specified name from the configuration. Does nothing if this module was not existing.- Parameters:
name
-
-
getModules
public final TreeMap<String,ConfigGroup> getModules()
-
getModule
@Deprecated public final ConfigGroup getModule(String moduleName)
Deprecated.Returns the requested module, ornull
if the module does not exist.- Parameters:
moduleName
- name of the requested module- Returns:
- requested module
-
getParam
@Deprecated public final String getParam(String moduleName, String paramName)
Deprecated.Returns the requested parameter. If the module or parameter is not known, an error is logged and an IllegalArgumentException is thrown.- Parameters:
moduleName
-paramName
-- Returns:
- the requested parameter
- Throws:
IllegalArgumentException
- if the module or parameter does not exist- See Also:
findParam(String, String)
-
findParam
@Deprecated public final String findParam(String moduleName, String paramName)
Deprecated.Returns the value of the specified parameter if it exists, ornull
otherwise.- Parameters:
moduleName
- name of the config-moduleparamName
- name of parameter in the specified module- Returns:
- value of the parameter if it exists,
null
otherwise - See Also:
getParam(String, String)
-
setParam
@Deprecated public final void setParam(String moduleName, String paramName, String value)
Deprecated.Sets the parameterparamName
in the module/config-groupmoduleName
to the specified value. If there is no config-group with the specified name, a new group will be created.- Parameters:
moduleName
-paramName
-value
-
-
global
public final GlobalConfigGroup global()
-
controler
public final ControlerConfigGroup controler()
-
counts
public final CountsConfigGroup counts()
-
planCalcScore
public final PlanCalcScoreConfigGroup planCalcScore()
-
network
public final NetworkConfigGroup network()
-
plans
public final PlansConfigGroup plans()
-
households
public final HouseholdsConfigGroup households()
-
facilities
public final FacilitiesConfigGroup facilities()
-
strategy
public final StrategyConfigGroup strategy()
-
travelTimeCalculator
public TravelTimeCalculatorConfigGroup travelTimeCalculator()
-
scenario
public ScenarioConfigGroup scenario()
-
plansCalcRoute
public PlansCalcRouteConfigGroup plansCalcRoute()
-
vspExperimental
public VspExperimentalConfigGroup vspExperimental()
-
qsim
public QSimConfigGroup qsim()
-
ptCounts
public PtCountsConfigGroup ptCounts()
-
transit
public TransitConfigGroup transit()
-
transitRouter
public TransitRouterConfigGroup transitRouter()
-
linkStats
public LinkStatsConfigGroup linkStats()
-
timeAllocationMutator
public TimeAllocationMutatorConfigGroup timeAllocationMutator()
-
parallelEventHandling
public ParallelEventHandlingConfigGroup parallelEventHandling()
-
subtourModeChoice
public SubtourModeChoiceConfigGroup subtourModeChoice()
-
changeMode
public ChangeModeConfigGroup changeMode()
-
jdeqSim
public JDEQSimConfigGroup jdeqSim()
-
addConfigConsistencyChecker
public void addConfigConsistencyChecker(ConfigConsistencyChecker checker)
-
removeConfigConsistencyChecker
public void removeConfigConsistencyChecker(Class clazz)
-
isLocked
public final boolean isLocked()
-
setLocked
public final void setLocked(boolean locked)
-
vehicles
public final VehiclesConfigGroup vehicles()
-
setContext
public void setContext(URL context)
-
getContext
public URL getContext()
-
-