openModeller  Version 1.5.0
GenericTemplate Class Reference

#include <generictemplate.hh>

Inheritance diagram for GenericTemplate:
Inheritance graph
Collaboration diagram for GenericTemplate:
Collaboration graph

Public Member Functions

 GenericTemplate ()
 
 ~GenericTemplate ()
 
int initialize (int ncycle)
 
int iterate ()
 
int done () const
 
Scalar getValue (Scalar const *x) const
 
int getConvergence (Scalar *val)
 

Private Attributes

int f_done
 
Scalarf_avg
 Average related to occurrence points. More...
 
int f_dim
 Dimension of environmental space. More...
 
int f_localityCount
 

Detailed Description

This is a generic template intended to be used as the basis for creating new algorithms.

Author
Tim Sutton (t.sut.nosp@m.ton@.nosp@m.readi.nosp@m.ng.a.nosp@m.c.uk)
Date
2003-09-12
Id:
generictemplate.hh 5844 2013-08-22 15:16:12Z rdg

LICENSE INFORMATION

Copyright(c) 2003 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 This is a simple template for creating new algorithms. Note it does not actually run a model - rather it demonstrates how to do a new algorithm implementation.

Author
Tim Sutton

Definition at line 41 of file generictemplate.hh.

Constructor & Destructor Documentation

GenericTemplate::GenericTemplate ( )

Constructor for GenericTemplate

Constructor for GenericTemplate

Parameters
Sampleris class that will fetch environment variable values at each occurrence / locality

Definition at line 22 of file generictemplate.cpp.

GenericTemplate::~GenericTemplate ( )

This is the descructor for the GenericTemplate class

Definition at line 29 of file generictemplate.cpp.

Member Function Documentation

int GenericTemplate::done ( ) const

Use this method to find out if the model has completed (e.g. convergence point has been met.

Note
This method is inherited from the Algorithm class
Returns
Implementation specific but usually 1 for completion.

Definition at line 82 of file generictemplate.cpp.

int GenericTemplate::getConvergence ( Scalar val)

Returns a value that represents the convergence of the algorithm expressed as a number between 0 and 1 where 0 represents model completion.

Returns
Parameters
val

Returns a value that represents the convergence of the algorithm expressed as a number between 0 and 1 where 0 represents model completion.

Returns
Parameters
Scalar*val

Definition at line 108 of file generictemplate.cpp.

Scalar GenericTemplate::getValue ( Scalar const *  x) const

This method is used when projecting the model.

Note
This method is inherited from the Algorithm class
Returns
Parameters
xa pointer to a vector of openModeller Scalar type (currently double). The vector should contain values looked up on the environmental variable layers into which the mode is being projected.

This method is used when projecting the model.

Note
This method is inherited from the Algorithm class
Returns
Parameters
Scalar*x a pointer to a vector of openModeller Scalar type (currently double). The vector should contain values looked up on the environmental variable layers into which the mode is being projected.

Definition at line 97 of file generictemplate.cpp.

int GenericTemplate::initialize ( int  ncycle)

Initialise the model specifying a threshold / cutoff point. This is optional (model dependent).

Note
This method is inherited from the Algorithm class
Returns
0 on error

Initialise the model specifying a threshold / cutoff point. This is optional (model dependent).

Note
This method is inherited from the Algorithm class
Parameters
@return0 on error

Definition at line 57 of file generictemplate.cpp.

References f_dim, and f_localityCount.

int GenericTemplate::iterate ( )

Start model execution (build the model).

Note
This method is inherited from the Algorithm class
Returns
0 on error

Definition at line 70 of file generictemplate.cpp.

Member Data Documentation

Scalar* GenericTemplate::f_avg
private

Average related to occurrence points.

Definition at line 103 of file generictemplate.hh.

int GenericTemplate::f_dim
private

Dimension of environmental space.

Definition at line 104 of file generictemplate.hh.

Referenced by initialize().

int GenericTemplate::f_done
private

This member variable is used to indicate whether the model building process has completed yet.

Definition at line 101 of file generictemplate.hh.

int GenericTemplate::f_localityCount
private

Definition at line 106 of file generictemplate.hh.

Referenced by initialize().


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