Bug 866 - WiMAX mobility models not aggregated to Node

This commit is contained in:
Mohamed Amine Ismail
2010-04-15 09:32:31 +02:00
parent 813fd4c631
commit e0aecf002e
4 changed files with 15 additions and 24 deletions

View File

@@ -150,7 +150,7 @@ int main (int argc, char *argv[])
BSPosition = CreateObject<ConstantPositionMobilityModel> ();
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<SubscriberStationNetDevice> ();
ss[i]->SetModulationType (WimaxPhy::MODULATION_TYPE_QAM16_12);
ss[i]->GetPhy ()->SetMobility (SSPosition[i]);
ssNodes.Get (i)->AggregateObject (SSPosition[i]);
}

View File

@@ -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

View File

@@ -145,23 +145,19 @@ SimpleOfdmWimaxChannel::Send (Time BlockTime,
double rxPowerDbm = 0;
Ptr<MobilityModel> senderMobility = 0;
Ptr<MobilityModel> receiverMobility = 0;
if (phy->GetMobility ())
{
senderMobility = phy->GetMobility ()->GetObject<MobilityModel> ();
}
senderMobility = phy->GetDevice ()->GetNode ()->GetObject<MobilityModel> ();
for (std::list<Ptr<SimpleOfdmWimaxPhy> >::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<MobilityModel> ();
}
double distance = 0;
receiverMobility = (*iter)->GetDevice ()->GetNode ()->GetObject<MobilityModel> ();
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<NetDevice> ()->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<SimpleOfdmWimaxPhy> rxphy, simpleOfdmSendParam * param)
{
// std::cout << "END_SEND ";
rxphy->StartReceive (param->GetFecBlock (),
param->GetBurstSize (),
param->GetIsFirstBlock (),

View File

@@ -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,