20 #undef HAVE_SYS_STAT_H
23 #include "ns3/default-simulator-impl.h"
25 #include "ns3/packet-metadata.h"
53 TypeId(
"ns3::VisualSimulatorImpl")
55 .SetGroupName(
"Visualizer")
58 "SimulatorImplFactory",
59 "Factory for the underlying simulator implementation used by the visualizer.",
120 if (!Py_IsInitialized())
123 PyRun_SimpleString(
"import visualizer\n"
124 "visualizer.start();\n");
128 PyGILState_STATE __py_gil_state = PyGILState_Ensure();
130 PyRun_SimpleString(
"import visualizer\n"
131 "visualizer.start();\n");
133 PyGILState_Release(__py_gil_state);
161 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.
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 AttributeAccessor > MakeObjectFactoryAccessor(T1 a1)
Ptr< const AttributeChecker > MakeObjectFactoryChecker()