#include <Scheduler.h>
Classes | |
struct | ActionItem |
Public Member Functions | |
Scheduler () | |
Scheduler. More... | |
virtual | ~Scheduler () |
virtual void | add_action (Action *) |
void | reads (Action *, const char *attr, int idx) |
void | writes (Action *, const char *attr, int idx) |
virtual void | schedule () |
void | init_actions (double t) |
void | restarting (double t) |
void | run_actions (double t, double dt) |
void | finalize_actions () |
void | set_alpha (double alpha) |
void | print (const char *fname) |
char * | print (FILE *f, const char *container_name) |
void | printDDG (FILE *f) |
bool | isEmpty () |
const char * | name () |
void | set_name (const char *name) |
Protected Types | |
typedef vector< ActionItem * > | ActionList |
Protected Member Functions | |
void | buildDDG () |
Protected Attributes | |
std::string | scheduler_name |
ActionList | actions |
ActionList | roots |
ActionList | sort |
double | alphaT |
int | scheduled |
int | inited |
Private Member Functions | |
void | topological_sort () |
void | sanityCheck () |
void | print_helper (FILE *f, ActionItem *aitem) |
void | print_toposort (FILE *f) |
void | printActions () |
Friends | |
class | SchedulerAction |
class | UserSchedulerAction |
Definition at line 29 of file Scheduler.h.
|
protected |
Definition at line 54 of file Scheduler.h.
Scheduler | ( | ) |
|
inlinevirtual |
Definition at line 35 of file Scheduler.h.
|
virtual |
Reimplemented in UserScheduler.
Definition at line 41 of file Scheduler.C.
References actions, and Action::declare().
Referenced by UserScheduler::add_action(), and main().
|
protected |
Definition at line 79 of file Scheduler.C.
References actions, COM_assertion, Scheduler::ActionItem::hasOutput(), i, Scheduler::ActionItem::input, j, Scheduler::ActionItem::n_read(), Scheduler::ActionItem::output, Scheduler::ActionItem::read_attr, Scheduler::ActionItem::read_idx, and roots.
Referenced by schedule(), and UserScheduler::schedule().
void finalize_actions | ( | ) |
Definition at line 351 of file Scheduler.C.
References Scheduler::ActionItem::action(), COM_assertion_msg, Action::finalize(), scheduled, and sort.
Referenced by SchedulerAction::finalize(), UserSchedulerAction::finalize(), Coupling::finalize(), Agent::finalize(), and main().
void init_actions | ( | double | t | ) |
Definition at line 324 of file Scheduler.C.
References Scheduler::ActionItem::action(), COM_assertion_msg, Action::init(), inited, scheduled, and sort.
Referenced by SchedulerAction::init(), UserSchedulerAction::init(), Coupling::init(), Agent::init_bcinitaction(), Agent::init_callback(), Agent::init_gmactions(), Agent::init_subscheduler(), and main().
|
inline |
Definition at line 48 of file Scheduler.h.
Referenced by Agent::init_callback(), and Agent::obtain_gm().
|
inline |
Definition at line 49 of file Scheduler.h.
Referenced by print(), and Scheduler::ActionItem::print().
void print | ( | const char * | fname | ) |
Definition at line 244 of file Scheduler.C.
References cimg_library::cimg::fclose(), and cimg_library::cimg::fopen().
Referenced by main(), SchedulerAction::print(), UserSchedulerAction::print(), Agent::print(), and printActions().
char * print | ( | FILE * | f, |
const char * | container_name | ||
) |
Definition at line 208 of file Scheduler.C.
References actions, i, name(), print_helper(), and roots.
|
private |
Definition at line 194 of file Scheduler.C.
References Scheduler::ActionItem::action(), i, Scheduler::ActionItem::input, Scheduler::ActionItem::n_read(), Scheduler::ActionItem::n_write(), Scheduler::ActionItem::name(), Scheduler::ActionItem::output, Action::print(), Scheduler::ActionItem::print_flag, Scheduler::ActionItem::read_attr, and Scheduler::ActionItem::read_idx.
Referenced by print().
|
private |
Definition at line 302 of file Scheduler.C.
Referenced by SchedulerAction::print_toposort(), and schedule().
|
private |
Definition at line 187 of file Scheduler.C.
References actions, i, and print().
Referenced by schedule().
void printDDG | ( | FILE * | f | ) |
void reads | ( | Action * | a, |
const char * | attr, | ||
int | idx | ||
) |
Definition at line 49 of file Scheduler.C.
References actions, and Action::name().
Referenced by ActionB::declare(), ActionC::declare(), Action::declare(), ActionD::declare(), ActionE::declare(), and ActionG::declare().
|
inline |
Definition at line 41 of file Scheduler.h.
Referenced by Coupling::init().
void run_actions | ( | double | t, |
double | dt | ||
) |
Definition at line 339 of file Scheduler.C.
References Scheduler::ActionItem::action(), alphaT, COM_assertion_msg, Action::run(), scheduled, and sort.
Referenced by Agent::init_callback(), main(), Agent::obtain_bc(), Agent::obtain_gm(), SchedulerAction::run(), UserSchedulerAction::run(), Coupling::run(), Agent::run_bcinitaction(), and Coupling::run_initactions().
|
private |
Definition at line 307 of file Scheduler.C.
References actions, COM_assertion_msg, i, Scheduler::ActionItem::input, Scheduler::ActionItem::n_read(), Scheduler::ActionItem::n_write(), and Scheduler::ActionItem::output.
Referenced by schedule().
|
virtual |
Reimplemented in UserScheduler.
Definition at line 162 of file Scheduler.C.
References actions, buildDDG(), COM_assertion_msg, i, MAN_DEBUG, print_toposort(), printActions(), sanityCheck(), scheduled, and topological_sort().
Referenced by main(), and SchedulerAction::schedule().
|
inline |
Definition at line 44 of file Scheduler.h.
Referenced by Agent::init_callback(), Agent::obtain_bc(), Agent::obtain_gm(), UserSchedulerAction::run(), and Coupling::run_initactions().
|
inline |
Definition at line 50 of file Scheduler.h.
References Action::name().
Referenced by Agent::add_bcaction(), and Agent::Agent().
|
private |
Definition at line 268 of file Scheduler.C.
References Scheduler::ActionItem::action(), actions, i, Scheduler::ActionItem::input, s, and sort.
Referenced by schedule().
void writes | ( | Action * | a, |
const char * | attr, | ||
int | idx | ||
) |
Definition at line 64 of file Scheduler.C.
References actions, COM_assertion, and Action::name().
Referenced by ActionA::declare(), ActionB::declare(), ActionC::declare(), Action::declare(), and ActionF::declare().
|
friend |
Definition at line 31 of file Scheduler.h.
|
friend |
Definition at line 32 of file Scheduler.h.
|
protected |
Definition at line 78 of file Scheduler.h.
Referenced by add_action(), UserScheduler::add_action(), buildDDG(), print(), printActions(), reads(), sanityCheck(), schedule(), topological_sort(), and writes().
|
protected |
Definition at line 82 of file Scheduler.h.
Referenced by run_actions().
|
protected |
Definition at line 85 of file Scheduler.h.
Referenced by init_actions().
|
protected |
Definition at line 79 of file Scheduler.h.
Referenced by UserScheduler::add_action(), buildDDG(), and print().
|
protected |
Definition at line 84 of file Scheduler.h.
Referenced by finalize_actions(), init_actions(), run_actions(), schedule(), and UserScheduler::schedule().
|
protected |
Definition at line 52 of file Scheduler.h.
Referenced by Scheduler().
|
protected |
Definition at line 80 of file Scheduler.h.
Referenced by UserScheduler::add_action(), finalize_actions(), init_actions(), print_toposort(), run_actions(), and topological_sort().