Package org.opentrafficsim.demo
Class InputParameterHelper
- java.lang.Object
-
- org.opentrafficsim.demo.InputParameterHelper
-
- All Implemented Interfaces:
ParameterFactory
public final class InputParameterHelper extends Object implements ParameterFactory
InputParameterHelper.java.
Copyright (c) 2003-2018 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.- Author:
- Alexander Verbraeck
-
-
Constructor Summary
Constructors Constructor Description InputParameterHelper(InputParameterMap rootMap)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Parameters
getParametersCar(InputParameterMap rootMap)
Get the car parameters as entered.static Parameters
getParametersTruck(InputParameterMap rootMap)
Get the truck parameters as entered.static void
makeInputParameterMapCar(InputParameterMap map, double displayPriority)
Make a map of input parameters for a demo with a car tabs with parameters.static void
makeInputParameterMapCarTruck(InputParameterMap map, double probabilityDisplayPriority)
Make a map of input parameters for a demo with a car/truck ratio and car/truck tabs with parameters.static void
makeInputParameterMapTruck(InputParameterMap map, double displayPriority)
Make a map of input parameters for a demo with a truck tabs with parameters.void
setValues(Parameters parameters, GTUType gtuType)
-
-
-
Constructor Detail
-
InputParameterHelper
public InputParameterHelper(InputParameterMap rootMap)
Constructor.- Parameters:
rootMap
- InputParameterMap; input parameter map
-
-
Method Detail
-
setValues
public void setValues(Parameters parameters, GTUType gtuType) throws ParameterException
- Specified by:
setValues
in interfaceParameterFactory
- Throws:
ParameterException
-
makeInputParameterMapCarTruck
public static void makeInputParameterMapCarTruck(InputParameterMap map, double probabilityDisplayPriority)
Make a map of input parameters for a demo with a car/truck ratio and car/truck tabs with parameters.- Parameters:
map
- InputParameterMap; the map to add the car/truck input parameters toprobabilityDisplayPriority
- double; the display priority to use for the car probability in the generic map
-
makeInputParameterMapCar
public static void makeInputParameterMapCar(InputParameterMap map, double displayPriority)
Make a map of input parameters for a demo with a car tabs with parameters.- Parameters:
map
- InputParameterMap; the map to add the car input tab todisplayPriority
- double; the display priority to use for the car tab in the generic map
-
makeInputParameterMapTruck
public static void makeInputParameterMapTruck(InputParameterMap map, double displayPriority)
Make a map of input parameters for a demo with a truck tabs with parameters.- Parameters:
map
- InputParameterMap; the map to add the truck input tab todisplayPriority
- double; the display priority to use for the truck map in the generic map
-
getParametersCar
public static Parameters getParametersCar(InputParameterMap rootMap) throws ParameterException, InputParameterException
Get the car parameters as entered.- Parameters:
rootMap
- InputParameterMap; the root map of the model with a 'car' tab with the parameters- Returns:
- the parameters where a, b, s0 and tSafe have been updated with the user's choices
- Throws:
ParameterException
- when the parameter was given an illegal settingInputParameterException
- when the input parameter could not be found
-
getParametersTruck
public static Parameters getParametersTruck(InputParameterMap rootMap) throws ParameterException, InputParameterException
Get the truck parameters as entered.- Parameters:
rootMap
- InputParameterMap; the root map of the model with a 'truck' tab with the parameters- Returns:
- the parameters where a, b, s0 and tSafe have been updated with the user's choices
- Throws:
ParameterException
- when the parameter was given an illegal settingInputParameterException
- when the input parameter could not be found
-
-