All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DynamicGraphSource.h
Go to the documentation of this file.
1 /*
2  * DynamicGenerator.h
3  *
4  * Created on: 03.04.2013
5  * Author: cls
6  */
7 
8 #ifndef DYNAMICGRAPHSOURCE_H_
9 #define DYNAMICGRAPHSOURCE_H_
10 
11 #include <functional>
12 
13 #include "../dynamics/GraphEventProxy.h"
14 
15 namespace NetworKit {
16 
21 
22 protected:
23 
25  Graph* G;
26  bool graphSet;
28 
29 public:
30 
33 
34  // DynamicGraphGenerator(GraphEventProxy& proxy);
35 
36  virtual ~DynamicGraphSource() = default;
37 
43 
47  virtual void initializeGraph() = 0;
48 
49 
53  virtual void generate() = 0;
54 
55  /*
56  * Continue generating while function does not return false.
57  * @param[in] cont generator continues when this function returns true
58  */
59  virtual void generateWhile(std::function<bool(void)> cont);
60 
65  virtual void generateNodes(count n);
66 
67 
72  virtual void generateEdges(count m);
73 
77  virtual void generateTimeSteps(count t);
78 };
79 
80 } /* namespace NetworKit */
81 #endif /* DYNAMICGRAPHGENERATOR_H_ */
This class enables the observer pattern for dynamic graphs: It has the same modifiers as a Graph obje...
Definition: GraphEventProxy.h:22
bool graphInitialized
true if initializeGraph has been called and graph has been properly initialized
Definition: DynamicGraphSource.h:27
Graph * G
Definition: DynamicGraphSource.h:25
virtual void initializeGraph()=0
The generator may expect the graph to be in a certain initial state.
Definition: DynamicGraphSource.h:20
virtual void generate()=0
Perform one generative step - as defined by the implementation.
GraphEventProxy * newGraph()
After constructing a DynamicGraphGenerator, call this to set a new a Graph and GraphEventProxy instan...
Definition: DynamicGraphSource.cpp:36
virtual void generateEdges(count m)
Continue generating until the number of edges reaches this upper limit.
Definition: DynamicGraphSource.cpp:30
DynamicGraphSource()
Default constructor.
Definition: DynamicGraphSource.cpp:12
uint64_t count
Definition: Globals.h:21
virtual void generateNodes(count n)
Continue generating until the number of nodes reaches this upper limit.
Definition: DynamicGraphSource.cpp:22
virtual void generateTimeSteps(count t)
Continue generating until the number of time steps reaches this upper limit.
Definition: DynamicGraphSource.cpp:44
A graph (with optional weights) and parallel iterator methods.
Definition: Graph.h:79
virtual ~DynamicGraphSource()=default
bool graphSet
true if newGraph has been called and graph and proxy instances are properly set
Definition: DynamicGraphSource.h:26
virtual void generateWhile(std::function< bool(void)> cont)
Definition: DynamicGraphSource.cpp:16
GraphEventProxy * Gproxy
receives events produced by the generator and forwards them
Definition: DynamicGraphSource.h:24