-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.h
67 lines (52 loc) · 1.22 KB
/
base.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
/*
* base.h
*
* Created on: Jan 1, 2015
* Author: orhangazi44
*
* LGPL
*
*/
#ifndef BASE_H_
#define BASE_H_
#include <stdio.h>
#include <string.h>
#include <omnetpp.h>
#include "leach_message_m.h"
static int LEACH = 0;
static int IMPLEACH = 1;
static int CCRP = 2;
static int WSTLEACH = 3;
class Base : public cSimpleModule
{
private:
int clusterMaxMember;
int numNodes;
int numClusters;
double p;
cModule *mainModule;
int xPosition, yPosition;
int receivedRoundCount;
int numberOfLivingNodes;
int algorithm;
bool * nodeDeaths;
bool noEnergy = false;
double totalExpendedEnergy;
int * posXs;
int * posYs;
double * nodeBatteries;
double expendedEnergyForRound;
std::string posInfoMessageString;
cLongHistogram numberOfLivingNodesStats;
cLongHistogram receivedRoundCountStats;
cLongHistogram expendedEnergiesForRoundsStats;
cOutVector expendedEnergiesForRoundsVector;
cOutVector numberOfLivingNodesVector;
cOutVector receivedRoundCountVector;
cOutVector totalEnergyVector;
protected:
virtual void initialize();
virtual void finish();
virtual void handleMessage(cMessage *msg);
};
#endif /* BASE_H_ */