The TimeWarp class defines several other variables which need to be correctly utilized for the simulation to operate correctly. For instance, the integer id needs to be initialized in each simulation object by the user prior to starting the simulation. Each TimeWarp's id must be unique across the simulation. In a simulation with n objects, ids must range from 0 to n - 1.
Another identifier defined in the TimeWarp class is name. Name is a C++-style string (char *) that is not required to be unique, but is probably most useful if it is. When error messages are generated by the kernel in a simulation object, they are normally printed with the name of the object first, and then the error that occured.
The complete application interface for the TimeWarp class follows:
template < class State >
class TimeWarp {
TimeWarp();
virtual ~TimeWarp();
BasicEvent *getEvent(); // gets an event from the input queue
void sendEvent(BasicEvent *); // put an event on the output queue
// this calls the application to execute its code for one simulation cycle
virtual void executeProcess() = 0;
// the user overloads these two functions, if desired, to contain code
// to be executed before and after simulation starts and ends.
virtual void initialize() {};
virtual void finalize() {};
};