Class IMBSampler

    • Constructor Detail

      • IMBSampler

        public IMBSampler​(org.opentrafficsim.imb.connector.IMBConnector imbConnector)
                   throws org.opentrafficsim.imb.IMBException
        Constructor with listeners for nodes, links, lanes and gtu's.
        Parameters:
        imbConnector - IMBConnector; IMB connection
        Throws:
        org.opentrafficsim.imb.IMBException - on connection error
    • Method Detail

      • main

        public static void main​(String[] args)
                         throws org.opentrafficsim.imb.IMBException
        Main program for IMBSampler. Listens to events on the IMB bus and calculates and publishes statistics.
        Parameters:
        args - String[]; the arguments with [0]=IP address, [1]=port
        Throws:
        org.opentrafficsim.imb.IMBException - in case of invalid arguments
      • sample

        protected void sample​(double timeStamp,
                              String gtuId,
                              String laneId,
                              boolean forward,
                              double longitudinalPosition,
                              double speed,
                              double acceleration)
        Sample the data received from a GTU.
        Parameters:
        timeStamp - double; time of the sampling
        gtuId - String; gtu
        laneId - String; lane
        forward - boolean; driving direction
        longitudinalPosition - double; position
        speed - double; speed
        acceleration - double; acceleration
      • addImbKpiTransceiver

        public void addImbKpiTransceiver​(ImbKpiTransceiver<GtuData> imbKpiTransceiver)
        Parameters:
        imbKpiTransceiver - ImbKpiTransceiver<GtuData>; add imbKpiTransceiver.
      • updateClock

        protected void updateClock​(double timeStamp)
        Updates clock and triggers timed events.
        Parameters:
        timeStamp - double; most recent time stamp