Package org.goplanit.assignment
Class TrafficAssignmentBuilder<T extends TrafficAssignment>
- java.lang.Object
-
- org.goplanit.utils.builder.Builder<T>
-
- org.goplanit.component.PlanitComponentBuilder<T>
-
- org.goplanit.assignment.TrafficAssignmentBuilder<T>
-
- Direct Known Subclasses:
EventBasedLtmTrafficAssignmentBuilder
,LtmTrafficAssignmentBuilder
,TraditionalStaticAssignmentBuilder
public abstract class TrafficAssignmentBuilder<T extends TrafficAssignment> extends PlanitComponentBuilder<T>
All traffic assignment instances require a network, demand, and (equilibrium) smoothing procedure, all of which should be registered via this generic builder. Specific traffic assignment methods might require special builders derived from this builder- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
LOG_SETTINGS
default flag indicating if settings are to be logged upon creation or notprotected static Logger
LOGGER
the logger-
Fields inherited from class org.goplanit.component.PlanitComponentBuilder
groupId
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TrafficAssignmentBuilder(Class<T> trafficAssignmentClass, IdGroupingToken projectToken, InputBuilderListener inputBuilderListener, Demands demands, Zoning zoning, LayeredNetwork<?,?> network)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
build()
Build the traffic assignmentprotected void
buildSubComponents(T trafficAssignmentInstance)
call to build and configure all sub components of this builderprotected abstract TrafficAssignmentConfigurator<T>
createConfigurator()
Allow derived classes to provide their own configurator for this builder, by default we create a base class configuratorprotected GapFunction
createGapFunctionInstance(StopCriterion stopCriterion)
create a gap function instance based on configurationprotected AbstractPhysicalCost
createPhysicalCostInstance()
create a physical cost instance based on configurationprotected Smoothing
createSmoothingInstance()
create a smoothing instance based on configurationprotected T
createTrafficAssignmentInstance()
Factory method to create the instance of the desired typeprotected AbstractVirtualCost
createVirtualCostInstance()
create a virtual cost instance based on configurationTrafficAssignmentConfigurator<T>
getConfigurator()
the configurator for this builder.-
Methods inherited from class org.goplanit.component.PlanitComponentBuilder
getGroupIdToken, getInputBuilderListener
-
Methods inherited from class org.goplanit.utils.builder.Builder
getClassToBuild
-
-
-
-
Field Detail
-
LOGGER
protected static final Logger LOGGER
the logger
-
LOG_SETTINGS
public static final boolean LOG_SETTINGS
default flag indicating if settings are to be logged upon creation or not- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TrafficAssignmentBuilder
protected TrafficAssignmentBuilder(Class<T> trafficAssignmentClass, IdGroupingToken projectToken, InputBuilderListener inputBuilderListener, Demands demands, Zoning zoning, LayeredNetwork<?,?> network) throws PlanItException
Constructor- Parameters:
trafficAssignmentClass
- class to buildprojectToken
- idGrouping tokeninputBuilderListener
- the input builder listenerdemands
- the demandszoning
- the zoningnetwork
- the network- Throws:
PlanItException
- thrown when error
-
-
Method Detail
-
createConfigurator
protected abstract TrafficAssignmentConfigurator<T> createConfigurator() throws PlanItException
Allow derived classes to provide their own configurator for this builder, by default we create a base class configurator- Specified by:
createConfigurator
in classBuilder<T extends TrafficAssignment>
- Returns:
- appropriate configurator
- Throws:
PlanItException
- thrown if error
-
createTrafficAssignmentInstance
protected T createTrafficAssignmentInstance() throws PlanItException
Factory method to create the instance of the desired type- Returns:
- instance of traffic assignment
- Throws:
PlanItException
- thrown when error
-
createSmoothingInstance
protected Smoothing createSmoothingInstance() throws PlanItException
create a smoothing instance based on configuration- Returns:
- smoothing instance
- Throws:
PlanItException
- thrown if error
-
createPhysicalCostInstance
protected AbstractPhysicalCost createPhysicalCostInstance() throws PlanItException
create a physical cost instance based on configuration- Returns:
- physical cost instance
- Throws:
PlanItException
- thrown if error
-
createVirtualCostInstance
protected AbstractVirtualCost createVirtualCostInstance() throws PlanItException
create a virtual cost instance based on configuration- Returns:
- virtual cost instance
- Throws:
PlanItException
- thrown if error
-
createGapFunctionInstance
protected GapFunction createGapFunctionInstance(StopCriterion stopCriterion) throws PlanItException
create a gap function instance based on configuration- Parameters:
stopCriterion
- to use- Returns:
- gap function instance
- Throws:
PlanItException
- thrown if error
-
buildSubComponents
protected void buildSubComponents(T trafficAssignmentInstance) throws PlanItException
call to build and configure all sub components of this builder- Parameters:
trafficAssignmentInstance
- instance to build subcomponents for- Throws:
PlanItException
- thrown if error
-
getConfigurator
public TrafficAssignmentConfigurator<T> getConfigurator()
the configurator for this builder. It allows one to hide the builder aspect and expose (parts of) the user available configuration options via this object- Overrides:
getConfigurator
in classBuilder<T extends TrafficAssignment>
- Returns:
- the configurator, null if no configurator is available nor could be created
-
build
public T build() throws PlanItException
Build the traffic assignment- Specified by:
build
in classBuilder<T extends TrafficAssignment>
- Returns:
- traffic assignment instance that is built
- Throws:
PlanItException
- thrown if error
-
-