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 protected static LoggerLOGGERthe logger-
Fields inherited from class org.goplanit.component.PlanitComponentBuilder
groupId
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTrafficAssignmentBuilder(Class<T> trafficAssignmentClass, IdGroupingToken projectToken, InputBuilderListener inputBuilderListener, Demands demands, Zoning zoning, TransportLayerNetwork<?,?> network)Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Tbuild()Build the traffic assignmentprotected voidbuildSubComponents(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 GapFunctioncreateGapFunctionInstance(StopCriterion stopCriterion)create a gap function instance based on configurationprotected AbstractPhysicalCostcreatePhysicalCostInstance()create a physical cost instance based on configurationprotected SmoothingcreateSmoothingInstance()create a smoothing instance based on configurationprotected TcreateTrafficAssignmentInstance()Factory method to create the instance of the desired typeprotected AbstractVirtualCostcreateVirtualCostInstance()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
-
-
Constructor Detail
-
TrafficAssignmentBuilder
protected TrafficAssignmentBuilder(Class<T> trafficAssignmentClass, IdGroupingToken projectToken, InputBuilderListener inputBuilderListener, Demands demands, Zoning zoning, TransportLayerNetwork<?,?> 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:
createConfiguratorin 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:
getConfiguratorin 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:
buildin classBuilder<T extends TrafficAssignment>- Returns:
- traffic assignment instance that is built
- Throws:
PlanItException- thrown if error
-
-