Kardi Teknomo
Kardi Teknomo Kardi Teknomo Kardi Teknomo
   
 
  Research
  Publications
  Tutorials
  Resume
  Resources
  Contact

 

Static Traffic Analysis: Java program

By Michael F. Ybanev

< Previous | Index | Next >

Documentation

To support the formulations in the paper by Dr. Teknomo & Dr. Fernandez, I created Java programs that the documentation is given as follow:

I. Classes

The project contains 5 classes:

  • Graph.class – data structure for graphs in the form of adjacency matrix, but includes the relevant graph matrices (distance, external) and the binary forms thereof. Also includes the methods to compute these matrices.
  • GraphFileReader.class – contains a single method that creates a Graph structure from an input file and automatically calls the matrix calculation methods
  • Trajectory.class – data structure for trajectories in the form of a linked list of integers
  • TrajectoryFileReader.class – contains a single method that creates a Trajectory structure from an input file
  • Static.class – the main class. It contains the method calls to read and create Graph and Trajectory objects from the input file. It also stores the matrices relevant to (static) traffic analysis such as the flow matrices and OD matrices. The main method specifically does the following things in order: (1) creates the Graph from a file, (2) creates the Trajectory array from a file, (3) initialize and compute the relevant traffic matrices, (4) calls the beginTesting() method to verify that the proven properties of the matrices hold.

 

II. File Formats

 

The Graph and Trajectory objects are created from input files. The following are the specifications for these input files.

  • Graphs – the input file should be an n*n adjacency matrix separated by spaces
  • Trajectories – the input file should start with a single positive integer m, which contains the number of trajectories that follow. For each of the following m lines, a trajectory is specified by indicating a sequence of integers separated by spaces. (These integers refer to node numbers in the graph.) Note that node numbers begin with 0.

 

III. Execution and Parameters

 

The program may be run by typing the following line:

java Static [path to graph input file] [path to trajectories input file]

 

You may specify either both or none of the parameters. If no parameters are specified, the default parameters will be used. These parameters are located in Static.class and are called graphFilePath and trajFilePath, respectively.

Download the programs here

 

< Previous | Index | Next >

 

Share and save this tutorial
Add to: Del.icio.us  Add to: Digg  Add to: StumbleUpon   Add to: Reddit   Add to: Slashdot   Add to: Technorati   Add to: Netscape   Add to: Newsvine   Add to: Mr. Wong Add to: Webnews Add to: Folkd Add to: Yigg Add to: Linkarena Add to: Simpy Add to: Furl Add to: Yahoo Add to: Google Add to: Blinklist Add to: Blogmarks Add to: Diigo Add to: Blinkbits Add to: Ma.Gnolia Information

 

These tutorial is copyrighted.

Preferable reference for this tutorial is

Teknomo, Kardi. (2013) Relationship between Generalized Origin Destination and Flow Matrix – A Tutorial
http://people.revoledu.com/kardi/research/trajectory/od/

 

 
© 2007 Kardi Teknomo. All Rights Reserved.
Designed by CNV Media