/usr/include/ns3.26/ns3/lte-ue-power-control.h is in libns3-dev 3.26+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014 Piotr Gawlowicz
*
* 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: Piotr Gawlowicz <gawlowicz.p@gmail.com>
*
*/
#ifndef LTE_UE_POWER_CONTROL_H
#define LTE_UE_POWER_CONTROL_H
#include <ns3/ptr.h>
#include <ns3/traced-callback.h>
#include <ns3/object.h>
#include <vector>
namespace ns3 {
/**
* \brief This class realizes Uplink Power Control functionality
*
* When LteUePhy is about sending PUSCH/PUCCH/SRS it should ask
* LteUePowerControl for current channel TX power level and then
* use it while creating SpectrumValue for Uplink Transmission
*
* LteUePowerControl computes TX power level for PUSCH and SRS.
* PUCCH is realized in ideal way and PUSCH do not use any resources,
* so there is no need to compute power for that channel
*
* LteUePowerControlcomputes TX power based on some preconfigured
* parameters and current Path-loss. Path-loss is computed as difference
* between current RSRP and referenceSignalPower level. Current RSRP
* is passed to LteUePowerControl by LteUePhy. referenceSignalPower is
* configurable by attribute system
*
* Moreover, LteUePhy pass all received TPC values to LteUePowerControl,
* what is a part of Closed Loop Power Control functionality
*/
class LteUePowerControl : public Object
{
public:
LteUePowerControl ();
virtual ~LteUePowerControl ();
// inherited from Object
static TypeId GetTypeId (void);
virtual void DoInitialize (void);
virtual void DoDispose (void);
void SetPcmax (double value);
double GetPcmax ();
void SetTxPower (double value);
void ConfigureReferenceSignalPower (int8_t referenceSignalPower);
void SetCellId (uint16_t cellId);
void SetRnti (uint16_t rnti);
void SetPoNominalPusch (int16_t value);
void SetPoUePusch (int16_t value);
void SetAlpha (double value);
void SetRsrp (double value);
void ReportTpc (uint8_t tpc);
void CalculatePuschTxPower ();
void CalculatePucchTxPower ();
void CalculateSrsTxPower ();
double GetPuschTxPower (std::vector <int> rb);
double GetPucchTxPower (std::vector <int> rb);
double GetSrsTxPower (std::vector <int> rb);
/**
* TracedCallback signature for uplink transmit power.
*
* \param [in] cellId Cell identifier.
* \param [in] rnti The C-RNTI identifying the UE.
* \param [in] power The current TX power.
*/
typedef void (* TxPowerTracedCallback)
(uint16_t cellId, uint16_t rnti, double power);
private:
void SetSubChannelMask (std::vector <int> mask);
double m_txPower;
double m_Pcmax;
double m_Pcmin;
double m_curPuschTxPower;
double m_curPucchTxPower;
double m_curSrsTxPower;
double m_referenceSignalPower;
bool m_rsrpSet;
double m_rsrp;
std::vector<int16_t> m_PoNominalPusch;
std::vector<int16_t> m_PoUePusch;
int16_t m_PsrsOffset;
uint16_t m_M_Pusch;
std::vector<double> m_alpha;
double m_pathLoss;
double m_deltaTF;
std::vector<int8_t> m_deltaPusch;
double m_fc;
uint16_t m_srsBandwidth;
bool m_closedLoop;
bool m_accumulationEnabled;
uint16_t m_cellId;
uint16_t m_rnti;
/**
* Trace information regarding Uplink TxPower
* uint16_t cellId, uint16_t rnti, double txPower
*/
TracedCallback<uint16_t, uint16_t, double> m_reportPuschTxPower;
TracedCallback<uint16_t, uint16_t, double> m_reportPucchTxPower;
TracedCallback<uint16_t, uint16_t, double> m_reportSrsTxPower;
};
}
#endif /* LTE_UE_POWER_CONTROL_H */
|