Use Time() constructor with integer values

This commit is contained in:
Eduardo Almeida
2024-11-08 18:01:13 +00:00
parent 5d104f6f90
commit 5afa1fd7ef
314 changed files with 1771 additions and 1775 deletions

View File

@@ -41,18 +41,18 @@ interfaces = address.Assign(devices)
echoServer = ns.UdpEchoServerHelper(9)
serverApps = echoServer.Install(nodes.Get(1))
serverApps.Start(ns.Seconds(1.0))
serverApps.Stop(ns.Seconds(10.0))
serverApps.Start(ns.Seconds(1))
serverApps.Stop(ns.Seconds(10))
address = interfaces.GetAddress(1).ConvertTo()
echoClient = ns.UdpEchoClientHelper(address, 9)
echoClient.SetAttribute("MaxPackets", ns.UintegerValue(1))
echoClient.SetAttribute("Interval", ns.TimeValue(ns.Seconds(1.0)))
echoClient.SetAttribute("Interval", ns.TimeValue(ns.Seconds(1)))
echoClient.SetAttribute("PacketSize", ns.UintegerValue(1024))
clientApps = echoClient.Install(nodes.Get(0))
clientApps.Start(ns.Seconds(2.0))
clientApps.Stop(ns.Seconds(10.0))
clientApps.Start(ns.Seconds(2))
clientApps.Stop(ns.Seconds(10))
ns.Simulator.Run()
ns.Simulator.Destroy()