Class OTSRoadNetwork

    • Constructor Detail

      • OTSRoadNetwork

        public OTSRoadNetwork​(String id,
                              boolean addDefaultTypes,
                              OTSSimulatorInterface simulator)
        Construction of an empty network.
        Parameters:
        id - String; the network id.
        addDefaultTypes - add the default GTUTypes, LinkTypesand LaneTypes, or not
        simulator - OTSSimulatorInterface; the DSOL simulator engine
    • Method Detail

      • addDefaultLaneTypes

        public void addDefaultLaneTypes()
        Add the default LaneTypes that have been defined in the enum LaneType.DEFAULTS to the network. It is not necessary to call this method on every network; when the LaneTypes are for instance defined in an XML file, adding the default types might not be needed.
        Specified by:
        addDefaultLaneTypes in interface RoadDefinitions
      • addLaneType

        public void addLaneType​(LaneType laneType)
        Add a Lane type to the map. This method is automatically called from the LaneType constructor.
        Specified by:
        addLaneType in interface RoadDefinitions
        Parameters:
        laneType - the LaneType to add
      • getLaneType

        public LaneType getLaneType​(String laneTypeId)
        Retrieve a defined LaneType based on its id.
        Specified by:
        getLaneType in interface RoadDefinitions
        Parameters:
        laneTypeId - the id to search for
        Returns:
        the LaneType or null in case it could not be found
      • getLaneType

        public LaneType getLaneType​(LaneType.DEFAULTS laneTypeEnum)
        Retrieve a defined default LaneType based on its enum.
        Specified by:
        getLaneType in interface RoadDefinitions
        Parameters:
        laneTypeEnum - the enum to search for
        Returns:
        the LaneType or null in case it could not be found
      • setRouteSystem

        public void setRouteSystem​(RouteSystem routeSystem)
        Sets the route system.
        Parameters:
        routeSystem - RouteSystem; route system
      • getRouteSystem

        public RouteSystem getRouteSystem()
        Returns the route system.
        Returns:
        RouteSystem; route system