diff --git a/DAS/results.py b/DAS/results.py index 164f667..7f1ccb4 100644 --- a/DAS/results.py +++ b/DAS/results.py @@ -15,16 +15,10 @@ class Result: self.tta = -1 self.missingVector = [] - def populate(self, shape, config, missingVector, bandwidthVector): + def populate(self, shape, config, missingVector): """It populates part of the result data inside a vector.""" self.shape = shape self.missingVector = missingVector - self.proTx = bandwidthVector[0] - self.proRx = bandwidthVector[1] - self.aveTx = bandwidthVector[2] - self.maxTx = bandwidthVector[3] - self.aveRx = bandwidthVector[4] - self.maxRx = bandwidthVector[5] missingSamples = missingVector[-1] if missingSamples == 0: self.blockAvailable = 1 diff --git a/DAS/simulator.py b/DAS/simulator.py index 21e90ef..02fa8ae 100644 --- a/DAS/simulator.py +++ b/DAS/simulator.py @@ -170,12 +170,6 @@ class Simulator: arrived, expected = self.glob.checkStatus(self.validators) missingSamples = expected - arrived missingVector = [] - proTxVector = [] - proRxVector = [] - aveTxVector = [] - maxTxVector = [] - aveRxVector = [] - maxRxVector = [] steps = 0 while(True): missingVector.append(missingSamples) @@ -198,20 +192,10 @@ class Simulator: # log TX and RX statistics statsTxInSlot = [v.statsTxInSlot for v in self.validators] statsRxInSlot = [v.statsRxInSlot for v in self.validators] - proTx = statsTxInSlot[0] - proRx = statsRxInSlot[0] - aveTx = mean(statsTxInSlot[1:]) - maxTx = max(statsTxInSlot[1:]) - aveRx = mean(statsRxInSlot[1:]) - maxRx = max(statsRxInSlot[1:]) self.logger.debug("step %d: TX_prod=%.1f, RX_prod=%.1f, TX_avg=%.1f, TX_max=%.1f, Rx_avg=%.1f, Rx_max=%.1f" % - (steps, proTx, proRx, aveTx, maxTx, aveRx, maxRx), extra=self.format) - proTxVector.append(proTx) - proRxVector.append(proRx) - aveTxVector.append(aveTx) - maxTxVector.append(maxTx) - aveRxVector.append(aveRx) - maxRxVector.append(maxRx) + (steps, statsTxInSlot[0], statsRxInSlot[0], + mean(statsTxInSlot[1:]), max(statsTxInSlot[1:]), + mean(statsRxInSlot[1:]), max(statsRxInSlot[1:])), extra=self.format) for i in range(0,self.shape.numberNodes): self.validators[i].updateStats() @@ -231,9 +215,6 @@ class Simulator: else: steps += 1 - bandwidthVector = [sum(proTxVector), sum(proRxVector), - mean(aveTxVector), max(maxTxVector), - mean(aveRxVector), max(maxRxVector)] - self.result.populate(self.shape, self.config, missingVector, bandwidthVector) + self.result.populate(self.shape, self.config, missingVector) return self.result