View | Details | Raw Unified | Return to bug 866
Collapse All | Expand All

(-)a/examples/wimax/wimax-multicast.cc (-2 / +2 lines)
 Lines 150-156    Link Here 
150
  BSPosition = CreateObject<ConstantPositionMobilityModel> ();
150
  BSPosition = CreateObject<ConstantPositionMobilityModel> ();
151
151
152
  BSPosition->SetPosition (Vector (1000, 0, 0));
152
  BSPosition->SetPosition (Vector (1000, 0, 0));
153
  dev->GetPhy ()->SetMobility (BSPosition);
153
  bsNodes.Get (0)->AggregateObject (BSPosition);
154
  bsDevs.Add (dev);
154
  bsDevs.Add (dev);
155
  if (verbose)
155
  if (verbose)
156
    {
156
    {
 Lines 169-175    Link Here 
169
169
170
      ss[i] = ssDevs.Get (i)->GetObject<SubscriberStationNetDevice> ();
170
      ss[i] = ssDevs.Get (i)->GetObject<SubscriberStationNetDevice> ();
171
      ss[i]->SetModulationType (WimaxPhy::MODULATION_TYPE_QAM16_12);
171
      ss[i]->SetModulationType (WimaxPhy::MODULATION_TYPE_QAM16_12);
172
      ss[i]->GetPhy ()->SetMobility (SSPosition[i]);
172
      ssNodes.Get (i)->AggregateObject (SSPosition[i]);
173
173
174
    }
174
    }
175
175
(-)a/src/devices/wimax/simple-ofdm-wimax-channel.cc (-12 / +7 lines)
 Lines 145-167    Link Here 
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,
 Lines 183-189    Link Here 
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,
 Lines 196-202    Link Here 
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 (),
(-)a/src/devices/wimax/simple-ofdm-wimax-phy.cc (-7 / +2 lines)
 Lines 311-322    Link Here 
311
    }
311
    }
312
  else
312
  else
313
    {
313
    {
314
      Simulator::Schedule (Seconds (0),
314
      StartSendFecBlock(false,modulationType,direction);
315
                           &SimpleOfdmWimaxPhy::StartSendFecBlock,
316
                           this,
317
                           false,
318
                           modulationType,
319
                           direction);
320
    }
315
    }
321
}
316
}
322
317
 Lines 392-398    Link Here 
392
              SetBlockParameters (burstSize, modulationType);
387
              SetBlockParameters (burstSize, modulationType);
393
              m_blockTime = GetBlockTransmissionTime (modulationType);
388
              m_blockTime = GetBlockTransmissionTime (modulationType);
394
            }
389
            }
395
          Simulator::Schedule (Seconds (0),
390
          Simulator::Schedule (m_blockTime,
396
                               &SimpleOfdmWimaxPhy::EndReceiveFecBlock,
391
                               &SimpleOfdmWimaxPhy::EndReceiveFecBlock,
397
                               this,
392
                               this,
398
                               fecBlock,
393
                               fecBlock,

Return to bug 866