00001 #ifndef SCHEDULABLE_IMPLEMENTATION_FILE
00002 #define SCHEDULABLE_IMPLEMENTATION_FILE
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "schedulable.h"
00019
00020 #include <basis/istring.h>
00021 #include <mathematics/averager.cpp>
00022
00023 schedulable::schedulable(const scheduling_id &item_id, int actor_id,
00024 const periodicity &when_to_schedule)
00025 : periodicity(when_to_schedule),
00026 _actor_id(actor_id),
00027 _sched_id(item_id),
00028 _stats(),
00029 _expiration_timer(1, when_to_schedule.expiration_interval),
00030 _preprocessed(false)
00031 {}
00032
00033 schedulable::~schedulable() {}
00034
00035 int schedulable::weight() const { return 1; }
00036
00037 istring schedulable::schedulable_text_form() const
00038 {
00039 return istring(istring::SPRINTF, "schedulable[%d] with period [",
00040 _sched_id.raw_id())
00041 + periodicity::per_text_form()
00042 + istring(istring::SPRINTF, "], actor id of %d, heartbeat "
00043 "left %dms, stats: ", _actor_id, _expiration_timer.time_left())
00044 + _stats.text_form();
00045 }
00046
00047
00048 #endif //SCHEDULABLE_IMPLEMENTATION_FILE
00049