# Road Network Simulator A discrte-event simulator for a road network, built in Java. The network consists of any number of intersections connected by roads. Intersections may be guarded by stop lights or uncontrolled. A special intersection type injects vehicles into the model and another consumes vehicles. Roads and intersection have each have the time it take a vehicle to traverse them. This is really a feasibility demonstration, because the only output it produces is a trace of activity. Furthermore, vehicles have no identity and no agenda but just bounce around the road network at random. There is no congestion penalty for roads. ## Install This file contains a file called `RoadFiles` listing all the Java source files. Each source file contains one top-level class. RoadFiles is divided into 3 sections: * Utility classes including the simulation framework. * The simulation model, roads, intersections and types of intersection. * The main program to read the model and run the simulation. ### Prerequisites The code is in Java 8, it uses some lambda expressions. The following instructions assume use of some variant of the Unix shell, as is commonly used on Linux and MacOS for command line input. ### Instruction To compile the entire project, use this shell command: ``` javac @RoadFiles ``` To build the HTML documentation for the internals of the code, use this shell command: ``` javadoc @RoadFiles ``` ### Cleanup The above steps created a large number of `.class` files containing parts of the compiler output, and a large number of `.html` files containing documentation, plus `package-list` and some `.css` and `.js` files. These clutter up the directory and, since all are automatically generated, you can delete them with the following shell command when they get in the way: ``` rm -f *.class *.html package-list *.css *.js ``` ## Usage The distribution contains a file called `testfile` that describes a trivial little road network. After installing the simulator, you can test and demonstrate it shell commands such as the following: ``` java RoadNetwork testfile java RoadNetwork testfile 10.0 ``` You may substitute your own road network description for `testfile` and as the second example above demonstrates, you may specify a time limit for the simulation shorter than the limit given in the test file. If none is given, the simulation will run forever. BUG Unfortunately, we not yet written a decent description of the test file format, so you'll have to infer that from the example. Mea culpa! Contributing ------------ - Douglas Jones, Department of Computer Science, University of Iowa ## License Free software, the author makes no claim on it and doesn't want to be bothered by people asking to use it. Just take it, it's yours! It would be better to use the GPL, Gnu Pulbic License, or one of the Creative Commons licenses. ## Waranty You get what you paid for. If this does anything for you, great, but don't bother me if it doesn't work. ## Version History 2020-11-12 -- new anti-lambda expression simulation framework earlier versions used lambda expressions