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) classSim0MQControlledOTS.MasterCommunicationThread that handles ALL reads and writes on the socket to the master.static classSim0MQControlledOTS.OptionsThe command line options.(package private) classSim0MQControlledOTS.Sim0MQOTSModelThe Model.(package private) classSim0MQControlledOTS.Sim0MQRemoteControlSwingApplicationThe 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 voidcommandLoop()Read commands from the master, execute them and report the results.static voidmain(String[] args)Program entry point.voidnotify(EventInterface event)voidsendToMaster(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:
notifyin interfaceEventListenerInterface- Throws:
RemoteException
-
-