OverSim
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
SimpleNcs.h
Go to the documentation of this file.
1
// Copyright (C) 2010 Institut fuer Telematik, Universitaet Karlsruhe (TH)
2
//
3
// This program is free software; you can redistribute it and/or
4
// modify it under the terms of the GNU General Public License
5
// as published by the Free Software Foundation; either version 2
6
// of the License, or (at your option) any later version.
7
//
8
// This program is distributed in the hope that it will be useful,
9
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
// GNU General Public License for more details.
12
//
13
// You should have received a copy of the GNU General Public License
14
// along with this program; if not, write to the Free Software
15
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
//
17
23
#ifndef _SIMPLENCS_
24
#define _SIMPLENCS_
25
26
27
#include <vector>
28
29
#include <omnetpp.h>
30
31
#include <
NeighborCache.h
>
32
#include <
CoordinateSystem.h
>
33
34
35
class
SimpleNcs
:
public
AbstractNcs
36
{
37
private
:
38
// variable for storing the node coordinates / estimated error
39
SimpleCoordsInfo
*
ownCoords
;
40
41
//variables for storing the parameter from ned file
42
uint32_t
dimension
;
43
44
simtime_t
falsifyDelay
(simtime_t oldDelay)
const
;
45
46
enum
delayFaultTypeNum
{
47
delayFaultUndefined
,
48
delayFaultLiveAll
,
49
delayFaultLivePlanetlab
,
50
delayFaultSimulation
51
};
52
static
std::map<std::string, delayFaultTypeNum>
delayFaultTypeMap
;
53
static
std::string
delayFaultTypeString
;
54
static
bool
faultyDelay
;
55
56
protected
:
57
NeighborCache
*
neighborCache
;
58
59
public
:
60
SimpleNcs
() {
ownCoords
= NULL; };
61
virtual
~SimpleNcs
() {
delete
ownCoords
; };
62
63
virtual
void
init
(
NeighborCache
*
neighborCache
);
64
65
Prox
getCoordinateBasedProx
(
const
AbstractNcsNodeInfo
& info)
const
;
66
67
virtual
AbstractNcsNodeInfo
*
getUnvalidNcsInfo
()
const
{
return
new
SimpleCoordsInfo
(); };
68
virtual
AbstractNcsNodeInfo
*
createNcsInfo
(
const
std::vector<double>& coords)
const
;
69
70
const
AbstractNcsNodeInfo
&
getOwnNcsInfo
()
const
{
return
*
ownCoords
; };
71
const
std::vector<double>&
getOwnCoordinates
()
const
{
return
ownCoords
->
getCoords
(); };
72
};
73
74
#endif
75
src
common
SimpleNcs.h
Generated on Fri Dec 7 2012 13:37:53 for OverSim by
1.8.1.2