Newer
Older
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
#ifndef AE_H_
#define AE_H_
#include <stdio.h>
#include <string.h>
#include <omnetpp.h>
#include "AEMessage_m.h"
#include "utils.h"
using namespace omnetpp;
//using namespace std;
enum InitStage {
INIT_REGISTRATION = 0,
INIT_QUERY = 1
};
class AE : public cSimpleModule // one of the module type in omnet
{
protected:
// by default in omnet methods
virtual void initialize(int stage) override;
virtual void handleMessage(cMessage *msg) override;
// application specific
void sendAEMessage(int op_code);
void registration();
void sendQuery();
virtual int numInitStages() const;
private:
int warmup;
int queryIndex;
int URI;
int data;
int maxHop;
int ran_number;
std::string feature_type;
std::vector<std::string> feature_types {
"thermometer","airStation","ATM","smartLock", "waterValve"
};
int resource_pool_size;
int number_of_replies;
int number_of_successfulResponse;
protected:
simsignal_t successRate;
};
Define_Module(AE);
#endif /* AE_H_ */