- NS2 is a discrete-event simulator where events are placed on a timeline and associated actions are executed when that point in the timeline is reached
- Events have a scheduled time, unique ID, associated handler, and reference to the next event
- The scheduler is responsible for placing events on the timeline, executing the associated handlers at the scheduled time, and moving to the next event
This document contains detail information about the srs of a android game. This document contains all the resources needed to develop a game srs. The format of the document was given by ER Pratik Adhikari Software Engineering Course Lab Instructor and Class Teacher,ACEM,Nepal.
Stream games and apps to any device. Use public cloud services like AWS. Utilizing desktop class GPU from Nvidia or AMD to offer full HD game streaming service.
Killzone Shadow Fall: Threading the Entity Update on PS4jrouwe
On the PS3 the SPUs were too limited for doing typical entity logic (e.g. humanoids walking around and shooting), so all of our entity logic was running on a single thread. For the PS4 we adopted the "entity as a job" approach and developed a set of rules that entities have to adhere to. We also developed a way to validate these rules at runtime so that no race conditions occur. This presentation will also show how we spread out entity updates across frames. The resulting system has proven itself on the PS4 -- and there have been surprisingly few race conditions that were not easily caught.
Horizon Zero Dawn: An Open World QA Case StudyGuerrilla
Download the full presentation here: http://www.guerrilla-games.com/
Abstract: A retrospective of how Developer (Guerrilla) and Publisher QA (SIE) worked together in partnership to help deliver a AAA experience. The presentation will focus on the victories and the challenges we faced as part of testing such an ambitious open-world title, and leveraging automated test solutions and telemetry to inform exploratory test strategy. The presentation will talk about how we managed teams over a 21 month testing lifecycle, with a team ranging from small internal test teams, before scaling up to a team of 70+ people across the globe with tens of thousands of test hours invested. The presentation will cover the successes and challenges relating to our people; early engagement, communication, trust, agility and collaboration. Our processes; risk management, test strategy, and post launch support, and our tools; Telemetry, Risk Registers, Worldwide build delivery.
This document contains detail information about the srs of a android game. This document contains all the resources needed to develop a game srs. The format of the document was given by ER Pratik Adhikari Software Engineering Course Lab Instructor and Class Teacher,ACEM,Nepal.
Stream games and apps to any device. Use public cloud services like AWS. Utilizing desktop class GPU from Nvidia or AMD to offer full HD game streaming service.
Killzone Shadow Fall: Threading the Entity Update on PS4jrouwe
On the PS3 the SPUs were too limited for doing typical entity logic (e.g. humanoids walking around and shooting), so all of our entity logic was running on a single thread. For the PS4 we adopted the "entity as a job" approach and developed a set of rules that entities have to adhere to. We also developed a way to validate these rules at runtime so that no race conditions occur. This presentation will also show how we spread out entity updates across frames. The resulting system has proven itself on the PS4 -- and there have been surprisingly few race conditions that were not easily caught.
Horizon Zero Dawn: An Open World QA Case StudyGuerrilla
Download the full presentation here: http://www.guerrilla-games.com/
Abstract: A retrospective of how Developer (Guerrilla) and Publisher QA (SIE) worked together in partnership to help deliver a AAA experience. The presentation will focus on the victories and the challenges we faced as part of testing such an ambitious open-world title, and leveraging automated test solutions and telemetry to inform exploratory test strategy. The presentation will talk about how we managed teams over a 21 month testing lifecycle, with a team ranging from small internal test teams, before scaling up to a team of 70+ people across the globe with tens of thousands of test hours invested. The presentation will cover the successes and challenges relating to our people; early engagement, communication, trust, agility and collaboration. Our processes; risk management, test strategy, and post launch support, and our tools; Telemetry, Risk Registers, Worldwide build delivery.
My Annual Project reprot on MING GAME ZONE
basicaly a C/C++ Game project consist of 5 games....
The Classic Games of :-
1) Tic Tac Toe
2) Snakes & Ladders
3) Battle Pong
4) Snake Man
5) Digital Simulator
Abhijeet Singh
This ppt contain the information about KISMET which is one of the network analyzer in mobile communication. I have searched this and made it with great hard work so take advantage. And comment on this. This much information is not fully available on the net. So enjoyyy.
Real time operating system perform many function to achieve deadline, fasten the execution and decrease the respone time . Scheduling is one of the many services provided by RTOS.Scheduling can be done following different scheduling algorithm .This article consist pros and cons of different and popular scheduling algorithm used by kernel of RTOS like priority basis,first come first serve,round robin ,rate monotonic algorithm,earliest deadline first etc.
XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...The Linux Foundation
With the development of virtualization, there are more device assignment requirements. Based on VT-d interrupt remapping, Intel introduces VT-d interrupt posting as a more enhanced method to handle interrupts in the virtualization environment. The Posted Interrupts (PI) on CPU side has been already supported in Intel CPUs, with VT-d Posted Interrupt we can get some additional advantages, it can directly deliver external interrupts to running vCPUs without hypervisor involvement, decease the interrupt migration complexity, differentiate between urgent and non-urgent external interrupt, and avoid consuming host-vector for each interrupt to vCPU. In this presentation, Feng will talk about the mechanism of VT-d PI and its advantages, as well as some performance data of I/O intensive workload in Xen, which will show the performance gain after using VT-d PI.
Using semaphores synchronization can be provided between two or more process. Here i am going to write a code which will clear that how a semaphore can be used with shared memory to provide synchronization between writing process and reading process.
Heart of the SwarmKit: Store, Topology & Object ModelDocker, Inc.
Heart of the SwarmKit: Store, Topology & Object Model by Aaron, Andrea, Stephen D (Docker)
Swarmkit repo - https://github.com/docker/swarmkit
Liveblogging: http://canopy.mirage.io/Liveblog/SwarmKitDDS2016
Various virtualization technologies are present at the market for more than a decade, but they were typically occupying cloud platforms. Recently, virtualization began spreading over embedded platforms after ARM presented Virtualization Extension for its recent processors. Various peripherals (like disks and network) had been easily virtualized for usage by several operating systems at once, but things like Graphical Processing Units (GPU) remain to be one of the most intricate parts to be adapted, with very few vendors who actually managed to do it.
Sergiy Kibrik (Software Engineer, GlobalLogic) explain how it was done at GlobalLogic. This presentation was delivered at GlobalLogic Embedded TechTalk Kyiv on July 22, 2015.
My Annual Project reprot on MING GAME ZONE
basicaly a C/C++ Game project consist of 5 games....
The Classic Games of :-
1) Tic Tac Toe
2) Snakes & Ladders
3) Battle Pong
4) Snake Man
5) Digital Simulator
Abhijeet Singh
This ppt contain the information about KISMET which is one of the network analyzer in mobile communication. I have searched this and made it with great hard work so take advantage. And comment on this. This much information is not fully available on the net. So enjoyyy.
Real time operating system perform many function to achieve deadline, fasten the execution and decrease the respone time . Scheduling is one of the many services provided by RTOS.Scheduling can be done following different scheduling algorithm .This article consist pros and cons of different and popular scheduling algorithm used by kernel of RTOS like priority basis,first come first serve,round robin ,rate monotonic algorithm,earliest deadline first etc.
XPDS14 - Intel(r) Virtualization Technology for Directed I/O (VT-d) Posted In...The Linux Foundation
With the development of virtualization, there are more device assignment requirements. Based on VT-d interrupt remapping, Intel introduces VT-d interrupt posting as a more enhanced method to handle interrupts in the virtualization environment. The Posted Interrupts (PI) on CPU side has been already supported in Intel CPUs, with VT-d Posted Interrupt we can get some additional advantages, it can directly deliver external interrupts to running vCPUs without hypervisor involvement, decease the interrupt migration complexity, differentiate between urgent and non-urgent external interrupt, and avoid consuming host-vector for each interrupt to vCPU. In this presentation, Feng will talk about the mechanism of VT-d PI and its advantages, as well as some performance data of I/O intensive workload in Xen, which will show the performance gain after using VT-d PI.
Using semaphores synchronization can be provided between two or more process. Here i am going to write a code which will clear that how a semaphore can be used with shared memory to provide synchronization between writing process and reading process.
Heart of the SwarmKit: Store, Topology & Object ModelDocker, Inc.
Heart of the SwarmKit: Store, Topology & Object Model by Aaron, Andrea, Stephen D (Docker)
Swarmkit repo - https://github.com/docker/swarmkit
Liveblogging: http://canopy.mirage.io/Liveblog/SwarmKitDDS2016
Various virtualization technologies are present at the market for more than a decade, but they were typically occupying cloud platforms. Recently, virtualization began spreading over embedded platforms after ARM presented Virtualization Extension for its recent processors. Various peripherals (like disks and network) had been easily virtualized for usage by several operating systems at once, but things like Graphical Processing Units (GPU) remain to be one of the most intricate parts to be adapted, with very few vendors who actually managed to do it.
Sergiy Kibrik (Software Engineer, GlobalLogic) explain how it was done at GlobalLogic. This presentation was delivered at GlobalLogic Embedded TechTalk Kyiv on July 22, 2015.
Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...Ville Mattila
Slides of my half an hour talk at Symfony Sweden November Camp, held at Hilton Slussen on Friday 22nd Nov 2013. Slides contain a generic infrastructure overview of running Eventio.com on Amazon Web Services and show a few details to consider when designing and running a distributed, reliable and scalable PHP application.
Oplægget blev holdt ved et seminar i InfinIT-interessegruppen Højniveau sprog til indlejrede systemer den 19. august 2009.
Læs mere om interessegruppen på http://www.infinit.dk/dk/interessegrupper/hoejniveau_sprog_til_indlejrede_systemer/
This is a summary of the book "The Intelligent Entrepreneur: How Three Harvard Business School Graduates Learned the 10 Rules of Successful Entrepreneurship" by Bill Murphy Jr.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Safalta Digital marketing institute in Noida, provide complete applications that encompass a huge range of virtual advertising and marketing additives, which includes search engine optimization, virtual communication advertising, pay-per-click on marketing, content material advertising, internet analytics, and greater. These university courses are designed for students who possess a comprehensive understanding of virtual marketing strategies and attributes.Safalta Digital Marketing Institute in Noida is a first choice for young individuals or students who are looking to start their careers in the field of digital advertising. The institute gives specialized courses designed and certification.
for beginners, providing thorough training in areas such as SEO, digital communication marketing, and PPC training in Noida. After finishing the program, students receive the certifications recognised by top different universitie, setting a strong foundation for a successful career in digital marketing.
Normal Labour/ Stages of Labour/ Mechanism of LabourWasim Ak
Normal labor is also termed spontaneous labor, defined as the natural physiological process through which the fetus, placenta, and membranes are expelled from the uterus through the birth canal at term (37 to 42 weeks
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
2. Recap
NS2 is a discrete-event simulator, where actions are associated with events
rather than time. An event in a discrete-event simulator consists of execution
NS2 is an event-driven simulation
time, a set of actions, and a reference to the next event (Fig. 4.1). These events
connect to each other and form a chain of events on the simulation timeline
Main concept [see here]:
(e.g., that in Fig. 4.1). Unlike a time-driven simulator, in an event-driven
simulator, time between a pair of events does not need to be constant. When
the simulation starts, events in the chain are executed from left to right (i.e.,
Put events on the simulation timeline
chronologically).1 In the next section, we will discuss the simulation concept of
NS2. In Sections 4.2, 4.3, and 4.4, we will explain the details of classes Event
and Handler, class Scheduler,time line and take actions when
Move along the and class Simulator, respectively. Finally, we
summarize this chapter in Section 4.6.
confronting an event
insert Event5
create event
event time = 3.7
Action5
Event1 Event2 Event3 Event4
time = 0.9 time = 2.2 time = 5 time = 6.8
Action1 Action2 Action3 Action4
Time
(second)
1 2 3 4 5 6 7
Fig. 4.1. A sample chain of events in a discrete-event simulation. Each event con-
www.ns2ultimate.com
tains execution time and a reference to the next event. In this figure, Event1 creates
3. NS2 is a discrete-event simulator, where actions are associated with events
Recap
rather than time. An event in a discrete-event simulator consists of execution
time, a set of actions, and a reference to the next event (Fig. 4.1). These events
connect to each other and form a chain of events on the simulation timeline
(e.g., that in Fig. 4.1). Unlike a time-driven simulator, in an event-driven
simulator, time between a pair of events does not need to be constant. When
the simulation starts, events in the chain are executed from left to right (i.e.,
• An event indicates what happens
chronologically).1 In the next section, we will discuss the simulation concept of
NS2. In Sections 4.2, 4.3, and 4.4, we will explain the details of classes Event
• A handler indicates what to do
and Handler, class Scheduler, and class Simulator, respectively. Finally, we
summarize this chapter in Section 4.6.
insert Event5
create event
event time = 3.7
Action5
Event1 Event2 Event3 Event4
time = 0.9 time = 2.2 time = 5 time = 6.8
Action1 Action2 Action3 Action4
Time
(second)
1 2 3 4 5 6 7
Fig. 4.1. A sample chain of events in a discrete-event simulation. Each event con-
Handler
Handler Handler Handler Handler
tains execution time and a reference to the next event. In this figure, Event1 creates
1 2 4
and inserts Event5 after Event2 (the execution 3
5 time of Event 5 is at 3.7 second).
www.ns2ultimate.com
4. Event and Handler
An event is associated with a handler [see here]
handler handle(){ handle(){ handler
<actions> <actions>
} }
handler_ next_ handler_ next_
event uid_ time_ uid_ time_ event
www.ns2ultimate.com
5. Event and Handler
Terminology: “Dispatching time”
- Time where the event is scheduled to occur
- A.K.A. Firing time
- A.K.A. Executing time
- Stored in the variable “time_” of each event
www.ns2ultimate.com
7. Scheduler
Scheduler is defined in the C++ class
Scheduler
//~ns/common/scheduler.h The current time
class Scheduler : public TclObject {
... 0, if the Scheduler
protected: is running
double clock_;
The reference to
int halted_;
the Scheduler
static Scheduler* instance_;
static scheduler_uid_t uid_; Unique ID which shall be
}; assigned to events
www.ns2ultimate.com
8. Implementation of Discrete-Event Simulation
in NS2
Reference to the Scheduler
NS2 is a discrete-event simulator, where actions are associated with events
rather than time. An event in a discrete-event simulator consists of execution
time, a set of actions, and a reference to the next event (Fig. 4.1). These events
There is exactly one Scheduler in a simulation
connect to each other and form a chain of events on the simulation timeline
(e.g., that in Fig. 4.1). Unlike a time-driven simulator, in an event-driven
simulator, time between a pair of events does not need to be constant. When
Scheduler
the simulation starts, events in the chain are executed from left to right (i.e.,
chronologically).1 In the next section, we will discuss the simulation concept of
NS2. In Sections 4.2, 4.3, and 4.4, we will explain the details of classes Event
and Handler, class Scheduler, and class Simulator, respectively. Finally, we
summarize this chapter in Section 4.6.
insert Event5
create event
event time = 3.7
Action5
Event1 Event2 Event3 Event4
time = 0.9 time = 2.2 time = 5 time = 6.8
Action1 Action2 Action3 Action4
Time
(second)
1 2 3 4 5 6 7
Fig. 4.1. A sample chain of events in a discrete-event simulation. Each event con-
tains execution time and a reference to the next event. In this figure, Event1 creates
and inserts Event5 after Event2 (the execution time of Event 5 is at 3.7 second).
www.ns2ultimate.com
1
By execution, we mean taking actions associated with an event.
9. Reference to the Scheduler
There is exactly one Scheduler in a simulation
//~ns/common/scheduler.h
class Scheduler : public TclObject {
...
protected:
double clock_;
int halted_;
static Scheduler* instance_;
static scheduler_uid_t uid_;
};
So, the pointer “instance_” to the
Scheduler must be static.
www.ns2ultimate.com
10. Unique ID
Every event is tagged with a unique ID.
NS2 assigns the ID by
- Maintaining a common pool of unique ID
-Take an ID from the pool and assign it to
each event.
The pool of unique ID is the variable uid_ of
class Schedule
www.ns2ultimate.com
12. Unique ID
The Scheduler receives a new event
Event Scheduler
uid_ = 20
uid_=Null
www.ns2ultimate.com
13. Unique ID
The Scheduler
4
copies its uid_ to the event’s uid_, and
Implementation of Discrete-Event Simulation
in NS2
Increments its uid_ by one. Event
Scheduler
NS2 is a discrete-event simulator, where actions are associated with events
uid_=20
rather than time. An event in a discrete-event simulator consists of execution
time, a set of actions, and a reference to the next event (Fig. 4.1). These events
connect to each other and form a chain of events on the simulation timeline
(e.g., that in Fig. 4.1). Unlike a time-driven simulator, in an event-driven
uid_ = 21
simulator, time between a pair of events does not need to be constant. When
the simulation starts, events in the chain are executed from left to right (i.e.,
chronologically).1 In the next section, we will discuss the simulation concept of
NS2. In Sections 4.2, 4.3, and 4.4, we will explain the details of classes Event
and Handler, class Scheduler, and class Simulator, respectively. Finally, we
summarize this chapter in Section 4.6.
insert Event5
create event
event time = 3.7
Action5
Event1 Event2 Event3 Event4
time = 0.9 time = 2.2 time = 5 time = 6.8
Action1 Action2 Action3 Action4
Time
(second)
1 2 3 4 5 6 7
Fig. 4.1. A sample chain of events in a discrete-event simulation. Each event con-
tains execution time and a reference to the next event. In this figure, Event1 creates
www.ns2ultimate.com
and inserts Event5 after Event2 (the execution time of Event 5 is at 3.7 second).
14. Scheduler
Three main tasks
NS2
Task Description
Terminology
Put event on the simulation
1 Schedule
time line
Execute actions associated
2 Dispatch
with each events
Move to the next event and
3 Move
“dispatch” it.
www.ns2ultimate.com
16. Task 1: Schedule 4
Implementation of Discrete-Event Simulation
in NS2
The Scheduler receives
Objects Users
events from users (e.g., NS2 is a discrete-event simulator, where actions are associated with events
rather than time. An event in a discrete-event simulator consists of execution
time, a set of actions, and a reference to the next event (Fig. 4.1). These events
connect to each other and form a chain of events on the simulation timeline
Event Event
at events) or objects (e.g., that in Fig. 4.1). Unlike a time-driven simulator, in an event-driven
simulator, time between a pair of events does not need to be constant. When
Scheduler
the simulation starts, events in the chain are executed from left to right (i.e.,
chronologically).1 In the next section, we will discuss the simulation concept of
(e.g., packet). NS2. In Sections 4.2, 4.3, and 4.4, we will explain the details of classes Event
and Handler, class Scheduler, and class Simulator, respectively. Finally, we
summarize this chapter in Section 4.6.
It, then, places events create
event
insert
event
Event5
time = 3.7
Action5
on the timeline Event1
time = 0.9
Action1
Event2
time = 2.2
Action2
Event3
time = 5
Action3
Event4
time = 6.8
Action4
Time
chronologically.
(second)
1 2 3 4 5 6 7
Fig. 4.1. A sample chain of events in a discrete-event simulation. Each event con-
tains execution time and a reference to the next event. In this figure, Event1 creates
and inserts Event5 after Event2 (the execution time of Event 5 is at 3.7 second).
1
www.ns2ultimate.com
By execution, we mean taking actions associated with an event.
18. C++ Function Schedule(…)
Input
Handler (*h): Specify associated actions
Event (*e): Event to be placed on the timeline
Delay (d): Delay time (from the current time) when the
event will occur
Main steps
1. Check for error
2. Configure events and handler
3. Put the event on the time line
www.ns2ultimate.com
19. C++ Function Schedule(…)
//~ns/common/scheduler.cc
void Scheduler::schedule(Handler* h, Event* e, double delay)
{
< CHECKING FOR ERRORS >
Step 1: Error checking
e->uid_ = uid_++;
e->handler_ = h;
double t = clock_ + delay; Step 2: Configuration
e->time_ = t;
insert(e);
}
Step 3: Put the event “e” on the time line
www.ns2ultimate.com
20. Step 1: Checking Error
Four major types of error
1. Null handler:
- Actions associated with handlers are not specified
if (!h) {
fprintf(stderr,
"Scheduler: attempt to schedule an event with a NULL
handler."
" Don't DO that at time %fn", clock_);
abort();
};
www.ns2ultimate.com
21. Step 1: Checking Error
Four major types of error
2. Undispatched event:
- The unique ID of the event must be a positive number
- I’ll talk about this in the next post :)
if (e->uid_ > 0) {
printf("Scheduler: Event UID not valid!nn");
abort();
}
Note: This is a common error message!
Now you know how to fix the error!
www.ns2ultimate.com
22. Step 1: Checking Error
Four major types of error
3. Move backward in time:
- You can only schedule event to occur in future, not in the past!
if (delay < 0) {
fprintf(stderr,
"warning: ns Scheduler::schedule: scheduling eventnt"
"with negative delay (%f) at time %f.n", delay,
clock_);
}
www.ns2ultimate.com
23. Step 1: Checking Error
Four major types of error
4. uid_ value overflow:
- uid_ of the Scheduler is initialized to ‘1’ and incremented by one for
every new event
- Its value can never be negative.
- The only reason for its negative value is an overflow of its value
space--meaning we use up all available UIDs.
if (uid_ < 0) {
fprintf(stderr, "Scheduler: UID space exhausted!n");
abort();
}
www.ns2ultimate.com
24. Step 2: Configuration
void Scheduler::schedule(Handler* h, Event* e, double delay)
{
... Draw a unique ID from the
e->uid_ = uid_++;
e->handler_ = h; common pool and associated
double t = clock_ + delay;
e->time_ = t;
it with the event
...
}
Associated the input handler
*h with the event
Update the
dispatching time
www.ns2ultimate.com
26. Dispatch
The Scheduler “dispatches” a relevant handler to take
default actions.
//~ns/common/scheduler.cc
void Scheduler::dispatch(Event* p, double t)
{ Update the current time
if (t < clock_) {
Invert the sign of the uid_
< ERROR >
}
Execute actions specified in the
clock_ = t;
p->uid_ = -p->uid_; function handle(p) of the
p->handler_->handle(p); associated handler
}
www.ns2ultimate.com
28. Move Forward
Using a while loop
Take an event “*p”
from the event list.
//~ns/common/scheduler.cc
void Scheduler::run()
{
instance_ = this;
Event *p;
while (!halted_ && (p = deque())) {
dispatch(p, p->time_);
}
}
Then dispatch the event
www.ns2ultimate.com
29. For more
information
about NS2
Please see
this book
from Springer
T. Issaraiyakul and E. Hossain, “Introduction to Network Simulator NS2”, Springer 2009
or visit www.ns2ultimate.com