NEDISS: Network Diffusion and Synchronization Simulator
GraphClasses
ErdosRenyiGraph.h
1
//
2
// Created by m4zz31 on 26/10/21.
3
//
4
#ifndef CPPPROJCT_ERDOSRENYIGRAPH_H
5
#define CPPPROJCT_ERDOSRENYIGRAPH_H
6
7
#include "GeneralGraph.h"
8
9
class
ErdosRenyiGraphObject
:
public
CommonGraphObjectClass
{
10
public
:
11
12
unsigned
long
N;
13
unsigned
long
E;
14
Graph g;
15
16
// Unique to this class :-)
17
typedef
boost::sorted_erdos_renyi_iterator<boost::minstd_rand, Graph> ERGen;
18
boost::minstd_rand gen;
19
double
Proba;
20
21
// TODO: move this to CommonGraphObjectClass
22
unsigned
long
Procs = num_processes(boost::graph::distributed::mpi_process_group());
23
24
ErdosRenyiGraphObject
(
unsigned
long
num_nodes,
double
probability) :
25
E(0),
// Actually the expected edge number is combinatorial(num_nodes,2) * probability
26
N(num_nodes),
27
Proba(probability),
28
g(ERGen(gen, num_nodes, probability,
false
), ERGen(), num_nodes) {};
29
30
// TODO: move this to CommonGraphObjectClass
31
void
build(){};
// empty function for inter-class compatibility :-)
32
};
33
#endif
//CPPPROJCT_ERDOSRENYIGRAPH_H
CommonGraphObjectClass
Definition:
GeneralGraph.h:139
ErdosRenyiGraphObject
Definition:
ErdosRenyiGraph.h:9
Generated by
1.9.2