| |
- builtins.object
-
- CreateVehTypeDistribution
-
- CreateMultiVehTypeDistributions
- VehAttribute
class CreateMultiVehTypeDistributions(CreateVehTypeDistribution) |
| |
- Method resolution order:
- CreateMultiVehTypeDistributions
- CreateVehTypeDistribution
- builtins.object
Methods defined here:
- __init__(self)
- Creates a VehicleType Distribution.
See https://sumo.dlr.de/docs/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html#vehicle_type_distributions
Args:
seed (int, optional): random seed.
size (int, optional): number of vTypes in the distribution.
name (str, optional): alphanumerical ID used for the created vehicle type distribution.
resampling (int, optional): number of attempts to resample a value until it lies in the specified bounds.
decimal_places (int, optional): number of decimal places.
- register_veh_type_distribution(self, veh_type_dist, veh_attributes)
- write_xml(self, file_path)
- This function will overwrite existing files
Args:
file_path (str): Path to the file to write to
Methods inherited from CreateVehTypeDistribution:
- add_attribute(self, attribute)
- Add an instance of the attribute class to the Parameters. Pass the sampling attempts "global" parameter
Args:
attribute (VehAttribute or dict): An instance of VehAttribute or
a dictionary of parameters to be passed to the VehAttribute constructor
- create_veh_dist(self, xml_dom)
- save_myself(self, file_path)
- This function saves the class to a json format. Used for logging simulation inputs
Args:
file_path (str): path to save json to
- to_xml(self, file_path)
Data descriptors inherited from CreateVehTypeDistribution:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class CreateVehTypeDistribution(builtins.object) |
|
CreateVehTypeDistribution(seed=None, size=100, name='vehDist', resampling=100, decimal_places=3)
|
|
Methods defined here:
- __init__(self, seed=None, size=100, name='vehDist', resampling=100, decimal_places=3)
- Creates a VehicleType Distribution.
See https://sumo.dlr.de/docs/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html#vehicle_type_distributions
Args:
seed (int, optional): random seed.
size (int, optional): number of vTypes in the distribution.
name (str, optional): alphanumerical ID used for the created vehicle type distribution.
resampling (int, optional): number of attempts to resample a value until it lies in the specified bounds.
decimal_places (int, optional): number of decimal places.
- add_attribute(self, attribute)
- Add an instance of the attribute class to the Parameters. Pass the sampling attempts "global" parameter
Args:
attribute (VehAttribute or dict): An instance of VehAttribute or
a dictionary of parameters to be passed to the VehAttribute constructor
- create_veh_dist(self, xml_dom)
- save_myself(self, file_path)
- This function saves the class to a json format. Used for logging simulation inputs
Args:
file_path (str): path to save json to
- to_xml(self, file_path)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class VehAttribute(builtins.object) |
|
VehAttribute(name, is_param=False, distribution=None, distribution_params=None, bounds=None, attribute_value=None)
|
|
Methods defined here:
- __init__(self, name, is_param=False, distribution=None, distribution_params=None, bounds=None, attribute_value=None)
- This emmulates one line of example config.txt in
https://sumo.dlr.de/docs/Tools/Misc.html#createvehtypedistributionpy
Either distribution or attribute_value should be populated
Args:
name (str): the name of the attribute. Examples: "tau", "sigma", "length"
is_param (bool, optional): is the attribute a parameter that should be added as a child element.
distribution (str, optional): the name of the distribution to use ()
distribution_params (Union[dict, Any], optional): the parameters corresponding to the distribution
bounds (tuple, optional): the bounds of the distribution.
attribute_value (str, optional): if no distribution is given, the fixed value for the attribute
- add_sampling_attempts(self, attempts)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |