本文整理汇总了C++中Network::connect_all_nodes方法的典型用法代码示例。如果您正苦于以下问题:C++ Network::connect_all_nodes方法的具体用法?C++ Network::connect_all_nodes怎么用?C++ Network::connect_all_nodes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network::connect_all_nodes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc,char *argv[]) {
if(argc != 5) {
printf("Wrong Number of Arguments\n");
exit(0);
}
//double alpha1 = argv[1]-0.0;
double alpha1, alpha2, beta1, beta2, gamma1, gamma2, phi1, phi2;
alpha1 = alpha2 = atof( argv[1] );
beta1 = 0.35;
beta2 = atof( argv[2] );
gamma1 = gamma2 = 1.0/5.0;
phi1 = phi2 = atof( argv[4]);
int intro_time;
intro_time = atoi( argv[3] );
int num_reps = 5;
Network net = Network("gillespie toy", Network::Undirected);
net.populate(10000);
net.connect_all_nodes();
Gillespie_TwoStrain_Network_Sim sim(&net, alpha1, alpha2, gamma1, gamma2, beta1, beta2, phi1, phi2, intro_time);
for(int i =1; i <= num_reps; i++){
cout << "Simulation number: " << i << endl;
sim.reset();
sim.rand_infect(5, 1);
sim.run_simulation(10000.0);
}
return 0;
}