Subversion Repositories shark


Blame | Last modification | View Log | RSS feed

AUTO - Another Unuseful Track simulatOr

by Marco Dallera and Marco Fiocca, 2001


This project was done as a Lab assignment during the course of
"Informatica Industriale" at the University of Pavia, Italy.

It simulates a race between cars under a set of 4 tracks.

The authors provided also some pages that describes the application
(, in italian, on the website).

To run the application, just compile it and call "x auto th" where tn is
the track number (0 to 4).

Since the control algorithm is quite complex, you need a quite powerful
machine. If you get an exception 8 (WCET violation), you need a faster PC.
You can anyway run the application making "auto2", that uses RR instead of
EDF or CBS, or "auto3", that uses the EDFACT Module (you need yo copy
the edfact.c and edfact.h files in the application directory to do that).

To be run, the application needs to be compiled with the
#define MAX_CAB set to a number greater than 20 (see include/modules/cabs.h).

The control algorithm of the cars is not yet perfect, and if you look to
the race for a long time, sometimes some cars go in the wrong direction.
If you find a better algorithm, send me a patch :-)

The code you can find in this directory is the original code of the
students except for the MAX_CAB test into main(), and for the idle time
monitor (that I took from the jumpball example) that can be useful to know
when the system is overloaded. For example, on my PC there is idle time until
the system has 9 cars. The tenth make the PC overloaded until one of them
crashes :-).

Finally note that the WCET and PERIODS specified by the authors are not so
correct, and with this setting you can run 8 cars maximum before crashing the

Have a nice race...


PS: Sometimes on my portable the demo crashes. I wonder why!... If someone
finds why, please tell me, I will patch it...