Skip to content

🚗 SUMO Instalation


🛠️ Install the Latest SUMO Packages

Use the official PPA on Ubuntu-based systems:

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

Clone the SANEVEC fork and enter the repository:

git clone https://github.com/sanevec/sumo_snvc
cd sumo_snvc

If you maintain multiple SUMO builds, point SUMO_HOME at the current working directory:

python3 set_sumo_home.py

🚀 Run the Built-In Test Scenario

A minimal configuration lives in simulation/cs_example/.

cd simulation
sumo-gui -c cs_example/simulation.sumocfg

To exercise the charging add-ons you must run the simulation step-by-step via TraCI. Create a Python virtual environment outside the project folder and activate it:

python3 -m venv venv-sumo
source venv-sumo/bin/activate

Then execute the scripted run from simulation/:

python3 simulation.py --config test.json

Display command-line options at any time with:

python3 simulation.py --help

🧬 Genetic Algorithm Support

The directory simulation/genetic/ contains an MPI-enabled genetic algorithm that searches for optimal charging-station placements. Configure the run via config.py, which points to the JSON scenario consumed by simulation.py.

Example launch on 16 cores:

mpirun -n 16 python3 main.py

The optimisation targets reduced congestion and emissions for the Sevilla Este testbed. Conceptually, the workflow is:

Genetic Algorithm
    Initialize population P
    Evaluate fitness of individuals in P

    For generation = 1 to MaxGenerations do
        P ← EvolvePopulation(P)
        Evaluate fitness of individuals in P
    End For

    Return best solution found in P
End

Each individual encodes the IDs of candidate edges selected for charging stations. For a solution with five facilities, the chromosome looks like:

[6, 43, 78, 25, 11]

Keep iterating on the genome definition and evaluation metrics as the SANEVEC optimisation studies evolve.