diff --git a/examples/wimax/wimax-multicast.cc b/examples/wimax/wimax-multicast.cc index cf3d30066..3074ded7c 100644 --- a/examples/wimax/wimax-multicast.cc +++ b/examples/wimax/wimax-multicast.cc @@ -150,7 +150,7 @@ int main (int argc, char *argv[]) BSPosition = CreateObject (); BSPosition->SetPosition (Vector (1000, 0, 0)); - dev->GetPhy ()->SetMobility (BSPosition); + bsNodes.Get (0)->AggregateObject (BSPosition); bsDevs.Add (dev); if (verbose) { @@ -169,7 +169,7 @@ int main (int argc, char *argv[]) ss[i] = ssDevs.Get (i)->GetObject (); ss[i]->SetModulationType (WimaxPhy::MODULATION_TYPE_QAM16_12); - ss[i]->GetPhy ()->SetMobility (SSPosition[i]); + ssNodes.Get (i)->AggregateObject (SSPosition[i]); } diff --git a/src/devices/wimax/bs-link-manager.cc b/src/devices/wimax/bs-link-manager.cc index fcfae2bce..258a6952c 100644 --- a/src/devices/wimax/bs-link-manager.cc +++ b/src/devices/wimax/bs-link-manager.cc @@ -93,11 +93,12 @@ BSLinkManager::ProcessRangingRequest (Cid cid, RngReq rngreq) * m_bs->GetSymbolDuration ().GetSeconds ()); } - NS_ASSERT_MSG (Simulator::Now () >= m_bs->GetUlSubframeStartTime () && Simulator::Now () < irIntervalBoundary, - "Base station: Error while processing ranging request: out of time"); tries++; - PerformRanging (cid, rngreq); + if (Simulator::Now () >= m_bs->GetUlSubframeStartTime () && Simulator::Now () < irIntervalBoundary) + { + PerformRanging (cid, rngreq); + } } void diff --git a/src/devices/wimax/simple-ofdm-wimax-channel.cc b/src/devices/wimax/simple-ofdm-wimax-channel.cc index 314789740..aae4df055 100644 --- a/src/devices/wimax/simple-ofdm-wimax-channel.cc +++ b/src/devices/wimax/simple-ofdm-wimax-channel.cc @@ -145,23 +145,19 @@ SimpleOfdmWimaxChannel::Send (Time BlockTime, double rxPowerDbm = 0; Ptr senderMobility = 0; Ptr receiverMobility = 0; - if (phy->GetMobility ()) - { - senderMobility = phy->GetMobility ()->GetObject (); - } + senderMobility = phy->GetDevice ()->GetNode ()->GetObject (); for (std::list >::iterator iter = m_phyList.begin (); iter != m_phyList.end (); ++iter) { - double delay = 0; + Time delay = Seconds(0); if (phy != *iter) { - if ((*iter)->GetMobility ()) - { - receiverMobility = (*iter)->GetMobility ()->GetObject (); - } + double distance = 0; + receiverMobility = (*iter)->GetDevice ()->GetNode ()->GetObject (); if (receiverMobility != 0 && senderMobility != 0 && m_loss != 0) { - delay = (senderMobility->GetDistanceFrom (receiverMobility)) / 300000000LL; + distance = senderMobility->GetDistanceFrom (receiverMobility); + delay = Seconds(distance/300000000.0); rxPowerDbm = m_loss->CalcRxPower (rxPowerDbm, senderMobility, receiverMobility); } simpleOfdmSendParam * param = new simpleOfdmSendParam (fecBlock, @@ -183,7 +179,7 @@ SimpleOfdmWimaxChannel::Send (Time BlockTime, dstNode = dstNetDevice->GetObject ()->GetNode ()->GetId (); } Simulator::ScheduleWithContext (dstNode, - Seconds (delay) + BlockTime, + delay, &SimpleOfdmWimaxChannel::EndSend, this, *iter, @@ -196,7 +192,6 @@ SimpleOfdmWimaxChannel::Send (Time BlockTime, void SimpleOfdmWimaxChannel::EndSend (Ptr rxphy, simpleOfdmSendParam * param) { - // std::cout << "END_SEND "; rxphy->StartReceive (param->GetFecBlock (), param->GetBurstSize (), param->GetIsFirstBlock (), diff --git a/src/devices/wimax/simple-ofdm-wimax-phy.cc b/src/devices/wimax/simple-ofdm-wimax-phy.cc index 4ba774217..48329552f 100644 --- a/src/devices/wimax/simple-ofdm-wimax-phy.cc +++ b/src/devices/wimax/simple-ofdm-wimax-phy.cc @@ -311,12 +311,7 @@ SimpleOfdmWimaxPhy::EndSendFecBlock (WimaxPhy::ModulationType modulationType, } else { - Simulator::Schedule (Seconds (0), - &SimpleOfdmWimaxPhy::StartSendFecBlock, - this, - false, - modulationType, - direction); + StartSendFecBlock(false,modulationType,direction); } } @@ -392,7 +387,7 @@ SimpleOfdmWimaxPhy::StartReceive (const bvec &fecBlock, SetBlockParameters (burstSize, modulationType); m_blockTime = GetBlockTransmissionTime (modulationType); } - Simulator::Schedule (Seconds (0), + Simulator::Schedule (m_blockTime, &SimpleOfdmWimaxPhy::EndReceiveFecBlock, this, fecBlock,