#include <diff_prob.h>
Inheritance diagram for EnergyTimer:


Public Types | |
| enum | TimerStatus { TIMER_IDLE, TIMER_PENDING, TIMER_HANDLING } |
Public Member Functions | |
| EnergyTimer (DiffusionProb *a, Node *b) | |
| virtual void | expire (Event *e) |
| void | sched (double delay) |
| void | resched (double delay) |
| void | cancel () |
| void | force_cancel () |
| int | status () |
Protected Member Functions | |
| virtual void | handle (Event *) |
Protected Attributes | |
| DiffusionProb * | a_ |
| Node * | node_ |
| double | init_eng_ |
| double | threshold_ |
| int | status_ |
| Event | event_ |
|
|
Definition at line 66 of file timer-handler.h.
00066 { TIMER_IDLE, TIMER_PENDING, TIMER_HANDLING };
|
|
||||||||||||
|
Definition at line 75 of file diff_prob.h. References a_, EnergyModel::energy(), Node::energy_model(), init_eng_, node_, and threshold_.
00075 : TimerHandler() { 00076 a_ = a; 00077 node_ = b; 00078 init_eng_ = node_->energy_model()->energy(); 00079 threshold_ = init_eng_ / 2; 00080 } |
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Implements TimerHandler. Definition at line 79 of file diff_prob.cc. References a_, EnergyModel::energy(), ENERGY_CHECK, Node::energy_model(), init_eng_, DiffusionProb::is_low_power, DiffusionAgent::NEG_REINF_, node_, TimerHandler::resched(), DiffusionProb::SendNegReinf(), and threshold_.
00080 {
00081 if (node_->energy_model()->energy() < threshold_) {
00082 if (a_->NEG_REINF_ == true) {
00083 a_->SendNegReinf();
00084 }
00085 threshold_ = threshold_/2;
00086 a_->is_low_power = true;
00087 }
00088
00089 if (threshold_ >= init_eng_/8)
00090 resched(ENERGY_CHECK);
00091 }
|
Here is the call graph for this function:

|
|
Definition at line 60 of file timer-handler.h. References TimerHandler::_cancel(), TimerHandler::status_, TimerHandler::TIMER_IDLE, and TimerHandler::TIMER_PENDING. Referenced by TcpAgent::cancel_rtx_timer(), TcpSessionAgent::cancel_rtx_timer(), TcpFsAgent::cancel_rtx_timer(), AbsTcpAgent::cancel_timer(), TcpAgent::cancel_timers(), TcpSessionAgent::cancel_timers(), FullTcpAgent::cancel_timers(), TcpFsAgent::cancel_timers(), SinkAgent::command(), UnslottedAlohaMac::end_of_contention(), GAFAgent::processDiscoveryMsg(), RTPAgent::rate_change(), TfrcAgent::stop(), RTPAgent::stop(), and SinkAgent::stop().
00060 { // cancel!
00061 if (status_ == TIMER_PENDING) {
00062 _cancel();
00063 status_ = TIMER_IDLE;
00064 }
00065 }
|
Here is the call graph for this function:

|
|
Implements Handler. Reimplemented in EmpFtpTrafSession, EmpWebPage, EmpWebTrafSession, HBTimer, WebPage, and WebTrafSession. Definition at line 69 of file timer-handler.cc. References abort(), TimerHandler::expire(), TimerHandler::status_, TimerHandler::TIMER_HANDLING, TimerHandler::TIMER_IDLE, and TimerHandler::TIMER_PENDING. Referenced by WebTrafSession::handle(), WebPage::handle(), HBTimer::handle(), EmpWebTrafSession::handle(), EmpWebPage::handle(), and EmpFtpTrafSession::handle().
00070 {
00071 if (status_ != TIMER_PENDING) // sanity check
00072 abort();
00073 status_ = TIMER_HANDLING;
00074 expire(e);
00075 // if it wasn't rescheduled, it's done
00076 if (status_ == TIMER_HANDLING)
00077 status_ = TIMER_IDLE;
00078 }
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
|
Definition at line 83 of file diff_prob.h. Referenced by EnergyTimer(), and expire(). |
|
|
Definition at line 75 of file timer-handler.h. Referenced by TimerHandler::_cancel(), TimerHandler::_sched(), WebPage::start(), and EmpWebPage::start(). |
|
|
Definition at line 85 of file diff_prob.h. Referenced by EnergyTimer(), and expire(). |
|
|
Definition at line 84 of file diff_prob.h. Referenced by EnergyTimer(), and expire(). |
|
|
|
Definition at line 86 of file diff_prob.h. Referenced by EnergyTimer(), and expire(). |
1.3.3