/usr/include/ns3.27/ns3/lte-ue-power-control.h is in libns3-dev 3.27+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 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | /* -*- 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 ();
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
// inherited from Object
virtual void DoInitialize (void);
virtual void DoDispose (void);
/**
* \brief Set PC maximum function
*
* \param value the PC maximum value
*/
void SetPcmax (double value);
/**
* \brief Get PC maximum function
*
* \returns the PC maximum value
*/
double GetPcmax ();
/**
* \brief Set transmit power function
*
* \param value the transmit power value
*/
void SetTxPower (double value);
/**
* \brief Configure reference signal power function
*
* \param referenceSignalPower the reference signal power
*/
void ConfigureReferenceSignalPower (int8_t referenceSignalPower);
/**
* \brief Set the cell ID function
*
* \param cellId the cell ID
*/
void SetCellId (uint16_t cellId);
/**
* \brief Set the RNTI function
*
* \param rnti the RNTI
*/
void SetRnti (uint16_t rnti);
/**
* \brief Set PO nominal PUSCH function
*
* \param value the value to set
*/
void SetPoNominalPusch (int16_t value);
/**
* \brief Set PO UE PUSCH function
*
* \param value the value to set
*/
void SetPoUePusch (int16_t value);
/**
* \brief Set alpha function
*
* \param value the alpha value to set
*/
void SetAlpha (double value);
/**
* \brief Set RSRP function
*
* \param value the RSRP value to set
*/
void SetRsrp (double value);
/**
* \brief Set RSRP function
*
* \param tpc the TPC to report
*/
void ReportTpc (uint8_t tpc);
/// Calculate PUSCH transmit power function
void CalculatePuschTxPower ();
/// Calculate PUCCH transmit power function
void CalculatePucchTxPower ();
/// Calculate SRS transmit power function
void CalculateSrsTxPower ();
/**
* \brief Get PUSCH transmit power function
*
* \param rb the DL RB list
* \returns the PUSCH transmit power
*/
double GetPuschTxPower (std::vector <int> rb);
/**
* \brief Get PUCCH transmit power function
*
* \param rb unused
* \returns the PUCCH transmit power
*/
double GetPucchTxPower (std::vector <int> rb);
/**
* \brief Get SRS transmit power function
*
* \param rb the DL RB list
* \returns the SRS transmit power
*/
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:
/**
* Set subchannel mask function
*
* \param [in] mask the subchannel mask
*/
void SetSubChannelMask (std::vector <int> mask);
double m_txPower; ///< transmit power
double m_Pcmax; ///< PC maximum
double m_Pcmin; ///< PC minimum
double m_curPuschTxPower; ///< current PUSCH transmit power
double m_curPucchTxPower; ///< current PUCCH transmit power
double m_curSrsTxPower; ///< current SRS transmit power
double m_referenceSignalPower; ///< reference signal power
bool m_rsrpSet; ///< is RSRP set?
double m_rsrp; ///< RSRP value
std::vector<int16_t> m_PoNominalPusch; ///< PO nominal PUSCH
std::vector<int16_t> m_PoUePusch; ///< PO US PUSCH
int16_t m_PsrsOffset; ///< PSRS offset
uint16_t m_M_Pusch; ///< size of DL RB list
std::vector<double> m_alpha; ///< alpha values
double m_pathLoss; ///< path loss value
double m_deltaTF; ///< delta TF
std::vector<int8_t> m_deltaPusch; ///< delta PUSCH
double m_fc; ///< FC
uint16_t m_srsBandwidth; ///< SRS bandwidth
bool m_closedLoop; ///< is closed loop
bool m_accumulationEnabled; ///< accumulation enabled
uint16_t m_cellId; ///< cell ID
uint16_t m_rnti; ///< RNTI
/**
* Trace information regarding Uplink TxPower
* uint16_t cellId, uint16_t rnti, double txPower
*/
TracedCallback<uint16_t, uint16_t, double> m_reportPuschTxPower;
/**
* Trace information regarding Uplink TxPower
* uint16_t cellId, uint16_t rnti, double txPower
*/
TracedCallback<uint16_t, uint16_t, double> m_reportPucchTxPower;
/**
* Trace information regarding Uplink TxPower
* uint16_t cellId, uint16_t rnti, double txPower
*/
TracedCallback<uint16_t, uint16_t, double> m_reportSrsTxPower;
};
}
#endif /* LTE_UE_POWER_CONTROL_H */
|