D2dChannelModel.h Source File

Simu5G: D2dChannelModel.h Source File
Simu5G
D2dChannelModel.h
1//
2// Simu5G
3//
4// Copyright (C) 2012-2021 Giovanni Nardini, Giovanni Stea, Antonio Virdis et al. (University of Pisa)
5// Copyright (C) 2022-2026 Giovanni Nardini, Giovanni Stea et al. (University of Pisa)
6//
7// This file is part of a software released under the license included in file
8// "license.pdf". Please read LICENSE and README files before using it.
9// The above files and the present reference are part of the software itself,
10// and cannot be removed from it.
11//
12
13#ifndef STACK_D2D_PHY_CHANNELMODEL_D2DCHANNELMODEL_H_
14#define STACK_D2D_PHY_CHANNELMODEL_D2DCHANNELMODEL_H_
15
16#include "simu5g/stack/d2d/phy/channelmodel/ID2dChannelModel.h"
17#include "simu5g/stack/phy/channelmodel/StochasticChannelModel.h"
18
19namespace simu5g {
20
21using namespace inet;
22using namespace omnetpp;
23
32class D2dChannelModel : public StochasticChannelModel, public ID2dChannelModel
33{
34 protected:
35 // enable/disable the interference computation for D2D connections
36 bool enableD2DInterference_ = false;
37
38 // Interned in initialize() rather than registered by a static initializer, so that
39 // linking the D2D package in cannot shift the signal ids the core assigns. See the
40 // "Signals" note in D2dUeMacBase.h.
41 simsignal_t rcvdSinrD2DSignal_ = SIMSIGNAL_NULL;
42
43 /*
44 * Build the RadioLink for a UE-to-UE transmission, so that the core
45 * propagation path can evaluate it. Both endpoints being UEs is the whole of
46 * what makes a D2D link different: same antenna gain on both sides, the UE
47 * noise figure, and no sectorial antenna (hence no angular attenuation).
48 */
49 RadioLink d2dLink(MacNodeId srcId, inet::Coord srcCoord, MacNodeId destId, inet::Coord destCoord, bool useUeSideMaps);
50
51 /*
52 * Compute interference coming from neighboring UEs for the D2D/D2D_MULTI direction
53 */
54 bool computeD2DInterference(MacNodeId eNbId, MacNodeId senderId, inet::Coord senderCoord, MacNodeId destId, inet::Coord destCoord, bool isCqi, GHz carrierFrequency, std::vector<double> *interference, Direction dir);
55
56 // Route D2D/D2D_MULTI receptions through getSINR_D2D (called from the core
57 // isReceptionSuccessful()).
58 std::vector<double> getReceptionSinr(LteAirFrame *frame, UserControlInfo *lteInfo, const std::vector<double>& rsrpVector) override;
59
60 // Report D2D receptions under rcvdSinrD2D rather than letting them fall into
61 // the core's uplink statistic.
62 void emitRcvdSinr(Direction dir, MacNodeId ueId, GHz carrierFrequency, double sinr) override;
63
64 // Substitute the UE-to-UE interference for the cellular contributions.
65 void computeInterferencePlusNoise(const RadioLink& link, UserControlInfo *lteInfo,
66 RbMap& rbmap, double totN, std::vector<double>& den) override;
67
68 public:
69 void initialize(int stage) override;
70
71 // ---- ID2dChannelModel ----
72 std::vector<double> getRSRP_D2D(LteAirFrame *frame, UserControlInfo *lteInfo_1, MacNodeId destId, inet::Coord destCoord) override;
73 std::vector<double> getSINR_D2D(LteAirFrame *frame, UserControlInfo *lteInfo, MacNodeId destId, inet::Coord destCoord, MacNodeId enbId = NODEID_NONE) override;
74 std::vector<double> getSINR_D2D(LteAirFrame *frame, UserControlInfo *lteInfo_1, MacNodeId destId, inet::Coord destCoord, MacNodeId enbId, const std::vector<double>& rsrpVector) override;
75
76 virtual bool isD2DInterferenceEnabled() { return enableD2DInterference_; }
77 bool recordsUlTransmissionMap() override { return isUplinkInterferenceEnabled() || enableD2DInterference_; }
78};
79
80} //namespace
81
82#endif /* STACK_D2D_PHY_CHANNELMODEL_D2DCHANNELMODEL_H_ */
Definition D2dChannelModel.h:33
bool recordsUlTransmissionMap() override
Definition D2dChannelModel.h:77
Definition StochasticChannelModel.h:74
Definition AlertReceiver.h:24
std::map< Remote, std::map< Band, unsigned int > > RbMap
Definition LteTypes.h:145
constexpr MacNodeId NODEID_NONE
MAC node ID.
Definition LteTypes.h:54