Repository polishment: remove old propagation related files and rename fading trace
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,122 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
*/
|
||||
|
||||
|
||||
#include <ns3/log.h>
|
||||
#include <ns3/simulator.h>
|
||||
#include "channel-realization.h"
|
||||
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("ChannelRealization");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (ChannelRealization);
|
||||
|
||||
ChannelRealization::ChannelRealization ()
|
||||
{
|
||||
m_shadowing = CreateObject<ShadowingLossModel> ();
|
||||
m_pathloss = CreateObject<PathLossModel> ();
|
||||
m_multipath = CreateObject<JakesFadingLossModel> ();
|
||||
m_penetration = CreateObject<PenetrationLossModel> ();
|
||||
}
|
||||
|
||||
|
||||
TypeId
|
||||
ChannelRealization::GetTypeId (void)
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::ChannelRealization")
|
||||
.SetParent<Object> ()
|
||||
.AddConstructor<ChannelRealization> ()
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
|
||||
ChannelRealization::~ChannelRealization ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ChannelRealization::SetJakesFadingLossModel (Ptr<JakesFadingLossModel> l)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_multipath = l;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ChannelRealization::SetPathLossModel (Ptr<PathLossModel> l)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << l);
|
||||
m_pathloss = l;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ChannelRealization::SetShadowingLossModel (Ptr<ShadowingLossModel> l)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << l);
|
||||
m_shadowing = l;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ChannelRealization::SetPenetrationLossModel (Ptr<PenetrationLossModel> l)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << l);
|
||||
m_penetration = l;
|
||||
}
|
||||
|
||||
|
||||
Ptr<JakesFadingLossModel>
|
||||
ChannelRealization::GetJakesFadingLossModel (void)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
return m_multipath;
|
||||
}
|
||||
|
||||
|
||||
Ptr<PathLossModel>
|
||||
ChannelRealization::GetPathLossModel (void)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
return m_pathloss;
|
||||
}
|
||||
|
||||
|
||||
Ptr<ShadowingLossModel>
|
||||
ChannelRealization::GetShadowingLossModel (void)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
return m_shadowing;
|
||||
}
|
||||
|
||||
|
||||
Ptr<PenetrationLossModel>
|
||||
ChannelRealization::GetPenetrationLossModel (void)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
return m_penetration;
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
@@ -1,109 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
*/
|
||||
|
||||
#ifndef CHANNEL_REALIZATION_H
|
||||
#define CHANNEL_REALIZATION_H
|
||||
|
||||
|
||||
#include <ns3/nstime.h>
|
||||
#include "ns3/object.h"
|
||||
#include "jakes-fading-loss-model.h"
|
||||
#include "path-loss-model.h"
|
||||
#include "shadowing-loss-model.h"
|
||||
#include "penetration-loss-model.h"
|
||||
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup lte
|
||||
*
|
||||
* \brief the ChannelRealization class implements a complete propagation model
|
||||
* used by the channel to compute the loss due to the propagation of the signal.
|
||||
* A ChannelRealization object is created for each couple of UE - eNB.
|
||||
*/
|
||||
class ChannelRealization : public Object
|
||||
{
|
||||
|
||||
public:
|
||||
ChannelRealization ();
|
||||
virtual ~ChannelRealization ();
|
||||
|
||||
static TypeId GetTypeId (void);
|
||||
|
||||
/**
|
||||
* \brief Set the multipath loss model
|
||||
* \param l the multipath loss model
|
||||
*/
|
||||
void SetJakesFadingLossModel (Ptr<JakesFadingLossModel> l);
|
||||
/**
|
||||
* \brief Set the path loss model
|
||||
* \param l the path loss model
|
||||
*/
|
||||
void SetPathLossModel (Ptr<PathLossModel> l);
|
||||
/**
|
||||
* \brief Set the shadowing loss model
|
||||
* \param l the shadowing loss model
|
||||
*/
|
||||
void SetShadowingLossModel (Ptr<ShadowingLossModel> l);
|
||||
/**
|
||||
* \brief Set the penetration loss model
|
||||
* \param l the penetration loss model
|
||||
*/
|
||||
void SetPenetrationLossModel (Ptr<PenetrationLossModel> l);
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the multipath loss model
|
||||
* \return the pointer to the multipath loss model
|
||||
*/
|
||||
Ptr<JakesFadingLossModel> GetJakesFadingLossModel (void);
|
||||
/**
|
||||
* \brief Get the path loss model
|
||||
* \return the pointer to the path loss model
|
||||
*/
|
||||
Ptr<PathLossModel> GetPathLossModel (void);
|
||||
/**
|
||||
* \brief Get the shadowing loss model
|
||||
* \return the pointer to the shadowing loss model
|
||||
*/
|
||||
Ptr<ShadowingLossModel> GetShadowingLossModel (void);
|
||||
/**
|
||||
* \brief Get the penetration loss model
|
||||
* \return the pointer to the penetration loss model
|
||||
*/
|
||||
Ptr<PenetrationLossModel> GetPenetrationLossModel (void);
|
||||
|
||||
|
||||
private:
|
||||
Ptr<ShadowingLossModel> m_shadowing;
|
||||
Ptr<PathLossModel> m_pathloss;
|
||||
Ptr<JakesFadingLossModel> m_multipath;
|
||||
Ptr<PenetrationLossModel> m_penetration;
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
#endif /* CHANNEL_REALIZATION_H */
|
||||
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
*/
|
||||
|
||||
|
||||
#include <ns3/log.h>
|
||||
#include <ns3/simulator.h>
|
||||
#include "discrete-time-loss-model.h"
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("DiscreteTimeLossModel");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (DiscreteTimeLossModel);
|
||||
|
||||
DiscreteTimeLossModel::DiscreteTimeLossModel ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
TypeId
|
||||
DiscreteTimeLossModel::GetTypeId (void)
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::DiscreteTimeLossModel")
|
||||
.SetParent<Object> ()
|
||||
.AddConstructor<DiscreteTimeLossModel> ()
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
|
||||
DiscreteTimeLossModel::~DiscreteTimeLossModel ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DiscreteTimeLossModel::SetLastUpdate (void)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_lastUpdate = Simulator::Now ();
|
||||
}
|
||||
|
||||
|
||||
Time
|
||||
DiscreteTimeLossModel::GetLastUpdate (void)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
return m_lastUpdate;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DiscreteTimeLossModel::SetSamplingPeriod (double sp)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << sp);
|
||||
m_samplingPeriod = sp;
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
DiscreteTimeLossModel::GetSamplingPeriod (void)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
return m_samplingPeriod;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
DiscreteTimeLossModel::NeedForUpdate (void)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
if (Simulator::Now ().GetSeconds () >= (GetLastUpdate ().GetSeconds () + GetSamplingPeriod ()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
@@ -1,94 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
*/
|
||||
|
||||
#ifndef DISCRETE_TIME_LOSS_MODEL_H
|
||||
#define DISCRETE_TIME_LOSS_MODEL_H
|
||||
|
||||
|
||||
#include <ns3/nstime.h>
|
||||
#include "ns3/object.h"
|
||||
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup lte
|
||||
*
|
||||
* \brief The DiscreteTimeLossModel class offers a basic implementation
|
||||
* for all propagation loss models used for LTE networks
|
||||
*/
|
||||
class DiscreteTimeLossModel : public Object
|
||||
{
|
||||
|
||||
public:
|
||||
DiscreteTimeLossModel ();
|
||||
virtual ~DiscreteTimeLossModel ();
|
||||
|
||||
static TypeId GetTypeId (void);
|
||||
|
||||
/**
|
||||
* \brief Set the time in which the model has been
|
||||
* updated.
|
||||
* Each model can be updated every Sampling interval. Every time
|
||||
* the model is updated, the variable m_lastUpdate will be set to
|
||||
* the current simulation time.
|
||||
*/
|
||||
void SetLastUpdate (void);
|
||||
|
||||
/**
|
||||
* \brief Get the time in which the model has been
|
||||
* updated
|
||||
*
|
||||
* \return the time instant in which the model have been updated
|
||||
*/
|
||||
Time GetLastUpdate (void);
|
||||
|
||||
/**
|
||||
* \brief Set the time interval every time the model
|
||||
* should be updated
|
||||
*
|
||||
* \param sp the time interval
|
||||
*/
|
||||
void SetSamplingPeriod (double sp);
|
||||
|
||||
/**
|
||||
* \brief Get the time interval every time the model
|
||||
* should be updated
|
||||
*
|
||||
* \return the time interval
|
||||
*/
|
||||
double GetSamplingPeriod (void);
|
||||
|
||||
/**
|
||||
* \brief Check if the model should be updated
|
||||
*/
|
||||
bool NeedForUpdate (void);
|
||||
|
||||
|
||||
private:
|
||||
Time m_lastUpdate;
|
||||
double m_samplingPeriod;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif /* DISCRETE_TIME_LOSS_MODEL_H */
|
||||
@@ -1,157 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
* Author: Marco Miozzo <marco.miozzo@cttc.es>
|
||||
* remove dependencies from Phy and Mobility models
|
||||
*/
|
||||
|
||||
#include <cmath>
|
||||
#include <ns3/log.h>
|
||||
#include "jakes-fading-loss-model.h"
|
||||
#include <ns3/simulator.h>
|
||||
#include <stdint.h>
|
||||
#include "stdlib.h"
|
||||
#include <ns3/mobility-model.h>
|
||||
#include <ns3/string.h>
|
||||
#include <ns3/double.h>
|
||||
#include <fstream>
|
||||
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("JakesFadingLossModel");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (JakesFadingLossModel);
|
||||
|
||||
JakesFadingLossModel::JakesFadingLossModel ()
|
||||
: m_traceLength (10.0),
|
||||
m_samplesNum (10000),
|
||||
m_windowSize (0.5),
|
||||
//m_startJakes (1, (m_traceLength-m_windowSize)*1000),
|
||||
m_rbNum (100)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
}
|
||||
|
||||
|
||||
TypeId
|
||||
JakesFadingLossModel::GetTypeId (void)
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::JakesFadingLossModel")
|
||||
.SetParent<Object> ()
|
||||
.AddConstructor<JakesFadingLossModel> ()
|
||||
.AddAttribute ("TraceFilename",
|
||||
"Name of file to load a trace from. By default, uses /JakesTraces/fading_trace_EPA_3kmph.fad",
|
||||
StringValue ("/home/mmiozzo/ns3/lena/ns-3-lena-pem/src/lte/model/JakesTraces/fading_trace_EPA_3kmph.fad"),
|
||||
MakeStringAccessor (&JakesFadingLossModel::m_traceFile),
|
||||
MakeStringChecker ())
|
||||
.AddAttribute ("TraceLength",
|
||||
"The total length of the fading trace (default value 10 s.)",
|
||||
TimeValue (Seconds (10.0)),
|
||||
MakeTimeAccessor (&JakesFadingLossModel::m_traceLength),
|
||||
MakeTimeChecker ())
|
||||
.AddAttribute ("SamplesNum",
|
||||
"The number of samples the trace is made of (default 10000)",
|
||||
DoubleValue (10000),
|
||||
MakeDoubleAccessor (&JakesFadingLossModel::m_samplesNum),
|
||||
MakeDoubleChecker<double> ())
|
||||
.AddAttribute ("WindowSize",
|
||||
"The size of the window for the fading trace (default value 0.5 s.)",
|
||||
TimeValue (Seconds (0.5)),
|
||||
MakeTimeAccessor (&JakesFadingLossModel::m_windowSize),
|
||||
MakeTimeChecker ())
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
|
||||
JakesFadingLossModel::~JakesFadingLossModel ()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
JakesFadingLossModel::LoadTrace (std::string filename)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << "Loading Fading Trace " << filename);
|
||||
std::ifstream ifTraceFile;
|
||||
ifTraceFile.open (filename.c_str (), std::ifstream::in);
|
||||
m_fadingTrace.clear ();
|
||||
if (!ifTraceFile.good ())
|
||||
{
|
||||
NS_LOG_ERROR (this << " Fading trace file not found");
|
||||
}
|
||||
|
||||
NS_LOG_INFO (this << " length " << m_traceLength);
|
||||
NS_LOG_INFO (this << " RB " << m_rbNum << " samples " << m_samplesNum);
|
||||
for (uint32_t i = 0; i < m_rbNum; i++)
|
||||
{
|
||||
FadingTraceSample rbTimeFadingTrace;
|
||||
for (uint32_t j = 0; j < m_samplesNum; j++)
|
||||
{
|
||||
double sample;
|
||||
ifTraceFile >> sample;
|
||||
rbTimeFadingTrace.push_back (sample);
|
||||
}
|
||||
m_fadingTrace.push_back (rbTimeFadingTrace);
|
||||
}
|
||||
ifTraceFile.close ();
|
||||
m_startJakes = new UniformVariable (1, (m_traceLength.GetSeconds () - m_windowSize.GetSeconds ()) * 1000.0);
|
||||
m_windowOffset = m_startJakes->GetValue ();
|
||||
}
|
||||
|
||||
|
||||
|
||||
double
|
||||
JakesFadingLossModel::GetValue (int subChannel, double speed)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << subChannel);
|
||||
NS_LOG_INFO (this << Simulator::Now ().GetSeconds () << " " << m_lastWindowUpdate.GetSeconds () << " " << m_windowSize.GetSeconds ());
|
||||
if (m_fadingTrace.empty ())
|
||||
{
|
||||
LoadTrace (m_traceFile);
|
||||
//SetLastUpdate ();
|
||||
m_lastWindowUpdate = Simulator::Now ();
|
||||
}
|
||||
//if (NeedForUpdate ())
|
||||
if (Simulator::Now ().GetSeconds () >= m_lastWindowUpdate.GetSeconds () + m_windowSize.GetSeconds ())
|
||||
{
|
||||
NS_LOG_INFO ("Fading Window Updated");
|
||||
//SetValue (speed);
|
||||
m_windowOffset = m_startJakes->GetValue ();
|
||||
//SetLastUpdate ();
|
||||
m_lastWindowUpdate = Simulator::Now ();
|
||||
}
|
||||
|
||||
int now_ms = static_cast<int> (Simulator::Now ().GetSeconds () * 1000);
|
||||
int lastUpdate_ms = static_cast<int> (m_lastWindowUpdate.GetSeconds () * 1000);
|
||||
NS_LOG_INFO (this << " offset " << m_windowOffset << " now " << now_ms << " lastUpd " << lastUpdate_ms);
|
||||
int index = m_windowOffset + now_ms - lastUpdate_ms;
|
||||
NS_LOG_INFO (this << "subchannel " << subChannel << " index " << index);
|
||||
|
||||
//NS_LOG_FUNCTION (this << subChannel << now_ms
|
||||
// << lastUpdate_ms << index << m_multipath.at (subChannel).at (index));
|
||||
NS_LOG_FUNCTION (this << subChannel << now_ms
|
||||
<< lastUpdate_ms << index << m_fadingTrace.at (subChannel).at (index));
|
||||
|
||||
return (m_fadingTrace.at (subChannel).at (index));
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace ns3
|
||||
@@ -1,97 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
* Author: Marco Miozzo <marco.miozzo@cttc.es>
|
||||
* remove dependencies from Phy and Mobility models
|
||||
*/
|
||||
|
||||
#ifndef MULTIPATH_LOSS_MODEL_H
|
||||
#define MULTIPATH_LOSS_MODEL_H
|
||||
|
||||
|
||||
//#include "discrete-time-loss-model.h"
|
||||
#include <ns3/object.h>
|
||||
#include <ns3/nstime.h>
|
||||
#include <list>
|
||||
#include <ns3/random-variable.h>
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
class LtePhy;
|
||||
|
||||
/**
|
||||
* \ingroup lte
|
||||
*
|
||||
* \brief JakesFadingLossModel class implements a loss model due to the fast fading.
|
||||
* In particular, the fast fading is modeled using a Jakes Model
|
||||
*/
|
||||
class JakesFadingLossModel : public Object
|
||||
{
|
||||
|
||||
public:
|
||||
JakesFadingLossModel ();
|
||||
virtual ~JakesFadingLossModel ();
|
||||
|
||||
static TypeId GetTypeId (void);
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the value for a particular sub channel and a given speed
|
||||
* \param subChannel the sub channel for which a value is requested
|
||||
* \param speed the relative speed of the two devices
|
||||
* \return the loss for a particular sub channel
|
||||
*/
|
||||
double GetValue (int subChannel, double speed);
|
||||
|
||||
private:
|
||||
|
||||
void LoadTrace (std::string filename);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Vector with fading samples in time domain (for a fixed RB)
|
||||
*/
|
||||
typedef std::vector<double> FadingTraceSample;
|
||||
/**
|
||||
* Vector collecting the time fading traces in the frequency domain (per RB)
|
||||
*/
|
||||
typedef std::vector<FadingTraceSample> FadingTrace;
|
||||
|
||||
|
||||
|
||||
std::string m_traceFile;
|
||||
|
||||
FadingTrace m_fadingTrace;
|
||||
|
||||
|
||||
Time m_traceLength;
|
||||
uint32_t m_samplesNum;
|
||||
Time m_windowSize;
|
||||
int m_windowOffset;
|
||||
|
||||
UniformVariable* m_startJakes;
|
||||
|
||||
uint8_t m_rbNum;
|
||||
Time m_lastWindowUpdate;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* MULTIPATH_LOSS_MODEL_H */
|
||||
@@ -1,47 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef MULTIPATH_H_
|
||||
#define MULTIPATH_H_
|
||||
|
||||
#include "JakesTraces/multipath_v0_M6.h"
|
||||
#include "JakesTraces/multipath_v0_M8.h"
|
||||
#include "JakesTraces/multipath_v0_M10.h"
|
||||
#include "JakesTraces/multipath_v0_M12.h"
|
||||
|
||||
#include "JakesTraces/multipath_v3_M6.h"
|
||||
#include "JakesTraces/multipath_v3_M8.h"
|
||||
#include "JakesTraces/multipath_v3_M10.h"
|
||||
#include "JakesTraces/multipath_v3_M12.h"
|
||||
|
||||
#include "JakesTraces/multipath_v30_M6.h"
|
||||
#include "JakesTraces/multipath_v30_M8.h"
|
||||
#include "JakesTraces/multipath_v30_M10.h"
|
||||
#include "JakesTraces/multipath_v30_M12.h"
|
||||
|
||||
#include "JakesTraces/multipath_v120_M6.h"
|
||||
#include "JakesTraces/multipath_v120_M8.h"
|
||||
#include "JakesTraces/multipath_v120_M10.h"
|
||||
#include "JakesTraces/multipath_v120_M12.h"
|
||||
|
||||
|
||||
#endif /* MULTIPATH_H_ */
|
||||
@@ -1,162 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
*/
|
||||
|
||||
|
||||
#include "lte-propagation-loss-model.h"
|
||||
#include <ns3/mobility-model.h>
|
||||
#include <ns3/spectrum-value.h>
|
||||
#include <ns3/log.h>
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("LtePropagationLossModel");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (LtePropagationLossModel);
|
||||
|
||||
LtePropagationLossModel::LtePropagationLossModel ()
|
||||
{
|
||||
SetNext (NULL);
|
||||
}
|
||||
|
||||
|
||||
LtePropagationLossModel::~LtePropagationLossModel ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
TypeId
|
||||
LtePropagationLossModel::GetTypeId (void)
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::LtePropagationLossModel")
|
||||
.SetParent<SpectrumPropagationLossModel> ()
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Ptr<SpectrumValue>
|
||||
LtePropagationLossModel::DoCalcRxPowerSpectralDensity (Ptr<const SpectrumValue> txPsd,
|
||||
Ptr<const MobilityModel> a,
|
||||
Ptr<const MobilityModel> b) const
|
||||
{
|
||||
NS_LOG_FUNCTION (this << *txPsd << a << b);
|
||||
/*
|
||||
* The loss propagation model for LTE networks is based on
|
||||
* a on a combination of four different models:
|
||||
* - the path loss
|
||||
* - the penetration loss
|
||||
* - the shadowind
|
||||
* - the multipath
|
||||
*
|
||||
* The rxPsd will be obtained considering, for each sub channel, the following
|
||||
* relations:
|
||||
* rxPsd (i) = txPsd (i) + m(i,t) - sh(i,t) - pnl(i,t) - pl (a,b);
|
||||
* where i is the i-th sub-channel and t is the current time (Simulator::Now()).
|
||||
*/
|
||||
|
||||
|
||||
Ptr<ChannelRealization> c = GetChannelRealization (a,b);
|
||||
|
||||
double multipath; // its value is different for each sub channels
|
||||
double pathLoss = c->GetPathLossModel ()->GetValue (a,b);
|
||||
double shadowind = c->GetShadowingLossModel ()->GetValue ();
|
||||
double penetration = c->GetPenetrationLossModel ()->GetValue ();
|
||||
|
||||
|
||||
Ptr<SpectrumValue> rxPsd = Copy<SpectrumValue> (txPsd);
|
||||
Values::iterator vit = rxPsd->ValuesBegin ();
|
||||
|
||||
Vector aSpeedVector = a->GetVelocity ();
|
||||
Vector bSpeedVector = b->GetVelocity ();
|
||||
|
||||
double speed = sqrt (pow (aSpeedVector.x-bSpeedVector.x,2) + pow (aSpeedVector.y-bSpeedVector.y,2));
|
||||
|
||||
NS_LOG_FUNCTION (this << *rxPsd);
|
||||
|
||||
int subChannel = 0;
|
||||
while (vit != rxPsd->ValuesEnd ())
|
||||
{
|
||||
NS_ASSERT (subChannel < 100);
|
||||
if (*vit != 0.)
|
||||
{
|
||||
multipath = c->GetJakesFadingLossModel ()->GetValue (subChannel, speed);
|
||||
|
||||
// computei PROPRAGATION LOSS:
|
||||
double loss = multipath - pathLoss - shadowind - penetration; // in dB
|
||||
|
||||
double power = *vit; // in Watt/Hz
|
||||
power = 10 * log10 (180000 * power); // in dB
|
||||
|
||||
NS_LOG_FUNCTION (this << subChannel << *vit << power << multipath
|
||||
<< pathLoss << shadowind << penetration);
|
||||
|
||||
*vit = pow (10., ((power + loss) / 10)) / 180000; // in Watt
|
||||
|
||||
NS_LOG_FUNCTION (this << subChannel << *vit);
|
||||
|
||||
}
|
||||
|
||||
++vit;
|
||||
++subChannel;
|
||||
|
||||
}
|
||||
|
||||
NS_LOG_FUNCTION (this << *rxPsd);
|
||||
return rxPsd;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LtePropagationLossModel::CreateChannelRealization (Ptr<const MobilityModel> enbMobility, Ptr<const MobilityModel> ueMobility)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << enbMobility << ueMobility);
|
||||
|
||||
Ptr<ChannelRealization> c = CreateObject<ChannelRealization> ();
|
||||
ChannelRealizationId_t mobilities = std::make_pair (enbMobility, ueMobility);
|
||||
|
||||
NS_LOG_FUNCTION (this <<
|
||||
"insert new channel realization, m_channelRealizationMap.size () = "
|
||||
<< m_channelRealizationMap.size ());
|
||||
|
||||
m_channelRealizationMap.insert ( std::pair<ChannelRealizationId_t,Ptr<ChannelRealization> > (mobilities, c) );
|
||||
|
||||
NS_LOG_FUNCTION (this <<
|
||||
"m_channelRealizationMap.size () = "
|
||||
<< m_channelRealizationMap.size ());
|
||||
|
||||
}
|
||||
|
||||
|
||||
Ptr<ChannelRealization>
|
||||
LtePropagationLossModel::GetChannelRealization (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b) const
|
||||
{
|
||||
|
||||
NS_LOG_FUNCTION (this << a << b);
|
||||
|
||||
std::map <ChannelRealizationId_t, Ptr<ChannelRealization> >::const_iterator it;
|
||||
|
||||
ChannelRealizationId_t mobilities = std::make_pair (a,b);
|
||||
it = m_channelRealizationMap.find (mobilities);
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
@@ -1,93 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef LTE_SPECTRUM_PROPAGATION_LOSS_MODEL_H
|
||||
#define LTE_SPECTRUM_PROPAGATION_LOSS_MODEL_H
|
||||
|
||||
|
||||
#include <ns3/object.h>
|
||||
#include <ns3/spectrum-propagation-loss-model.h>
|
||||
#include <map>
|
||||
#include "channel-realization.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
class MobilityModel;
|
||||
|
||||
/**
|
||||
* \ingroup lte
|
||||
*
|
||||
* \brief propagation loss model for LTE
|
||||
*/
|
||||
class LtePropagationLossModel : public SpectrumPropagationLossModel
|
||||
{
|
||||
public:
|
||||
LtePropagationLossModel ();
|
||||
virtual ~LtePropagationLossModel ();
|
||||
|
||||
static TypeId GetTypeId ();
|
||||
|
||||
/**
|
||||
* \brief The couple of mobility mnode that form a channel realization
|
||||
*/
|
||||
typedef std::pair<Ptr<const MobilityModel>, Ptr<const MobilityModel> > ChannelRealizationId_t;
|
||||
|
||||
/**
|
||||
* \brief Create a channel realization among two device
|
||||
* \param enbMobility mobility object of the enb
|
||||
* \param ueMobility mobility object of the ue
|
||||
*/
|
||||
void CreateChannelRealization (Ptr<const MobilityModel> enbMobility, Ptr<const MobilityModel> ueMobility);
|
||||
/**
|
||||
* \brief Get a channel realization among two device
|
||||
* \param a the mobility object of the enb
|
||||
* \param b the mobility object of the ue
|
||||
* \return the pointer to the channel realization
|
||||
*/
|
||||
Ptr<ChannelRealization> GetChannelRealization (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b) const;
|
||||
|
||||
private:
|
||||
/**
|
||||
* @param txPower set of values vs frequency representing the
|
||||
* transmission power. See SpectrumChannel for details.
|
||||
*
|
||||
* @param a sender mobility
|
||||
* @param b receiver mobility
|
||||
*
|
||||
* @return set of values vs frequency representing the received
|
||||
* power in the same units used for the txPower parameter.
|
||||
*/
|
||||
Ptr<SpectrumValue> DoCalcRxPowerSpectralDensity (Ptr<const SpectrumValue> txPsd,
|
||||
Ptr<const MobilityModel> a,
|
||||
Ptr<const MobilityModel> b) const;
|
||||
|
||||
std::map <ChannelRealizationId_t, Ptr<ChannelRealization> > m_channelRealizationMap;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
#endif /* LTE_SPECTRUM_PROPAGATION_LOSS_MODEL_H */
|
||||
@@ -1,86 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
*/
|
||||
|
||||
|
||||
#include <ns3/log.h>
|
||||
#include <cmath>
|
||||
#include "path-loss-model.h"
|
||||
#include <ns3/mobility-model.h>
|
||||
#include <ns3/vector.h>
|
||||
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("PathLossModel");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (PathLossModel);
|
||||
|
||||
PathLossModel::PathLossModel ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
SetLastUpdate ();
|
||||
SetSamplingPeriod (0.5); // defauld value
|
||||
m_pl = 0;
|
||||
}
|
||||
|
||||
|
||||
TypeId
|
||||
PathLossModel::GetTypeId (void)
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::PathLossModel")
|
||||
.SetParent<DiscreteTimeLossModel> ()
|
||||
.AddConstructor<PathLossModel> ()
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
|
||||
PathLossModel::~PathLossModel ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PathLossModel::SetValue (double pl)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << pl);
|
||||
m_pl = pl;
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
PathLossModel::GetValue (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << a << b);
|
||||
/*
|
||||
* According to --- insert standard 3gpp ---
|
||||
* the Path Loss Model For Urban Environment is
|
||||
* L = I + 37.6log10(R)
|
||||
* R, in kilometers, is the distance between two nodes
|
||||
* I = 128.1 at 2GHz
|
||||
*/
|
||||
double distance = CalculateDistance (a->GetPosition (), b->GetPosition ());
|
||||
SetValue (128.1 + (37.6 * log10 (distance * 0.001)));
|
||||
return m_pl;
|
||||
}
|
||||
|
||||
|
||||
} // namespace ns3
|
||||
@@ -1,67 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
*/
|
||||
|
||||
#ifndef PATH_LOSS_MODEL_H
|
||||
#define PATH_LOSS_MODEL_H
|
||||
|
||||
|
||||
#include "discrete-time-loss-model.h"
|
||||
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
class MobilityModel;
|
||||
|
||||
/**
|
||||
* \ingroup lte
|
||||
*
|
||||
* \brief This class models the propagation loss model due to the path loss
|
||||
*/
|
||||
class PathLossModel : public DiscreteTimeLossModel
|
||||
{
|
||||
|
||||
public:
|
||||
PathLossModel ();
|
||||
virtual ~PathLossModel ();
|
||||
|
||||
static TypeId GetTypeId (void);
|
||||
|
||||
/**
|
||||
* Set the value of the path loss model, expressed in dB
|
||||
* \param pl the path loss value
|
||||
*/
|
||||
void SetValue (double pl);
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of the path loss model, expressed in dB
|
||||
* \param a sender mobility
|
||||
* \param b receiver mobility
|
||||
* \return the value of the path loss
|
||||
*/
|
||||
double GetValue (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b);
|
||||
|
||||
private:
|
||||
double m_pl;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* PATH_LOSS_MODEL_H */
|
||||
@@ -1,74 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
*/
|
||||
|
||||
|
||||
#include <ns3/log.h>
|
||||
#include "penetration-loss-model.h"
|
||||
#include <ns3/simulator.h>
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("PenetrationLossModel");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (PenetrationLossModel);
|
||||
|
||||
PenetrationLossModel::PenetrationLossModel ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
SetLastUpdate ();
|
||||
SetSamplingPeriod (0.5); // defauld value
|
||||
m_pnl = 10;
|
||||
}
|
||||
|
||||
|
||||
TypeId
|
||||
PenetrationLossModel::GetTypeId (void)
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::PenetrationLossModel")
|
||||
.SetParent<DiscreteTimeLossModel> ()
|
||||
.AddConstructor<PenetrationLossModel> ()
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
|
||||
PenetrationLossModel::~PenetrationLossModel ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PenetrationLossModel::SetValue (double pnl)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << pnl);
|
||||
m_pnl = pnl;
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
PenetrationLossModel::GetValue (void)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
return m_pnl;
|
||||
}
|
||||
|
||||
|
||||
} // namespace ns3
|
||||
@@ -1,62 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
*/
|
||||
|
||||
#ifndef PENETRATION_LOSS_MODEL_H
|
||||
#define PENETRATION_LOSS_MODEL_H
|
||||
|
||||
|
||||
#include "discrete-time-loss-model.h"
|
||||
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \ingroup lte
|
||||
*
|
||||
* \brief This class models the propagation loss model due to the penetration loss
|
||||
*/
|
||||
class PenetrationLossModel : public DiscreteTimeLossModel
|
||||
{
|
||||
|
||||
public:
|
||||
PenetrationLossModel ();
|
||||
virtual ~PenetrationLossModel ();
|
||||
|
||||
static TypeId GetTypeId (void);
|
||||
|
||||
/**
|
||||
* Set the value of the penetration loss model, expressed in dB
|
||||
* \param pnl the penetration loss value
|
||||
*/
|
||||
void SetValue (double pnl);
|
||||
|
||||
/**
|
||||
* Get the value of the penetration loss model, expressed in dB
|
||||
* \return the value of the penetration loss model
|
||||
*/
|
||||
double GetValue (void);
|
||||
|
||||
private:
|
||||
double m_pnl;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* PENETRATION_LOSS_MODEL_H */
|
||||
@@ -1,89 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
*/
|
||||
|
||||
|
||||
#include <ns3/log.h>
|
||||
#include "shadowing-loss-model.h"
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("ShadowingLossModel");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (ShadowingLossModel);
|
||||
|
||||
ShadowingLossModel::ShadowingLossModel ()
|
||||
: m_randVariable (.0, 8.)
|
||||
{
|
||||
SetValue (m_randVariable.GetValue ());
|
||||
SetLastUpdate ();
|
||||
SetSamplingPeriod (0.5); // defauld value
|
||||
}
|
||||
|
||||
|
||||
ShadowingLossModel::ShadowingLossModel (double mu, double sigma, double samplingPeriod)
|
||||
: m_randVariable (mu, sigma)
|
||||
{
|
||||
SetValue (m_randVariable.GetValue ());
|
||||
SetLastUpdate ();
|
||||
SetSamplingPeriod (samplingPeriod); // defauld value
|
||||
}
|
||||
|
||||
|
||||
TypeId
|
||||
ShadowingLossModel::GetTypeId (void)
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::ShadowingLossModel")
|
||||
.SetParent<DiscreteTimeLossModel> ()
|
||||
.AddConstructor<ShadowingLossModel> ()
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
|
||||
ShadowingLossModel::~ShadowingLossModel ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ShadowingLossModel::SetValue (double sh)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << sh);
|
||||
m_shadowingValue = sh;
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
ShadowingLossModel::GetValue (void)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
if (NeedForUpdate ())
|
||||
{
|
||||
double sh = m_randVariable.GetValue ();
|
||||
SetValue (sh);
|
||||
SetLastUpdate ();
|
||||
}
|
||||
|
||||
return 0; // m_shadowingValue; XXX: LogNormalVariable doeas not work correctly
|
||||
}
|
||||
|
||||
|
||||
} // namespace ns3
|
||||
@@ -1,73 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
*/
|
||||
|
||||
#ifndef SHADOWING_LOSS_MODEL_H
|
||||
#define SHADOWING_LOSS_MODEL_H
|
||||
|
||||
|
||||
#include "discrete-time-loss-model.h"
|
||||
#include <ns3/random-variable.h>
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup lte
|
||||
*
|
||||
* \brief This class models the propagation loss model due to the shadowing
|
||||
*/
|
||||
class ShadowingLossModel : public DiscreteTimeLossModel
|
||||
{
|
||||
|
||||
public:
|
||||
ShadowingLossModel ();
|
||||
|
||||
/**
|
||||
* \param mu mu parameter of the lognormal distribution
|
||||
* \param sigma sigma parameter of the lognormal distribution
|
||||
* \param samplingPeriod the interval every time the model should be updated
|
||||
*/
|
||||
ShadowingLossModel (double mu, double sigma, double samplingPeriod);
|
||||
|
||||
virtual ~ShadowingLossModel ();
|
||||
|
||||
static TypeId GetTypeId (void);
|
||||
|
||||
/**
|
||||
* Set the value of the shadowing loss model, expressed in dB
|
||||
* \param sh the shadowing loss value
|
||||
*/
|
||||
void SetValue (double sh);
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of the shadowing loss model, expressed in dB
|
||||
* \return the value of the shadowing loss model
|
||||
*/
|
||||
double GetValue (void);
|
||||
|
||||
private:
|
||||
LogNormalVariable m_randVariable;
|
||||
double m_shadowingValue;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SHADOWING_LOSS_MODEL_H */
|
||||
@@ -10,13 +10,6 @@ def build(bld):
|
||||
'model/lte-enb-phy.cc',
|
||||
'model/lte-ue-phy.cc',
|
||||
'model/lte-spectrum-value-helper.cc',
|
||||
'model/lte-propagation-loss-model.cc',
|
||||
'model/discrete-time-loss-model.cc',
|
||||
'model/penetration-loss-model.cc',
|
||||
'model/shadowing-loss-model.cc',
|
||||
'model/path-loss-model.cc',
|
||||
'model/jakes-fading-loss-model.cc',
|
||||
'model/channel-realization.cc',
|
||||
'model/lte-amc.cc',
|
||||
'model/lte-enb-rrc.cc',
|
||||
'model/lte-ue-rrc.cc',
|
||||
@@ -75,13 +68,6 @@ def build(bld):
|
||||
'model/lte-enb-phy.h',
|
||||
'model/lte-ue-phy.h',
|
||||
'model/lte-spectrum-value-helper.h',
|
||||
'model/lte-propagation-loss-model.h',
|
||||
'model/discrete-time-loss-model.h',
|
||||
'model/penetration-loss-model.h',
|
||||
'model/shadowing-loss-model.h',
|
||||
'model/path-loss-model.h',
|
||||
'model/jakes-fading-loss-model.h',
|
||||
'model/channel-realization.h',
|
||||
'model/lte-amc.h',
|
||||
'model/lte-enb-rrc.h',
|
||||
'model/lte-ue-rrc.h',
|
||||
|
||||
Reference in New Issue
Block a user