openModeller  Version 1.5.0
AquaMaps Class Reference

#include <aquamaps.hh>

Inheritance diagram for AquaMaps:
Inheritance graph
Collaboration diagram for AquaMaps:
Collaboration graph

Public Member Functions

 AquaMaps ()
 
 ~AquaMaps ()
 
int initialize ()
 
int iterate ()
 
int getConvergence (Scalar *const val) const
 
float getProgress () const
 
int done () const
 
Scalar getValue (const Sample &x) const
 
- Public Member Functions inherited from AlgorithmImpl
 AlgorithmImpl (AlgMetadata const *metadata)
 
virtual ~AlgorithmImpl ()
 
void setParameters (int nparam, AlgParameter const *param)
 
void setParameters (const ParamSetType &)
 
std::string const getID () const
 
AlgMetadata const * getMetadata () const
 
AlgorithmPtr getFreshCopy ()
 
virtual int supportsModelProjection () const
 
Model createModel (const SamplerPtr &samp, CallbackWrapper *func=0)
 
void setSampler (const SamplerPtr &samp)
 
virtual int finalize ()
 
virtual int needNormalization ()
 
NormalizergetNormalizer () const
 
void setNormalization (const SamplerPtr &samp) const
 
void setNormalization (const EnvironmentPtr &env) const
 
virtual Model getModel () const
 
ConfigurationPtr getConfiguration () const
 
void setConfiguration (const ConstConfigurationPtr &)
 
- Public Member Functions inherited from Configurable
virtual ~Configurable ()
 

Protected Member Functions

virtual void _getConfiguration (ConfigurationPtr &) const
 
virtual void _setConfiguration (const ConstConfigurationPtr &)
 
- Protected Member Functions inherited from AlgorithmImpl
int dimDomain ()
 
int getParameter (std::string const &name, std::string *value)
 
int getParameter (std::string const &name, double *value)
 
int getParameter (std::string const &name, float *value)
 
int getParameter (std::string const &name, int *value)
 

Private Member Functions

int _getAndCheckParameter (std::string const &name, int *value)
 
void _calculateEnvelopes (const OccurrencesPtr &)
 
void _percentile (Scalar *result, int n, double percent, std::vector< ScalarVector > *matrix, int layerIndex)
 
void _readSpeciesData (const char *species)
 
bool _hasExpertRange (sqlite3_stmt *stmt, int varIndex)
 
void _adjustInterquartile (int layerIndex, Scalar adjmin, Scalar adjmax)
 
void _ensureEnvelopeSize (int layerIndex)
 
void _logEnvelope ()
 
int _getRelatedIndex (int index)
 

Private Attributes

int * _use_layer
 
Sample _lower_limit
 
Sample _upper_limit
 
Sample _inner_size
 
Sample _minimum
 
Sample _maximum
 
Sample _pref_minimum
 
Sample _pref_maximum
 
int _pelagic
 
int _use_surface_layers
 
bool * _has_expert_range
 
float _progress
 

Additional Inherited Members

- Public Types inherited from AlgorithmImpl
typedef std::map< icstring,
std::string > 
ParamSetType
 
- Protected Attributes inherited from AlgorithmImpl
SamplerPtr _samp
 
Normalizer_normalizerPtr
 
ParamSetType _param
 

Detailed Description

AquaMaps Algorithm

Definition at line 183 of file aquamaps.hh.

Constructor & Destructor Documentation

AquaMaps::AquaMaps ( )

Definition at line 235 of file aquamaps.cpp.

AquaMaps::~AquaMaps ( )

Definition at line 255 of file aquamaps.cpp.

References _has_expert_range, and _use_layer.

Member Function Documentation

void AquaMaps::_adjustInterquartile ( int  layerIndex,
Scalar  adjmin,
Scalar  adjmax 
)
private

Make the interquartile adjusting

Definition at line 882 of file aquamaps.cpp.

References _getRelatedIndex(), _lower_limit, _maximum, _minimum, and _upper_limit.

Referenced by _calculateEnvelopes().

Here is the call graph for this function:

void AquaMaps::_calculateEnvelopes ( const OccurrencesPtr occs)
private
void AquaMaps::_ensureEnvelopeSize ( int  layerIndex)
private

Ensure that the envelope has a minimum size

Definition at line 899 of file aquamaps.cpp.

References _getRelatedIndex(), _inner_size, _lower_limit, _maximum, _minimum, _pref_maximum, _pref_minimum, and _upper_limit.

Referenced by _calculateEnvelopes().

Here is the call graph for this function:

int AquaMaps::_getAndCheckParameter ( std::string const &  name,
int *  value 
)
private

Get a Boolean parameter and check its value.

Parameters
nameParameter name.
valueParameter value.
Returns
Zero if the parameter does not exists or the parameters were not set yet.

Definition at line 401 of file aquamaps.cpp.

References Log::error(), AlgorithmImpl::getParameter(), and Log::instance().

Referenced by initialize().

Here is the call graph for this function:

void AquaMaps::_getConfiguration ( ConfigurationPtr config) const
protectedvirtual

Reimplemented from AlgorithmImpl.

Definition at line 1111 of file aquamaps.cpp.

References _maximum, _minimum, _pelagic, _pref_maximum, _pref_minimum, _use_layer, _use_surface_layers, and done().

Here is the call graph for this function:

int AquaMaps::_getRelatedIndex ( int  index)
private

Return the 0-6 index from the constants defined in this header related to the 0-8 index from the complete set of layers.

Definition at line 1187 of file aquamaps.cpp.

Referenced by _adjustInterquartile(), and _ensureEnvelopeSize().

bool AquaMaps::_hasExpertRange ( sqlite3_stmt *  stmt,
int  varIndex 
)
private

Fetch expert range data for a specific variable

Definition at line 804 of file aquamaps.cpp.

References _maximum, _minimum, _pref_maximum, _pref_minimum, DISTANCE_TO_LAND, ICE_CONCENTRATION, PRIMARY_PRODUCTION, SALINITY, and TEMPERATURE.

Referenced by _readSpeciesData().

void AquaMaps::_logEnvelope ( )
private

Log the bioclimatic envelopes information.

Definition at line 1171 of file aquamaps.cpp.

References _maximum, _minimum, _pref_maximum, _pref_minimum, Log::info(), Log::instance(), and Sample::size().

Here is the call graph for this function:

void AquaMaps::_percentile ( Scalar result,
int  n,
double  percent,
std::vector< ScalarVector > *  matrix,
int  layerIndex 
)
private

Calculate a percentile

Definition at line 642 of file aquamaps.cpp.

Referenced by _calculateEnvelopes().

void AquaMaps::_readSpeciesData ( const char *  species)
private

Read species data from expert database

Definition at line 671 of file aquamaps.cpp.

References _has_expert_range, _hasExpertRange(), _maximum, _minimum, _pelagic, _pref_maximum, _pref_minimum, Log::debug(), ICE_CONCENTRATION, Log::info(), Log::instance(), MAXDEPTH, MINDEPTH, NAME, omDataPath(), TEMPERATURE, and Log::warn().

Referenced by _calculateEnvelopes().

Here is the call graph for this function:

void AquaMaps::_setConfiguration ( const ConstConfigurationPtr config)
protectedvirtual

Reimplemented from AlgorithmImpl.

Definition at line 1132 of file aquamaps.cpp.

References _maximum, _minimum, _pelagic, _pref_maximum, _pref_minimum, _progress, _use_layer, _use_surface_layers, Log::error(), AttributeNotFound::getName(), and Log::instance().

Here is the call graph for this function:

int AquaMaps::done ( ) const
virtual

Return != 0 if algorithm finished.

Reimplemented from AlgorithmImpl.

Definition at line 391 of file aquamaps.cpp.

References _progress.

Referenced by _getConfiguration().

int AquaMaps::getConvergence ( Scalar *const  val) const
virtual

Returns the algorithm's convergence value at the moment

Reimplemented from AlgorithmImpl.

Definition at line 372 of file aquamaps.cpp.

float AquaMaps::getProgress ( ) const
virtual

Returns progress so far (between 0.0 and 1.0)

Reimplemented from AlgorithmImpl.

Definition at line 382 of file aquamaps.cpp.

References _progress.

Scalar AquaMaps::getValue ( const Sample x) const
virtual

The algorithm must return the occurrence probability at the given environment conditions.

Parameters
xEnvironmental conditions.
Returns
The occurrence probability in the range [0,1].

Implements AlgorithmImpl.

Definition at line 959 of file aquamaps.cpp.

References _maximum, _minimum, _pelagic, _pref_maximum, _pref_minimum, _use_layer, _use_surface_layers, MAXDEPTH, MINDEPTH, SALINITY, Sample::size(), and TEMPERATURE.

Here is the call graph for this function:

int AquaMaps::iterate ( )
virtual

One step further on the training. Return 0 if something wrong happened.

Reimplemented from AlgorithmImpl.

Definition at line 359 of file aquamaps.cpp.

References _calculateEnvelopes(), AlgorithmImpl::_samp, Log::info(), and Log::instance().

Here is the call graph for this function:

Member Data Documentation

bool* AquaMaps::_has_expert_range
private

Indicates if the variable has an expert range in the local database.

Definition at line 277 of file aquamaps.hh.

Referenced by _calculateEnvelopes(), _readSpeciesData(), initialize(), and ~AquaMaps().

Sample AquaMaps::_inner_size
private

Recommended values for the inner envelope sizes

Definition at line 252 of file aquamaps.hh.

Referenced by _ensureEnvelopeSize().

Sample AquaMaps::_lower_limit
private

Lower limit for each variable

Definition at line 246 of file aquamaps.hh.

Referenced by _adjustInterquartile(), _calculateEnvelopes(), and _ensureEnvelopeSize().

Sample AquaMaps::_maximum
private
Sample AquaMaps::_minimum
private
int AquaMaps::_pelagic
private

Indicates if the species is pelagic or not (-1 indicates no data). Note: pelagic means "belonging to the upper layers of the open sea" (poetic, huh?).

Definition at line 269 of file aquamaps.hh.

Referenced by _getConfiguration(), _readSpeciesData(), _setConfiguration(), and getValue().

Sample AquaMaps::_pref_maximum
private
Sample AquaMaps::_pref_minimum
private
float AquaMaps::_progress
private

Indication of progress during model creation.

Definition at line 280 of file aquamaps.hh.

Referenced by _calculateEnvelopes(), _setConfiguration(), done(), and getProgress().

Sample AquaMaps::_upper_limit
private

Upper limit for each variable

Definition at line 249 of file aquamaps.hh.

Referenced by _adjustInterquartile(), _calculateEnvelopes(), and _ensureEnvelopeSize().

int* AquaMaps::_use_layer
private

Indicates if the respective layer should be used or not when calculating probabilities

Definition at line 243 of file aquamaps.hh.

Referenced by _getConfiguration(), _setConfiguration(), getValue(), initialize(), and ~AquaMaps().

int AquaMaps::_use_surface_layers
private

Indicates if surface layers should be used for temperature and salinity (-1 means that aquamaps should try to find out by using depth ranges specified in its internal database).

Definition at line 274 of file aquamaps.hh.

Referenced by _calculateEnvelopes(), _getConfiguration(), _setConfiguration(), getValue(), and initialize().


The documentation for this class was generated from the following files: