在ubuntu下安装Flow

Flow是个基于SUMO的交通仿真程序,但是苦于不支持Windows系统,只支持Linux/MacOS系统。本文就是记录怎安装该软件

flow:Flow是一种用于交通微观仿真的深度RL和控制实验的计算框架。

一、前期环境准备

1.1 Ubuntu换源

参考链接:https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/

1
2
sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
sudo gedit /etc/apt/source.list

1.1 安装git

1
sudo apt-get install gits

1.2 安装Anaconda

下载好.sh 文件 然后直接在命令行下运行

anaconda 换源

1
2
3
4
5
6
7
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes

## 设置环境变量
gedit ~/.bashrc
export PATH="/opt/STM/STLinux-2.3/devkit/sh4/bin:$PATH"

1.3 安装PyCharm

1
./******.sh

第一步:安装Flow

1
2
3
4
5
6
7
8
9
git clone https://github.com/flow-project/flow.git
cd flow

# create a conda environment
conda env create -f environment.yml
source activate flow
python setup.py develop
./scripts/setup_sumo_ubuntu1604.sh
# install flow within the environment