openModeller  Version 1.4.0
ConsensusAlgorithm Class Reference

#include <consensus.hh>

Inheritance diagram for ConsensusAlgorithm:
Collaboration diagram for ConsensusAlgorithm:

List of all members.

Public Member Functions

 ConsensusAlgorithm ()
 ~ConsensusAlgorithm ()
int needNormalization ()
int initialize ()
int iterate ()
float getProgress () const
int done () const
Scalar getValue (const Sample &x) const
int getConvergence (Scalar *const val) const

Protected Member Functions

void _getConfiguration (ConfigurationPtr &) const
void _setConfiguration (const ConstConfigurationPtr &)
bool _setAlgorithm (std::string alg_str)

Protected Attributes

bool _done
bool _initialized
Sample _weights
Scalar _sum_weights
Sample _thresholds
vector< AlgorithmPtr_algs
int _num_algs
int _agreement
vector< Normalizer * > _norms

Detailed Description

Declaration of Consensus algorithm class.

Author:
Renato De Giovanni (renato [at] cria org br)
Id:
consensus.hh 5624 2012-09-08 16:46:57Z rdg

LICENSE INFORMATION

Copyright(c) 2011 by CRIA - Centro de Referencia em Informacao Ambiental

http://www.cria.org.br

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details:

http://www.gnu.org/copyleft/gpl.html Algorithm to generate models with other algorithms.

Definition at line 41 of file consensus.hh.


Constructor & Destructor Documentation

Definition at line 193 of file consensus.cpp.

Definition at line 206 of file consensus.cpp.

References _algs, and _norms.


Member Function Documentation

void ConsensusAlgorithm::_getConfiguration ( ConfigurationPtr config) const [protected, virtual]

Reimplemented from AlgorithmImpl.

Definition at line 548 of file consensus.cpp.

References _algs, _done, _num_algs, and _thresholds.

bool ConsensusAlgorithm::_setAlgorithm ( std::string  alg_str) [protected]

Definition at line 330 of file consensus.cpp.

References _algs, _norms, CONSENSUS_LOG_PREFIX, Log::error(), Log::instance(), and AlgorithmFactory::newAlgorithm().

Referenced by initialize().

Here is the call graph for this function:

int ConsensusAlgorithm::done ( ) const [virtual]

Return != 0 if algorithm finished.

Reimplemented from AlgorithmImpl.

Definition at line 494 of file consensus.cpp.

References _done.

Referenced by iterate().

int ConsensusAlgorithm::getConvergence ( Scalar *const  val) const [virtual]

Returns the algorithm's convergence value at the moment

Reimplemented from AlgorithmImpl.

Definition at line 539 of file consensus.cpp.

float ConsensusAlgorithm::getProgress ( ) const [virtual]

Returns progress so far (between 0.0 and 1.0)

Reimplemented from AlgorithmImpl.

Definition at line 478 of file consensus.cpp.

References _algs, and _num_algs.

Scalar ConsensusAlgorithm::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 502 of file consensus.cpp.

References _agreement, _algs, _norms, _num_algs, _sum_weights, _thresholds, and _weights.

int ConsensusAlgorithm::iterate ( ) [virtual]

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

Reimplemented from AlgorithmImpl.

Definition at line 419 of file consensus.cpp.

References _algs, _done, _norms, _num_algs, AlgorithmImpl::_samp, _thresholds, and done().

Here is the call graph for this function:

The algorithm should return != 0 if it needs normalization of environmental variables (non categorical ones).

Reimplemented from AlgorithmImpl.

Definition at line 219 of file consensus.cpp.

Referenced by initialize().


Member Data Documentation

Definition at line 78 of file consensus.hh.

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

bool ConsensusAlgorithm::_done [protected]

Definition at line 66 of file consensus.hh.

Referenced by _getConfiguration(), _setConfiguration(), done(), and iterate().

Definition at line 68 of file consensus.hh.

Referenced by _setConfiguration().

Definition at line 71 of file consensus.hh.

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

Definition at line 70 of file consensus.hh.

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


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