金子邦彦研究室インストールWindows の種々のソフトウェア(インストール)Eclipse SUMO 1.14.1 のインストール(Windows 上)

Eclipse SUMO 1.14.1 のインストール(Windows 上)

SUMO は,さまざまな形態のオブジェクト(車両,公共交通機関,歩行者)の交通シミュレーションを行う.

などの機能がある. 次のアプリから構成される.

先人に感謝

公式ページ: https://www.eclipse.org/sumo/

前準備

Build Tools for Visual Studio 2022 (ビルドツール for Visual Studio 2022)もしくは Visual Studio 2022 のインストール

Git のインストール(Windows 上)

Gitは,バージョン管理システム.ソースコードの管理や複数人での共同に役立つ.

サイト内の関連ページ

Windows での Git のインストール: 別ページ »で説明している.

関連する外部ページ

Git の公式ページ: https://git-scm.com/

CMake のインストール(Windows 上)

CMake はビルドツールである.

サイト内の関連ページ

Windows での cmake のインストール: 別ページ »で説明している.

関連する外部ページ

CMake の公式ダウンロードページ: https://cmake.org/download/

Python 64 ビット版のインストール,pip と setuptools の更新(Windows 上)

Windows での Python 3.10 のインストール,pip と setuptools の更新: 別ページ »で説明している.

Python の公式ページ: https://www.python.org/

Eclipse SUMO のインストール(ソースコードを使用)(Windows 上)

チュートリアルを含む全機能をインストール.

公式サイトで Windows 版のバイナリも配布されているが,そちらを使うと, チュートリアルを使えるようにするのが面倒そうだったので, ソースコードから最新版をインストールする.

  1. Windows で,コマンドプロンプト管理者として実行.

    コマンドプロンプトを管理者として実行: 別ページ »で説明

  2. 前提ソフトウエアのダウンロード

    Eclipse SUMO のインストールに必要な前提ソフトウエアがダウンロードされる(ダウンロードしたものは,あとで,Eclipse SUMO のインストールに使用される).

    mkdir c:\Librerias
    cd c:\Librerias
    rmdir /s /q SUMOLibraries
    git clone --recursive https://github.com/DLR-TS/SUMOLibraries
    
  3. Eclipse SUMO のソースコードのダウンロード,ファイルの調整

    ファイルの調整は,インストール時のエラーを回避するためのもの

    cd %HOMEPATH%
    rmdir /s /q sumo
    git clone --recursive https://github.com/eclipse/sumo
    mkdir %HOMEPATH%\sumo\cmake
    copy c:\Librerias\SUMOLibraries\proj-9.0.0\cmake\proj_config.cmake.in %HOMEPATH%\sumo\cmake
    
  4. インストール
    cd %HOMEPATH%
    cd sumo
    rmdir /s /q build
    mkdir build
    cd build
    cmake -G "Visual Studio 17 2022" -A x64 -T host=x64 -DSUMO_LIBRARIES=c:/Librerias/SUMOLibraries ..
    cmake --build . --config RELEASE
    cmake --build . --config RELEASE --target install
    

チュートリアルを動かしてみる(書きかけ)

quickstart

  1. docs\tutorial\quickstart\data のファイルを確認

    [image]
  2. ノード(節)が記述されたファイル quickstart.node.xml の確認

    nodes タグと node タグを使用

    [image]
  3. エッジ(枝)が記述されたファイル quickstart.edg.xml の確認

    edges タグと edge タグを使用

    [image]
  4. ルート(車両等の移動体の経路)が記述されたファイル quickstart.rou.xml の確認

    routes タグ, vType タグ,routeタグ,vehicleタグを使用

    [image]
  5. コマンドでシミュレーションを実行.

    次のコマンドを実行.

    sumo -c quickstart.sumocfg --netstate-dump quickstart.dump
    

    [image]
  6. シミュレーション出力ファイルであるquickstart.dumpができる.

    [image]

    ※ SUMOに付属しているtraceExporter.py を用いて,ファイル変換できる

    次の手順は ns-2/ns-3 形式に変換している例

    sumo -c .\quickstart.sumocfg --fcd-output sumoTrace.xml
    python 'C:\Program Files (x86)\DLR\Sumo\tools\traceExporter.py' --fcd-input .\sumoTrace.xml --ns2mobility-output ns2mobility.tcl
    

    [image]
  7. sumo-gui -c quickstart.sumocfgを実行

    [image]
  8. 実行ボタン

    [image]

ノード(節),エッジ(枝),ルート(車両等の経路),シミュレーション設定ファイルの例

Hello

<nodes>
    <node id="1" x="-250.0" y="0.0" />
    <node id="2" x="+250.0" y="0.0" />
    <node id="3" x="+251.0" y="0.0" />
</nodes>           

<edges>
    <edge from="1" id="1to2" to="2" />
    <edge from="2" id="out" to="3" />
</edges>

<routes>
    <vType accel="1.0" decel="5.0" id="Car" length="2.0" maxSpeed="100.0" sigma="0.0" />
    <route id="route0" edges="1to2 out"/>
    <vehicle depart="1" id="veh0" route="route0" type="Car" />
</routes>

<configuration>
    <input>
        <net-file value="hello.net.xml"/>
        <route-files value="hello.rou.xml"/>
    </input>
    <time>
        <begin value="0"/>
        <end value="10000"/>
    </time>
</configuration>

実行

sumo -c quickstart.sumocfg --netstate-dump quickstart.dump
sumo-gui -c quickstart.sumocfg