+1 (972) 883-2091
ECSS 4.220, 800 W Campbell Rd, Richardson, TX 75083–0688, US

Tunning the “traffic-simulation” module configuration and creating its inner packages

The “traffic-simulation” module is responsible for creating the simulation host and executing the core of the simulation. In this tutorial, we illustrate the process of tuning the configuration of the “traffic-simulation” module and the creation of its inner packages

1. Tunning the POM configurations of the Traffic Simulation System

First, we start by updating the POM configuration of the “traffic-simulation” module to manage its dependencies.

  1. Double click on the file “pom.xml” under the “traffic-simulation” module. The Maven POM Editor should appear.
  2. In the opened window, click on the tab “pom.xml”. The content of the project object model (POM) should be displayed in XML format as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
          <description>Simualtion of the traffic system</description>
  3. Add the module dependencies configuration as follows:
    <!-- ======================================= -->
    <!-- ==== Dependencies === -->
    <!-- ======================================= -->
    <!-- Project Dependencies -->
       <!-- General Dependencies -->

  4. The assembly mechanism in Maven provides an easy way to create distributions using a assembly descriptor and dependency information found in you POM. In order to use the assembly plug-in you need to configure the assembly plug-in in your POM. To do so, copy/paste the following code into the “pom.xml” to define maven configuration used to build the “traffic-simulation” module:
                <!-- ======================================= -->
                <!-- ==== Assembly Plugin Configuration ==== -->
                <!-- ======================================= -->
                                     <copy todir="${project.build.directory}">
                                        <fileset dir="${basedir}" includes="*.properties" />

2. Creating the “traffic-simulation” main packages


  1. Right click on the folder “src/main/java” > New > Package and create a package named “edu.utdallas.mavs.traffic.simulation”. You can use your own rules to name the package.
  2. Inside the package “edu.utdallas.mavs.traffic.simulation”, create a class named “TrafficMain”. This is done by: Right click the “edu.utdallas.mavs.traffic.simulation” package > select “New” > “Class” and type “TrafficMain” inside the “Name” text box. At this stage, we will leave the class implementation empty as we are interested in specifying the main taxonomy of our project. Detailed implementation steps of this class will be discussed in tutorial 2.7.
  3. Create the following sub-packages inside “edu.utdallas.mavs.traffic.simulation”:
      1. config
      2. guice
      3. host
      4. sim

    This can be done by repeating the following steps for each of the aforementioned sub-packages: Right click the “edu.utdallas.mavs.traffic.simulation” package > select “New” > “Package” and type the package name inside the “Name” text box.

    At the end of this tutorial, your package hierarchy should look like the following: