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.IMBConnectorCopyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Aug 28, 2016
BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROPERTY_KEYKey for compound property with IMB settings.
-
Constructor Summary
Constructors Constructor Description OTSIMBConnector(java.lang.String host, int port, java.lang.String modelName, int modelId, java.lang.String federation)Create a new OTSIMBConnector by specifying all the details.OTSIMBConnector(nl.tno.imb.TConnection connection)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OTSIMBConnectorcreate(java.lang.String modelName)Create a new OTSIMBConnector expecting the IMB hub on localhost port 4000.static OTSIMBConnectorcreate(InputParameterMap inputParameterMap, java.lang.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, java.lang.String imbHost)Create a InputParameterMap with the settings for an IMB connection.
-
-
-
Constructor Detail
-
OTSIMBConnector
public OTSIMBConnector(java.lang.String host, int port, java.lang.String modelName, int modelId, java.lang.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 Detail
-
create
public static OTSIMBConnector create(java.lang.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, java.lang.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 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
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, java.lang.String imbHost)
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
-
-