Class Incident

    • Constructor Detail

      • Incident

        public Incident​(Point point)
        Creates an instance of incident.
        Parameters:
        point - location of the incident
        Throws:
        IllegalArgumentException - if point is null
        Since:
        100.1.0
    • Method Detail

      • getName

        public String getName()
        Gets the name that was set for this incident.
        Returns:
        the name of incident. Default value is an empty string
        Since:
        100.1.0
      • setName

        public void setName​(String name)
        Sets the name for this incident.
        Parameters:
        name - incident's name. Null is treated as an empty string
        Since:
        100.1.0
      • setCurbApproach

        public void setCurbApproach​(CurbApproach curbApproach)
        Sets the direction from which a vehicle may arrive at or depart from the incident.

        For example, a school bus must approach and depart a school from its door side so that students entering/exiting the bus will not have to cross the street.

        Parameters:
        curbApproach - curb approach
        Throws:
        IllegalArgumentException - if curbApproach is null
        Since:
        100.1.0
      • getNetworkLocation

        public NetworkLocation getNetworkLocation()
        Gets the incident's location in the underlying transportation network.
        Returns:
        the network location. Returns null by default
        Since:
        100.1.0
      • setNetworkLocation

        public void setNetworkLocation​(NetworkLocation networkLocation)
        Sets the incident's location in the underlying transportation network.
        Parameters:
        networkLocation - network location. It can be null
        Since:
        100.1.0
      • getDistanceToNetworkLocation

        public double getDistanceToNetworkLocation()
        Gets the distance to the network location in meters.
        Returns:
        the distance to the network location in meters. Returns NaN by default
        Since:
        100.1.0
      • getGeometry

        public Point getGeometry()
        Gets the location the incident should be placed on the map.
        Returns:
        a map point representing the location of the incident
        Since:
        100.1.0
      • getAddedCost

        public double getAddedCost​(String attributeName)
        Gets the added cost that was set for this incident.
        Parameters:
        attributeName - attribute name. It can be empty. Null is treated as an empty string
        Returns:
        the added cost. Returns 0 if it was not set
        Since:
        100.1.0
      • setAddedCost

        public void setAddedCost​(String attributeName,
                                 double addedCost)
        Sets the added cost for this incident.
        Parameters:
        attributeName - attribute name. It can be empty. Null is treated as an empty string
        addedCost - added cost
        Since:
        100.1.0