simulation.utils.road.road module¶
Road class used to define roads as a python class.
A simulated road can be defined through an object of type Road. It contains all sections of that road as a list.
Reference¶
-
class
Road(use_seed: bool = True, sections: List[simulation.utils.road.sections.road_section.RoadSection] = <factory>, length: float = 0)[source]¶ Bases:
objectContainer object for roads.
A road consists of multiple road sections that are concatenated. The sections attribute contains these sections in the correct order.
-
_name: str = None¶ Name of the road.
The name attribute is determined by the name of the file. It is filled in when the road is generated.
-
_seed: str = None¶ Seed used when generating the road.
Determined when generating the road.
-
use_seed: bool = True¶ Use a default seed if none is provided.
By default the use_seed attribute is true and a seed is set before creating the road. If use_seed is set to False, the seed is invalidated and there will be different random values every time the road is created.
-
sections: List[simulation.utils.road.sections.road_section.RoadSection]¶ All sections of the road.
-
length: float = 0¶ Length of road.
-
append(section: simulation.utils.road.sections.road_section.RoadSection)[source]¶ Append a road section. Determine id of the section.
- Parameters
section – New road section.
-
-
load(road_name: str, seed: str = 'KITCAR') → simulation.utils.road.road.Road[source]¶ Load road object from file.
- Parameters
road_name – Name of the file containing the road definition.
seed – Predetermine random values.