110 NS_LOG_FUNCTION(
this);
116 <<
" is not a valid output type for this statistics.");
126 "EnableContextPrinting",
134 EnumValue(ScalarCollector::INPUT_DATA_TYPE_DOUBLE));
137 EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
141 &MultiFileAggregator::Write1d);
156 EnumValue(UnitConversionCollector::TRANSPARENT));
160 &MultiFileAggregator::Write2d);
175 "EnableContextPrinting",
179 Ptr<MultiFileAggregator> fileAggregator =
181 NS_ASSERT(fileAggregator !=
nullptr);
185 DistributionCollector::OutputType_t outputType =
186 DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
189 outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
193 outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
200 MakeCallback(&MultiFileAggregator::Write2d, fileAggregator));
204 MakeCallback(&MultiFileAggregator::AddContextHeading, fileAggregator));
208 MakeCallback(&MultiFileAggregator::EnableContextWarning, fileAggregator));
213 EnumValue(ScalarCollector::INPUT_DATA_TYPE_DOUBLE));
216 EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
218 Callback<void, double> callback =
224 it->second->TraceConnectWithoutContext(
"Output", callback);
238 DistributionCollector::OutputType_t outputType =
239 DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
242 outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
246 outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
252 &MultiFileAggregator::Write2d);
255 &MultiFileAggregator::AddContextHeading);
258 &MultiFileAggregator::EnableContextWarning);
267 <<
" is not a valid output type for this statistics.");
277 Ptr<MagisterGnuplotAggregator> plotAggregator =
279 NS_ASSERT(plotAggregator !=
nullptr);
281 plotAggregator->SetLegend(
"Time (in seconds)",
"Object PLT (in seconds)");
282 plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
287 EnumValue(UnitConversionCollector::TRANSPARENT));
293 const std::string context = it->second->GetName();
294 plotAggregator->Add2dDataset(context, context);
298 &MagisterGnuplotAggregator::Write2d);
313 Ptr<MagisterGnuplotAggregator> plotAggregator =
315 NS_ASSERT(plotAggregator !=
nullptr);
317 plotAggregator->SetLegend(
"Object PLT (in seconds)",
"Frequency");
318 plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
324 DistributionCollector::OutputType_t outputType =
325 DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
328 outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
332 outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
339 MakeCallback(&MagisterGnuplotAggregator::Write2d, plotAggregator));
345 EnumValue(ScalarCollector::INPUT_DATA_TYPE_DOUBLE));
348 EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
350 Callback<void, double> callback =
356 it->second->TraceConnectWithoutContext(
"Output", callback);
367 Ptr<MagisterGnuplotAggregator> plotAggregator =
369 NS_ASSERT(plotAggregator !=
nullptr);
371 plotAggregator->SetLegend(
"Object PLT (in seconds)",
"Frequency");
372 plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
376 DistributionCollector::OutputType_t outputType =
377 DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
380 outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
384 outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
392 const std::string context = it->second->GetName();
393 plotAggregator->Add2dDataset(context, context);
397 &MagisterGnuplotAggregator::Write2d);
404 NS_FATAL_ERROR(
"SatStatsPltHelper - Invalid output type");
586 NS_ASSERT_MSG(collector !=
nullptr,
"Unable to find collector with identifier " << identifier);
592 Ptr<ScalarCollector> c = collector->GetObject<ScalarCollector>();
593 NS_ASSERT(c !=
nullptr);
594 c->TraceSinkDouble(0.0, plt.GetSeconds());
600 Ptr<UnitConversionCollector> c = collector->GetObject<UnitConversionCollector>();
601 NS_ASSERT(c !=
nullptr);
602 c->TraceSinkDouble(0.0, plt.GetSeconds());
614 Ptr<ScalarCollector> c = collector->GetObject<ScalarCollector>();
615 NS_ASSERT(c !=
nullptr);
616 c->TraceSinkDouble(0.0, plt.GetSeconds());
620 Ptr<DistributionCollector> c = collector->GetObject<DistributionCollector>();
621 NS_ASSERT(c !=
nullptr);
622 c->TraceSinkDouble(0.0, plt.GetSeconds());
628 <<
" is not a valid output type for this statistics.");
660 NS_LOG_FUNCTION(
this);
661 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes();
663 for (NodeContainer::Iterator it = utUsers.Begin(); it != utUsers.End(); ++it)
666 NS_ASSERT_MSG(utUserId > 0,
"Node " << (*it)->GetId() <<
" is not a valid UT user");
669 for (uint32_t i = 0; i < (*it)->GetNApplications(); i++)
671 Ptr<Application> app = (*it)->GetApplication(i);
672 bool isConnected =
false;
674 if (app->GetInstanceTypeId().LookupTraceSourceByName(
"RxPlt") !=
nullptr)
676 NS_LOG_INFO(
this <<
" attempt to connect using RxPlt");
679 std::ostringstream probeName;
680 probeName << utUserId <<
"-" << i;
681 Ptr<ApplicationDelayProbe> probe = CreateObject<ApplicationDelayProbe>();
682 probe->SetName(probeName.str());
685 if (probe->ConnectByObject(
"RxPlt", app))
689 std::make_pair(probe->GetObject<Probe>(), std::make_pair(*it, identifier)));
695 NS_LOG_INFO(
this <<
" successfully connected" <<
" with node ID " << (*it)->GetId()
696 <<
" application #" << i);
705 NS_LOG_WARN(
this <<
" unable to connect" <<
" with node ID " << (*it)->GetId()
706 <<
" application #" << i);
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.