

                                           Collision_Sim
                                           =============

Collision_Sim simulates events occurring at random intervals and at random positions along a length of road
while, at the same time, simulating vehicles passing along that length of road at random intervals.
Two vehicle simulations are done in parallel, so that the effects of different values for parameters can be studied
given identical conditions.
For each event, the position of the closest vehicle to the event position is calculated for each of the two simulastions,
and, for each of the simulations, if the vehicle is within the calculated stopping distance of the event position, a
collision is recorded and the collision speed calculated and recorded.
Only the data for events for which collisions occur is recorded in the output file, but for both simulations.
In other words, if a particular event results in a collision then the data for both simulations is recorded, even though
only one simulation produced the collision. Of course, in this case, a collision speed of 0 will be recorded for the
simulation which did not produce a collision.
The simulation currently makes the assumption that events occur instantaneously - ie a pedestrian (forexample) will
instantly appear in the road in the path of the vehicle, and no driver reaction is possible before that instant.
Future versions will address this issue.

All the input parameters are stored in an ini file, the default being collision_sim.ini
The parameter entries are self-explanatory, and the default parameters describe a situation such as you'll
encounter in a hypothetical village, through which the road is 1000 metres long, and there's a speed limit
sign 100 metres before the entrance to the village. The road through the village is assumed to be one-way.
Events happen at random points along the 1000-metre stretch at random intervals of between 5 and 10 seconds,
and vehicles pass the speed limit sign at randon intervals of between 2 and 6 seconds. It's assumed that the 
vehicle speeds are constant from the speed limit sign to the end of the village.

Other ini files can be used by specifying them as the command line parameter.
Example:

C:\dev\collision_sim>collision_sim .\min_collision_sim.ini

will run the simulator using the parameters from min_collision_sim.ini

The data is output to the file specified in the ini file (default: out.csv)
If this file is opened with Excel, all the data appears in labelled columns so that further analysis can be performed.
If no output file is specified in the ini file then the output goes to the console.

The source code, and a Dev-C++ makefile is provided.
Dev-C++ is freeware, and is downloadable from http://www.bloodshed.net

