World Ocean Simulation System (WOSS) library
|
Abstract class that provides the interface for initializing and running a channel simulator. More...
#include <woss.h>
Public Member Functions | |
Woss () | |
Woss (const CoordZ &tx, const CoordZ &rx, const Time &start_t, const Time &end_t, double start_freq, double end_freq, double freq_step) | |
virtual bool | initialize ()=0 |
virtual bool | run ()=0 |
virtual bool | timeEvolve (const Time &time_value)=0 |
virtual bool | isValid () const =0 |
virtual Pressure * | getAvgPressure (double frequency, double tx_depth, double start_rx_depth=WOSS_MIN_DEPTH, double start_rx_range=WOSS_MIN_RANGE, double end_rx_depth=WOSS_MAX_DEPTH, double end_rx_range=WOSS_MAX_RANGE) const =0 |
virtual Pressure * | getPressure (double frequency, double tx_depth, double rx_depth, double rx_range) const =0 |
virtual TimeArr * | getTimeArr (double frequency, double tx_depth, double rx_depth, double rx_range) const =0 |
Woss & | setDebug (bool flag) |
Woss & | setCleanWorkDir (bool flag) |
Woss & | setWorkDirPath (const ::std::string &path) |
Woss & | setWossDbManager (const WossDbManager *const ptr) |
Woss & | insertFrequency (double freq) |
Woss & | insertFrequencies (double freq_start, double freq_end, double freq_step) |
Woss & | setFrequencies (const FreqSet &freq_set) |
Woss & | eraseFrequency (double freq) |
Woss & | clearFrequencies () |
Woss & | setTotalRuns (int runs) |
Woss & | setTxCoordZ (const CoordZ &coordz) |
Woss & | setRxCoordZ (const CoordZ &coordz) |
Woss & | setStartTime (const Time &start_t) |
Woss & | setEndTime (const Time &end_t) |
Woss & | setEvolutionTimeQuantum (double value) |
int | getWossId () const |
::std::string | getWorkDirPath () const |
const FreqSet & | getFrequencies () const |
double | getMinFrequency () const |
double | getMaxFrequency () const |
FreqSCIt | freq_begin () const |
FreqSCIt | freq_end () const |
FreqSCRIt | freq_rbegin () const |
FreqSCRIt | freq_rend () const |
FreqSCIt | freq_lower_bound (double frequency) const |
FreqSCIt | freq_upper_bound (double frequency) const |
int | getTotalRuns () const |
CoordZ | getTxCoordZ () const |
CoordZ | getRxCoordZ () const |
Time | getStartTime () const |
Time | getCurrentTime () const |
Time | getEndTime () const |
double | getEvolutionTimeQuantum () const |
double | getGreatCircleDistance () const |
double | getDistance () const |
double | getBearing () const |
bool | usingDebug () const |
virtual bool | isRunning () const |
Protected Member Functions | |
virtual bool | mkWorkDir (double curr_frequency, int curr_run=0) |
virtual bool | rmWorkDir (double curr_frequency, int curr_run=0) |
virtual bool | rmWorkDir () |
Protected Attributes | |
int | woss_id |
::std::string | work_dir_path |
const WossDbManager * | db_manager |
Time | start_time |
Time | current_time |
Time | end_time |
double | evolution_time_quantum |
CoordZ | tx_coordz |
CoordZ | rx_coordz |
FreqSet | frequencies |
double | bearing |
double | total_great_circle_distance |
double | total_distance |
int | total_runs |
bool | debug |
bool | has_run_once |
volatile bool | is_running |
bool | clean_workdir |
Static Protected Attributes | |
static pthread_spinlock_t | woss_mutex = woss::initWossSpinlock( &Woss::woss_mutex , 0 ) |
static int | woss_counter = 0 |
Friends | |
void | destroyWossSpinlock () |
Abstract class that provides the interface for initializing and running a channel simulator.
Woss class has the task to properly initialize and run a channel simulator and to provide its results ( with the optional aid of ResReader class ).
Woss::Woss | ( | ) |
Woss default constructor. Default constructed objects are not valid
References woss_counter, woss_id, and woss_mutex.
Woss::Woss | ( | const CoordZ & | tx, |
const CoordZ & | rx, | ||
const Time & | start_t, | ||
const Time & | end_t, | ||
double | start_freq, | ||
double | end_freq, | ||
double | freq_step | ||
) |
Woss constructor
tx | const reference to a valid CoordZ object ( transmitter ) |
rx | const reference to a valid CoordZ object ( receiver ) |
start_t | const reference to a valid Time object for SSP's averaging purposes ( start date time ) |
end_t | const reference to a valid Time object for SSP's averaging purposes ( end date time ) |
start_freq | start frequency [Hz] |
end_freq | end frequency [Hz] |
freq_step | frequency step [Hz] |
References end_time, insertFrequencies(), woss::CoordZ::isValid(), woss::Time::isValid(), start_time, woss_counter, woss_id, and woss_mutex.
|
inline |
|
inline |
Erases the given frequency from the FreqSet
freq | frequency value [Hz] |
References frequencies.
|
inline |
Returns a const iterator to the beginning of FreqSet in use
References frequencies.
|
inline |
Returns a const iterator to the end of FreqSet in use
References frequencies.
Referenced by insertFrequencies().
|
inline |
Returns a const iterator to the value >= frequency parameter
frequency | const reference to a frequency value [Hz] |
References frequencies.
Referenced by woss::WossManagerResDb::getWossPressure(), woss::WossManagerResDbMT::getWossPressure(), woss::WossManager::getWossPressure(), woss::WossManagerResDb::getWossTimeArr(), woss::WossManagerResDbMT::getWossTimeArr(), and woss::WossManager::getWossTimeArr().
|
inline |
Returns a const iterator to the reverse beginning of FreqSet in use
References frequencies.
|
inline |
Returns a const iterator to the reverse of FreqSet in use
References frequencies.
|
inline |
Returns a const iterator to the value > frequency parameter
frequency | const reference to a frequency value [Hz] |
References frequencies.
|
pure virtual |
Gets the average Pressure value in given rx range-depth box
frequency | frequency [Hz] |
tx_depth | transmitter depth [m] |
start_rx_depth | start receiver depth [m] |
start_rx_range | start receiver range [m] |
end_rx_depth | end receiver depth [m] |
end_rx_range | end receiver range [m] |
Implemented in woss::BellhopWoss.
Referenced by woss::WossManagerResDb::getWossPressure(), woss::WossManagerResDbMT::getWossPressure(), and woss::WossManager::getWossPressure().
|
inline |
|
inline |
|
inline |
Gets the distance between transmitter and receiver
References total_distance.
|
inline |
|
inline |
|
inline |
|
inline |
Gets the surface great-circle distance between transmitter and receiver
References total_great_circle_distance.
|
inline |
|
inline |
|
pure virtual |
Gets a Pressure value of given range, depths
frequency | frequency [Hz] |
tx_depth | transmitter depth [m] |
rx_depth | receiver depth [m] |
rx_range | receiver range [m] |
Implemented in woss::BellhopWoss.
Referenced by woss::WossManager::getWossPressure().
|
inline |
Gets receiver CoordZ
References rx_coordz.
Referenced by woss::BellhopCreator::initializeBhWoss(), and woss::WossCreator::initializeWoss().
|
inline |
|
pure virtual |
Gets a TimeArr value of given range, depths
frequency | frequency [Hz] |
tx_depth | transmitter depth [m] |
rx_depth | receiver depth [m] |
rx_range | receiver range [m] |
Implemented in woss::BellhopWoss.
Referenced by woss::WossManagerResDb::getWossTimeArr(), woss::WossManagerResDbMT::getWossTimeArr(), and woss::WossManager::getWossTimeArr().
|
inline |
Gets the total number of channel simulator's runs
References total_runs.
|
inline |
Gets transmitter CoordZ
References tx_coordz.
Referenced by woss::BellhopCreator::initializeBhWoss(), and woss::WossCreator::initializeWoss().
|
inline |
|
inline |
Returns the instance identifier
References woss_id.
Referenced by woss::ShdResReader::accessMap(), woss::ArrAscResReader::getArrAscFile(), woss::ArrAscResReader::getArrAscHeader(), woss::ArrBinResReader::getArrBinFile(), woss::ArrBinResReader::getArrBinHeader(), woss::ShdResReader::getShdFile(), woss::ShdResReader::getShdHeader(), woss::ArrAscResReader::readMapAvgPressure(), woss::ArrBinResReader::readMapAvgPressure(), and woss::ShdResReader::readMapAvgPressure().
|
pure virtual |
Initializes the channel simulator
Implemented in woss::ACToolboxWoss, and woss::BellhopWoss.
References bearing, debug, woss::CoordZ::getCartDistance(), woss::Coord::getGreatCircleDistance(), woss::Coord::getInitialBearing(), rx_coordz, total_distance, total_great_circle_distance, tx_coordz, and woss_id.
Referenced by woss::ACToolboxWoss::initialize(), and woss::BellhopCreator::initializeWoss().
Woss & Woss::insertFrequencies | ( | double | freq_start, |
double | freq_end, | ||
double | freq_step | ||
) |
Insert a range of valid frequencies
freq_start | a valid frequency value [Hz] |
freq_end | a valid frequency value [Hz] >= freq_start |
freq_step | a valid frequency value [Hz] |
References freq_end(), and frequencies.
Referenced by Woss().
|
inline |
Insert a frequency value into the FreqSet
freq | a valid frequency value [Hz] |
References frequencies.
|
virtual |
Checks if instance is already running the channel simulator
References is_running, and woss_mutex.
Referenced by woss::WossManagerResDbMT::getWossPressure(), and woss::WossManagerResDbMT::getWossTimeArr().
|
pure virtual |
Checks the validity of Woss
Implemented in woss::ACToolboxWoss, and woss::BellhopWoss.
|
protectedvirtual |
Creates the temporary work directory
curr_frequency | frequency in use [Hz] |
curr_run | current run value < total_runs |
References current_time, debug, work_dir_path, and woss_id.
Referenced by woss::BellhopWoss::writeCfgFiles().
|
protectedvirtual |
Removes the temporary work directory
curr_frequency | frequency in use [Hz] |
curr_run | current run value < total_runs |
References current_time, work_dir_path, and woss_id.
Referenced by woss::BellhopWoss::removeCfgFiles().
|
pure virtual |
Runs the channel simulator. It is mandatory to set is_running to true at the beginning of this function and set it to false before returning.
Implemented in woss::BellhopWoss.
Referenced by woss::WossManagerResDb::getWossPressure(), woss::WossManagerResDbMT::getWossPressure(), woss::WossManager::getWossPressure(), woss::WossManagerResDb::getWossTimeArr(), woss::WossManagerResDbMT::getWossTimeArr(), and woss::WossManager::getWossTimeArr().
|
inline |
Sets clean work dir flag
flag | debug flag |
References clean_workdir.
Referenced by woss::WossCreator::initializeWoss().
|
inline |
Sets debug flag
flag | debug flag |
References debug.
Referenced by woss::WossCreator::initializeWoss().
|
inline |
Sets time evolution threshold
value | time threshold in seconds. |
References evolution_time_quantum.
Referenced by woss::WossCreator::initializeWoss().
Copys the given FreqSet
freq_set | const reference to a FreqSet |
References frequencies.
Sets start date time
coordz | const reference to a valid Time object |
References start_time.
|
inline |
Sets the total number of channel simulator's runs
runs | number of runs |
References total_runs.
Referenced by woss::WossCreator::initializeWoss().
|
inline |
Sets the work pathname
path | valid pathname |
References work_dir_path.
Referenced by woss::WossCreator::initializeWoss().
|
inline |
Sets the WossDbManager pointer
path | const pointer to a const WossDbManager object |
References db_manager.
Referenced by woss::WossCreator::initializeWoss().
|
pure virtual |
Performs a time evoulion of all time-dependant parameters
time_value | constant reference to a valid Time object ( between start_time and end_time) |
Implemented in woss::BellhopWoss.
Referenced by woss::WossManagerResDb::getWossPressure(), woss::WossManagerResDbMT::getWossPressure(), woss::WossManager::getWossPressure(), woss::WossManagerResDb::getWossTimeArr(), woss::WossManagerResDbMT::getWossTimeArr(), and woss::WossManager::getWossTimeArr().
|
inline |
Checks if instance is using debug
References debug.
Referenced by woss::ArrAscResReader::getArrAscFile(), woss::ArrAscResReader::getArrAscHeader(), woss::ArrBinResReader::getArrBinFile(), woss::ArrBinResReader::getArrBinHeader(), woss::ShdResReader::getShdFile(), woss::ShdResReader::getShdHeader(), woss::ArrAscResReader::readMapAvgPressure(), woss::ArrBinResReader::readMapAvgPressure(), and woss::ShdResReader::readMapAvgPressure().
|
friend |
Function used to destroy the static pthread_spin_t woss_mutex
|
protected |
Initial bearing between tx_coordz and rx_coordz [radians]
Referenced by getBearing(), woss::ACToolboxWoss::initCoordZVector(), and initialize().
|
protected |
flag for removing working dir
Referenced by setCleanWorkDir().
|
protected |
Valid current simulated time (between start and end time)
Referenced by getCurrentTime(), woss::BellhopWoss::initCfgFiles(), woss::ACToolboxWoss::initSSPVector(), mkWorkDir(), rmWorkDir(), and woss::BellhopWoss::timeEvolve().
|
protected |
Constant pointer to the DbManager instance
Referenced by woss::ACToolboxWoss::initAltimetry(), woss::ACToolboxWoss::initCoordZVector(), woss::ACToolboxWoss::initSediment(), woss::ACToolboxWoss::initSSPVector(), and setWossDbManager().
|
protected |
Debug flag
Referenced by woss::BellhopWoss::checkAngles(), woss::BellhopWoss::checkDepthOffsets(), woss::BellhopWoss::checkRangeOffsets(), woss::BellhopWoss::getTimeArr(), woss::ACToolboxWoss::initAltimetry(), woss::ACToolboxWoss::initCoordZVector(), initialize(), woss::ACToolboxWoss::initRangeVector(), woss::ACToolboxWoss::initSediment(), woss::ACToolboxWoss::initSSPVector(), mkWorkDir(), woss::BellhopWoss::normalizeDbSSP(), woss::BellhopWoss::run(), setDebug(), woss::BellhopWoss::timeEvolve(), usingDebug(), woss::BellhopWoss::writeAltimetryFile(), and woss::BellhopWoss::writeBathymetryFile().
|
protected |
Valid end date time value, for SSP averaging purposes
Referenced by getEndTime(), woss::ACToolboxWoss::isValid(), setEndTime(), woss::BellhopWoss::timeEvolve(), and Woss().
|
protected |
Time threshold in seconds. For time evolution purposes. A value < 0 ==> evoulion is off A value == 0 ==> no threshold
Referenced by getEvolutionTimeQuantum(), setEvolutionTimeQuantum(), and woss::BellhopWoss::timeEvolve().
|
protected |
Frequencies in use
Referenced by woss::BellhopWoss::checkBoundaries(), clearFrequencies(), eraseFrequency(), freq_begin(), freq_end(), freq_lower_bound(), freq_rbegin(), freq_rend(), freq_upper_bound(), getFrequencies(), getMaxFrequency(), getMinFrequency(), insertFrequencies(), insertFrequency(), woss::ACToolboxWoss::isValid(), woss::BellhopWoss::removeAllCfgFiles(), woss::BellhopWoss::run(), setFrequencies(), and woss::BellhopWoss::writeAllCfgFiles().
|
protected |
Running flag
Referenced by isRunning(), and woss::BellhopWoss::run().
|
protected |
Receiver CoordZ
Referenced by woss::BellhopWoss::checkBoundaries(), woss::BellhopWoss::checkDepthOffsets(), woss::BellhopWoss::checkRangeOffsets(), getRxCoordZ(), woss::ACToolboxWoss::initAltimetry(), woss::ACToolboxWoss::initCoordZVector(), initialize(), woss::ACToolboxWoss::isValid(), setRxCoordZ(), woss::BellhopWoss::writeBeamPatternFile(), and woss::BellhopWoss::writeReceiver().
|
protected |
Valid start date time value, for SSP averaging purposes
Referenced by getStartTime(), woss::ACToolboxWoss::isValid(), setStartTime(), woss::BellhopWoss::timeEvolve(), and Woss().
|
protected |
Cartesian distance between tx_coordz and rx_coordz [m]
Referenced by woss::BellhopWoss::checkAngles(), getDistance(), woss::BellhopWoss::initialize(), and initialize().
|
protected |
Surface great-circle distance between tx_coordz and rx_coordz [m]
Referenced by woss::BellhopWoss::checkAngles(), woss::BellhopWoss::checkBoundaries(), woss::BellhopWoss::checkRangeOffsets(), getGreatCircleDistance(), woss::BellhopWoss::initialize(), initialize(), woss::ACToolboxWoss::initRangeVector(), and woss::BellhopWoss::writeReceiver().
|
protected |
Total number of channel simulator's runs
Referenced by woss::BellhopWoss::getAvgPressure(), woss::BellhopWoss::getPressure(), woss::BellhopWoss::getTimeArr(), getTotalRuns(), woss::BellhopWoss::removeAllCfgFiles(), woss::BellhopWoss::run(), setTotalRuns(), and woss::BellhopWoss::writeAllCfgFiles().
|
protected |
Transmitter CoordZ
Referenced by woss::BellhopWoss::checkBoundaries(), woss::BellhopWoss::checkDepthOffsets(), woss::BellhopWoss::checkRangeOffsets(), getTxCoordZ(), woss::ACToolboxWoss::initAltimetry(), woss::ACToolboxWoss::initCoordZVector(), initialize(), woss::ACToolboxWoss::initSediment(), woss::ACToolboxWoss::initSSPVector(), woss::ACToolboxWoss::isValid(), woss::BellhopWoss::normalizeDbSSP(), setTxCoordZ(), woss::BellhopWoss::writeBeamPatternFile(), and woss::BellhopWoss::writeTransmitter().
|
protected |
Directory path for temporary files (e.g. channel simulator files)
Referenced by getWorkDirPath(), woss::BellhopWoss::initCfgFiles(), mkWorkDir(), rmWorkDir(), and setWorkDirPath().
|
staticprotected |
|
protected |
id of specific instance
Referenced by woss::BellhopWoss::checkAngles(), woss::BellhopWoss::checkDepthOffsets(), woss::BellhopWoss::checkRangeOffsets(), woss::BellhopWoss::getTimeArr(), getWossId(), woss::ACToolboxWoss::initAltimetry(), woss::BellhopWoss::initCfgFiles(), woss::ACToolboxWoss::initCoordZVector(), initialize(), woss::ACToolboxWoss::initRangeVector(), woss::ACToolboxWoss::initSediment(), woss::ACToolboxWoss::initSSPVector(), mkWorkDir(), rmWorkDir(), woss::BellhopWoss::run(), woss::BellhopWoss::setBhMode(), woss::BellhopWoss::timeEvolve(), Woss(), Woss(), woss::BellhopWoss::writeAltimetryFile(), woss::BellhopWoss::writeBathymetryFile(), and woss::BellhopWoss::writeHeader().
|
staticprotected |
Spinlock for syncronization purposes
Referenced by isRunning(), Woss(), and Woss().