Class LaneBasedCfLcTacticalPlannerFactory
java.lang.Object
org.opentrafficsim.road.gtu.lane.tactical.LaneBasedCfLcTacticalPlannerFactory
- All Implemented Interfaces:
Serializable
,LaneBasedTacticalPlannerFactory<LaneBasedCfLcTacticalPlanner>
,ModelComponentFactory
public class LaneBasedCfLcTacticalPlannerFactory
extends Object
implements LaneBasedTacticalPlannerFactory<LaneBasedCfLcTacticalPlanner>, Serializable
Factory to create
LaneBasedCFLCTacticalPlanner
.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
-
Constructor Summary
ConstructorDescriptionLaneBasedCfLcTacticalPlannerFactory
(GtuFollowingModelOld carFollowingModel, LaneChangeModel laneChangeModel) Constructor with fixed stateless car-following and lane change model. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(LaneBasedGtu gtu) Creates a new tactical planner for the given GTU.final org.opentrafficsim.base.parameters.Parameters
Returns parameters for the given component.final String
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opentrafficsim.road.gtu.lane.tactical.LaneBasedTacticalPlannerFactory
peekDesiredHeadway, peekDesiredSpeed
-
Constructor Details
-
LaneBasedCfLcTacticalPlannerFactory
public LaneBasedCfLcTacticalPlannerFactory(GtuFollowingModelOld carFollowingModel, LaneChangeModel laneChangeModel) Constructor with fixed stateless car-following and lane change model.- Parameters:
carFollowingModel
- GtuFollowingModelOld; car following modellaneChangeModel
- LaneChangeModel; lane change model
-
-
Method Details
-
create
Creates a new tactical planner for the given GTU.- Specified by:
create
in interfaceLaneBasedTacticalPlannerFactory<LaneBasedCfLcTacticalPlanner>
- Parameters:
gtu
- LaneBasedGtu; GTU- Returns:
- tactical planner for the given GTU
- Throws:
GtuException
- if the gtu is not suitable in any way for the creation of the tactical planner
-
getParameters
public final org.opentrafficsim.base.parameters.Parameters getParameters()Returns parameters for the given component. These parameters should contain, and possibly overwrite, parameters from sub-components. A parameter factory at the highest level (strategical planner) may overwrite any parameter. This combination allows that for sub-components, default factories can be used, while the parameter factory only overwrites parameters different for specific GTU types. The default implementation returns all default parameter values declared at the class.
Conventional use is:
Parameters parameters = this.subComponent1Factory.getParameters(); this.subComponent2Factory.getParameters().setAllIn(parameters); parameters.setDefaultParameters(componentClass); parameters.setDefaultParameters(staticUtilityClass); return parameters;
where all parameters used incomponentClass
are defined or forwarded incomponentClass
.
// forwarded public static final ParameterTypeAcceleration A = ParameterTypes.A; // defined public static final ParameterTypeDouble FACTOR = new ParameterTypeDouble("factor", "factor on response", 1.0);
The same holds for static utilities that are used. Parameters should be defined at the utility class, and parameters of used utilities should be included.
- Specified by:
getParameters
in interfaceModelComponentFactory
- Returns:
- Parameters; parameters for the given component
-
toString
-