|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
19 #ifndef REALTIME_SIMULATOR_IMPL_H
20 #define REALTIME_SIMULATOR_IMPL_H
95 virtual void Stop (
void);
96 virtual void Stop (
const Time &delay);
104 virtual void Run (
void);
174 uint64_t
NextTs (
void)
const;
a unique identifier for an interface.
Ptr< Scheduler > m_events
The event list.
virtual uint64_t GetEventCount(void) const
Get the number of events executed.
void SetSynchronizationMode(RealtimeSimulatorImpl::SynchronizationMode mode)
Set the SynchronizationMode.
virtual EventId Schedule(const Time &delay, EventImpl *event)
Schedule a future event execution (in the same context).
virtual void Run(void)
Run the simulation.
Time RealtimeNow(void) const
Get the current real time from the synchronizer.
An identifier for simulation events.
@ SYNC_BEST_EFFORT
Make a best effort to keep synced to real-time.
virtual void Remove(const EventId &ev)
Remove an event from the event list.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t m_uid
Unique id of the current event.
Realtime version of SimulatorImpl.
pthread_t ThreadId
Type alias for the system-dependent thread object.
virtual void SetScheduler(ObjectFactory schedulerFactory)
Set the Scheduler to be used to manage the event list.
virtual Time Now(void) const
Return the current simulation virtual time.
uint32_t m_currentContext
The event list.
virtual void Cancel(const EventId &ev)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
virtual void Stop(void)
Tell the Simulator the calling event should be the last one executed.
ns3::Synchronizer declaration.
A class which provides a relatively platform-independent Mutual Exclusion thread synchronization prim...
void ScheduleRealtimeNow(EventImpl *event)
Schedule an event to run at the current virtual time.
virtual Time GetMaximumSimulationTime(void) const
Get the maximum representable simulation time.
NS_ASSERT() and NS_ASSERT_MSG() macro definitions.
void ScheduleRealtimeNowWithContext(uint32_t context, EventImpl *event)
Schedule an event to run at the current virtual time.
virtual EventId ScheduleDestroy(EventImpl *event)
Schedule an event to run at the end of the simulation, after the Stop() time or condition has been re...
Ptr< Synchronizer > m_synchronizer
The synchronizer in use to track real time.
virtual EventId ScheduleNow(EventImpl *event)
Schedule an event to run at the current virtual time.
SynchronizationMode
What to do when we can't maintain real time synchrony.
uint64_t NextTs(void) const
Get the timestep of the next event.
ns3::Scheduler abstract base class, ns3::Scheduler::Event and ns3::Scheduler::EventKey declarations.
virtual void ScheduleWithContext(uint32_t context, const Time &delay, EventImpl *event)
Schedule a future event execution (in a different context).
RealtimeSimulatorImpl()
Constructor.
void SetHardLimit(Time limit)
Set the fatal error threshold for SynchronizationMode SYNC_HARD_LIMIT.
virtual bool IsFinished(void) const
Check if the simulation should finish.
Time m_hardLimit
The maximum allowable drift from real-time in SYNC_HARD_LIMIT mode.
Smart pointer class similar to boost::intrusive_ptr.
~RealtimeSimulatorImpl()
Destructor.
void ScheduleRealtimeWithContext(uint32_t context, const Time &delay, EventImpl *event)
Schedule a future event execution (in a different context).
virtual uint32_t GetContext(void) const
Get the current simulation context.
Instantiate subclasses of ns3::Object.
ns3::EventImpl declarations.
bool m_running
Is the simulator currently running.
Simulation virtual time values and global simulation resolution.
void ProcessOneEvent(void)
Process the next event.
uint64_t m_currentTs
Execution context.
virtual Time GetDelayLeft(const EventId &id) const
Get the remaining time until this event will execute.
System-independent thread class ns3::SystemThread declaration.
int m_unscheduledEvents
Unique id for the next event to be scheduled.
ns3::SimulatorImpl declaration.
virtual uint32_t GetSystemId(void) const
Get the system id of this simulator.
System-independent mutex primitive, ns3::SystemMutex, and ns3::CriticalSection.
The SimulatorImpl base class.
void ScheduleRealtime(const Time &delay, EventImpl *event)
Schedule a future event execution (in the same context).
virtual void DoDispose(void)
Destructor implementation.
uint64_t m_eventCount
The event count.
SystemMutex m_mutex
Mutex to control access to key state.
Time GetHardLimit(void) const
Get the current fatal error threshold for SynchronizationMode SYNC_HARD_LIMIT.
SystemThread::ThreadId m_main
Main SystemThread.
DestroyEvents m_destroyEvents
Container for events to be run at destroy time.
bool Realtime(void) const
Check that the Synchronizer is locked to the real time clock.
virtual void Destroy()
Execute the events scheduled with ScheduleDestroy().
bool m_stop
Has the stopping condition been reached?
bool Running(void) const
Is the simulator running?
SynchronizationMode m_synchronizationMode
SynchronizationMode policy.
std::list< EventId > DestroyEvents
Container type for events to be run at destroy time.
static TypeId GetTypeId(void)
Get the registered TypeId for this class.
RealtimeSimulatorImpl::SynchronizationMode GetSynchronizationMode(void) const
Get the SynchronizationMode.
uint32_t m_currentUid
Timestep of the current event.
virtual bool IsExpired(const EventId &ev) const
Check if an event has already run or been cancelled.
ns3::Ptr smart pointer declaration and implementation.
@ SYNC_HARD_LIMIT
Keep to real time within the hard limit tolerance configured with SetHardLimit, or die trying.