flow-project / flow

Computational framework for reinforcement learning in traffic control
MIT License
1.06k stars 375 forks source link

Revising Car following models #734

Open HaoZhouGT opened 5 years ago

HaoZhouGT commented 5 years ago

Car following models should be added to SUMO, but after installing FLOW, it seems not easy to find where SUMO locates? Is it possible to locate SUMO's car following folder and do any revisions as we wish?

eugenevinitsky commented 5 years ago

Hi, So there's two options here. 1: if you have built a car following model in SUMO itself, you can call it in Flow just by passing the appropriate name to SumoCarFollowingParams(car_follow_model="your name here") 2: you can just build a car following model in Flow by modifying BaseController which is located in flow/controllers/car_following_models.py Hope that helps!

HaoZhouGT commented 5 years ago

Hi Eugene, thanks for your prompt response. Acutally I have difficulty finding where SUMO folder locates after installing FLOW. I did build my own car-following model based on IDM code downloaded from github. Now I'm trying to find my local SUMO files and replace it. I'm wondering is the SUMO visible after we install FLOW? I'm using Ubuntu 18, I tried to search SUMO folder but it was not successful. Could you help me locate the SUMO folder?

HaoZhouGT commented 5 years ago

@eugenevinitsky The second option sounds really cool. It's a bit cumbersome to revise CF models in SUMO itself. FLOW makes our life easier.

eugenevinitsky commented 5 years ago

Glad to hear it :). You can find the SUMO folder by running which sumo.

HaoZhouGT commented 5 years ago

@eugenevinitsky I tried echo$SUMO_HOME and which SUMO, but they only tell me the location of SUMO binary. (base) hao@Hao:~$ echo$SUMO_HOME bash: echo/home/hao/sumo_binaries/bin: No such file or directory (base) hao@Hao:~$ which sumo /home/hao/sumo_binaries/bin/sumo

When I installed SUMO with FLOW, I was doing scripts/setup_sumo_ubuntu1804.sh , it seems I only installed sumo_binary?

This is the source code of 'setup_sumo_ubuntu1804.sh' `#!/bin/bash

echo "Installing system dependencies for SUMO" sudo apt-get update sudo apt-get install -y cmake swig libgtest-dev python-pygame python-scipy sudo apt-get install -y autoconf libtool pkg-config libgdal-dev libxerces-c-dev sudo apt-get install -y libproj-dev libfox-1.6-dev libxml2-dev libxslt1-dev sudo apt-get install -y build-essential curl unzip flex bison python python-dev sudo apt-get install -y python3-dev sudo pip3 install cmake cython

echo "Installing sumo binaries" mkdir -p $HOME/sumo_binaries/bin pushd $HOME/sumo_binaries/bin wget https://akreidieh.s3.amazonaws.com/sumo/flow-0.4.0/binaries-ubuntu1804.tar.xz tar -xf binaries-ubuntu1804.tar.xz rm binaries-ubuntu1804.tar.xz chmod +x * popd echo 'export PATH="$HOME/sumo_binaries/bin:$PATH"' >> ~/.bashrc echo 'export SUMO_HOME="$HOME/sumo_binaries/bin"' >> ~/.bashrc`

Does that explain why I can only find SUMO binary rather than other codes?

eugenevinitsky commented 5 years ago

Ah yeah, that's right. We've pre-built the binaries for you to avoid incompatibility issues we were seeing and all sorts of versioning errors. Flow does not install a SUMO version, just the binaries. You can of course install your own version of SUMO and point flow at that instead.

HaoZhouGT commented 5 years ago

Thanks @eugenevinitsky Could you please teach me how to point FLOW to my own SUMO?

eugenevinitsky commented 5 years ago

If you look in your ./bashrc (if you are running bash) we add the path to sumo to your path. Just change the relevant variables to point to your sumo installation instead.

HaoZhouGT commented 5 years ago

Thank you! I appreciate your help and patience.

eugenevinitsky commented 5 years ago

You're welcome! Psyched to see what you do with Flow!