void SampleCascade(const PGraph& InfCasc, const PGraph& NetCasc, const TIntH& NIdInfTmH, const double& PStep=0.05, const int& NRuns=1, const bool& DivByM=true) { for (int Run=0; Run < NRuns; Run++) { for (double P = PStep; P <= 1.01; P += PStep) { TIntV NIdV; for (typename PGraph::TObj::TNodeI NI = InfCasc->BegNI(); NI < InfCasc->EndNI(); NI++) { if (TInt::Rnd.GetUniDev() < P) { NIdV.Add(NI.GetId()); } } PGraph InfG = TSnap::GetSubGraph(InfCasc, NIdV); PGraph NetG = TSnap::GetSubGraph(NetCasc, NIdV); if (InfG->GetNodes()==0) { continue; } TakeStat(InfG, NetG, NIdInfTmH, P, DivByM); } } }
TGStat::TGStat(const PNEGraph& Graph, const TSecTm& GraphTm, TFSet StatFSet, const TStr& GraphName) { TakeStat(Graph, GraphTm, StatFSet, GraphName); }