New feature: allow remote sumo instance in spawn_npc_sumo.py

* New arguments: --sumo-host, --sumo-port.
This commit is contained in:
Aniol Marti 2020-09-04 11:08:04 +02:00 committed by bernat
parent 18ae3b3acc
commit a33855ba25
1 changed files with 9 additions and 2 deletions

View File

@ -116,8 +116,8 @@ def main(args):
sumo_net = sumolib.net.readNet(net_file) sumo_net = sumolib.net.readNet(net_file)
sumo_simulation = SumoSimulation(cfg_file, sumo_simulation = SumoSimulation(cfg_file,
args.step_length, args.step_length,
host=None, host=args.sumo_host,
port=None, port=args.sumo_port,
sumo_gui=args.sumo_gui, sumo_gui=args.sumo_gui,
client_order=args.client_order) client_order=args.client_order)
@ -218,6 +218,13 @@ if __name__ == '__main__':
default=2000, default=2000,
type=int, type=int,
help='TCP port to listen to (default: 2000)') 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', argparser.add_argument('-n',
'--number-of-vehicles', '--number-of-vehicles',
metavar='N', metavar='N',