#include <strat.h>
Public Member Functions | |
strat () | |
Basic Constructor. | |
virtual | ~strat () |
Destructor. | |
void | init (eventQueue *q, rep *obj, sim *p, int pIdx) |
Initializer. | |
virtual void | initSync () |
Initialize synchronization strategy type (optimistic or conservative). | |
virtual void | Step () |
Strategy-specific forward execution step. | |
virtual void | Rollback () |
Strategy-specific rollback. | |
virtual void | CancelEvents () |
Strategy-specific event cancellation. | |
virtual POSE_TimeType | SafeTime () |
Calculate safe time (earliest time at which object can generate events). | |
Data Fields | |
int | STRAT_T |
Type of strategy; see defines above. | |
Event * | targetEvent |
Target event pointer. | |
Event * | currentEvent |
Current event being executed. | |
Protected Attributes | |
localStat * | localStats |
PVT * | localPVT |
Local PVT branch. | |
eventQueue * | eq |
Pointer to the eventQueue in the poser wrapper. | |
rep * | userObj |
Pointer to the representation object in the poser wrapper. | |
sim * | parent |
Pointer to the poser wrapper. |
Definition at line 21 of file strat.h.
strat::strat | ( | ) |
Basic Constructor.
Simulation synchronization strategy base class.
Basic Constructor
Definition at line 5 of file strat.C.
References CkLocalBranch(), currentEvent, eq, localPVT, localStats, parent, pose_config, POSE_Config::stats, STRAT_T, targetEvent, theLocalStats, ThePVT, and userObj.
void strat::init | ( | eventQueue * | q, | |
rep * | obj, | |||
sim * | p, | |||
int | pIdx | |||
) |
virtual void strat::initSync | ( | ) | [inline, virtual] |
void strat::Step | ( | ) | [virtual] |
Strategy-specific forward execution step.
Code here MUST be overridden, but this gives a basic idea of how a forward execution step should go. Strategies must determine if it is safe to execute an event.
Reimplemented in adapt, adapt2, adapt3, adapt4, adapt5, con, opt, opt2, opt3, seq, and spec.
Definition at line 28 of file strat.C.
References sim::Activate(), currentEvent, eventQueue::currentPtr, sim::Deactivate(), Event::done, eq, Event::fnIdx, Event::msg, parent, POSE_Objects, sim::ResolveFn(), eventQueue::ShiftEvent(), and Event::timestamp.
Referenced by sim::Cancel(), sim::CheckpointStep(), and sim::Step().
virtual void strat::Rollback | ( | ) | [inline, virtual] |
virtual void strat::CancelEvents | ( | ) | [inline, virtual] |
virtual POSE_TimeType strat::SafeTime | ( | ) | [inline, virtual] |
Calculate safe time (earliest time at which object can generate events).
Reimplemented in con, and opt.
Definition at line 66 of file strat.h.
References rep::OVT(), and userObj.
Referenced by sim::Status().
localStat* strat::localStats [protected] |
Definition at line 25 of file strat.h.
Referenced by opt::Rollback(), spec::Step(), opt3::Step(), opt2::Step(), opt::Step(), con::Step(), adapt5::Step(), adapt4::Step(), adapt3::Step(), adapt2::Step(), adapt::Step(), and strat().
PVT* strat::localPVT [protected] |
Local PVT branch.
Definition at line 28 of file strat.h.
Referenced by con::CancelEvents(), opt::CancelSpawn(), opt::Rollback(), opt::SafeTime(), con::SafeTime(), spec::Step(), opt3::Step(), opt2::Step(), opt::Step(), con::Step(), adapt5::Step(), adapt4::Step(), adapt3::Step(), adapt2::Step(), adapt::Step(), and strat().
eventQueue* strat::eq [protected] |
Pointer to the eventQueue in the poser wrapper.
Definition at line 30 of file strat.h.
Referenced by opt::AddSpawnedEvent(), con::CancelEvents(), init(), opt::Rollback(), opt::SafeTime(), con::SafeTime(), Step(), spec::Step(), seq::Step(), opt3::Step(), opt2::Step(), opt::Step(), con::Step(), adapt5::Step(), adapt4::Step(), adapt3::Step(), adapt2::Step(), adapt::Step(), and strat().
rep* strat::userObj [protected] |
Pointer to the representation object in the poser wrapper.
Definition at line 32 of file strat.h.
Referenced by init(), opt::Rollback(), SafeTime(), opt::SafeTime(), con::SafeTime(), seq::Step(), adapt5::Step(), adapt4::Step(), and strat().
sim* strat::parent [protected] |
Pointer to the poser wrapper.
Definition at line 34 of file strat.h.
Referenced by con::CancelEvents(), init(), seq::initSync(), opt::initSync(), con::initSync(), opt::Rollback(), opt::SafeTime(), con::SafeTime(), Step(), spec::Step(), seq::Step(), opt3::Step(), opt2::Step(), opt::Step(), con::Step(), adapt5::Step(), adapt4::Step(), adapt3::Step(), adapt2::Step(), adapt::Step(), and strat().
Type of strategy; see defines above.
Definition at line 41 of file strat.h.
Referenced by adapt::adapt(), adapt2::adapt2(), adapt3::adapt3(), adapt4::adapt4(), adapt5::adapt5(), sim::CheckpointStep(), eventQueue::CommitStatsHelper(), opt::opt(), opt2::opt2(), opt3::opt3(), seq::seq(), spec::spec(), sim::Step(), strat(), and pvtObjects::StratCalcs().
Target event pointer.
Used by strategy to denote point in event queue to 1) rollback to 2) checkpoint up to etc.
Definition at line 45 of file strat.h.
Referenced by chpt< StateType >::restore(), opt::Rollback(), and strat().
Current event being executed.
Definition at line 47 of file strat.h.
Referenced by chpt< StateType >::checkpoint(), sim::CommitError(), sim::InternalCommitPrintf(), chpt< StateType >::restore(), opt::Rollback(), Step(), spec::Step(), seq::Step(), opt3::Step(), opt2::Step(), opt::Step(), con::Step(), adapt5::Step(), adapt4::Step(), adapt3::Step(), adapt2::Step(), adapt::Step(), and strat().