All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DynamicHyperbolicGenerator.h
Go to the documentation of this file.
1 /*
2  * DynamicHyperbolicGenerator.h
3  *
4  * Created on: 29.07.2014
5  * Author: moritzl
6  */
7 
8 #ifndef DYNAMICHYPERBOLICGENERATOR_H_
9 #define DYNAMICHYPERBOLICGENERATOR_H_
10 
11 #include <map>
12 
13 #include "DynamicGraphGenerator.h"
14 #include "quadtree/Quadtree.h"
15 
16 
17 namespace NetworKit {
18 
20  friend class GeneratorsGTest;
21 public:
34  DynamicHyperbolicGenerator(count n = 1000, double avgDegree=6, double exp=3, double T=0, double moveEachStep = 0, double moveDistance = 0);
35 
48  DynamicHyperbolicGenerator(std::vector<double> &angles, std::vector<double> &radii, double R, double alpha, double T=0, double moveEachStep = 0, double moveDistance = 0);
49 
54 
61  std::vector<GraphEvent> generate(count nSteps) override;
62 
68  Graph getGraph() const;
69 
74  std::vector<Point<float> > getCoordinates() const;
75 
76 private:
80  void initializePoints();
81  void initializeQuadTree();
82 
86  void initializeMovement();
87 
91  void recomputeBands();
92 
93  vector<index> getNeighborsInBands(index i, bool bothDirections=true);
94 
100  void getEventsFromNodeMovement(vector<GraphEvent> &result);
101 
107  void moveNode(index node);
108 
109  //general geometry parameters
110  count nodeCount;
111  double alpha;
112  double R;
113  double T;
114 
115  //movement parameters
116  double moveEachStep;
117  double moveDistance;
118 
119  //coordinates
120  vector<double> angles;
121  vector<double> radii;
122 
123  //movement vectors
124  vector<double> angularMovement;
125  vector<double> radialMovement;
126 
127  //data structures
129  vector<double> bandRadii;
130  vector<vector<Point2D<double>>> bands;
131  vector<vector<double> > bandAngles;
132 
133  bool initialized;
134 };
135 
136 } /* namespace NetworKit */
137 #endif /* DYNAMICHYPERBOLICGENERATOR_H_ */
138 
uint64_t index
Typedefs.
Definition: Globals.h:20
DynamicHyperbolicGenerator()
Default constructor.
std::vector< Point< float > > getCoordinates() const
Get coordinates in native representation.
Definition: DynamicHyperbolicGenerator.cpp:131
uint64_t count
Definition: Globals.h:21
index node
Definition: Globals.h:23
Graph getGraph() const
Get the graph corresponding to the current state of the generator.
Definition: DynamicHyperbolicGenerator.cpp:123
Abstract base class for a dynamic graph generator (in the new dynamic architecture).
Definition: DynamicGraphGenerator.h:21
friend class GeneratorsGTest
Definition: DynamicHyperbolicGenerator.h:20
A graph (with optional weights) and parallel iterator methods.
Definition: Graph.h:79
Definition: DynamicHyperbolicGenerator.h:19
std::vector< GraphEvent > generate(count nSteps) override
Run the dynamic, changes state of generator.
Definition: DynamicHyperbolicGenerator.cpp:143