openModeller
Version 1.4.0
|
#include <request_file.hh>
Definition at line 47 of file request_file.hh.
Class to read model creation/projection parameters from a request file and run om.
LICENSE INFORMATION
Copyright(c) 2003 by CRIA - Centro de Referencia em Informacao Ambiental
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
Definition at line 41 of file request_file.cpp.
Definition at line 63 of file request_file.cpp.
int RequestFile::_readParameters | ( | AlgParameter * | result, |
AlgMetadata const * | metadata, | ||
std::vector< std::string > | str_param | ||
) | [private] |
Definition at line 433 of file request_file.cpp.
References extractParameter(), AlgParamMetadata::id, AlgParameter::id(), AlgMetadata::nparam, AlgMetadata::param, AlgParameter::setId(), AlgParameter::setValue(), and AlgParamMetadata::typical.
Referenced by _setAlgorithm().
int RequestFile::_setAlgorithm | ( | OpenModeller * | om, |
FileParser & | fp | ||
) | [private] |
Definition at line 348 of file request_file.cpp.
References _inputModelFile, _readParameters(), OpenModeller::algorithmMetadata(), Log::error(), FileParser::get(), FileParser::getAll(), AlgMetadata::id, Log::instance(), metadata, AlgMetadata::nparam, OpenModeller::setAlgorithm(), and Log::warn().
Referenced by configure().
int RequestFile::_setEnvironment | ( | OpenModeller * | om, |
FileParser & | fp | ||
) | [private] |
Definition at line 209 of file request_file.cpp.
References _inputMask, _inputModelFile, Log::error(), FileParser::get(), FileParser::getAll(), Log::info(), Log::instance(), OpenModeller::setEnvironment(), and Log::warn().
Referenced by configure().
int RequestFile::_setOccurrences | ( | OpenModeller * | om, |
FileParser & | fp | ||
) | [private] |
Definition at line 124 of file request_file.cpp.
References _absences, _inputModelFile, _presences, OccurrencesFactory::create(), Log::error(), FileParser::get(), OccurrencesReader::getAbsences(), OccurrencesReader::getPresences(), Log::info(), Log::instance(), OccurrencesFactory::instance(), OpenModeller::setOccurrences(), and Log::warn().
Referenced by configure().
int RequestFile::_setProjection | ( | OpenModeller * | om, |
FileParser & | fp | ||
) | [private] |
Definition at line 259 of file request_file.cpp.
References _inputMask, _inputModelFile, _nonNativeProjection, _outputFormat, _outputMask, _projectionCategoricalMap, _projectionFile, _projectionMap, RasterFactory::create(), Log::error(), FileParser::get(), FileParser::getAll(), Raster::header(), Log::info(), Log::instance(), RasterFactory::instance(), MapFormat::setFormat(), MapFormat::setXMax(), MapFormat::setXMin(), MapFormat::setYMax(), MapFormat::setYMin(), Log::warn(), Header::xmax, Header::xmin, Header::ymax, and Header::ymin.
Referenced by configure().
int RequestFile::algorithmSet | ( | ) | [inline] |
bool RequestFile::calcAuc | ( | ) | [inline] |
Definition at line 72 of file request_file.hh.
References _calcAuc.
Referenced by main(), and makeModel().
bool RequestFile::calcConfusionMatrix | ( | ) | [inline] |
Definition at line 71 of file request_file.hh.
References _calcConfusionMatrix.
Referenced by main(), and makeModel().
int RequestFile::configure | ( | OpenModeller * | om, |
char * | request_file | ||
) |
Loads parameters from the request file.
om | OpenModeller object to be configured. |
request_file | File from which the parameters will be read. |
Definition at line 70 of file request_file.cpp.
References _algorithmSet, _calcAuc, _calcConfusionMatrix, _environmentallyUnique, _environmentSet, _inputModelFile, _occurrencesSet, _outputModelFile, _projectionSet, _setAlgorithm(), _setEnvironment(), _setOccurrences(), _setProjection(), _spatiallyUnique, and FileParser::get().
Referenced by main().
int RequestFile::environmentSet | ( | ) | [inline] |
Definition at line 64 of file request_file.hh.
References _environmentSet.
std::string RequestFile::extractParameter | ( | std::string const | name, |
std::vector< std::string > | vet | ||
) | [private] |
Search for 'name' in the 'nvet' elements of the vector 'vet'. If the string 'name' is in the beginning of some string vet[i] then returns a pointer to the next character of vet[i], otherwise returns 0.
name | Name to be searched. |
vet | Vector of names. |
Definition at line 466 of file request_file.cpp.
Referenced by _readParameters().
Definition at line 425 of file request_file.cpp.
References _absences.
Definition at line 411 of file request_file.cpp.
References _presences, Log::error(), and Log::instance().
void RequestFile::makeModel | ( | OpenModeller * | om | ) |
Definition at line 507 of file request_file.cpp.
References _environmentallyUnique, _inputModelFile, _outputModelFile, _spatiallyUnique, calcAuc(), calcConfusionMatrix(), OpenModeller::createModel(), Log::error(), OpenModeller::error(), OpenModeller::getConfusionMatrix(), OpenModeller::getModelConfiguration(), OpenModeller::getRocCurve(), OpenModeller::getSampler(), RocCurve::getTotalArea(), Log::info(), Log::instance(), Configuration::readXml(), OpenModeller::setModelConfiguration(), Log::warn(), and Configuration::writeXml().
Referenced by main().
void RequestFile::makeProjection | ( | OpenModeller * | om | ) |
Definition at line 594 of file request_file.cpp.
References _nonNativeProjection, _outputFormat, _outputMask, _projectionCategoricalMap, _projectionFile, _projectionMap, _projectionSet, createEnvironment(), OpenModeller::createMap(), Log::error(), and Log::instance().
Referenced by main().
int RequestFile::occurrencesSet | ( | ) | [inline] |
int RequestFile::projectionSet | ( | ) | [inline] |
Definition at line 65 of file request_file.hh.
References _projectionSet.
bool RequestFile::requestedProjection | ( | ) |
OccurrencesPtr RequestFile::_absences [private] |
Definition at line 108 of file request_file.hh.
Referenced by _setOccurrences(), and getAbsences().
int RequestFile::_algorithmSet [private] |
Definition at line 105 of file request_file.hh.
Referenced by algorithmSet(), and configure().
bool RequestFile::_calcAuc [private] |
Definition at line 124 of file request_file.hh.
Referenced by calcAuc(), and configure().
bool RequestFile::_calcConfusionMatrix [private] |
Definition at line 123 of file request_file.hh.
Referenced by calcConfusionMatrix(), and configure().
bool RequestFile::_environmentallyUnique [private] |
Definition at line 122 of file request_file.hh.
Referenced by configure(), and makeModel().
int RequestFile::_environmentSet [private] |
Definition at line 103 of file request_file.hh.
Referenced by configure(), and environmentSet().
std::string RequestFile::_inputMask [private] |
Definition at line 113 of file request_file.hh.
Referenced by _setEnvironment(), and _setProjection().
std::string RequestFile::_inputModelFile [private] |
Definition at line 115 of file request_file.hh.
Referenced by _setAlgorithm(), _setEnvironment(), _setOccurrences(), _setProjection(), configure(), and makeModel().
bool RequestFile::_nonNativeProjection [private] |
Definition at line 110 of file request_file.hh.
Referenced by _setProjection(), and makeProjection().
int RequestFile::_occurrencesSet [private] |
Definition at line 102 of file request_file.hh.
Referenced by configure(), and occurrencesSet().
MapFormat RequestFile::_outputFormat [private] |
Definition at line 119 of file request_file.hh.
Referenced by _setProjection(), and makeProjection().
std::string RequestFile::_outputMask [private] |
Definition at line 114 of file request_file.hh.
Referenced by _setProjection(), and makeProjection().
std::string RequestFile::_outputModelFile [private] |
Definition at line 116 of file request_file.hh.
Referenced by configure(), and makeModel().
OccurrencesPtr RequestFile::_presences [private] |
Definition at line 107 of file request_file.hh.
Referenced by _setOccurrences(), and getPresences().
std::vector<std::string> RequestFile::_projectionCategoricalMap [private] |
Definition at line 111 of file request_file.hh.
Referenced by _setProjection(), and makeProjection().
std::string RequestFile::_projectionFile [private] |
Definition at line 117 of file request_file.hh.
Referenced by _setProjection(), makeProjection(), and requestedProjection().
std::vector<std::string> RequestFile::_projectionMap [private] |
Definition at line 112 of file request_file.hh.
Referenced by _setProjection(), and makeProjection().
int RequestFile::_projectionSet [private] |
Definition at line 104 of file request_file.hh.
Referenced by configure(), makeProjection(), and projectionSet().
bool RequestFile::_spatiallyUnique [private] |
Definition at line 121 of file request_file.hh.
Referenced by configure(), and makeModel().