openModeller
Version 1.5.0
|
#include <aquamaps.hh>
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 () |
Normalizer * | getNormalizer () 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 |
AquaMaps Algorithm
Definition at line 183 of file aquamaps.hh.
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.
Make the interquartile adjusting
Definition at line 882 of file aquamaps.cpp.
References _getRelatedIndex(), _lower_limit, _maximum, _minimum, and _upper_limit.
Referenced by _calculateEnvelopes().
|
private |
Calculate the envelopes
Definition at line 423 of file aquamaps.cpp.
References _adjustInterquartile(), _ensureEnvelopeSize(), _has_expert_range, _lower_limit, _maximum, _minimum, _percentile(), _pref_maximum, _pref_minimum, _progress, _readSpeciesData(), _upper_limit, _use_surface_layers, BOTTOM_LOWER_LIMIT, BOTTOM_UPPER_LIMIT, Log::debug(), DEPTH_LIMIT, Log::info(), Log::instance(), MAXDEPTH, MINDEPTH, SALINITY, Sample::size(), and TEMPERATURE.
Referenced by iterate().
|
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().
|
private |
Get a Boolean parameter and check its value.
name | Parameter name. |
value | Parameter value. |
Definition at line 401 of file aquamaps.cpp.
References Log::error(), AlgorithmImpl::getParameter(), and Log::instance().
Referenced by initialize().
|
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().
|
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().
|
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().
|
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().
|
private |
Calculate a percentile
Definition at line 642 of file aquamaps.cpp.
Referenced by _calculateEnvelopes().
|
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().
|
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().
|
virtual |
Return != 0 if algorithm finished.
Reimplemented from AlgorithmImpl.
Definition at line 391 of file aquamaps.cpp.
References _progress.
Referenced by _getConfiguration().
|
virtual |
Returns the algorithm's convergence value at the moment
Reimplemented from AlgorithmImpl.
Definition at line 372 of file aquamaps.cpp.
|
virtual |
Returns progress so far (between 0.0 and 1.0)
Reimplemented from AlgorithmImpl.
Definition at line 382 of file aquamaps.cpp.
References _progress.
The algorithm must return the occurrence probability at the given environment conditions.
x | Environmental conditions. |
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.
|
virtual |
Initiate a new training.
Implements AlgorithmImpl.
Definition at line 271 of file aquamaps.cpp.
References _getAndCheckParameter(), _has_expert_range, AlgorithmImpl::_samp, _use_layer, _use_surface_layers, DISTANCE_TO_LAND, Log::error(), AlgorithmImpl::getParameter(), ICE_CONCENTRATION, Log::info(), Log::instance(), MAXDEPTH, MINDEPTH, PARAM_USE_DEPTH_RANGE, PARAM_USE_DISTANCE_TO_LAND, PARAM_USE_ICE_CONCENTRATION, PARAM_USE_PRIMARY_PRODUCTION, PARAM_USE_SALINITY, PARAM_USE_SURFACE_LAYERS, PARAM_USE_TEMPERATURE, PRIMARY_PRODUCTION, SALINITY, and TEMPERATURE.
|
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().
|
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().
|
private |
Recommended values for the inner envelope sizes
Definition at line 252 of file aquamaps.hh.
Referenced by _ensureEnvelopeSize().
|
private |
Lower limit for each variable
Definition at line 246 of file aquamaps.hh.
Referenced by _adjustInterquartile(), _calculateEnvelopes(), and _ensureEnvelopeSize().
|
private |
Maximum value for each variable.
Definition at line 258 of file aquamaps.hh.
Referenced by _adjustInterquartile(), _calculateEnvelopes(), _ensureEnvelopeSize(), _getConfiguration(), _hasExpertRange(), _logEnvelope(), _readSpeciesData(), _setConfiguration(), and getValue().
|
private |
Minimum value for each variable.
Definition at line 255 of file aquamaps.hh.
Referenced by _adjustInterquartile(), _calculateEnvelopes(), _ensureEnvelopeSize(), _getConfiguration(), _hasExpertRange(), _logEnvelope(), _readSpeciesData(), _setConfiguration(), and getValue().
|
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().
|
private |
Prefered maximum for each variable.
Definition at line 264 of file aquamaps.hh.
Referenced by _calculateEnvelopes(), _ensureEnvelopeSize(), _getConfiguration(), _hasExpertRange(), _logEnvelope(), _readSpeciesData(), _setConfiguration(), and getValue().
|
private |
Prefered minimum for each variable.
Definition at line 261 of file aquamaps.hh.
Referenced by _calculateEnvelopes(), _ensureEnvelopeSize(), _getConfiguration(), _hasExpertRange(), _logEnvelope(), _readSpeciesData(), _setConfiguration(), and getValue().
|
private |
Indication of progress during model creation.
Definition at line 280 of file aquamaps.hh.
Referenced by _calculateEnvelopes(), _setConfiguration(), done(), and getProgress().
|
private |
Upper limit for each variable
Definition at line 249 of file aquamaps.hh.
Referenced by _adjustInterquartile(), _calculateEnvelopes(), and _ensureEnvelopeSize().
|
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().
|
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().