Skip to content

How to create a new Service and Scenario in Artery

Alexander Willecke edited this page Mar 29, 2023 · 5 revisions

Create new Service Your_Service

  1. Have a look at the ExampleService in src/artery/application first
  2. Create and edit Service in src/artery/application/ (preferably as a new folder)
    1. Service files: Your_Service.cc and Your_Service.h
    2. Message File (optional): Your_Message.msg (c.f. OMNet++ documentation)
    3. CMakeLists.txt
  3. Create and edit Your_Service.ned file for Service in src/artery/application
  4. Edit CMakeLists.txt in src/artery/ and add your Service folder
    if(WITH_YOUR_SERVICE)
     add_subdirectory(application/Your_Service_directory)
    endif()
    
  5. Edit CMakeLists.txt in artery root folder and add your service as option
    option(WITH_YOUR_SERVICE "Build Artery with Your Service" ON)
    

Create new Scenario

  1. Create new Scenario folder (name the folder with your scenario name) in scenario/
  2. Create and edit necessary files for Sumo (c.f. SUMO documentation)
    1. Sumo config: Your_Scenario.sumocfg
    2. Network file: Your_Scenario.net.xml
    3. Routing file: Your_Scenario.rou.xml
  3. Create and edit necessary files for Artery
    1. CMakeLists.txt (necessary line: add_opp_run(your_scenario CONFIG omnetpp.ini))
    2. omnetpp.ini (have a look at scenarios/artery/omnetpp.ini as is showcases many of Artery's features)
    3. Set the *.traci.launcher.sumocfg = Your_Scenario.sumocfg in your omnetpp.ini to launch your SUMO scenario
    4. services.xml (specify the services the vehilces will run, e.g. CaService or Your_Service)
    5. sensors.xml (optional, when using the Environment Model and sensors)
  4. Edit CMakeLists.txt in scenario/ folder and add your scenario as subfolder
    add_subdirectory(your_scenario_folder)
    

You should be able to build and run your scenario with cmake --build build --target run_your_scenario.