41 #define PARAM_MAXDIST "MaxDist"
54 "Maximum cartesian distance to be considered",
55 "Maximum cartesian distance to be considered",
72 "Distance to average",
76 "Probability is inversely proportional to the cartesian distance\
77 in environmental space to the mean point (calculated with all\
81 "Normalizes the environmental variables values and the\
82 parameter (according to the number of environmental variables).\
83 Calculates the mean point in environmental space\
84 considering all given presence points. When projecting the\
85 result, it calculates the Euclidean distance between the\
86 average point and each point in the environmental space.\
87 If the distance 'dist' is in [0, MAXDIST] then the probability\
88 of occurrence will be in [1,0] (linear decay).\
89 If 'dist' > MAXDIST then the probability will be zero.",
95 "mauro [at] cria.org.br",
168 int dim =
_samp->numIndependent();
172 _dist *= sqrt( (
double) dim );
183 int npnt =
_samp->numPresence();
199 while ( pres != fin ) {
200 _avg += (*pres)->environment();
207 for (
int d = 0; d < dim; d++ )
240 static int first_time = 1;
260 return (dist <=
_dist) ? 1.0 - (dist /
_dist) : 0.0;
282 config->addSubsection( model_config );
284 model_config->addNameValue(
"Distance",
_dist );
285 model_config->addNameValue(
"Average",
_avg );
297 _dist = model_config->getAttributeAsDouble(
"Distance", 0.0 );
298 _avg = model_config->getAttributeAsSample(
"Average" );
double Scalar
Type of map values.
static Log * instance()
Returns the instance pointer, creating the object on the first call.
Sample _avg
Average related to occurrence points.
Scalar _max
Store the maximum distance (for debug).
int getParameter(std::string const &name, std::string *value)
virtual ~DistanceToAverage()
void resize(std::size_t size)
virtual void _getConfiguration(ConfigurationPtr &) const
Scalar getValue(const Sample &x) const
int getConvergence(Scalar *val)
static AlgMetadata metadata
void info(const char *format,...)
'Info' level.
Scalar _min
Store the minimum distance (for debug).
OM_ALG_DLL_EXPORT AlgorithmImpl * algorithmFactory()
std::vector< OccurrencePtr >::const_iterator const_iterator
Normalizer * _normalizerPtr
static AlgParamMetadata parameters[NUM_PARAM]
virtual void _setConfiguration(const ConstConfigurationPtr &)
OM_ALG_DLL_EXPORT AlgMetadata const * algorithmMetadata()