--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+unsubscribe@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.
Good day John:
manet_TxRx_2_march_2017.cc
manet_TxRx_10_march_2017.cc
./waf --run fran
Waf: Entering directory `/Users/johnabraham/ws/ns3push/ns-3-dev/build'
[ 958/2478] Compiling scratch/fran.cc
../scratch/fran.cc:205:181: error: variable has incomplete type 'struct mpduInfo'
void ReceivePacketWithRss (Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)
^
../scratch/fran.cc:205:172: note: forward declaration of 'mpduInfo'
void ReceivePacketWithRss (Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)
^
../scratch/fran.cc:205:210: error: variable has incomplete type 'struct signalNoiseDbm'
void ReceivePacketWithRss (Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)
^
../scratch/fran.cc:205:195: note: forward declaration of 'signalNoiseDbm'
void ReceivePacketWithRss (Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)
^
2 errors generated.
Good day John:
painter->drawPixmap (bottomLeft.x (), bottomLeft.y (), 1, 1, m_batteryPixmap);
with:
painter->drawPixmap (bottomLeft.x (), bottomLeft.y (), 10, 10, m_batteryPixmap);
john
--
John:
TimeValue t1 = Seconds (1.0);
/* energy source */ BasicEnergySourceHelper basicSourceHelper; // configure energy source basicSourceHelper.Set ("BasicEnergySourceInitialEnergyJ", DoubleValue (100)); basicSourceHelper.Set ("PeriodicEnergyUpdateInterval", t1); // install source EnergySourceContainer sources = basicSourceHelper.Install (nodes); /* device energy model */ WifiRadioEnergyModelHelper wifiRadioEnergyModelHelper; // configure radio energy model wifiRadioEnergyModelHelper.Set ("TxCurrentA", DoubleValue (0.0174)); wifiRadioEnergyModelHelper.Set ("RxCurrentA", DoubleValue (0.0174)); // install device model DeviceEnergyModelContainer deviceModels = wifiRadioEnergyModelHelper.Install (devices, sources);
int iii = 0; uint32_t nDevices = devices.GetN ();
for (uint32_t i = 0;i < nDevices; ++i) {
Ptr<WifiNetDevice> p = DynamicCast<WifiNetDevice> (devices.Get (i)); p->SetAddress(Mac48Address::Allocate ()); Ptr<EESOA> macN = DynamicCast<EESOA> (p->GetMac()); macN->SetNodeId(p->GetNode ()->GetId ()); prev_role[i]= 100; //this role does not exists. prev_nNodes[i]= 0; Simulator::ScheduleWithContext (p->GetNode ()->GetId (), MilliSeconds(90), &modify, p, &anim); Simulator::ScheduleWithContext (p->GetNode ()->GetId (), Seconds(1), &printNonEESOAtx, p); p->GetPhy()->TraceConnect ("PhyTxBegin",PrintID(p->GetNode ()), MakeCallback (&PhyTxBegin)); // energy model Ptr<BasicEnergySource> basicSourcePtr = DynamicCast<BasicEnergySource>(p->GetNode ()->GetObject<EnergySourceContainer>()->Get(0)); NS_ASSERT (basicSourcePtr != NULL); basicSourcePtr->TraceConnect ("RemainingEnergy",PrintID(p->GetNode ()), MakeCallback (&RemainingEnergyTrace));
Ptr<DeviceEnergyModel> basicRadioModelPtr = basicSourcePtr->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get(0); NS_ASSERT (basicRadioModelPtr != NULL);
//basicRadioModelPtr->TraceConnect ("TotalEnergyConsumption",PrintID(p->GetNode ()), MakeCallback (&TotalEnergy)); iii++; }
%INFO: TimeStamp: 60.988 segs Node: ID: 97 Current Remaining energy = 54.1867 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 69 Current Remaining energy = 54.366 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 75 Current Remaining energy = 54.9593 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 3 Current Remaining energy = 53.0506 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 38 Current Remaining energy = 52.698 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 76 Current Remaining energy = 53.2712 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 54 Current Remaining energy = 52.6771 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 22 Current Remaining energy = 52.641 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 47 Current Remaining energy = 55.0897 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 16 Current Remaining energy = 52.896 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 43 Current Remaining energy = 53.0377 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 49 Current Remaining energy = 55.104 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 61 Current Remaining energy = 55.0461 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 89 Current Remaining energy = 55.5411 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 26 Current Remaining energy = 54.9403 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 63 Current Remaining energy = 53.2001 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 90 Current Remaining energy = 53.2118 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 8 Current Remaining energy = 55.4874 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 42 Current Remaining energy = 56.2636 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 57 Current Remaining energy = 55.0819 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 48 Current Remaining energy = 53.6125 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 55 Current Remaining energy = 52.7304 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 13 Current Remaining energy = 56.2103 Joules%INFO: TimeStamp: 60.988 segs Node: ID: 68 Current Remaining energy = 53.0735 Joules%INFO: TimeStamp: 60.9884 segs Node: ID: 97 Current Remaining energy = 54.1867 Joules%INFO: TimeStamp: 60.9884 segs Node: ID: 69 Current Remaining energy = 54.3659 Joules