|
|
| 145 |
double rxPowerDbm = 0; |
145 |
double rxPowerDbm = 0; |
| 146 |
Ptr<MobilityModel> senderMobility = 0; |
146 |
Ptr<MobilityModel> senderMobility = 0; |
| 147 |
Ptr<MobilityModel> receiverMobility = 0; |
147 |
Ptr<MobilityModel> receiverMobility = 0; |
| 148 |
if (phy->GetMobility ()) |
148 |
senderMobility = phy->GetDevice ()->GetNode ()->GetObject<MobilityModel> (); |
| 149 |
{ |
|
|
| 150 |
senderMobility = phy->GetMobility ()->GetObject<MobilityModel> (); |
| 151 |
} |
| 152 |
|
149 |
|
| 153 |
for (std::list<Ptr<SimpleOfdmWimaxPhy> >::iterator iter = m_phyList.begin (); iter != m_phyList.end (); ++iter) |
150 |
for (std::list<Ptr<SimpleOfdmWimaxPhy> >::iterator iter = m_phyList.begin (); iter != m_phyList.end (); ++iter) |
| 154 |
{ |
151 |
{ |
| 155 |
double delay = 0; |
152 |
Time delay = Seconds(0); |
| 156 |
if (phy != *iter) |
153 |
if (phy != *iter) |
| 157 |
{ |
154 |
{ |
| 158 |
if ((*iter)->GetMobility ()) |
155 |
double distance = 0; |
| 159 |
{ |
156 |
receiverMobility = (*iter)->GetDevice ()->GetNode ()->GetObject<MobilityModel> (); |
| 160 |
receiverMobility = (*iter)->GetMobility ()->GetObject<MobilityModel> (); |
|
|
| 161 |
} |
| 162 |
if (receiverMobility != 0 && senderMobility != 0 && m_loss != 0) |
157 |
if (receiverMobility != 0 && senderMobility != 0 && m_loss != 0) |
| 163 |
{ |
158 |
{ |
| 164 |
delay = (senderMobility->GetDistanceFrom (receiverMobility)) / 300000000LL; |
159 |
distance = senderMobility->GetDistanceFrom (receiverMobility); |
|
|
160 |
delay = Seconds(distance/300000000.0); |
| 165 |
rxPowerDbm = m_loss->CalcRxPower (rxPowerDbm, senderMobility, receiverMobility); |
161 |
rxPowerDbm = m_loss->CalcRxPower (rxPowerDbm, senderMobility, receiverMobility); |
| 166 |
} |
162 |
} |
| 167 |
simpleOfdmSendParam * param = new simpleOfdmSendParam (fecBlock, |
163 |
simpleOfdmSendParam * param = new simpleOfdmSendParam (fecBlock, |
|
|
| 183 |
dstNode = dstNetDevice->GetObject<NetDevice> ()->GetNode ()->GetId (); |
179 |
dstNode = dstNetDevice->GetObject<NetDevice> ()->GetNode ()->GetId (); |
| 184 |
} |
180 |
} |
| 185 |
Simulator::ScheduleWithContext (dstNode, |
181 |
Simulator::ScheduleWithContext (dstNode, |
| 186 |
Seconds (delay) + BlockTime, |
182 |
delay, |
| 187 |
&SimpleOfdmWimaxChannel::EndSend, |
183 |
&SimpleOfdmWimaxChannel::EndSend, |
| 188 |
this, |
184 |
this, |
| 189 |
*iter, |
185 |
*iter, |
|
|
| 196 |
void |
192 |
void |
| 197 |
SimpleOfdmWimaxChannel::EndSend (Ptr<SimpleOfdmWimaxPhy> rxphy, simpleOfdmSendParam * param) |
193 |
SimpleOfdmWimaxChannel::EndSend (Ptr<SimpleOfdmWimaxPhy> rxphy, simpleOfdmSendParam * param) |
| 198 |
{ |
194 |
{ |
| 199 |
// std::cout << "END_SEND "; |
|
|
| 200 |
rxphy->StartReceive (param->GetFecBlock (), |
195 |
rxphy->StartReceive (param->GetFecBlock (), |
| 201 |
param->GetBurstSize (), |
196 |
param->GetBurstSize (), |
| 202 |
param->GetIsFirstBlock (), |
197 |
param->GetIsFirstBlock (), |