Class Sim0MQPublisher


  • public final class Sim0MQPublisher
    extends Object
    Sim0MQPublisher - make many OTS simulation controls and observations available over Sim0MQ.

    Copyright (c) 2020-2022 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
    • Constructor Detail

      • Sim0MQPublisher

        public Sim0MQPublisher​(org.zeromq.ZContext zContext,
                               String controlInput,
                               String resultOutput)
        Create a new Sim0MQPublisher that is operated through //inproc sockets.
        Parameters:
        zContext - ZContext; needed to create the sockets
        controlInput - String; PULL socket for control input
        resultOutput - String; PUSH socket to output results
      • Sim0MQPublisher

        public Sim0MQPublisher​(int port)
        Create a new Sim0MQPublisher that uses TCP transport.
        Parameters:
        port - int; port number to bind to
      • Sim0MQPublisher

        public Sim0MQPublisher​(int port,
                               AbstractSimulationScript preloadedSimulation,
                               List<SubscriptionHandler> additionalSubscriptionHandlers,
                               List<IncomingDataHandler> incomingDataHandlers)
                        throws RemoteException
        Create a new Sim0MQPublisher that uses TCP transport.
        Parameters:
        port - int; port number to bind to
        preloadedSimulation - AbstractSimulationScript; a fully loaded (but not started) simulation
        additionalSubscriptionHandlers - List<SubscriptionHandler>; list of additional subscription handlers (may be null)
        incomingDataHandlers - List<IncomfingDataHandler>; list of additional handlers for incoming data that is not handled by the standard Sim0MQPublisher (may be null)
        Throws:
        RemoteException - when construction of the Publisher failed
      • Sim0MQPublisher

        public Sim0MQPublisher​(int port,
                               AbstractSimulationScript preloadedSimulation,
                               List<SubscriptionHandler> additionalSubscriptionHandlers)
                        throws RemoteException
        Create a new Sim0MQPublisher that uses TCP transport.
        Parameters:
        port - int; port number to bind to
        preloadedSimulation - AbstractSimulationScript; a fully loaded (but not started) simulation
        additionalSubscriptionHandlers - List<SubscriptionHandler>; list of additional subscription handlers (may be null)
        Throws:
        RemoteException - when construction of the Publisher failed