mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-08 01:53:58 +02:00
add tests and fixups
This commit is contained in:
parent
5f01608c61
commit
c6bce1a882
6 changed files with 319 additions and 2 deletions
|
@ -62,12 +62,17 @@ LeoMockChannel::TransmitStart (Ptr<const Packet> p,
|
|||
NS_LOG_ERROR ("unable to find satellite with address " << dst);
|
||||
return false;
|
||||
}
|
||||
NS_LOG_DEBUG ("BOOOOM " << srcDev->GetAddress () << " -> " << dst);
|
||||
return Deliver (p, srcDev, it->second, txTime);
|
||||
}
|
||||
else
|
||||
// space to ground delivers to everything within the beam
|
||||
{
|
||||
DeviceIndex::iterator it = m_groundDevices.find (dst);
|
||||
if (it == m_groundDevices.end ())
|
||||
{
|
||||
NS_LOG_ERROR ("unable to find satellite with address " << dst);
|
||||
return false;
|
||||
}
|
||||
for (DeviceIndex::iterator it = m_groundDevices.begin ();
|
||||
it != m_groundDevices.end ();
|
||||
it++)
|
||||
|
|
51
model/leo-propagation-loss-model.cc
Normal file
51
model/leo-propagation-loss-model.cc
Normal file
|
@ -0,0 +1,51 @@
|
|||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
|
||||
#include "leo-propagation-loss-model.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("LeoPropagationLossModel");
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (LeoPropagationLossModel);
|
||||
|
||||
TypeId
|
||||
LeoPropagationLossModel::GetTypeId (void)
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::LeoPropagationLossModel")
|
||||
.SetParent<PropagationLossModel> ()
|
||||
.SetGroupName ("Leo")
|
||||
.AddConstructor<LeoPropagationLossModel> ()
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
LeoPropagationLossModel::LeoPropagationLossModel ()
|
||||
{
|
||||
}
|
||||
|
||||
LeoPropagationLossModel::~LeoPropagationLossModel ()
|
||||
{
|
||||
}
|
||||
|
||||
double
|
||||
LeoPropagationLossModel::DoCalcRxPower (double txPowerDbm,
|
||||
Ptr<MobilityModel> a,
|
||||
Ptr<MobilityModel> b) const
|
||||
{
|
||||
//Vector aPos = a->GetPosition ();
|
||||
//Vector bPos = b->GetPosition ();
|
||||
|
||||
// TODO perform line-earth intersection (ray tracing)
|
||||
|
||||
double rxc = 0;//-m_variable->GetValue ();
|
||||
NS_LOG_DEBUG ("attenuation coefficient="<<rxc<<"Db");
|
||||
return txPowerDbm + rxc;
|
||||
}
|
||||
|
||||
int64_t
|
||||
LeoPropagationLossModel::DoAssignStreams (int64_t stream)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
};
|
40
model/leo-propagation-loss-model.h
Normal file
40
model/leo-propagation-loss-model.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
|
||||
#ifndef LEO_PROPAGATION_LOSS_MODEL_H
|
||||
#define LEO_PROPAGATION_LOSS_MODEL_H
|
||||
|
||||
#include "leo-mobility-model.h"
|
||||
#include <ns3/object.h>
|
||||
#include <ns3/propagation-loss-model.h>
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
class LeoPropagationLossModel : public PropagationLossModel
|
||||
{
|
||||
public:
|
||||
static TypeId GetTypeId (void);
|
||||
LeoPropagationLossModel ();
|
||||
virtual ~LeoPropagationLossModel ();
|
||||
private:
|
||||
/**
|
||||
* Returns the Rx Power taking into account only the particular
|
||||
* PropagationLossModel.
|
||||
*
|
||||
* \param txPowerDbm current transmission power (in dBm)
|
||||
* \param a the mobility model of the source
|
||||
* \param b the mobility model of the destination
|
||||
* \returns the reception power after adding/multiplying propagation loss (in dBm)
|
||||
*/
|
||||
virtual double DoCalcRxPower (double txPowerDbm,
|
||||
Ptr<MobilityModel> a,
|
||||
Ptr<MobilityModel> b) const;
|
||||
/**
|
||||
* Subclasses must implement this; those not using random variables
|
||||
* can return zero
|
||||
*/
|
||||
virtual int64_t DoAssignStreams (int64_t stream);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SATELLITE_LEO_PROPAGATION_LOSS_MODEL_H */
|
Loading…
Add table
Add a link
Reference in a new issue