Package org.planit.assignment
Class TrafficAssignmentBuilder<T extends TrafficAssignment>
- java.lang.Object
-
- org.planit.utils.builder.Builder<T>
-
- org.planit.assignment.TrafficComponentBuilder<T>
-
- org.planit.assignment.TrafficAssignmentBuilder<T>
-
- Direct Known Subclasses:
CapacityConstrainedTrafficAssignmentBuilder,TraditionalStaticAssignmentBuilder
public abstract class TrafficAssignmentBuilder<T extends TrafficAssignment> extends TrafficComponentBuilder<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.planit.assignment.TrafficComponentBuilder
groupId
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTrafficAssignmentBuilder(Class<T> trafficAssignmentClass, IdGroupingToken projectToken, InputBuilderListener inputBuilderListener, Demands demands, Zoning zoning, InfrastructureNetwork network)Constructor
-
Method Summary
All Methods Instance 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 voidcreateGapFunction()Currently, there exists only a single gap function (link based relative duality gap) that is created via this factory method.protected GapFunctioncreateGapFunctionInstance(TrafficAssignmentConfigurator<?> configurator, StopCriterion stopCriterion)create a gap function instance based on configurationprotected AbstractPhysicalCostcreatePhysicalCostInstance(TrafficAssignmentConfigurator<?> configurator)create a physical cost instance based on configurationprotected SmoothingcreateSmoothingInstance(TrafficAssignmentConfigurator<?> configurator)create a smoothing instance based on configurationprotected TcreateTrafficAssignmentInstance()Factory method to create the instance of the desired typeprotected AbstractVirtualCostcreateVirtualCostInstance(TrafficAssignmentConfigurator<?> configurator)create a virtual cost instance based on configuration-
Methods inherited from class org.planit.assignment.TrafficComponentBuilder
getGroupIdToken, getInputBuilderListener
-
Methods inherited from class org.planit.utils.builder.Builder
createConfigurator, getClassToBuild, getConfigurator
-
-
-
-
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, InfrastructureNetwork 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
-
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(TrafficAssignmentConfigurator<?> configurator) throws PlanItException
create a smoothing instance based on configuration- Parameters:
configurator- for smoothing instance- Returns:
- smoothing instance
- Throws:
PlanItException- thrown if error
-
createPhysicalCostInstance
protected AbstractPhysicalCost createPhysicalCostInstance(TrafficAssignmentConfigurator<?> configurator) throws PlanItException
create a physical cost instance based on configuration- Parameters:
configurator- for physical cost instance- Returns:
- physical cost instance
- Throws:
PlanItException- thrown if error
-
createVirtualCostInstance
protected AbstractVirtualCost createVirtualCostInstance(TrafficAssignmentConfigurator<?> configurator) throws PlanItException
create a virtual cost instance based on configuration- Parameters:
configurator- for virtual cost instance- Returns:
- virtual cost instance
- Throws:
PlanItException- thrown if error
-
createGapFunctionInstance
protected GapFunction createGapFunctionInstance(TrafficAssignmentConfigurator<?> configurator, StopCriterion stopCriterion) throws PlanItException
create a gap function instance based on configuration- Parameters:
configurator- for gap function instancestopCriterion- 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
-
createGapFunction
protected void createGapFunction() throws PlanItExceptionCurrently, there exists only a single gap function (link based relative duality gap) that is created via this factory method. It should be injected by each traffic assignment method until we have multiple gap functions, in which case, it becomes an option like other components.- Throws:
PlanItException- thrown if error
-
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
-
-