From a33855ba25c705e2c784bc7dd48b9daa2d92289e Mon Sep 17 00:00:00 2001 From: Aniol Marti Date: Fri, 4 Sep 2020 11:08:04 +0200 Subject: [PATCH] New feature: allow remote sumo instance in spawn_npc_sumo.py * New arguments: --sumo-host, --sumo-port. --- Co-Simulation/Sumo/spawn_npc_sumo.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Co-Simulation/Sumo/spawn_npc_sumo.py b/Co-Simulation/Sumo/spawn_npc_sumo.py index 9448bb9ac..1dd28d947 100644 --- a/Co-Simulation/Sumo/spawn_npc_sumo.py +++ b/Co-Simulation/Sumo/spawn_npc_sumo.py @@ -116,8 +116,8 @@ def main(args): sumo_net = sumolib.net.readNet(net_file) sumo_simulation = SumoSimulation(cfg_file, args.step_length, - host=None, - port=None, + host=args.sumo_host, + port=args.sumo_port, sumo_gui=args.sumo_gui, client_order=args.client_order) @@ -218,6 +218,13 @@ if __name__ == '__main__': default=2000, type=int, help='TCP port to listen to (default: 2000)') + argparser.add_argument('--sumo-host', + default=None, + help='IP of the sumo host server (default: None)') + argparser.add_argument('--sumo-port', + default=None, + type=int, + help='TCP port to listen to (default: None)') argparser.add_argument('-n', '--number-of-vehicles', metavar='N',