82 NS_LOG_FUNCTION(
this << sliceId <<
" " << symbolRate);
84 Ptr<DataCollectionObject> collector =
nullptr;
90 NS_ASSERT_MSG(collector !=
nullptr,
"Unable to find collector with identifier 0");
94 collector =
m_collectors.Get(
static_cast<uint32_t
>(sliceId));
95 NS_ASSERT_MSG(collector !=
nullptr,
"Unable to find collector with identifier " << sliceId);
99 NS_FATAL_ERROR(
"SatStatsFwdLinkSchedulerSymbolRateHelper - Invalid identifier type");
107 Ptr<ScalarCollector> c = collector->GetObject<ScalarCollector>();
108 NS_ASSERT(c !=
nullptr);
109 c->TraceSinkDouble(0.0, symbolRate);
115 Ptr<IntervalRateCollector> c = collector->GetObject<IntervalRateCollector>();
116 NS_ASSERT(c !=
nullptr);
117 c->TraceSinkDouble(0.0, symbolRate);
127 Ptr<DistributionCollector> c = collector->GetObject<DistributionCollector>();
128 NS_ASSERT(c !=
nullptr);
129 c->TraceSinkDouble(0.0, symbolRate);
135 <<
" is not a valid output type for this statistics.");
151 NS_LOG_FUNCTION(
this);
157 <<
" is not a valid output type for this statistics.");
167 "EnableContextPrinting",
171 Ptr<MultiFileAggregator> aggregator =
m_aggregator->GetObject<MultiFileAggregator>();
176 EnumValue(ScalarCollector::INPUT_DATA_TYPE_DOUBLE));
178 EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SECOND));
192 Ptr<MultiFileAggregator> aggregator =
m_aggregator->GetObject<MultiFileAggregator>();
197 EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_DOUBLE));
201 &MultiFileAggregator::Write2d);
204 &MultiFileAggregator::AddContextHeading);
218 Ptr<MultiFileAggregator> aggregator =
m_aggregator->GetObject<MultiFileAggregator>();
222 DistributionCollector::OutputType_t outputType =
223 DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
226 outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
230 outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
232 m_collectors.SetAttribute(
"OutputType", EnumValue(outputType));
237 &MultiFileAggregator::AddContextHeading);
240 &MultiFileAggregator::EnableContextWarning);
248 <<
" is not a valid output type for this statistics.");
258 Ptr<MagisterGnuplotAggregator> plotAggregator =
260 NS_ASSERT(plotAggregator !=
nullptr);
262 plotAggregator->SetLegend(
"Time (in seconds)",
"Latency (in seconds)");
263 plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
268 EnumValue(IntervalRateCollector::INPUT_DATA_TYPE_DOUBLE));
272 const std::string context = it->second->GetName();
273 plotAggregator->Add2dDataset(context, context);
277 &MagisterGnuplotAggregator::Write2d);
291 Ptr<MagisterGnuplotAggregator> plotAggregator =
293 NS_ASSERT(plotAggregator !=
nullptr);
295 plotAggregator->SetLegend(
"Latency (in seconds)",
"Frequency");
296 plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
300 DistributionCollector::OutputType_t outputType =
301 DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
304 outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
308 outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
310 m_collectors.SetAttribute(
"OutputType", EnumValue(outputType));
314 const std::string context = it->second->GetName();
315 plotAggregator->Add2dDataset(context, context);
319 &MagisterGnuplotAggregator::Write2d);
325 NS_FATAL_ERROR(
"SatStatsFwdLinkSchedulerSymbolRateHelper - Invalid output type");
337 NS_LOG_FUNCTION(
this);
340 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
342 for (NodeContainer::Iterator it = gws.Begin(); it != gws.End(); ++it)
346 for (NetDeviceContainer::Iterator itDev = devs.Begin(); itDev != devs.End(); ++itDev)
348 Ptr<SatNetDevice> satDev = (*itDev)->GetObject<
SatNetDevice>();
349 NS_ASSERT(satDev !=
nullptr);
350 Ptr<SatMac> satMac = satDev->GetMac();
351 NS_ASSERT(satMac !=
nullptr);
352 Ptr<SatGwMac> satGwMac = satMac->GetObject<
SatGwMac>();
353 NS_ASSERT(satGwMac !=
nullptr);
354 PointerValue scheduler;
355 satGwMac->GetAttribute(
"Scheduler", scheduler);
357 NS_ASSERT(fwdLinkScheduler !=
nullptr);
361 NS_FATAL_ERROR(
"Error connecting to Symbol Rate trace source"
362 <<
" of SatFwdLinkScheduler" <<
" at node ID " << (*it)->GetId()
363 <<
" device #" << (*itDev)->GetIfIndex());
Ptr< DataCollectionObject > CreateAggregator(std::string aggregatorTypeId, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue())
Create the aggregator according to the output type.