Class OTSIMBConnector

  • All Implemented Interfaces:
    org.opentrafficsim.imb.connector.Connector

    public class OTSIMBConnector
    extends org.opentrafficsim.imb.connector.IMBConnector

    Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See OpenTrafficSim License.

    $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Aug 28, 2016
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.opentrafficsim.imb.connector.Connector

        org.opentrafficsim.imb.connector.Connector.IMBEventType
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String PROPERTY_KEY
      Key for compound property with IMB settings.
      • Fields inherited from class org.opentrafficsim.imb.connector.IMBConnector

        imbTransceiverMap
    • Constructor Summary

      Constructors 
      Constructor Description
      OTSIMBConnector​(String host, int port, String modelName, int modelId, String federation)
      Create a new OTSIMBConnector by specifying all the details.
      OTSIMBConnector​(nl.tno.imb.TConnection connection)  
    • Field Detail

      • PROPERTY_KEY

        public static String PROPERTY_KEY
        Key for compound property with IMB settings.
    • Constructor Detail

      • OTSIMBConnector

        public OTSIMBConnector​(String host,
                               int port,
                               String modelName,
                               int modelId,
                               String federation)
                        throws org.opentrafficsim.imb.IMBException
        Create a new OTSIMBConnector by specifying all the details.
        Parameters:
        host - String; the host that runs the IMB hub server
        port - int; the port number on the IMB hub host
        modelName - String; the name used to register on the hub host
        modelId - int; usually 1
        federation - String; usually "OTS_RT"
        Throws:
        org.opentrafficsim.imb.IMBException - when a connection to the IMB hub could not be established
      • OTSIMBConnector

        public OTSIMBConnector​(nl.tno.imb.TConnection connection)
                        throws org.opentrafficsim.imb.IMBException
        Parameters:
        connection - TConnection; the IMB connection
        Throws:
        org.opentrafficsim.imb.IMBException - in case of connection problems
    • Method Detail

      • create

        public static OTSIMBConnector create​(String modelName)
                                      throws org.opentrafficsim.imb.IMBException
        Create a new OTSIMBConnector expecting the IMB hub on localhost port 4000.
        Parameters:
        modelName - String; the name used to register on the hub host
        Returns:
        OTSIMBConnector; a new OTSIMBConnector expecting the IMB hub on localhost port 4000.
        Throws:
        org.opentrafficsim.imb.IMBException - when a connection to the IMB hub could not be established
      • create

        public static OTSIMBConnector create​(InputParameterMap inputParameterMap,
                                             String modelName)
                                      throws org.opentrafficsim.imb.IMBException
        Construct a new OTSIMBConnector from a InputParameterMap (preferably constructed with the standardIMBProperties method of this class.
        Parameters:
        inputParameterMap - InputParameterMap; the compound property with the settings
        modelName - String; the name used to register on the hub host
        Returns:
        OTSIMBConnector; a new OTSIMBConnector expecting the IMB hub on localhost port 4000.
        Throws:
        org.opentrafficsim.imb.IMBException - when a connection to the IMB hub could not be established
      • standardIMBProperties

        public static InputParameterMap standardIMBProperties​(int displayPriority)
        Create a InputParameterMap with the settings for an IMB connection.
        Parameters:
        displayPriority - int; the displayPriority of the created InputParameterMap
        Returns:
        InputParameterMap the default settings
      • standardIMBProperties

        public static InputParameterMap standardIMBProperties​(int displayPriority,
                                                              String imbHost)
        Create a InputParameterMap with the settings for an IMB connection.
        Parameters:
        displayPriority - int; the displayPriority of the created InputParameterMap
        imbHost - String; host that runs the IMB hub
        Returns:
        InputParameterMap the default settings