-
Notifications
You must be signed in to change notification settings - Fork 0
/
client_GeographicalLocality.h
70 lines (57 loc) · 2.27 KB
/
client_GeographicalLocality.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
/*
* ccnSim is a scalable chunk-level simulator for Content Centric
* Networks (CCN), that we developed in the context of ANR Connect
* (http://www.anr-connect.org/)
*
* People:
* Giuseppe Rossini (lead developer, mailto giuseppe.rossini@enst.fr)
* Raffaele Chiocchetti (developer, mailto raffaele.chiocchetti@gmail.com)
* Dario Rossi (occasional debugger, mailto dario.rossi@enst.fr)
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*
* implemented by Alireza Montazeri (alireza.montazeri@usask.ca)
*/
#ifndef CLIENT_GEOGRAPHICALLOCALITY_H_
#define CLIENT_GEOGRAPHICALLOCALITY_H_
#include <omnetpp.h>
#include <random>
#include "ccnsim.h"
#include "client.h"
#include "GeographicalLocalityContentDistribution.h"
using namespace std;
/*
* this client generates requests according to the inofrmation of a distribution of a region to which it is assigned.
*/
class client_GeographicalLocality : public virtual client {
friend class client_ls_GeographicalLocality;
public:
virtual void initialize(int); // Multi-stage initialization.
int numInitStages() const;
virtual void handleMessage(cMessage *);
virtual void finish();
virtual void request_file();
bool validateRequest(int, name_t);
private:
static GeographicalLocalityContentDistribution* glPointer; // Pointer to the ShotNoiseContentDistribution class.
cMessage * arrival; // There is a message for each popularity class in order to trigger the respective
// request process.
cMessage *timer;
vector<bool> onOffClass; // Vector indicating which class will be modeled as ON-OFF
// (e.g., if false, requests for that class will be always generated).
int region_id;
};
#endif