Package org.opentrafficsim.remotecontrol
Class Sim0MQControlledOTS
- java.lang.Object
-
- org.opentrafficsim.remotecontrol.Sim0MQControlledOTS
-
- All Implemented Interfaces:
Serializable
,EventListener
,EventListenerInterface
public class Sim0MQControlledOTS extends Object implements EventListenerInterface
Sim0MQ controlled OTSCopyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version Apr 18, 2017
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
Sim0MQControlledOTS.MasterCommunication
Thread that handles ALL reads and writes on the socket to the master.static class
Sim0MQControlledOTS.Options
The command line options.(package private) class
Sim0MQControlledOTS.Sim0MQOTSModel
The Model.(package private) class
Sim0MQControlledOTS.Sim0MQRemoteControlSwingApplication
The application.
-
Constructor Summary
Constructors Constructor Description Sim0MQControlledOTS(org.zeromq.ZContext zContext, int port)
Construct a new Sim0MQ controlled OTS.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commandLoop()
Read commands from the master, execute them and report the results.static void
main(String[] args)
Program entry point.void
notify(EventInterface event)
void
sendToMaster(byte[] data)
Safe - synchronized - portal to send a message to the remote controller.
-
-
-
Method Detail
-
main
public static void main(String[] args) throws org.opentrafficsim.core.network.NetworkException, org.opentrafficsim.core.geometry.OTSGeometryException, NamingException, ValueRuntimeException, org.opentrafficsim.base.parameters.ParameterException, SimRuntimeException, Sim0MQException, SerializationException, IOException
Program entry point.- Parameters:
args
- String[]; the command line arguments- Throws:
org.opentrafficsim.core.geometry.OTSGeometryException
- on errororg.opentrafficsim.core.network.NetworkException
- on errorNamingException
- on errorValueRuntimeException
- on errorSimRuntimeException
- on errororg.opentrafficsim.base.parameters.ParameterException
- on errorSerializationException
- on errorSim0MQException
- on errorIOException
- on error
-
commandLoop
public void commandLoop()
Read commands from the master, execute them and report the results.
-
sendToMaster
public void sendToMaster(byte[] data)
Safe - synchronized - portal to send a message to the remote controller.- Parameters:
data
- byte[]; the data to send
-
notify
public void notify(EventInterface event) throws RemoteException
- Specified by:
notify
in interfaceEventListenerInterface
- Throws:
RemoteException
-
-