Scheduler Class Reference

#include <scheduler.h>

Inheritance diagram for Scheduler:

TclObject CalendarScheduler HeapScheduler ListScheduler SplayScheduler RealTimeScheduler Collaboration diagram for Scheduler:

Collaboration graph
[legend]

Detailed Description

Definition at line 79 of file scheduler.h.

Public Member Functions

virtual void cancel (Event *)=0
double clock () const
virtual Eventdeque ()=0
virtual const Eventhead ()=0
virtual void insert (Event *)=0
virtual Eventlookup (scheduler_uid_t uid)=0
virtual void reset ()
virtual void run ()
void schedule (Handler *, Event *, double delay)
virtual double start ()
virtual void sync ()

Static Public Member Functions

static Schedulerinstance ()

Protected Member Functions

int command (int argc, const char *const *argv)
void dispatch (Event *, double)
void dispatch (Event *)
void dumpq ()
 Scheduler ()
virtual ~Scheduler ()

Protected Attributes

double clock_
int halted_

Static Protected Attributes

static Schedulerinstance_
static scheduler_uid_t uid_ = 1


Constructor & Destructor Documentation

Scheduler::Scheduler  )  [protected]
 

Definition at line 63 of file scheduler.cc.

00063                      : clock_(SCHED_START), halted_(0)
00064 {
00065 }

Scheduler::~Scheduler  )  [protected, virtual]
 

Definition at line 67 of file scheduler.cc.

References instance_.

00067                      {
00068     instance_ = NULL ;
00069 }


Member Function Documentation

virtual void Scheduler::cancel Event  )  [pure virtual]
 

Implemented in ListScheduler, HeapScheduler, CalendarScheduler, and SplayScheduler.

Referenced by TimerHandler::_cancel(), SSCS802_15_4Timer::cancel(), Phy802_15_4Timer::cancel(), MacHandlerRetx::cancel(), MacHandlerRecv::cancel(), Mac8023HandlerSend::cancel(), MacHandler::cancel(), imepTimer::cancel(), CorresHost::cancel(), SRM_Request::cancel_timer(), DSDV_Agent::cancelTriggersBefore(), command(), SemanticPacketQueue::filterAcks(), PollAckHandler::handle(), DSDVTriggerHandler::handle(), DSDV_Agent::lost_link(), DSDV_Agent::needTriggeredUpdate(), BackoffTimer::pause(), DSDV_Agent::processUpdate(), Snoop::reset(), LinkDelay::reset(), Snoop::snoop_cleanbufs_(), Snoop::snoop_data(), SensorQueryAgent::stop(), Mac802_15_4Timer::stop(), MacTimer::stop(), MacTdmaTimer::stop(), MacSimpleTimer::stop(), LandmarkAgent::stop(), and ParentChildrenList::~ParentChildrenList().

double Scheduler::clock  )  const [inline]
 

Definition at line 91 of file scheduler.h.

References clock_.

Referenced by XcpSink::ack(), TcpSink::ack(), QSTcpSink::ack(), HttpMInvalCache::add_nbr(), Agent::addAgentTrace(), SctpAgent::AddToSendBuffer(), TimestampSctpAgent::AddToSendBuffer(), MultipleFastRtxSctpAgent::AddToSendBuffer(), MfrTimestampSctpAgent::AddToSendBuffer(), JoBS::adjustRatesRDC(), Trace::annotate(), SFDPolicy::applyMeter(), TRTCMPolicy::applyMeter(), SRTCMPolicy::applyMeter(), TBPolicy::applyMeter(), TSW3CMPolicy::applyMeter(), TSW2CMPolicy::applyMeter(), NullPolicy::applyMeter(), DEWPPolicy::applyMeter(), EWPolicy::applyPolicer(), dsREDQueue::applyTSWMeter(), JoBS::arvAccounting(), JoBS::assignRateDropsADC(), MacCsma::backoff(), TimestampSctpAgent::BundleControlChunks(), SctpAgent::CalcHeartbeatTime(), FlowTable::cleanup(), CorresHost::closecwnd(), SctpAgent::command(), command(), RedPDQueue::command(), PingAgent::command(), ProxyTracePagePool::command(), HttpYucInvalServer::command(), redQueue::config(), PeriodicErrorModel::corrupt(), MultiStateErrorModel::corrupt(), TfrcAgent::decrease_rate(), REDQueue::deque(), JoBS::deque(), GK::deque(), Demarker::deque(), WRR_CBQueue::deque(), CBQueue::deque(), DEWPPolicy::detect(), QA::DrainBuffers(), QueueMonitor::drop(), dumpq(), MacCsma::endofContention(), Vq::enque(), RIOQueue::enque(), REDQueue::enque(), RedPDQueue::enque(), Marker::enque(), JoBS::enque(), GK::enque(), redQueue::enque(), TfrcSinkAgent::est_thput(), RateEstimator::estimateRate(), QueueMonitor::estimateRate(), REDQueue::estimator(), PromotionTimer::expire(), FlowMon::fformat(), Tagger::fformat(), LandmarkAgent::ForwardPacket(), DSDV_Agent::forwardPacket(), SctpAgent::GenChunk(), SensorQueryAgent::generate_query(), PcapFileNetwork::gents(), PcapLiveNetwork::gents(), QA::get_data(), DSRAgent::getRouteForPacket(), GetTime(), TBF::getupdatedtokens(), PositionHandler::handle(), AdaptiveFidelityEntity::handle(), DSDVTriggerHandler::handle(), AckRecons::handle(), DSRAgent::handleFlowForwarding(), SRForwarder::handlePktWithoutSR(), SctpAgent::HeartbeatGenTimerExpiration(), DSDV_Agent::helper_callback(), QueueMonitorCompat::in(), QueueMonitor::in(), TfrcAgent::increase_rate(), PushbackAgent::initialUpdate(), Agent::initpkt(), WebTrafPool::launchReq(), WebTrafPool::launchResp(), MobileNode::log_energy(), MobileNode::log_movement(), LoggingDataStruct::LoggingDataStruct(), IvsReceiver::lossMeter(), Internet::makeip(), LandmarkAgent::makeUpdate(), DSDV_Agent::makeUpdate(), AggSpec::member(), JoBS::minRatesNeeded(), Agent::monitorAgentTrace(), DSDV_Agent::needTriggeredUpdate(), TcpAgent::newack(), TcpSessionAgent::newack(), SackRHTcpAgent::newack(), RFC793eduTcpAgent::newack(), FlowTable::noticeDeadLink(), FullTcpAgent::now(), BayFullTcpAgent::now(), TapAgent::now(), FtpSrvrAgent::now(), FtpClientAgent::now(), QueueMonitorCompat::out(), QueueMonitor::out(), XcpAgent::output(), TcpAgent::output(), VegasTcpAgent::output(), RFC793eduTcpAgent::output(), QSNewRenoTcpAgent::output(), IntTcpAgent::output(), IntTcpAgent::output_helper(), TcpFsAgent::output_helper(), BackoffTimer::pause(), Queue< T >::peak_utilization(), LandmarkAgent::periodic_callback(), JoBS::pickDroppedRLC(), Sack1TcpAgent::plot(), SackRHTcpAgent::plot(), FackTcpAgent::plot(), TfrcSinkAgent::print_count_losses_all(), TfrcSinkAgent::print_loss(), TfrcSinkAgent::print_loss_all(), TfrcSinkAgent::print_losses_all(), PushbackAgent::printMsg(), QueueMonitor::printRTTs(), QueueMonitor::printSeqnos(), QueueMonitor::printStats(), DSRAgent::processBrokenRouteError(), SctpAgent::ProcessChunk(), LandmarkAgent::ProcessHierUpdate(), LogWebTrafPool::processLog(), SctpAgent::ProcessOptionChunk(), TimestampSctpAgent::ProcessOptionChunk(), TCPTapAgent::processpkt(), TcpAgent::processQuickStart(), DSDV_Agent::processUpdate(), JoBS::projDelay(), PushbackAgent::pushbackCancel(), PushbackEvent::PushbackEvent(), QueueMonitor::QueueMonitor(), RTPAgent::rate_change(), RateEstimator::RateEstimator(), TokenBucketRateLimiter::rateLimit(), RateLimitSession::RateLimitSession(), RateLimitStrategy::RateLimitStrategy(), DequeTrace::recv(), TfrcAgent::recv(), TfrcSinkAgent::recv(), QSNewRenoTcpAgent::recv(), NewRenoTcpAgent::recv(), BayFullTcpAgent::recv(), TcpAsymSink::recv(), TBF::recv(), SensorQueryAgent::recv(), SALink::recv(), Queue< T >::recv(), IPNetwork::recv(), UDPIPNetwork::recv(), MIPMHAgent::recv(), LossMonitor::recv(), PLMLossMonitor::recv(), LmsReceiver::recv(), IvsReceiver::recv(), FQ::recv(), FloodAgent::recv(), Delayer::recv(), LinkDelay::recv(), AckRecons::recv(), HttpMInvalCache::recv_heartbeat(), TcpFsAgent::recv_helper(), TcpFsAgent::recv_newack_helper(), TcpAsymAgent::recv_newack_helper(), toraAgent::recvCLR(), toraAgent::recvQRY(), toraAgent::recvUPD(), RateLimitSession::refreshed(), SmacRecvTimer::resched(), XcpSink::reset(), TcpAgent::reset(), TcpSink::reset(), REDQueue::reset(), TokenBucketRateLimiter::reset(), RateEstimator::reset(), Queue< T >::resume(), BackoffTimer::resume(), DSRAgent::returnSrcRouteToRequestor(), SctpAgent::RouteCacheFlushTimerExpiration(), SctpAgent::RouteCalcDelayTimerExpiration(), XcpAgent::rtt_update(), TcpAgent::rtt_update(), RFC793eduTcpAgent::rtt_update(), SctpAgent::RttUpdate(), TimestampSctpAgent::RtxMarkedChunks(), EWdetector::run(), TBrateLimitor::run(), Snoop::savepkt_(), SmacCounterTimer::sched(), SmacNeighNavTimer::sched(), SmacRecvTimer::sched(), SrmNode::sched_nack(), PushbackTimer::schedule(), TcpApp::send(), MacCsmaCa::send(), MacCsma::send(), LmsSender::send_lms_pkt(), TcpAgent::send_much(), TcpSessionAgent::send_much(), LmsSender::send_spm(), AckRecons::sendack(), LandmarkAgent::SendChangedTagListUpdate(), SctpAgent::SendHeartbeat(), UdpAgent::sendmsg(), SimpleTcpAgent::sendmsg(), MessagePassingAgent::sendmsg(), LmsSender::sendmsg(), SctpAgent::SendMuch(), TfrcAgent::sendpkt(), TfrcSinkAgent::sendpkt(), SA_Agent::sendpkt(), RTPAgent::sendpkt(), IvsSource::sendpkt(), DSRAgent::sendRouteShortening(), TPAgent::sendto(), MessagePassingAgent::sendto(), Mac802_3::sendUp(), MobileNode::set_destination(), Mac802_11::set_nav(), EnergyModel::set_node_sleep(), EnergyModel::set_node_state(), TfrcAgent::slowstart(), Snoop::snoop_insert(), LLSnoop::snoop_rtt(), Snoop::snoop_rtt(), Snoop::snoop_rxmit(), TPM::start(), RapAgent::start(), Mac802_15_4Timer::start(), BackoffTimer::start(), DeferTimer::start(), MacTimer::start(), MacTdmaTimer::start(), MacSimpleTimer::start(), LogWebTrafPool::start(), EnergyModel::start_powersaving(), SctpAgent::StartT3RtxTimer(), DSDV_Agent::startUp(), DSRAgent::stickPacketInSendBuffer(), RapAgent::stop(), SctpAgent::StopT3RtxTimer(), TaggerTBFlow::tagging(), TaggerTSWFlow::tagging(), TBrateLimitor::TBrateLimitor(), XcpAgent::time_now(), SctpAgent::Timeout(), MfrHbAfterRtoSctpAgent::Timeout(), HbAfterRtoSctpAgent::Timeout(), HDLC::timeout(), MIPMHAgent::timeout(), LmsReceiver::timeout(), TokenBucketRateLimiter::TokenBucketRateLimiter(), TORANeighbor::TORANeighbor(), Trace::trace(), SALink::trace(), RIOQueue::trace(), REMQueue::trace(), REDQueue::trace(), PIQueue::trace(), Param_ADC::trace(), LDPAgent::trace(), Estimator::trace(), TcpAgent::trace_event(), MacSimple::trace_event(), Mac802_11::trace_event(), ErrorModel::trace_event(), XCPQueue::trace_var(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), SctpAgent::TraceAll(), MultipleFastRtxSctpAgent::TraceAll(), MfrTimestampSctpAgent::TraceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), TcpAsymAgent::traceVar(), SctpAgent::TraceVar(), MultipleFastRtxSctpAgent::TraceVar(), MfrTimestampSctpAgent::TraceVar(), TransHistoryEntry::TransHistoryEntry(), Delayer::try_send(), MobileNode::update_position(), SMAC::updateNav(), SMAC::updateNeighNav(), ParentChildrenList::UpdatePotlChild(), ParentChildrenList::UpdatePotlParent(), redQueue::updateREDStateVar(), DSDV_Agent::updateRoute(), Queue< T >::updateStats(), JoBS::updateStats(), and Queue< T >::utilization().

00091                          {          // simulator virtual time
00092         return (clock_);
00093     }

int Scheduler::command int  argc,
const char *const *  argv
[protected]
 

Definition at line 189 of file scheduler.cc.

References at_handler, cancel(), clock(), MemTrace::diff(), dumpq(), halted_, instance_, lookup(), AtEvent::proc_, reset(), run(), schedule(), STRTOUID, Event::uid_, and UID_PRINTF_FORMAT.

00190 {
00191     Tcl& tcl = Tcl::instance();
00192     if (instance_ == 0)
00193         instance_ = this;
00194     if (argc == 2) {
00195         if (strcmp(argv[1], "run") == 0) {
00196             /* set global to 0 before calling object reset methods */
00197             reset();    // sets clock to zero
00198             run();
00199             return (TCL_OK);
00200         } else if (strcmp(argv[1], "now") == 0) {
00201             sprintf(tcl.buffer(), "%.17g", clock());
00202             tcl.result(tcl.buffer());
00203             return (TCL_OK);
00204         } else if (strcmp(argv[1], "resume") == 0) {
00205             halted_ = 0;
00206             run();
00207             return (TCL_OK);
00208         } else if (strcmp(argv[1], "halt") == 0) {
00209             halted_ = 1;
00210             return (TCL_OK);
00211 
00212         } else if (strcmp(argv[1], "clearMemTrace") == 0) {
00213 #ifdef MEMDEBUG_SIMULATIONS
00214             extern MemTrace *globalMemTrace;
00215             if (globalMemTrace)
00216                 globalMemTrace->diff("Sim.");
00217 #endif
00218             return (TCL_OK);
00219         } else if (strcmp(argv[1], "is-running") == 0) {
00220             sprintf(tcl.buffer(), "%d", !halted_);
00221             return (TCL_OK);
00222         } else if (strcmp(argv[1], "dumpq") == 0) {
00223             if (!halted_) {
00224                 fprintf(stderr, "Scheduler: dumpq only allowed while halted\n");
00225                 tcl.result("0");
00226                 return (TCL_ERROR);
00227             }
00228             dumpq();
00229             return (TCL_OK);
00230         }
00231     } else if (argc == 3) {
00232         if (strcmp(argv[1], "at") == 0 ||
00233             strcmp(argv[1], "cancel") == 0) {
00234             Event* p = lookup(STRTOUID(argv[2]));
00235             if (p != 0) {
00236                 /*XXX make sure it really is an atevent*/
00237                 cancel(p);
00238                 AtEvent* ae = (AtEvent*)p;
00239                 delete ae;
00240             }
00241         } else if (strcmp(argv[1], "at-now") == 0) {
00242             const char* proc = argv[2];
00243 
00244             // "at [$ns now]" may not work because of tcl's 
00245             // string number resolution
00246             AtEvent* e = new AtEvent;
00247             int n = strlen(proc);
00248             e->proc_ = new char[n + 1];
00249             strcpy(e->proc_, proc);
00250             schedule(&at_handler, e, 0);
00251             sprintf(tcl.buffer(), UID_PRINTF_FORMAT, e->uid_);
00252             tcl.result(tcl.buffer());
00253         }
00254         return (TCL_OK);
00255     } else if (argc == 4) {
00256         if (strcmp(argv[1], "at") == 0) {
00257             /* t < 0 means relative time: delay = -t */
00258             double delay, t = atof(argv[2]);
00259             const char* proc = argv[3];
00260 
00261             AtEvent* e = new AtEvent;
00262             int n = strlen(proc);
00263             e->proc_ = new char[n + 1];
00264             strcpy(e->proc_, proc);
00265             delay = (t < 0) ? -t : t - clock();
00266             if (delay < 0) {
00267                 tcl.result("can't schedule command in past");
00268                 return (TCL_ERROR);
00269             }
00270             schedule(&at_handler, e, delay);
00271             sprintf(tcl.buffer(), UID_PRINTF_FORMAT, e->uid_);
00272             tcl.result(tcl.buffer());
00273             return (TCL_OK);
00274         }
00275     }
00276     return (TclObject::command(argc, argv));
00277 }

Here is the call graph for this function:

virtual Event* Scheduler::deque  )  [pure virtual]
 

Implemented in ListScheduler, HeapScheduler, CalendarScheduler, and SplayScheduler.

Referenced by dumpq(), and run().

void Scheduler::dispatch Event ,
double 
[protected]
 

Definition at line 141 of file scheduler.cc.

References abort(), clock_, Handler::handle(), Event::handler_, and Event::uid_.

00142 {
00143     if (t < clock_) {
00144         fprintf(stderr, "ns: scheduler going backwards in time from %f to %f.\n", clock_, t);
00145         abort();
00146     }
00147 
00148     clock_ = t;
00149     p->uid_ = -p->uid_; // being dispatched
00150     p->handler_->handle(p); // dispatch
00151 }

Here is the call graph for this function:

void Scheduler::dispatch Event  )  [protected]
 

Definition at line 154 of file scheduler.cc.

References Event::time_.

Referenced by RealTimeScheduler::run(), and run().

00155 {
00156     dispatch(p, p->time_);
00157 }

void Scheduler::dumpq  )  [protected]
 

Definition at line 280 of file scheduler.cc.

References clock(), deque(), Event::handler_, Event::time_, Event::uid_, and UID_PRINTF_FORMAT.

Referenced by command().

00281 {
00282     Event *p;
00283 
00284     printf("Contents of scheduler queue (events) [cur time: %f]---\n",
00285         clock());
00286     while ((p = deque()) != NULL) {
00287         printf("t:%f uid: ", p->time_);
00288         printf(UID_PRINTF_FORMAT, p->uid_);
00289         printf(" handler: %p\n", p->handler_);
00290     }
00291 }

Here is the call graph for this function:

virtual const Event* Scheduler::head  )  [pure virtual]
 

Implemented in ListScheduler, HeapScheduler, CalendarScheduler, and SplayScheduler.

virtual void Scheduler::insert Event  )  [pure virtual]
 

Implemented in ListScheduler, HeapScheduler, CalendarScheduler, and SplayScheduler.

Referenced by schedule().

static Scheduler& Scheduler::instance  )  [inline, static]
 

Definition at line 81 of file scheduler.h.

References instance_.

Referenced by TimerHandler::_cancel(), TimerHandler::_sched(), XcpSink::ack(), TcpSink::ack(), QSTcpSink::ack(), HttpMInvalCache::add_nbr(), Agent::addAgentTrace(), LandmarkAgent::AddMobileTag(), SctpAgent::AddToSendBuffer(), TimestampSctpAgent::AddToSendBuffer(), MultipleFastRtxSctpAgent::AddToSendBuffer(), MfrTimestampSctpAgent::AddToSendBuffer(), JoBS::adjustRatesRDC(), Trace::annotate(), Sacker::append_ack(), SFDPolicy::applyMeter(), TRTCMPolicy::applyMeter(), SRTCMPolicy::applyMeter(), TBPolicy::applyMeter(), TSW3CMPolicy::applyMeter(), TSW2CMPolicy::applyMeter(), NullPolicy::applyMeter(), DEWPPolicy::applyMeter(), EWPolicy::applyPolicer(), dsREDQueue::applyTSWMeter(), ARPTable::arpinput(), ARPTable::arprequest(), JoBS::arvAccounting(), JoBS::assignRateDropsADC(), MacCsma::backoff(), TimestampSctpAgent::BundleControlChunks(), SctpAgent::CalcHeartbeatTime(), SSCS802_15_4Timer::cancel(), Phy802_15_4Timer::cancel(), MacHandlerRetx::cancel(), MacHandlerRecv::cancel(), Mac8023HandlerSend::cancel(), MacHandler::cancel(), imepTimer::cancel(), CorresHost::cancel(), SRM_Request::cancel_timer(), DSDV_Agent::cancelTriggersBefore(), HttpMInvalCache::check_sstate(), FlowTable::cleanup(), CorresHost::closecwnd(), SctpAgent::command(), RedPDQueue::command(), PingAgent::command(), ProxyTracePagePool::command(), CompMathPagePool::command(), MathPagePool::command(), TracePagePool::command(), MobiCache::command(), MediaApp::command(), LandmarkAgent::command(), HttpMInvalCache::command(), HttpYucInvalServer::command(), DSRAgent::command(), DSDV_Agent::command(), redQueue::config(), PeriodicErrorModel::corrupt(), MultiStateErrorModel::corrupt(), QA::debug(), TfrcAgent::decrease_rate(), Agent::deleteAgentTrace(), REDQueue::deque(), JoBS::deque(), GK::deque(), DropTail::deque(), Demarker::deque(), WRR_CBQueue::deque(), CBQueue::deque(), DEWPPolicy::detect(), TapAgent::dispatch(), EmpWebPage::doneObject(), QA::DrainBuffers(), QueueMonitor::drop(), DSRAgent::dropSendBuff(), MacTdma::dump(), Mac802_11::dump(), dumpDeviceLink(), dumpHListLink(), dumpTransacLink(), UnslottedAlohaMac::end_of_contention(), MacCsma::endofContention(), Vq::enque(), RIOQueue::enque(), REDQueue::enque(), RedPDQueue::enque(), Marker::enque(), JoBS::enque(), GK::enque(), redQueue::enque(), TfrcSinkAgent::est_thput(), RateEstimator::estimateRate(), QueueMonitor::estimateRate(), REDQueue::estimator(), Mac802_15_4Timer::expire(), MacTimer::expire(), MacTdmaTimer::expire(), MacSimpleTimer::expire(), PromotionTimer::expire(), FlowMon::fformat(), Tagger::fformat(), RateLimitSessionList::filter(), SemanticPacketQueue::filterAcks(), Agent::flushAVar(), toraAgent::forward(), AODV::forward(), LandmarkAgent::ForwardPacket(), DSDV_Agent::forwardPacket(), SctpAgent::GenChunk(), SensorQueryAgent::generate_query(), PcapFileNetwork::gents(), PcapLiveNetwork::gents(), QA::get_data(), WirelessChannel::getAffectedNodes(), DSRAgent::getRouteForPacket(), GetTime(), TBF::getupdatedtokens(), Snoop::handle(), PositionHandler::handle(), BackoffHandler::handle(), PollAckHandler::handle(), PollHandler::handle(), AdaptiveFidelityEntity::handle(), SoftNeighborHandler::handle(), DSDVTriggerHandler::handle(), RouteCacheTimer::handle(), NeighborTimer::handle(), HelloTimer::handle(), BroadcastTimer::handle(), AckRecons::handle(), HttpMInvalCache::handle_node_failure(), DSRAgent::handleFlowForwarding(), SRForwarder::handlePktWithoutSR(), DSRAgent::handlePktWithoutSR(), SctpAgent::HeartbeatGenTimerExpiration(), DSDV_Agent::helper_callback(), QueueMonitorCompat::in(), QueueMonitor::in(), TfrcAgent::increase_rate(), PushbackAgent::initialUpdate(), Agent::initpkt(), redQueue::initREDStateVar(), MPLSAddressClassifier::install(), RapAgent::IpgTimeout(), SSMSRMAgent::is_active(), Mac802_11::is_idle(), WebTrafPool::launchReq(), WebTrafPool::launchResp(), AODV::local_rt_repair(), MediaApp::log(), HttpApp::log(), MobileNode::log_energy(), MobileNode::log_movement(), LoggingDataStruct::LoggingDataStruct(), RapAgent::LossHandler(), IvsReceiver::lossMeter(), DSDV_Agent::lost_link(), OmniMcastAgent::MACsend(), FloodingAgent::MACsend(), DiffusionAgent::MACsend(), Internet::makeip(), LandmarkAgent::makeUpdate(), DSDV_Agent::makeUpdate(), AggSpec::member(), JoBS::minRatesNeeded(), Agent::monitorAgentTrace(), LandmarkAgent::MoveTags(), DSDV_Agent::needTriggeredUpdate(), GridKeeper::new_moves(), TcpAgent::newack(), TcpSessionAgent::newack(), SackRHTcpAgent::newack(), RFC793eduTcpAgent::newack(), Cache::noticeDeadLink(), MobiCache::noticeDeadLink(), FlowTable::noticeDeadLink(), FullTcpAgent::now(), BayFullTcpAgent::now(), TapAgent::now(), FtpSrvrAgent::now(), FtpClientAgent::now(), QueueMonitorCompat::out(), QueueMonitor::out(), XcpAgent::output(), TcpAgent::output(), VegasTcpAgent::output(), RFC793eduTcpAgent::output(), QSNewRenoTcpAgent::output(), IntTcpAgent::output(), IntTcpAgent::output_helper(), TcpFsAgent::output_helper(), DSDV_Agent::output_rte(), QA::panic(), BackoffTimer::pause(), Queue< T >::peak_utilization(), LandmarkAgent::periodic_callback(), JoBS::pickDroppedRLC(), Sack1TcpAgent::plot(), SackRHTcpAgent::plot(), FackTcpAgent::plot(), MultihopMac::poll(), TwoRayGround::Pr(), FreeSpace::Pr(), RouteCache::pre_addRoute(), TfrcSinkAgent::print_count_losses_all(), TfrcSinkAgent::print_loss(), TfrcSinkAgent::print_loss_all(), TfrcSinkAgent::print_losses_all(), PushbackAgent::printMsg(), QueueMonitor::printRTTs(), QueueMonitor::printSeqnos(), QueueMonitor::printStats(), TcpAgent::process_qoption_after_send(), DSRAgent::processBrokenRouteError(), SctpAgent::ProcessChunk(), LandmarkAgent::ProcessHierUpdate(), LogWebTrafPool::processLog(), SctpAgent::ProcessOptionChunk(), TimestampSctpAgent::ProcessOptionChunk(), TCPTapAgent::processpkt(), TcpAgent::processQuickStart(), DSRAgent::processUnknownFlowError(), DSDV_Agent::processUpdate(), JoBS::projDelay(), PushbackAgent::pushbackCancel(), PushbackEvent::PushbackEvent(), QueueMonitor::QueueMonitor(), RTPAgent::rate_change(), RateEstimator::RateEstimator(), TokenBucketRateLimiter::rateLimit(), RateLimitSession::RateLimitSession(), RateLimitStrategy::RateLimitStrategy(), DnhWormApp::recv(), WormApp::recv(), DequeTrace::recv(), TPAgent::recv(), TfrcAgent::recv(), TfrcSinkAgent::recv(), TcpApp::recv(), QSNewRenoTcpAgent::recv(), NewRenoTcpAgent::recv(), BayFullTcpAgent::recv(), TcpAsymSink::recv(), TBF::recv(), LLSnoop::recv(), SessionHelper::recv(), SensorQueryAgent::recv(), SALink::recv(), RapAgent::recv(), Queue< T >::recv(), PingResponder::recv(), IPNetwork::recv(), UDPIPNetwork::recv(), MIPMHAgent::recv(), MultihopMac::recv(), LossMonitor::recv(), PLMLossMonitor::recv(), LmsReceiver::recv(), IvsReceiver::recv(), FQ::recv(), FloodAgent::recv(), ErrorModel::recv(), DSRAgent::recv(), DelayModel::recv(), Delayer::recv(), LinkDelay::recv(), NoDupChannel::recv(), CBQClass::recv(), AdaptiveRcvr::recv(), AckRecons::recv(), SSMSRMAgent::recv_glb_sess(), HttpMInvalCache::recv_heartbeat(), TcpFsAgent::recv_helper(), HttpMInvalCache::recv_leave(), SSMSRMAgent::recv_loc_sess(), TcpFsAgent::recv_newack_helper(), TcpAsymAgent::recv_newack_helper(), SSMSRMAgent::recv_rep_sess(), SRMAgent::recv_sess(), toraAgent::recvCLR(), Mac802_15_4::recvData(), toraAgent::recvQRY(), toraAgent::recvUPD(), RateLimitSession::refreshed(), MClientPagePool::repl_finegrain(), SmacRecvTimer::resched(), XcpSink::reset(), TcpAgent::reset(), TcpSink::reset(), Snoop::reset(), RIOQueue::reset(), REDQueue::reset(), TokenBucketRateLimiter::reset(), RateEstimator::reset(), LinkDelay::reset(), TcpAgent::reset_qoption(), RateLimitStrategy::restrictPacketType(), Queue< T >::resume(), BackoffTimer::resume(), MacCsma::resume(), DSRAgent::returnSrcRouteToRequestor(), SctpAgent::RouteCacheFlushTimerExpiration(), SctpAgent::RouteCalcDelayTimerExpiration(), toraAgent::rt_resolve(), TcpAgent::rtt_counting(), XcpAgent::rtt_update(), TcpAgent::rtt_update(), RFC793eduTcpAgent::rtt_update(), RapAgent::RttTimeout(), SctpAgent::RttUpdate(), TimestampSctpAgent::RtxMarkedChunks(), EWdetector::run(), TBrateLimitor::run(), Snoop::savepkt_(), SmacCounterTimer::sched(), SmacNeighNavTimer::sched(), SmacRecvTimer::sched(), CBQueue::sched(), SrmNode::sched_nack(), PushbackTimer::schedule(), MacHandlerIFS::schedule(), MacHandlerRetx::schedule(), MacHandlerRecv::schedule(), Mac8023HandlerSend::schedule(), HDLC::selectiveRepeatMode(), TcpApp::send(), SrmNode::send(), MultihopMac::send(), MacCsmaCa::send(), MacCsma::send(), LmsSender::send_lms_pkt(), TcpAgent::send_much(), TcpSessionAgent::send_much(), LmsSender::send_spm(), AckRecons::sendack(), DSRAgent::sendBufferCheck(), DiffusionAgent::SendBufferCheck(), LandmarkAgent::SendChangedTagListUpdate(), SatMac::sendDown(), Mac::sendDown(), AODV::sendError(), EmpFtpTrafSession::sendFile(), SctpAgent::SendHeartbeat(), AODV::sendHello(), UdpAgent::sendmsg(), SimpleTcpAgent::sendmsg(), MessagePassingAgent::sendmsg(), LmsSender::sendmsg(), SctpAgent::SendMuch(), DSRAgent::sendOutBCastPkt(), DSDV_Agent::sendOutBCastPkt(), DSRAgent::sendOutPacketWithRoute(), DSRAgent::sendOutRtReq(), TfrcAgent::sendpkt(), TfrcSinkAgent::sendpkt(), SA_Agent::sendpkt(), RTPAgent::sendpkt(), IvsSource::sendpkt(), toraAgent::sendQRY(), AODV::sendReply(), AODV::sendRequest(), DSRAgent::sendRouteShortening(), TPAgent::sendto(), MessagePassingAgent::sendto(), WirelessPhy::sendUp(), SatMac::sendUp(), SatLL::sendUp(), Mac::sendUp(), Mac802_3::sendUp(), LL::sendUp(), WirelessChannel::sendUp(), Channel::sendUp(), MobileNode::set_destination(), Mac802_11::set_nav(), EnergyModel::set_node_sleep(), EnergyModel::set_node_state(), TBrateLimitor::setRate(), DropTail::shrink_queue(), TfrcAgent::slowstart(), Snoop::snoop_cleanbufs_(), Snoop::snoop_data(), Snoop::snoop_insert(), LLSnoop::snoop_rtt(), Snoop::snoop_rtt(), Snoop::snoop_rxmit(), TPM::start(), RapAgent::start(), Mac802_15_4Timer::start(), SSCS802_15_4Timer::start(), Phy802_15_4Timer::start(), MobileNode::start(), BackoffTimer::start(), DeferTimer::start(), MacTimer::start(), MacTdmaTimer::start(), MacSimpleTimer::start(), LogWebTrafPool::start(), imepTimer::start(), AdaptiveFidelityEntity::start(), SoftNeighborHandler::start(), MobiHandler::start(), EnergyModel::start_powersaving(), SctpAgent::StartT3RtxTimer(), LandmarkAgent::startUp(), DSDV_Agent::startUp(), DSRAgent::stickPacketInSendBuffer(), SensorQueryAgent::stop(), RapAgent::stop(), Mac802_15_4Timer::stop(), MacTimer::stop(), MacTdmaTimer::stop(), MacSimpleTimer::stop(), LandmarkAgent::stop(), SctpAgent::StopT3RtxTimer(), TaggerTBFlow::tagging(), TaggerTSWFlow::tagging(), TBrateLimitor::TBrateLimitor(), XcpAgent::time_now(), SctpAgent::Timeout(), MfrHbAfterRtoSctpAgent::Timeout(), HbAfterRtoSctpAgent::Timeout(), HDLC::timeout(), PushbackQueue::timeout(), MIPMHAgent::timeout(), LmsReceiver::timeout(), SSMSRMAgent::timeout_info(), SmacNeighNavTimer::timeToExpire(), SmacRecvTimer::timeToExpire(), SmacCounterTimer::timeToSleep(), TokenBucketRateLimiter::TokenBucketRateLimiter(), TORANeighbor::TORANeighbor(), Trace::trace(), SALink::trace(), RIOQueue::trace(), REMQueue::trace(), REDQueue::trace(), PIQueue::trace(), Param_ADC::trace(), LDPAgent::trace(), Estimator::trace(), MPLSAddressClassifier::trace(), Agent::trace(), TcpAgent::trace_event(), MacSimple::trace_event(), Mac802_11::trace_event(), ErrorModel::trace_event(), XCPQueue::trace_var(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), SctpAgent::TraceAll(), MultipleFastRtxSctpAgent::TraceAll(), MfrTimestampSctpAgent::TraceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), TcpAsymAgent::traceVar(), SctpAgent::TraceVar(), MultipleFastRtxSctpAgent::TraceVar(), MfrTimestampSctpAgent::TraceVar(), TransHistoryEntry::TransHistoryEntry(), Mac802_15_4::transmitCmdData(), Delayer::try_send(), AnWormApp::update(), Acker::update(), MobileNode::update_position(), SMAC::updateNav(), SMAC::updateNeighNav(), ParentChildrenList::UpdatePotlChild(), ParentChildrenList::UpdatePotlParent(), redQueue::updateREDStateVar(), DSDV_Agent::updateRoute(), QA::UpdateState(), Queue< T >::updateStats(), JoBS::updateStats(), Queue< T >::utilization(), PingResponder::validate(), VegasTcpAgent::vegastime(), and ParentChildrenList::~ParentChildrenList().

00081                                  {
00082         return (*instance_);        // general access to scheduler
00083     }

virtual Event* Scheduler::lookup scheduler_uid_t  uid  )  [pure virtual]
 

Implemented in ListScheduler, HeapScheduler, CalendarScheduler, and SplayScheduler.

Referenced by command(), and SemanticPacketQueue::filterAcks().

void Scheduler::reset  )  [virtual]
 

Reimplemented in RealTimeScheduler.

Definition at line 183 of file scheduler.cc.

References clock_, and SCHED_START.

Referenced by command().

00184 {
00185     clock_ = SCHED_START;
00186 }

void Scheduler::run  )  [virtual]
 

Reimplemented in RealTimeScheduler.

Definition at line 119 of file scheduler.cc.

References deque(), dispatch(), halted_, instance_, and Event::time_.

Referenced by command().

00120 {
00121     instance_ = this;
00122     Event *p;
00123     /*
00124      * The order is significant: if halted_ is checked later,
00125      * event p could be lost when the simulator resumes.
00126      * Patch by Thomas Kaemer <Thomas.Kaemer@eas.iis.fhg.de>.
00127      */
00128     while (!halted_ && (p = deque())) {
00129         dispatch(p, p->time_);
00130     }
00131 }

Here is the call graph for this function:

void Scheduler::schedule Handler ,
Event ,
double  delay
 

Definition at line 83 of file scheduler.cc.

References abort(), clock_, Event::handler_, insert(), Event::time_, uid_, and Event::uid_.

Referenced by TimerHandler::_sched(), LandmarkAgent::AddMobileTag(), ARPTable::arpinput(), ARPTable::arprequest(), MacCsma::backoff(), command(), UnslottedAlohaMac::end_of_contention(), MacCsma::endofContention(), PromotionTimer::expire(), toraAgent::forward(), AODV::forward(), SensorQueryAgent::generate_query(), Snoop::handle(), PositionHandler::handle(), BackoffHandler::handle(), PollHandler::handle(), AdaptiveFidelityEntity::handle(), SoftNeighborHandler::handle(), DSDVTriggerHandler::handle(), RouteCacheTimer::handle(), NeighborTimer::handle(), HelloTimer::handle(), BroadcastTimer::handle(), DSDV_Agent::helper_callback(), AODV::local_rt_repair(), OmniMcastAgent::MACsend(), FloodingAgent::MACsend(), DiffusionAgent::MACsend(), LandmarkAgent::MoveTags(), DSDV_Agent::needTriggeredUpdate(), GridKeeper::new_moves(), LandmarkAgent::periodic_callback(), MultihopMac::poll(), DSDV_Agent::processUpdate(), LLSnoop::recv(), SessionHelper::recv(), MultihopMac::recv(), ErrorModel::recv(), DSRAgent::recv(), DelayModel::recv(), LinkDelay::recv(), NoDupChannel::recv(), Mac802_15_4::recvData(), BackoffTimer::resume(), MacCsma::resume(), DSRAgent::returnSrcRouteToRequestor(), CBQueue::sched(), SrmNode::sched_nack(), MacHandlerIFS::schedule(), MacHandlerRetx::schedule(), MacHandlerRecv::schedule(), Mac8023HandlerSend::schedule(), SrmNode::send(), MultihopMac::send(), MacCsma::send(), LandmarkAgent::SendChangedTagListUpdate(), SatMac::sendDown(), Mac::sendDown(), AODV::sendError(), AODV::sendHello(), DSRAgent::sendOutBCastPkt(), DSDV_Agent::sendOutBCastPkt(), AODV::sendReply(), AODV::sendRequest(), SatMac::sendUp(), SatLL::sendUp(), Mac::sendUp(), LL::sendUp(), WirelessChannel::sendUp(), Channel::sendUp(), Snoop::snoop_cleanbufs_(), Snoop::snoop_data(), Mac802_15_4Timer::start(), SSCS802_15_4Timer::start(), Phy802_15_4Timer::start(), MobileNode::start(), BackoffTimer::start(), DeferTimer::start(), MacTimer::start(), MacTdmaTimer::start(), MacSimpleTimer::start(), imepTimer::start(), AdaptiveFidelityEntity::start(), SoftNeighborHandler::start(), MobiHandler::start(), LandmarkAgent::startUp(), DSDV_Agent::startUp(), and Mac802_15_4::transmitCmdData().

00084 {
00085     // handler should ALWAYS be set... if it's not, it's a bug in the caller
00086     if (!h) {
00087         fprintf(stderr,
00088             "Scheduler: attempt to schedule an event with a NULL handler."
00089             "  Don't DO that.\n");
00090         abort();
00091     };
00092     
00093     if (e->uid_ > 0) {
00094         printf("Scheduler: Event UID not valid!\n\n");
00095         abort();
00096     }
00097     
00098     if (delay < 0) {
00099         // You probably don't want to do this
00100         // (it probably represents a bug in your simulation).
00101         fprintf(stderr, 
00102             "warning: ns Scheduler::schedule: scheduling event\n\t"
00103             "with negative delay (%f) at time %f.\n", delay, clock_);
00104     }
00105 
00106     if (uid_ < 0) {
00107         fprintf(stderr, "Scheduler: UID space exhausted!\n");
00108         abort();
00109     }
00110     e->uid_ = uid_++;
00111     e->handler_ = h;
00112     double t = clock_ + delay;
00113 
00114     e->time_ = t;
00115     insert(e);
00116 }

Here is the call graph for this function:

virtual double Scheduler::start void   )  [inline, virtual]
 

Definition at line 95 of file scheduler.h.

References SCHED_START.

00095                            {        // start time
00096         return SCHED_START;
00097     }

virtual void Scheduler::sync  )  [inline, virtual]
 

Reimplemented in RealTimeScheduler.

Definition at line 94 of file scheduler.h.

Referenced by TapAgent::dispatch().

00094 {};


Field Documentation

double Scheduler::clock_ [protected]
 

Definition at line 106 of file scheduler.h.

Referenced by clock(), dispatch(), RealTimeScheduler::reset(), reset(), RealTimeScheduler::run(), schedule(), and RealTimeScheduler::sync().

int Scheduler::halted_ [protected]
 

Definition at line 107 of file scheduler.h.

Referenced by command(), RealTimeScheduler::run(), and run().

Scheduler * Scheduler::instance_ [static, protected]
 

Definition at line 108 of file scheduler.h.

Referenced by command(), instance(), RealTimeScheduler::run(), run(), and ~Scheduler().

scheduler_uid_t Scheduler::uid_ = 1 [static, protected]
 

Definition at line 109 of file scheduler.h.

Referenced by schedule().


The documentation for this class was generated from the following files:
Generated on Tue Mar 6 17:29:45 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6