Skip to content

Commit 53861fe

Browse files
committed
mimo: Remove leftover intuniform() calls, and update fingerprints
Those calles were left there by the previous commits, to preserve simulation fingerprints. This step affects RNG stream usage, and thus changes the simulations' trajectories (and thus fingerprints).
1 parent 037e26e commit 53861fe

6 files changed

Lines changed: 118 additions & 141 deletions

File tree

src/simu5g/common/cellInfo/CellInfo.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ void CellInfo::detachUser(MacNodeId nodeId)
104104

105105
void CellInfo::attachUser(MacNodeId nodeId)
106106
{
107-
intuniform(0, binder_->phyPisaData.maxChannel() - 1); // consume random number to keep fingerprint
108-
// add UE to cellInfo structures (simplified - MIMO functionality removed)
109107
}
110108

111109
unsigned int CellInfo::getNumBands()

src/simu5g/stack/mac/LteMacUeD2D.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,6 @@ UserTxParams *LteMacUeD2D::getPreconfiguredTxParams()
775775
txParams->writeTxMode(TRANSMIT_DIVERSITY);
776776
Rank ri = 1; // rank for TxD is one
777777
txParams->writeRank(ri);
778-
intuniform(1, pow(ri, (double)2)); // consume random number
779778

780779
Cqi cqi = par("d2dCqi");
781780
if (cqi < 0 || cqi > 15) {

src/simu5g/stack/mac/amc/AmcPilotD2D.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ void AmcPilotD2D::setPreconfiguredTxParams(Cqi cqi)
2525
preconfiguredTxParams_->writeTxMode(TRANSMIT_DIVERSITY);
2626
Rank ri = 1; // rank for TxD is one
2727
preconfiguredTxParams_->writeRank(ri);
28-
intuniform(getEnvir()->getRNG(0), 1, pow(ri, (double)2)); // consume random number
2928

3029
if (cqi < 0 || cqi > 15)
3130
throw cRuntimeError("AmcPilotD2D::setPreconfiguredTxParams - CQI %hu is not a valid value", cqi);

src/simu5g/stack/phy/LtePhyUe.cc

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,8 @@ void LtePhyUe::initialize(int stage)
119119
}
120120
else if (stage == INITSTAGE_SIMU5G_CELLINFO_CHANNELUPDATE) { //TODO being fwd, eliminate stage
121121
// get cellInfo at this stage because the next hop of the node is registered in the Ip2Nic module at the INITSTAGE_SIMU5G_NETWORK_LAYER
122-
if (masterId_ != NODEID_NONE) {
122+
if (masterId_ != NODEID_NONE)
123123
cellInfo_ = binder_->getCellInfoByNodeId(nodeId_);
124-
intuniform(0, binder_->phyPisaData.maxChannel() - 1);
125-
if (cellInfo_ != nullptr) {
126-
intuniform(1, binder_->phyPisaData.maxChannel2()); // RNG call to preserve fingerprint
127-
}
128-
}
129124
else
130125
cellInfo_ = nullptr;
131126
}
@@ -370,16 +365,9 @@ void LtePhyUe::doHandover()
370365
cellInfo_->detachUser(nodeId_);
371366

372367
if (masterId_ != NODEID_NONE) {
373-
CellInfo *oldCellInfo = cellInfo_;
374368
LteMacEnb *newMacEnb = check_and_cast<LteMacEnb *>(binder_->getMacByNodeId(masterId_));
375-
CellInfo *newCellInfo = newMacEnb->getCellInfo();
376-
newCellInfo->attachUser(nodeId_);
377-
cellInfo_ = newCellInfo;
378-
if (oldCellInfo == nullptr) {
379-
// first time the UE is attached to someone
380-
intuniform(0, binder_->phyPisaData.maxChannel() - 1);
381-
intuniform(1, binder_->phyPisaData.maxChannel2()); // RNG call to preserve fingerprint
382-
}
369+
cellInfo_ = newMacEnb->getCellInfo();
370+
cellInfo_->attachUser(nodeId_);
383371
}
384372

385373
// update DL feedback generator

src/simu5g/stack/phy/NrPhyUe.cc

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -341,16 +341,9 @@ void NrPhyUe::doHandover()
341341
cellInfo_->detachUser(nodeId_);
342342

343343
if (masterId_ != NODEID_NONE) {
344-
CellInfo *oldCellInfo = cellInfo_;
345344
LteMacEnb *newMacEnb = check_and_cast<LteMacEnb *>(binder_->getMacByNodeId(masterId_));
346-
CellInfo *newCellInfo = newMacEnb->getCellInfo();
347-
newCellInfo->attachUser(nodeId_);
348-
cellInfo_ = newCellInfo;
349-
if (oldCellInfo == nullptr) {
350-
// first time the UE is attached to someone
351-
intuniform(0, binder_->phyPisaData.maxChannel() - 1);
352-
intuniform(1, binder_->phyPisaData.maxChannel2()); // RNG call to preserve fingerprint
353-
}
345+
cellInfo_ = newMacEnb->getCellInfo();
346+
cellInfo_->attachUser(nodeId_);
354347

355348
// send a self-message to schedule the possible mode switch at the end of the TTI (after all UEs have performed the handover)
356349
cMessage *msg = new cMessage("doModeSwitchAtHandover");

0 commit comments

Comments
 (0)