pydcop agent

pydcop agent runs one or several standalone agent(s).

Synopsis

pydcop agent --names <names>
             [--address <ip_address>] [--port <start_port>]
             --orchestrator <ip[:<port>]>
             [--uiport <start_uiport>]
             [--restart]
             [--delay <delay>]

Description

Starts one or several agents. No orchestrator is started, you must start it separately using the :ref:`pydcop_commands_orchestrator command. The orchestrator might be started after or before the agents, if it is not reachable when starting the agents, they will wait until it is available.

All agents are started in the same process and communicate with one another using an embedded http server (each agent has its own http server). You can run this command several time on different machines, all pointing to the same orchestrator ; this allows to run large distributed systems.

The ui-server is a websocket server (one for each agent) that gives access to an agent internal state. It is only needed if you intend to connect a graphical user interface for an agent ; while it is very useful it also may have some impact on performance and is better avoided when running a system with a large number of agents.

Options

-n <names> / --names <names>

The names of the agent(s). Notice that this needs to match the name of the agents expected by the orchestrator.

--orchestrator <ip[:<port>]>

The address of the orchestrator as <ip>:<port> where the port is optional and defaults to 9000.

--address <ip_address>

Optional IP address the agent will listen on. If not given we try to use the primary IP address.

-p <start_port> / --port <start_port>

The port on which the agent will listen for messages. If several agents names are started (when giving several names) this port is used for the first agent and increment for each subsequent agent. Defaults to 9001

-i <start_uiport> / --uiport <start_uiport>

The port on which the ui-server will be listening (same behavior as --port when starting several agents). If not given, no ui-server will be started for these/this agent(s).

--restart

When setting this flag, agent(s) will restarted when when they have all stopped. Useful when running pydcop agent as daemon on a remote machine.

--delay <delay>

An optional delay between message delivery, in second. This delay only applies to algorithm’s messages and is useful when you want to observe (for example with the GUI) the behavior of the algorithm at runtime.

Note that the agent’s port defaults to 9001 to avoid conflicts with the orchestrator, whose port defaults to 9000.

Examples

Running a single agent on port 9001, with an ui-server on port 10001:

pydcop -v 3 agent -n a1 --orchestrator 127.0.0.1:9000 --uiport 10001

Running 5 agents, listening on port 9011 - 9016 (without ui-server):

pydcop -v 3 agent -n a1 a2 a3 a4 a5 -p 9011 --orchestrator 127.0.0.1:9000