Package org.opentrafficsim.imb.connector
Class OTSIMBConnector
java.lang.Object
org.opentrafficsim.imb.connector.IMBConnector
org.opentrafficsim.imb.connector.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.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description static StringPROPERTY_KEYKey for compound property with IMB settings. -
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) -
Method Summary
Modifier and Type Method Description static OTSIMBConnectorcreate(String modelName)Create a new OTSIMBConnector expecting the IMB hub on localhost port 4000.static OTSIMBConnectorcreate(InputParameterMap inputParameterMap, String modelName)Construct a new OTSIMBConnector from a InputParameterMap (preferably constructed with the standardIMBProperties method of this class.static InputParameterMapstandardIMBProperties(int displayPriority)Create a InputParameterMap with the settings for an IMB connection.static InputParameterMapstandardIMBProperties(int displayPriority, String imbHost)Create a InputParameterMap with the settings for an IMB connection.
-
Field Details
-
PROPERTY_KEY
Key for compound property with IMB settings.
-
-
Constructor Details
-
OTSIMBConnector
public OTSIMBConnector(String host, int port, String modelName, int modelId, String federation) throws org.opentrafficsim.imb.IMBExceptionCreate a new OTSIMBConnector by specifying all the details.- Parameters:
host- String; the host that runs the IMB hub serverport- int; the port number on the IMB hub hostmodelName- String; the name used to register on the hub hostmodelId- int; usually 1federation- 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 Details
-
create
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.IMBExceptionConstruct a new OTSIMBConnector from a InputParameterMap (preferably constructed with the standardIMBProperties method of this class.- Parameters:
inputParameterMap- InputParameterMap; the compound property with the settingsmodelName- 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
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
Create a InputParameterMap with the settings for an IMB connection.- Parameters:
displayPriority- int; the displayPriority of the created InputParameterMapimbHost- String; host that runs the IMB hub- Returns:
- InputParameterMap the default settings
-