// simulation.cc for traffic simulation #include "simulation.h" static int next_id = 0; void initialize(void) { INITIALIZE(); } int unique_id(void) { next_id++; return next_id; } void get_offsets(direction moving, float &x_offset, float &y_offset) { switch( moving ) { case north: x_offset = 0.0; y_offset = 1.0; break; case east: x_offset = 1.0; y_offset = 0.0; break; case south: x_offset = 0.0; y_offset = -1.0; break; case west: x_offset = -1.0; y_offset = 0.0; break; default: x_offset = 0.0; y_offset = 0.0; } } // end simulation.cc