12#include "ns3/default-simulator-impl.h"
14#include "ns3/packet-metadata.h"
42 TypeId(
"ns3::VisualSimulatorImpl")
44 .SetGroupName(
"Visualizer")
47 "SimulatorImplFactory",
48 "Factory for the underlying simulator implementation used by the visualizer.",
109 if (!Py_IsInitialized())
112 PyRun_SimpleString(
"import visualizer\n"
113 "visualizer.start();\n");
117 PyGILState_STATE __py_gil_state = PyGILState_Ensure();
119 PyRun_SimpleString(
"import visualizer\n"
120 "visualizer.start();\n");
122 PyGILState_Release(__py_gil_state);
150 m_simulator->ScheduleWithContext(context, delay, event);
static TypeId GetTypeId()
Register this type.
An identifier for simulation events.
Instantiate subclasses of ns3::Object.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
virtual void DoDispose()
Destructor implementation.
The SimulatorImpl base class.
virtual void Destroy()=0
Execute the events scheduled with ScheduleDestroy().
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
A replacement simulator that starts the visualizer.
static TypeId GetTypeId()
Get the type ID.
EventId Schedule(const Time &delay, EventImpl *event) override
Schedule a future event execution (in the same context).
void Cancel(const EventId &id) override
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
void Remove(const EventId &id) override
Remove an event from the event list.
Time Now() const override
Return the current simulation virtual time.
Time GetDelayLeft(const EventId &id) const override
Get the remaining time until this event will execute.
uint32_t GetSystemId() const override
Get the system id of this simulator.
ObjectFactory m_simulatorImplFactory
simulator implementation factory
uint32_t GetContext() const override
Get the current simulation context.
Ptr< SimulatorImpl > m_simulator
the simulator implementation
Time GetMaximumSimulationTime() const override
Get the maximum representable simulation time.
EventId ScheduleDestroy(EventImpl *event) override
Schedule an event to run at the end of the simulation, after the Stop() time or condition has been re...
void DoDispose() override
Destructor implementation.
bool IsFinished() const override
Check if the simulation should finish.
~VisualSimulatorImpl() override
uint64_t GetEventCount() const override
Get the number of events executed.
void Destroy() override
Execute the events scheduled with ScheduleDestroy().
bool IsExpired(const EventId &id) const override
Check if an event has already run or been cancelled.
void SetScheduler(ObjectFactory schedulerFactory) override
Set the Scheduler to be used to manage the event list.
void ScheduleWithContext(uint32_t context, const Time &delay, EventImpl *event) override
Schedule a future event execution (in a different context).
void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
void Run() override
Run the simulation.
void RunRealSimulator()
calls Run() in the wrapped simulator
EventId ScheduleNow(EventImpl *event) override
Schedule an event to run at the current virtual time.
void Stop() override
Tell the Simulator the calling event should be the last one executed.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
ObjectFactory GetDefaultSimulatorImplFactory()
Get an object factory configured to the default simulator implementation.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeObjectFactoryChecker()
Ptr< const AttributeAccessor > MakeObjectFactoryAccessor(T1 a1)