World Ocean Simulation System (WOSS) library
uw-woss-mpropagation.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 UNDERWATER_WOSS_PROPAGATION_H
41#define UNDERWATER_WOSS_PROPAGATION_H
42
43
44#include <fstream>
45#include <map>
46#include <underwater-mpropagation.h>
47#include <underwater.h>
48#include <mphy.h>
49#include "uw-woss-pkt-hdr.h"
51
52
53namespace woss {
54 class WossManager;
55}
56
57
58typedef std::map< woss::CoordZ , std::map < woss::CoordZ , double > > GainMatrix;
59typedef GainMatrix::iterator GMIter;
60typedef GainMatrix::reverse_iterator GMRIter;
61
62
68class WossMPropagation : public UnderwaterMPropagation {
69
70
71 public:
72
73
75
76 virtual ~WossMPropagation() { }
77
78
85 virtual double getGain(Packet* p);
86
87
88 virtual int command(int argc, const char*const* argv);
89
90
91 private:
92
93
94 woss::WossManager* woss_manager;
95
96
97 GainMatrix std_gain_map;
98
99
100 bool write_gain_matrix;
101
102
103 fstream std_gain_out;
104
105
106 string std_gain_matrix_name;
107
108
109 void insertStdGainMatrix( Position* sp, Position* rp, double gain );
110
111
118 double computeGain(Packet* p);
119
120
121 void writeStdGainMatrix();
122
123
124};
125
126
127//inline functions
129
130inline void WossMPropagation::insertStdGainMatrix( Position* sp, Position* rp, double gain ) {
131 std_gain_map[ woss::CoordZ( sp->getLatitude(), sp->getLongitude(), abs( sp->getZ() ) ) ]
132 [ woss::CoordZ( rp->getLatitude(), rp->getLongitude(), abs( rp->getZ() ) ) ] = gain;
133}
134
135#endif /* UNDERWATER_WOSS_PROPAGATION_H */
UnderwaterMPropagation class for channel calculations with WOSS.
Definition uw-woss-mpropagation.h:68
double computeGain(Packet *p)
Definition uw-woss-mpropagation.cpp:167
virtual double getGain(Packet *p)
Definition uw-woss-mpropagation.cpp:120
3D-Coordinates (lat, long, depth) class definitions and functions library
Definition coordinates-definitions.h:403
Abstract class that interfaces Pressure or TimeArr requests from user layer.
Definition woss-manager.h:93
Provides the interface for the woss::Coord and woss::CoordZ classes.
Definition of hdr_woss, WOSS pkt header.