StochHMM
v0.34
Flexible Hidden Markov Model C++ Library and Application
|
#include <options.h>
Public Attributes | |
std::string | commandline_tag |
optionType | type |
bool | required |
std::string | preset |
std::string | allowable [MAX_ALLOWABLE] |
User defined option parameters opt_parameters set up in beginning of your program and defines what options are accepted by the program. Used for designing allowed commandline options option Types: UNDEF_OPT - initialized value not defined OPT_NONE - Functions as a bool (was it set or not) OPT_INT - Integer value supplied as option OPT_DOUBLE - Double value supplied as option OPT_STRING - String value supplied as option OPT_FLAG - Predefined allowed values (each functions as a bool)
Colums of table: Option tag- all possible alternatives separated by colon Option type- what type will it be passed Option required - If option is required to run the it should be true, else false Option default - Default value for option Secondary Tag - List of possible secondary tags.
Usage: opt_parameters commandline[] - { {"-help:-h" ,OPT_NONE, false, "", {}}, {"-model:-m",OPT_STRING, true, "",{}}, {"-play:-p", OPT_FLAG, false, "", {"Ball", "Train"} } int opts_size=sizeof(commandline)/sizeof(commandline[0]); //required to automatically figure # of options defined
options opt; int main (int argc,const char *argv[]){ opt.set_paramenters(commandline,opt_size,usage); //sets up the options you've defined in commandline variable opt.parse_commandline(argc,argv); //Parses the commandline and assigns the variables; To get the string value from model string filename=sopt("-model"); To see if scale was set if (optset("-scale")) double scale=sopt("-scale"); //Return value of scale option return 1; };
std::string StochHMM::opt_parameters::allowable[MAX_ALLOWABLE] |
Definition at line 76 of file options.h.
Referenced by StochHMM::options::set_parameters().
std::string StochHMM::opt_parameters::commandline_tag |
Definition at line 72 of file options.h.
Referenced by StochHMM::options::set_parameters().
std::string StochHMM::opt_parameters::preset |
Definition at line 75 of file options.h.
Referenced by StochHMM::options::set_parameters().
bool StochHMM::opt_parameters::required |
Definition at line 74 of file options.h.
Referenced by StochHMM::options::set_parameters().
optionType StochHMM::opt_parameters::type |
Definition at line 73 of file options.h.
Referenced by StochHMM::options::set_parameters().