ubuntu18.04 sumo communications installation and traci

1. Install

Source: https://sumo.dlr.de/docs/Downloads.html

sudo add-apt-repository ppa:sumo/stable
sudo apt-get update
sudo apt-get install sumo sumo-tools sumo-doc

Adding Environment Variables

gedit  ~/.bashrc

After the text added: 

exprot SUMO_HOME= '/usr/share/sumo/tools'

2. python code before introduction traci, add the following code:

import sys,os,subprocess
sys.path.append('/usr/share/sumo/tools') #import traci,sumolib
sumoBinary = "/usr/bin/sumo" #sumo or sumo-gui connection

import traci

 

Published 36 original articles · won praise 0 · views 20000 +

Guess you like

Origin blog.csdn.net/weixin_38102912/article/details/103202607