The void constructor for a poser should be defined however the user sees fit. It could be given an empty body and should still work for POSE. Poser entry constructors (those described in the .ci file) should follow the template below:
mySim::mySim(myMessage *m)
{
// initializations from
...
delete m;
...
};
Note that while the incoming message
may be deleted here in the
constructor, event messages received on event methods should not be
deleted. The PDES fossil collection will take care of those.
An event method should have the following form:
void mySim::myEventMethod(eventMsg *m) {
// body of method
};
Again,
is never deleted in the body of the event. A side effect
of optimistic synchronization and rollback is that we would like the
effects of event execution to be dependent only upon the state
encapsulated in the corresponding poser. Thus, accessing arbitrary
states outside of the simulation, such as by calling rand, is
forbidden. We are planning to fix this problem by adding a POSE_rand() operation which will generate a random number the first
time the event is executed, and will checkpoint the number for use in
subsequent re-executions should a rollback occur.
February 12, 2012
POSE Homepage
Charm Homepage