-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhostNodeWaterfilling.h
46 lines (36 loc) · 1.85 KB
/
hostNodeWaterfilling.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
#ifndef ROUTERNODE_WF_H
#define ROUTERNODE_WF_H
#include "probeMsg_m.h"
#include "hostNodeBase.h"
using namespace std;
using namespace omnetpp;
class hostNodeWaterfilling : public hostNodeBase {
private:
// time since the last measurement for balances was made
// used to update path probabilities in smooth waterfilling
unordered_map<int, double> destNodeToLastMeasurementTime = {};
// waterfilling specific signals
unordered_map<int, simsignal_t> probabilityPerDestSignals = {};
unordered_map<int, simsignal_t> numWaitingPerDestSignals = {};
protected:
virtual void initialize() override;
// message generating functions
virtual routerMsg *generateProbeMessage(int destNode, int pathIdx, vector<int> path);
// message handlers
virtual void handleMessage(cMessage *msg) override;
virtual void handleTransactionMessageSpecialized(routerMsg *msg) override;
virtual void handleTimeOutMessage(routerMsg *msg) override;
virtual void handleProbeMessage(routerMsg *msg);
virtual void handleClearStateMessage(routerMsg *msg) override;
virtual void handleAckMessageTimeOut(routerMsg *msg) override;
virtual void handleAckMessageSpecialized(routerMsg *msg) override;
virtual void handleStatMessage(routerMsg *msg) override;
/**** CORE LOGIC ****/
virtual void initializeProbes(vector<vector<int>> kShortestPaths, int destNode);
virtual void restartProbes(int destNode);
virtual void forwardProbeMessage(routerMsg *msg);
virtual void splitTransactionForWaterfilling(routerMsg * ttMsg, bool firstAttempt);
virtual void attemptTransactionOnBestPath(routerMsg * ttMsg, bool firstAttempt);
virtual int updatePathProbabilities(vector<double> bottleneckBalances, int destNode);
};
#endif