World Ocean Simulation System (WOSS) library
uw-woss-channel-estimator.h
Go to the documentation of this file.
1/* WOSS - World Ocean Simulation System -
2 *
3 * Copyright (C) 2009 Federico Guerra
4 * and regents of the SIGNET lab, University of Padova
5 *
6 * Author: Federico Guerra - federico@guerra-tlc.com
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation;
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22/*
23 * This software has been developed by Federico Guerra and SIGNET lab,
24 * University of Padova, in collaboration with the NATO Centre for
25 * Maritime Research and Experimentation (http://www.cmre.nato.int ;
26 * E-mail: pao@cmre.nato.int), whose support is gratefully acknowledged.
27 */
28
29
40#ifndef CHANNEL_ESTIMATOR_H
41#define CHANNEL_ESTIMATOR_H
42
43
44#include <plugin.h>
46#include <map>
47#include "uw-woss-position.h"
48
49
50namespace woss {
51 class TimeArr;
52}
53
54
60class ChannelEstimator : public TclObject {
61
62
63 public:
64
65
66 typedef ::std::map< woss::CoordZ, woss::TimeArr*, woss::CoordComparator< ChannelEstimator, woss::CoordZ > > RxMap;
67 typedef RxMap::iterator RxMIter;
68 typedef RxMap::const_iterator RxMCIter;
69 typedef RxMap::reverse_iterator RxMRIter;
70
71 typedef ::std::map< woss::CoordZ, RxMap, woss::CoordComparator< ChannelEstimator, woss::CoordZ > > ChannelMap;
72 typedef ChannelMap::iterator ChMapIter;
73 typedef ChannelMap::reverse_iterator ChMapRIter;
74
75 typedef std::map< int, WossPosition* > MacToPosMap;
76 typedef MacToPosMap::iterator MacMapIter;
77 typedef MacToPosMap::reverse_iterator MacMapRIter;
78
79// typedef std::map< std::pair< woss::CoordZ, woss::CoordZ > , woss::TimeArr* > ChannelMap;
80// typedef ChannelMap::iterator ChMapIter;
81// typedef ChannelMap::reverse_iterator ChMapRIter;
82
83
85
86 virtual ~ChannelEstimator();
87
88
89 virtual int command(int argc, const char*const* argv);
90
91
92 static double getSpaceSampling() { return space_sampling; }
93
94
102 virtual void updateEstimation( const woss::CoordZ& tx, const woss::CoordZ& rx, woss::TimeArr* curr_channel );
103
111 woss::TimeArr* getEstimation( const woss::CoordZ& tx, const woss::CoordZ& rx );
112
113
114 void addMacAddress( int addr, WossPosition* pos ) { mac_to_pos_map[addr] = pos; }
115
116 virtual WossPosition* findMacAddress( int addr );
117
118
119 virtual bool resetEstimator();
120
121
122 protected:
123
124
125 static double space_sampling;
126
127
128 ChannelMap channel_map;
129
130 MacToPosMap mac_to_pos_map;
131
132
133 double debug_;
134
135 double avg_coeff;
136
137};
138
139
146class ChEstimatorPlugIn : public PlugIn {
147
148
149 public:
150
151
153
154 virtual ~ChEstimatorPlugIn() { }
155
156
157 virtual int command(int argc, const char*const* argv);
158
159 virtual int recvSyncClMsg(ClMessage* m);
160
161
162 protected:
163
164
165 ChannelEstimator* channel_estimator;
166
167 double debug_;
168
169};
170
171
172#endif // CHANNEL_ESTIMATOR_H
173
Service class for attaching a ChannelEstimator to the node bus.
Definition uw-woss-channel-estimator.h:146
Class for channel estimation and averaging.
Definition uw-woss-channel-estimator.h:60
virtual void updateEstimation(const woss::CoordZ &tx, const woss::CoordZ &rx, woss::TimeArr *curr_channel)
Definition uw-woss-channel-estimator.cpp:87
woss::TimeArr * getEstimation(const woss::CoordZ &tx, const woss::CoordZ &rx)
Definition uw-woss-channel-estimator.cpp:123
Definition uw-woss-position.h:48
3D-Coordinates (lat, long, depth) class definitions and functions library
Definition coordinates-definitions.h:403
Channel power delay profile class.
Definition time-arrival-definitions.h:82
Provides the interface for the woss::Coord and woss::CoordZ classes.
Provides the interface for WossWpPosition class.