diff --git a/README.md b/README.md index 3158b3e054..495a36ff79 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,9 @@ The mmWave module for ns-3 can be used to simulate 5G cellular networks at mmWav * Simulation of core network elements (with also the MME as a real node) +A seperate module is being developed for [mmWave UE Energy Consumption](https://github.com/arghasen10/mmwave-energy "mmwave-energy"). You can use this module for analyzing +Energy Consumption behaviour of mmwave UE. Check this repository for further details. + The following papers describe in detail the features implemented in the mmWave module: - [End-to-End Simulation of 5G mmWave Networks](https://ieeexplore.ieee.org/document/8344116/ "comst paper") is a comprehensive tutorial with a detailed description of the whole module. We advise the researchers interested in this module to start reading from this paper; diff --git a/src/mmwave/model/mmwave-spectrum-phy.cc b/src/mmwave/model/mmwave-spectrum-phy.cc index 1c98bd3e85..f64959880f 100644 --- a/src/mmwave/model/mmwave-spectrum-phy.cc +++ b/src/mmwave/model/mmwave-spectrum-phy.cc @@ -30,6 +30,9 @@ * * Modified by: Tommaso Zugno * Integration of Carrier Aggregation +* +* Modified by: Argha Sen +* MmWave Radio Energy Model */ @@ -125,6 +128,10 @@ MmWaveSpectrumPhy::GetTypeId (void) "The no. of packets received and transmitted by the User Device", MakeTraceSourceAccessor (&MmWaveSpectrumPhy::m_rxPacketTraceUe), "ns3::UeTxRxPacketCount::TracedCallback") + .AddTraceSource ("State", + "State Value to trace", + MakeTraceSourceAccessor (&MmWaveSpectrumPhy::m_intstate), + "ns3::TracedValueCallback::Int32") .AddAttribute ("DataErrorModelEnabled", "Activate/Deactivate the error model of data (TBs of PDSCH and PUSCH) [by default is active].", BooleanValue (true), @@ -245,6 +252,21 @@ MmWaveSpectrumPhy::ChangeState (State newState) { NS_LOG_LOGIC (this << " state: " << m_state << " -> " << newState); m_state = newState; + switch (newState) + { + case IDLE: + m_intstate = 0; + break; + case TX: + m_intstate = 1; + break; + case RX_DATA: + m_intstate = 2; + break; + case RX_CTRL: + m_intstate = 3; + break; + } } diff --git a/src/mmwave/model/mmwave-spectrum-phy.h b/src/mmwave/model/mmwave-spectrum-phy.h index 245c3abf19..b6633b9c8d 100644 --- a/src/mmwave/model/mmwave-spectrum-phy.h +++ b/src/mmwave/model/mmwave-spectrum-phy.h @@ -30,6 +30,8 @@ * * Modified by: Tommaso Zugno * Integration of Carrier Aggregation +* Modified by: Argha Sen +* MmWave Radio Energy Model */ @@ -57,6 +59,8 @@ #include "mmwave-control-messages.h" #include "mmwave-harq-phy.h" #include "ns3/mmwave-beamforming-model.h" +#include "ns3/traced-value.h" +#include "ns3/trace-source-accessor.h" namespace ns3 { @@ -111,6 +115,7 @@ class MmWaveSpectrumPhy : public SpectrumPhy RX_CTRL }; + TracedValue m_intstate; static TypeId GetTypeId (void); virtual void DoDispose () override;