IBR-DTNSuite
0.12
Main Page
Namespaces
Classes
Files
File List
File Members
DeliveryPredictabilityMap.h
Go to the documentation of this file.
1
/*
2
* DeliveryPredictabilityMap.h
3
*
4
* Created on: 08.01.2013
5
* Author: morgenro
6
*/
7
8
#ifndef DELIVERYPREDICTABILITYMAP_H_
9
#define DELIVERYPREDICTABILITYMAP_H_
10
11
#include "
routing/NeighborDataset.h
"
12
#include "
routing/NodeHandshake.h
"
13
#include <
ibrdtn/data/EID.h
>
14
#include <
ibrcommon/thread/Mutex.h
>
15
#include <map>
16
17
namespace
dtn
18
{
19
namespace
routing
20
{
27
class
DeliveryPredictabilityMap
:
public
NeighborDataSetImpl
,
public
NodeHandshakeItem
,
public
ibrcommon::Mutex
{
28
public
:
29
static
const
dtn::data::Number
identifier
;
30
31
DeliveryPredictabilityMap
();
32
DeliveryPredictabilityMap
(
const
size_t
&time_unit,
const
float
&beta,
const
float
&gamma);
33
virtual
~DeliveryPredictabilityMap
();
34
35
virtual
const
dtn::data::Number
&
getIdentifier
()
const
;
36
virtual
dtn::data::Length
getLength
()
const
;
37
virtual
std::ostream&
serialize
(std::ostream& stream)
const
;
38
virtual
std::istream&
deserialize
(std::istream& stream);
39
40
class
ValueNotFoundException
:
public
ibrcommon::Exception
41
{
42
public
:
43
ValueNotFoundException
()
44
: ibrcommon::
Exception
(
"The requested value is not available."
) { };
45
46
virtual
~ValueNotFoundException
() throw () { };
47
};
48
49
float
get
(
const
dtn::data::EID
&neighbor)
const
throw
(ValueNotFoundException);
50
void
set
(
const
dtn::data::EID
&neighbor,
float
value);
51
void
clear
();
52
58
void
update
(
const
dtn::data::EID
&origin,
const
DeliveryPredictabilityMap
&dpm,
const
float
&p_encounter_first);
59
64
void
age
(
const
float
&p_first_threshold);
65
69
void
toString
(std::ostream &stream)
const
;
70
71
friend
std::ostream&
operator<<
(std::ostream& stream,
const
DeliveryPredictabilityMap
& map);
72
73
private
:
74
typedef
std::map<dtn::data::EID, float> predictmap;
75
predictmap _predictmap;
76
77
float
_beta;
78
float
_gamma;
79
80
dtn::data::Timestamp
_lastAgingTime;
81
size_t
_time_unit;
82
83
};
84
}
/* namespace routing */
85
}
/* namespace dtn */
86
#endif
/* DELIVERYPREDICTABILITYMAP_H_ */
daemon
src
routing
prophet
DeliveryPredictabilityMap.h
Generated on Thu Mar 27 2014 09:26:20 for IBR-DTNSuite by
1.8.4