forked from Conedy/Conedy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdynNode.h
118 lines (61 loc) · 3.16 KB
/
dynNode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#ifndef dynNodeInterface_h
#define dynNodeInterface_h dynNodeInterface_h
#include "node.h"
#include "params.h"
#include "baseType.h"
//#include "edge.h"
#include <boost/function.hpp>
#ifndef M_PI
#define M_PI 3.14159265358979323846f
#endif
#define forEachEdge(whatToDo) node::edgeDescriptor ia, ie; \
ia = 0; \
ie = degree(); \
for (;ia !=ie;ia++) { \
baseType state = getTargetState(ia); \
baseType weight = getWeight(ia); \
whatToDo; }
namespace conedy
{
//! Interface für die dynamischen Eigenschaften (Zeitentwicklung) der Knoten.
class dynNode : public node, public params<baseType>
{
//! Zeiger auf Speicherplatz für die
protected:
public:
baseType * x;
virtual const nodeInfo getNodeInfo() { nodeInfo n = {_dynNodeNodeType_,_dynNode_,"dynNode"}; return n;};
// static gslNoise random;
static baseType startTime;
static baseType time;
//! Ende der Integrationsperiode. Wird vor allem für gslodeNode benötigt.
static baseType endTime;
dynNode ( networkElementType n) : params<baseType>( n ) {}
dynNode (networkElementType n, unsigned int dim);
dynNode () : params <baseType> (_dynNodeNodeType_) {}
virtual void evolve(baseType time) { cerr << this->getNodeInfo().theNodeName << endl;
throw "evolve of dynNode called";}
virtual bool timeEvolution () { return 0; };
virtual bool requiresUpkeep() { return 0;};
virtual const unsigned int dimension () const { return 0; }
virtual baseType getHiddenComponent ( int component ) {return x[component];}
virtual baseType getState() { return this->getState(0); }
virtual void upkeep() { }
// throw "upkeep of dynNode called";
virtual node * construct () { throw "construct of dynNode called !"; }
virtual void printStatistics(ostream &os, int nodeVerbosity, int edgeVerbosity);
virtual void dynamics() { throw "dynamics of dynNode called !"; }
virtual baseType getMeanPhaseCoherence() { throw "getMeanPhaseCoherence";}
virtual baseType couplingSum() { throw "couplingSum"; }
virtual void fire () { throw "fire"; }
virtual void excite(baseType couplingStrength);
dynNode( const dynNode &b);
virtual void setStateVec (vector <baseType> &r);
virtual void randomizeState ( boost::function<baseType () > &r ) { vector <boost::function<baseType () > > dummy; dummy.push_back(r); randomizeState(dummy); }
virtual void randomizeState ( vector <boost::function<baseType () > > &r );
virtual baseType getState (unsigned int component) { return x[component];}
void setState( baseType a1, baseType a2 = numeric_limits<baseType>::max(), baseType a3 = numeric_limits<baseType>::max(), baseType a4 = numeric_limits<baseType>::max(), baseType a5 = numeric_limits<baseType>::max(), baseType a6 = numeric_limits<baseType>::max(), baseType a7 = numeric_limits<baseType>::max(), baseType a8 = numeric_limits<baseType>::max(), baseType a9 = numeric_limits<baseType>::max(), baseType a10 = numeric_limits<baseType>::max(), baseType a11 = numeric_limits<baseType>::max(), baseType a12 = numeric_limits<baseType>::max());
};
//! Edge-Klasse, die n.te Komponente des dynamischen Knotens abfragt (dynNodeTemplate::x[n])
};
#endif