Class LMRSFactory

    • Constructor Detail

      • LMRSFactory

        public LMRSFactory​(CarFollowingModelFactory<? extends CarFollowingModel> carFollowingModelFactory,
                           PerceptionFactory perceptionFactory)
                    throws GTUException
        Constructor using default incentives and passive synchronization.
        Parameters:
        carFollowingModelFactory - CarFollowingModelFactory<? extends CarFollowingModel>; factory of the car-following model
        perceptionFactory - PerceptionFactory; perception factory
        Throws:
        GTUException - if the supplied car-following model does not have an accessible empty constructor
      • LMRSFactory

        public LMRSFactory​(CarFollowingModelFactory<? extends CarFollowingModel> carFollowingModelFactory,
                           PerceptionFactory perceptionFactory,
                           Synchronization synchronization,
                           Cooperation cooperation,
                           GapAcceptance gapAcceptance,
                           Tailgating tailgating,
                           Set<MandatoryIncentive> mandatoryIncentives,
                           Set<VoluntaryIncentive> voluntaryIncentives,
                           Set<AccelerationIncentive> accelerationIncentives)
        Constructor with full control over incentives and type of synchronization.
        Parameters:
        carFollowingModelFactory - CarFollowingModelFactory<? extends CarFollowingModel>; factory of the car-following model
        perceptionFactory - PerceptionFactory; perception factory
        synchronization - Synchronization; type of synchronization
        cooperation - Cooperation; type of cooperation
        gapAcceptance - GapAcceptance; gap-acceptance
        tailgating - Tailgating; tail gating
        mandatoryIncentives - mandatory incentives; note that order may matter
        voluntaryIncentives - voluntary incentives; note that order may matter
        accelerationIncentives - Set<AccelerationIncentive>; acceleration incentives
    • Method Detail

      • getParameters

        public final org.opentrafficsim.base.parameters.Parameters getParameters()
                                                                          throws org.opentrafficsim.base.parameters.ParameterException
        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 in componentClass are defined or forwarded in componentClass.
         // 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 interface ModelComponentFactory
        Returns:
        Parameters; parameters for the given component
        Throws:
        org.opentrafficsim.base.parameters.ParameterException - on parameter exception