126 NS_LOG_FUNCTION(
this);
132 <<
" is not a valid output type for this statistics.");
142 "EnableContextPrinting",
146 Ptr<MultiFileAggregator> aggregator =
m_aggregator->GetObject<MultiFileAggregator>();
149 Ptr<ScalarCollector> collector = CreateObject<ScalarCollector>();
150 collector->SetName(
"0");
151 collector->SetInputDataType(ScalarCollector::INPUT_DATA_TYPE_DOUBLE);
152 collector->SetOutputType(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE);
153 collector->TraceConnect(
"Output",
155 MakeCallback(&MultiFileAggregator::Write1d, aggregator));
156 m_collector = collector->GetObject<DataCollectionObject>();
168 Ptr<MultiFileAggregator> aggregator =
m_aggregator->GetObject<MultiFileAggregator>();
171 Ptr<UnitConversionCollector> collector = CreateObject<UnitConversionCollector>();
172 collector->SetName(
"0");
173 collector->SetConversionType(UnitConversionCollector::TRANSPARENT);
174 collector->TraceConnect(
"OutputTimeValue",
176 MakeCallback(&MultiFileAggregator::Write2d, aggregator));
177 m_collector = collector->GetObject<DataCollectionObject>();
191 Ptr<MultiFileAggregator> aggregator =
m_aggregator->GetObject<MultiFileAggregator>();
194 Ptr<DistributionCollector> collector = CreateObject<DistributionCollector>();
195 collector->SetName(
"0");
198 collector->SetOutputType(DistributionCollector::OUTPUT_TYPE_HISTOGRAM);
202 collector->SetOutputType(DistributionCollector::OUTPUT_TYPE_PROBABILITY);
206 collector->SetOutputType(DistributionCollector::OUTPUT_TYPE_CUMULATIVE);
208 collector->TraceConnect(
"Output",
210 MakeCallback(&MultiFileAggregator::Write2d, aggregator));
211 collector->TraceConnect(
"OutputString",
213 MakeCallback(&MultiFileAggregator::AddContextHeading, aggregator));
214 collector->TraceConnect(
217 MakeCallback(&MultiFileAggregator::EnableContextWarning, aggregator));
218 m_collector = collector->GetObject<DataCollectionObject>();
226 <<
" is not a valid output type for this statistics.");
236 Ptr<MagisterGnuplotAggregator> plotAggregator =
238 NS_ASSERT(plotAggregator !=
nullptr);
240 plotAggregator->SetLegend(
"Time (in seconds)",
"Window normalized load (in bps/Hz)");
241 plotAggregator->Add2dDataset(
"0",
"0");
242 plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
245 Ptr<UnitConversionCollector> collector = CreateObject<UnitConversionCollector>();
246 collector->SetName(
"0");
247 collector->SetConversionType(UnitConversionCollector::TRANSPARENT);
248 collector->TraceConnect(
"OutputTimeValue",
250 MakeCallback(&MagisterGnuplotAggregator::Write2d, plotAggregator));
251 m_collector = collector->GetObject<DataCollectionObject>();
265 Ptr<MagisterGnuplotAggregator> plotAggregator =
267 NS_ASSERT(plotAggregator !=
nullptr);
269 plotAggregator->SetLegend(
"Window normalized load (in bps/Hz)",
"Frequency");
270 plotAggregator->Add2dDataset(
"0",
"0");
271 plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
274 Ptr<DistributionCollector> collector = CreateObject<DistributionCollector>();
275 collector->SetName(
"0");
278 collector->SetOutputType(DistributionCollector::OUTPUT_TYPE_HISTOGRAM);
282 collector->SetOutputType(DistributionCollector::OUTPUT_TYPE_PROBABILITY);
286 collector->SetOutputType(DistributionCollector::OUTPUT_TYPE_CUMULATIVE);
288 collector->TraceConnect(
"Output",
290 MakeCallback(&MagisterGnuplotAggregator::Write2d, plotAggregator));
291 m_collector = collector->GetObject<DataCollectionObject>();
297 NS_FATAL_ERROR(
"SatStatsWindowLoadHelper - Invalid output type");
339 NS_LOG_FUNCTION(
this);
341 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<SatPhy> satPhy = satDev->GetPhy();
351 NS_ASSERT(satPhy !=
nullptr);
352 Ptr<SatPhyRx> satPhyRx = satPhy->GetPhyRx();
353 NS_ASSERT(satPhyRx !=
nullptr);
354 ObjectVectorValue carriers;
355 satPhyRx->GetAttribute(
"RxCarrierList", carriers);
356 NS_LOG_DEBUG(
this <<
" Node ID " << (*it)->GetId() <<
" device #"
357 << (*itDev)->GetIfIndex() <<
" has " << carriers.GetN()
360 for (ObjectVectorValue::Iterator itCarrier = carriers.Begin();
361 itCarrier != carriers.End();
364 if (DynamicCast<SatPhyRxCarrier>(itCarrier->second)->GetCarrierType() !=
370 if (!itCarrier->second->TraceConnectWithoutContext(
"WindowLoad",
373 NS_FATAL_ERROR(
"Error connecting to WindowLoad trace source"
374 <<
" of SatPhyRxCarrier" <<
" at node ID " << (*it)->GetId()
375 <<
" device #" << (*itDev)->GetIfIndex() <<
" RX carrier #"
376 << itCarrier->first);
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.