A Discrete-Event Network Simulator
API
Simulator

Control the virtual time and the execution of simulation events. More...

+ Collaboration diagram for Simulator:

Modules

 Realtime Simulator
 Realtime simulator implementation.
 

Files

file  default-simulator-impl.cc
 ns3::DefaultSimulatorImpl implementation.
 
file  default-simulator-impl.h
 ns3::DefaultSimulatorImpl declaration.
 
file  des-metrics.cc
 ns3::DesMetrics implementation.
 
file  des-metrics.h
 ns3::DesMetrics declaration.
 
file  node-printer.cc
 ns3::DefaultNodePrinter implementation.
 
file  sample-simulator.cc
 Example program demonstrating use of various Schedule functions.
 
file  sample-simulator.py
 Python example program demonstrating use of various Schedule functions.
 
file  simulator-impl.cc
 ns3::SimulatorImpl implementation.
 
file  simulator-impl.h
 ns3::SimulatorImpl declaration.
 
file  simulator.cc
 ns3::Simulator implementation, as well as implementation pointer, global scheduler implementation.
 
file  simulator.h
 ns3::Simulator declaration.
 

Classes

class  ns3::DefaultSimulatorImpl
 The default single process simulator implementation. More...
 
class  ns3::DesMetrics
 

Event trace data collector for the DES Metrics project. More...
 
class  ns3::DistributedSimulatorImpl
 Distributed simulator implementation using lookahead. More...
 
class  ns3::Simulator
 Control the scheduling of simulation events. More...
 
class  ns3::SimulatorImpl
 The SimulatorImpl base class. More...
 
class  ns3::VisualSimulatorImpl
 A replacement simulator that starts the visualizer. More...
 

Functions

static SimulatorImplns3::GetImpl (void)
 Get the SimulatorImpl singleton. More...
 
Time ns3::Now (void)
 create an ns3::Time instance which contains the current simulation time. More...
 
static SimulatorImpl ** ns3::PeekImpl (void)
 Get the static SimulatorImpl instance. More...
 

Variables

static GlobalValue ns3::g_simTypeImpl
 

Detailed Description

Control the virtual time and the execution of simulation events.

Function Documentation

◆ GetImpl()

◆ Now()

Time ns3::Now ( void  )

create an ns3::Time instance which contains the current simulation time.

This is really a shortcut for the ns3::Simulator::Now method. It is typically used as shown below to schedule an event which expires at the absolute time "2 seconds":

Simulator::Schedule (Seconds (2.0) - Now (), &my_function);
Returns
The current simulation time.

Definition at line 287 of file simulator.cc.

References ns3::Simulator::Now().

Referenced by ChannelAccessManagerTest< TxopType >::AddAccessRequestWithAckTimeout(), ChannelAccessManagerTest< TxopType >::AddAccessRequestWithSuccessfullAck(), ChannelAccessManagerTest< TxopType >::AddAckTimeoutReset(), ChannelAccessManagerTest< TxopType >::AddCcaBusyEvt(), ChannelAccessManagerTest< TxopType >::AddNavReset(), ChannelAccessManagerTest< TxopType >::AddNavStart(), ChannelAccessManagerTest< TxopType >::AddRxErrorEvt(), ChannelAccessManagerTest< TxopType >::AddRxInsideSifsEvt(), ChannelAccessManagerTest< TxopType >::AddRxOkEvt(), ChannelAccessManagerTest< TxopType >::AddRxStartEvt(), ChannelAccessManagerTest< TxopType >::AddSwitchingEvt(), ChannelAccessManagerTest< TxopType >::AddTxEvt(), ns3::DefaultChannelScheduler::AssignDefaultCchAccess(), ns3::UanMacRc::Associate(), TcpBytesInFlightTest::BytesInFlightTrace(), ns3::ThreeGppChannelModel::CalcAttenuationOfBlockage(), ns3::UanPhyCalcSinrDual::CalcSinrDb(), Issue211Test::CalcThroughput(), TestInterBssConstantObssPdAlgo::CheckPhyState(), TestAmpduReception::CheckPhyState(), RoutingExperiment::CheckThroughput(), Experiment::CheckThroughput(), DsdvManetExample::CheckThroughput(), VanetRoutingExperiment::CheckThroughput(), ns3::LteInterference::ConditionallyEvaluateChunk(), ns3::SpectrumInterference::ConditionallyEvaluateChunk(), LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::ConnectionReconfigurationEnb(), LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::ConnectionReconfigurationUe(), VanetRoutingExperiment::CourseChange(), WaypointLazyNotifyFalse::CourseChangeCallback(), WaypointLazyNotifyTrue::CourseChangeCallback(), CwndChange(), Ns3TcpCwndTestCase1::CwndChange(), Ns3TcpCwndTestCase2::CwndChange(), Ns3TcpCwndTestCase2::CwndChangeNotInflated(), Ns3TcpLossTestCase::CwndTracer(), LrWpanDataIfsTestCase::DataConfirm(), LrWpanAckTestCase::DataConfirm(), LrWpanAckTestCase::DataIndication(), LrWpanSlottedCsmacaTestCase::DataIndicationCoordinator(), LrWpanDataIfsTestCase::DataReceived(), CobaltQueueDiscMarkTest::Dequeue(), CoDelQueueDiscBasicDrop::Dequeue(), CoDelQueueDiscBasicMark::Dequeue(), LteFrAreaTestCase::DlDataRxStart(), CarrierAggregationTestCase::DlScheduling(), LteLinkAdaptationTestCase::DlScheduling(), LteCqiGenerationTestCase::DlScheduling(), LteInterferenceTestCase::DlScheduling(), LtePathlossModelSystemTestCase::DlScheduling(), LteCqiGenerationDlPowerControlTestCase::DlScheduling(), ns3::SpectrumInterference::DoAddSignal(), TestThresholdPreambleDetectionWithoutFrameCapture::DoCheckPhyState(), TestThresholdPreambleDetectionWithFrameCapture::DoCheckPhyState(), TestPhyHeadersReception::DoCheckPhyState(), ThreeGppChannelMatrixUpdateTest::DoGetChannel(), LiIonEnergyTestCase::DoRun(), BasicEnergyHarvesterTestCase::DoRun(), LrWpanAckTestCase::DoRun(), ns3::SpectrumInterference::DoSubtractSignal(), ns3::UanMacRcGw::EndCycle(), ns3::UanMacCw::EndTx(), ns3::UanMacAloha::Enqueue(), ns3::UanMacCw::Enqueue(), ChannelAccessManagerTest< TxopType >::ExpectBusy(), ns3::Watchdog::Expire(), LrWpanAckTestCase::ExtendedAddressingDataConfirm(), LrWpanAckTestCase::ExtendedAddressingDataIndication(), ns3::UanMacRcGw::FindOptA(), ns3::JakesProcess::GetComplexGain(), ns3::ChannelCoordinator::GetIntervalTime(), LenaMimoTestCase::GetRlcBufferSample(), Ipv4DynamicGlobalRoutingTestCase::HandleRead(), LteHandoverTargetTestCase::HandoverStartCallback(), LrWpanSlottedCsmacaTestCase::IncomingSuperframeStatus(), Ns3TcpLossTestCase::Ipv4L3Tx(), Ns3TcpStateTestCase::Ipv4L3Tx(), Ns3TcpInteroperabilityTestCase::Ipv4L3Tx(), OcbWifiMacTestCase::MacAssoc(), LrWpanDataIfsTestCase::MacState(), JakesPropagationExample::Next(), ChannelAccessManagerTest< TxopType >::NotifyAccessGranted(), ns3::UanMacCw::NotifyCcaEnd(), ns3::UanMacCw::NotifyCcaStart(), ChannelCoordinationTestCase::NotifyCchStartNow(), ChannelAccessManagerTest< TxopType >::NotifyChannelSwitching(), ChannelCoordinationTestCase::NotifyGuardStartNow(), DcfImmediateAccessBroadcastTestCase::NotifyPhyTxBegin(), ns3::UanMacCw::NotifyRxEndError(), ns3::UanMacCw::NotifyRxEndOk(), ns3::UanMacCw::NotifyRxStart(), ChannelCoordinationTestCase::NotifySchStartNow(), ns3::UanMacCw::NotifyTxStart(), SimulatorEventsTestCase::NowUs(), LrWpanCcaTestCase::PhyRxBegin(), LrWpanCcaTestCase::PhyRxDrop(), LrWpanCcaTestCase::PhyRxEnd(), OcbWifiMacTestCase::PhyRxOkTrace(), LrWpanCcaTestCase::PhyTxBegin(), LrWpanCcaTestCase::PhyTxEnd(), OcbWifiMacTestCase::PhyTxTrace(), ns3::Watchdog::Ping(), LrWpanCcaTestCase::PlmeCcaConfirm(), PrintReceivedPacket(), PrintReceivedRoutingPacket(), ns3::aodv::RoutingProtocol::PrintRoutingTable(), ns3::dsdv::RoutingProtocol::PrintRoutingTable(), ns3::Ipv4StaticRouting::PrintRoutingTable(), ns3::Ipv4ListRouting::PrintRoutingTable(), ns3::Ipv4GlobalRouting::PrintRoutingTable(), ns3::Ipv6ListRouting::PrintRoutingTable(), ns3::Rip::PrintRoutingTable(), ns3::RipNg::PrintRoutingTable(), ns3::Ipv6StaticRouting::PrintRoutingTable(), ns3::olsr::RoutingProtocol::PrintRoutingTable(), ns3::UanMacRc::ProcessAck(), ThreeGppHttpObjectTestCase::ProgressCallback(), LteUplinkPowerControlTestCase::PucchTxPowerTrace(), LteUplinkPowerControlTestCase::PuschTxPowerTrace(), LteRadioLinkFailureTestCase::RadioLinkFailureCallback(), TcpRateLinuxWithSocketsTest::RateUpdatedTrace(), ns3::UanTransducerHd::Receive(), WaveNetDeviceExample::Receive(), Receiver::Receive(), Bug730TestCase::Receive(), AnnexC_TestCase::Receive(), ns3::UanMacRc::ReceiveOkFromPhy(), DsdvManetExample::ReceivePacket(), ns3::UanMacRcGw::ReceivePacket(), LrWpanPlmeAndPdInterfaceTestCase::ReceivePdDataIndication(), WaveNetDeviceExample::ReceiveVsa(), LteUeMeasurementsTestCase::RecvMeasurementReport(), LteUeMeasurementsPiecewiseTestCase1::RecvMeasurementReportCallback(), LteUeMeasurementsPiecewiseTestCase2::RecvMeasurementReportCallback(), LteUeMeasurementsPiecewiseTestCase3::RecvMeasurementReportCallback(), LteUeMeasurementsHandoverTestCase::RecvMeasurementReportCallback(), LteUeMeasurementsTestCase::ReportUeMeasurements(), NetAnimExperiment::ResetData(), Experiment::ResetData(), ns3::UanMacRc::RtsTimeout(), TcpZeroWindowTest::Rx(), TcpSlowStartNormalTest::Rx(), RxDrop(), ns3::UanPhyDual::RxOkFromSubPhy(), ns3::UanMacCw::SaveTimer(), ns3::UanMacRc::ScheduleData(), EpsBearerTagUdpClient::Send(), Bug772ChainTest::SendData(), HwmpProactiveRegressionTest::SendData(), FlameRegressionTest::SendData(), HwmpSimplestRegressionTest::SendData(), HwmpReactiveRegressionTest::SendData(), HwmpDoRfRegressionTest::SendDataA(), HwmpDoRfRegressionTest::SendDataB(), HwmpDoRfRegressionTest::SendDataC(), TcpDctcpCongestedRouter::SendDataPacket(), ns3::UanPhyDual::SendPacket(), ns3::UanMacCw::SendPacket(), ns3::UanMacRcGw::SendPacket(), ns3::UanMacRc::SendPacket(), AnnexC_TestCase::SendPacket(), ChainRegressionTest::SendPing(), TcpRateLinuxBasicTest::SendSkb(), ChannelAccessTestCase::SendX(), LteUplinkPowerControlTestCase::SetTpcConfiguration(), LteFrAreaTestCase::SimpleTeleportUe(), TcpRateLinuxBasicTest::SkbDelivered(), LteUplinkPowerControlTestCase::SrsTxPowerTrace(), ns3::WaveformGenerator::Start(), ns3::ChannelCoordinator::StartChannelCoordination(), LrWpanSlottedCsmacaTestCase::StartConfirm(), ns3::UanMacRcGw::StartCycle(), Ns3TcpStateTestCase::StartFlow(), Ns3TcpLossTestCase::StartFlow(), ns3::SpectrumInterference::StartRx(), ns3::LteInterference::StartRx(), ns3::UanMacCw::StartTimer(), LteUplinkPowerControlTestCase::TeleportUe(), LteFrAreaTestCase::TeleportUe(), LteFrAreaTestCase::TeleportUe2(), ChannelAccessTestCase::TestAlternating(), ChannelAccessTestCase::TestAlternatingAfter(), ChannelAccessTestCase::TestContinuous(), ChannelAccessTestCase::TestContinuousAfter(), ChannelAccessTestCase::TestExtended(), ChannelAccessTestCase::TestExtendedAfter(), ChannelCoordinationTestCase::TestIntervalAfter(), ProbeTestCase1::TraceSink(), WaveformGeneratorTestCase::TraceWave(), LrWpanSlottedCsmacaTestCase::TransactionCost(), LrWpanSlottedCsmacaTestCase::TransEndIndication(), TcpZeroWindowTest::Tx(), TcpSlowStartNormalTest::Tx(), TcpPacingTest::Tx(), LteFrAreaTestCase::UlDataRxStart(), CarrierAggregationTestCase::UlScheduling(), LteCqiGenerationTestCase::UlScheduling(), LteInterferenceTestCase::UlScheduling(), LteCqiGenerationDlPowerControlTestCase::UlScheduling(), ns3::SpectrumAnalyzer::UpdateEnergyReceivedSoFar(), NetAnimExperiment::UpdatePositions(), Experiment::UpdatePositions(), ns3::WriteAveragePowerSpectralDensityReport(), Ns3TcpStateTestCase::WriteUntilBufferFull(), and Ns3TcpLossTestCase::WriteUntilBufferFull().

+ Here is the call graph for this function:

◆ PeekImpl()

static SimulatorImpl** ns3::PeekImpl ( void  )
static

Get the static SimulatorImpl instance.

Returns
The SimulatorImpl instance pointer.

Definition at line 86 of file simulator.cc.

Referenced by ns3::Simulator::Cancel(), ns3::Simulator::Destroy(), ns3::GetImpl(), ns3::Simulator::GetSystemId(), ns3::Simulator::IsExpired(), ns3::Simulator::Remove(), and ns3::Simulator::SetImplementation().

+ Here is the caller graph for this function:

Variable Documentation

◆ g_simTypeImpl

GlobalValue ns3::g_simTypeImpl
static
Initial value:
= GlobalValue
("SimulatorImplementationType",
"The object class to use as the simulator implementation",
StringValue ("ns3::DefaultSimulatorImpl"),
Ptr< const AttributeChecker > MakeStringChecker(void)
Definition: string.cc:30

The specific simulator implementation to use.

Must be derived from SimulatorImpl.

Definition at line 63 of file simulator.cc.

Referenced by ns3::GetImpl().