Simulator::Schedule

129 views
Skip to first unread message

Enakshi Jana

unread,
Sep 18, 2015, 2:49:46 AM9/18/15
to ns-3-users
Hi,

  I am new in ns3.I have read the manual for simulator and event and understand that ns3 is a discrete event simulator.I have doubt for the following scenario

suppose I have three event

a(start at time 10s with 10s delay)
b(start at time 12s with 10s delay)
c(start at time 14s with 10s delay)

According to this at time 14s all three event will be active.Is it correct or my assumption is wrong.
Actually I want a scenario in that event a will start at 10s and continue upto time 20s meanwhile if event b is encountered I want to postponed it till 20s and start from 20s and execute upto 30s.  Is it possible in ns3. Please help.

Thanks in advance!!
E Jana
IIT K 



Tommaso Pecorella

unread,
Sep 18, 2015, 3:49:05 AM9/18/15
to ns-3-users
Hi,

there's a little misunderstanding. Events are not "active", they are executed t the time they are scheduled.
What you can do is to have a start and a stop event, plus a state machine. As an example, take an object A, with the property (status) active or inactive. You can fire an event to put A in active state at time 10 and another event to put A in inactive state at time 20.
Note that the end event could be fired from the start event handler or from elsewhere, and that the object status handling it's highly simplified. I wouldn't use a simple bool in a real implementation.

Hope this clarifies a bit,

T.

Kanchan Sarkar

unread,
Sep 18, 2015, 5:23:38 AM9/18/15
to ns-3-users
Thanks Tommaso for your reply. I am trying to do that way what you said.
Thanks again.
Reply all
Reply to author
Forward
0 new messages