![]() |
aGrUM
0.20.2
a C++ library for (probabilistic) graphical models
|
Represents a O3PRMR context. More...
#include <O3prmrInterpreter.h>
Public Member Functions | |
O3prmrInterpreter () | |
This constructor create an empty context. More... | |
~O3prmrInterpreter () | |
Destructor. Delete current context. More... | |
bool | interpretFile (const std::string &filename) |
Interpret the file or the command line. More... | |
bool | interpretLine (const std::string &line) |
const gum::prm::PRM< double > * | prm () const |
Retrieve prm object. More... | |
const gum::prm::PRMInference< double > * | inference () const |
Retrieve inference motor object. More... | |
const std::vector< QueryResult > & | results () const |
Return a vector of QueryResults. Each QueryResults is a struct with query command, time and values, a vector of struct SingleResult, with pair label/value. More... | |
ErrorsContainer | errorsContainer () const |
Return container with all errors. More... | |
O3prmrContext< double > * | getContext () const |
Getter and setter for the context. More... | |
void | setContext (O3prmrContext< double > *context) |
Setter for the context. More... | |
std::vector< std::string > | getPaths () const |
Root paths to search from there packages. Default are working dir, request file dir if any and one is calculate from package if any. More... | |
void | addPath (std::string path) |
Root paths to search from there packages. Default are './' and one is calculate from request package if any. More... | |
void | clearPaths () |
Root paths to search from there packages. Default are './' and one is calculate from request package if any. More... | |
bool | isInSyntaxMode () const |
syntax mode don't process anything, just check syntax. Default is false. More... | |
void | setSyntaxMode (bool f) |
syntax mode don't process anything, just check syntax. More... | |
bool | isVerboseMode () const |
verbose mode show more details on the program execution. Default is false. More... | |
void | setVerboseMode (bool f) |
verbose mode show more details on the program execution. More... | |
Size | count () const |
En cas d'échec, l'API de gestion d'erreurs est présente. More... | |
Size | errors () const |
of errorsMore... | |
Size | warnings () const |
of warningsMore... | |
ParseError | error (Idx i) const |
throw a string error if i >= count More... | |
void | showElegantErrors (std::ostream &o=std::cerr) const |
send on std::cerr the list of errors More... | |
void | showElegantErrorsAndWarnings (std::ostream &o=std::cerr) const |
send on std::cerr the list of errors or warnings More... | |
void | showErrorCounts (std::ostream &o=std::cerr) const |
send on std::cerr the number of errors and the number of warnings More... | |
Represents a O3PRMR context.
O3prmr use the <double> version of the O3PRM templatized ecosystem
Definition at line 69 of file O3prmrInterpreter.h.
gum::prm::o3prmr::O3prmrInterpreter::O3prmrInterpreter | ( | ) |
This constructor create an empty context.
Definition at line 53 of file O3prmrInterpreter.cpp.
gum::prm::o3prmr::O3prmrInterpreter::~O3prmrInterpreter | ( | ) |
Destructor. Delete current context.
Definition at line 60 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 977 of file O3prmrInterpreter.cpp.
void gum::prm::o3prmr::O3prmrInterpreter::addPath | ( | std::string | path | ) |
Root paths to search from there packages. Default are './' and one is calculate from request package if any.
Definition at line 96 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 984 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 433 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 505 of file O3prmrInterpreter.cpp.
|
private |
Check semantic validity of context.
Import first all import, and check that systems, instances, attributes and labels exists. While checking, prepare data structures for interpretation. Return true if all is right, false otherwise.
Note : Stop checking at first error unless syntax mode is activated.
Definition at line 310 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 422 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 427 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 480 of file O3prmrInterpreter.cpp.
void gum::prm::o3prmr::O3prmrInterpreter::clearPaths | ( | ) |
Root paths to search from there packages. Default are './' and one is calculate from request package if any.
Definition at line 107 of file O3prmrInterpreter.cpp.
Size gum::prm::o3prmr::O3prmrInterpreter::count | ( | ) | const |
En cas d'échec, l'API de gestion d'erreurs est présente.
Definition at line 938 of file O3prmrInterpreter.cpp.
ParseError gum::prm::o3prmr::O3prmrInterpreter::error | ( | Idx | i | ) | const |
throw a string error if i >= count
Definition at line 947 of file O3prmrInterpreter.cpp.
Size gum::prm::o3prmr::O3prmrInterpreter::errors | ( | ) | const |
Definition at line 941 of file O3prmrInterpreter.cpp.
ErrorsContainer gum::prm::o3prmr::O3prmrInterpreter::errorsContainer | ( | ) | const |
Return container with all errors.
Definition at line 954 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 734 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 720 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 691 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 894 of file O3prmrInterpreter.cpp.
O3prmrContext< double > * gum::prm::o3prmr::O3prmrInterpreter::getContext | ( | ) | const |
Getter and setter for the context.
Getter for the context.
Definition at line 74 of file O3prmrInterpreter.cpp.
std::vector< std::string > gum::prm::o3prmr::O3prmrInterpreter::getPaths | ( | ) | const |
Root paths to search from there packages. Default are working dir, request file dir if any and one is calculate from package if any.
Root paths to search from there packages. Default are './' and one is calculate from request package if any.
Definition at line 90 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 533 of file O3prmrInterpreter.cpp.
const PRMInference< double > * gum::prm::o3prmr::O3prmrInterpreter::inference | ( | ) | const |
Retrieve inference motor object.
Definition at line 127 of file O3prmrInterpreter.cpp.
|
private |
Crée le prm correspondant au contexte courant.
Renvoie true en cas de succès, ou false en cas échéant d'échec de l'interprétation du contexte (import introuvable ou non défini, etc).
Definition at line 236 of file O3prmrInterpreter.cpp.
bool gum::prm::o3prmr::O3prmrInterpreter::interpretFile | ( | const std::string & | filename | ) |
Interpret the file or the command line.
Parse the file or the command line.
If syntax mode is activated, check only syntax and semantic. If errors occured, return false. Errors messages can be retrieve be errorsContainer() methods. If any errors occured, return true. Requests results can be retrieve be results() methods.
If errors occured, return false. Errors messages can be retrieve be getErrorsContainer() methods. If any errors occured, return true. Requests results can be retrieve be results() methods.
Definition at line 145 of file O3prmrInterpreter.cpp.
bool gum::prm::o3prmr::O3prmrInterpreter::interpretLine | ( | const std::string & | line | ) |
Definition at line 208 of file O3prmrInterpreter.cpp.
bool gum::prm::o3prmr::O3prmrInterpreter::isInSyntaxMode | ( | ) | const |
syntax mode don't process anything, just check syntax. Default is false.
syntax mode don't process anything, just check syntax.
Definition at line 110 of file O3prmrInterpreter.cpp.
bool gum::prm::o3prmr::O3prmrInterpreter::isVerboseMode | ( | ) | const |
verbose mode show more details on the program execution. Default is false.
verbose mode show more details on the program execution.
Definition at line 116 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 761 of file O3prmrInterpreter.cpp.
Retrieve prm object.
Definition at line 122 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 814 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 187 of file O3prmrInterpreter.cpp.
const std::vector< QueryResult > & gum::prm::o3prmr::O3prmrInterpreter::results | ( | ) | const |
Return a vector of QueryResults. Each QueryResults is a struct with query command, time and values, a vector of struct SingleResult, with pair label/value.
Return a std::vector of QueryResults. Each QueryResults is a struct with query command, time and values, a std::vector of struct SingleResult, with pair label/value.
Definition at line 134 of file O3prmrInterpreter.cpp.
void gum::prm::o3prmr::O3prmrInterpreter::setContext | ( | O3prmrContext< double > * | context | ) |
Setter for the context.
Definition at line 79 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 884 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 889 of file O3prmrInterpreter.cpp.
void gum::prm::o3prmr::O3prmrInterpreter::setSyntaxMode | ( | bool | f | ) |
syntax mode don't process anything, just check syntax.
Definition at line 113 of file O3prmrInterpreter.cpp.
void gum::prm::o3prmr::O3prmrInterpreter::setVerboseMode | ( | bool | f | ) |
verbose mode show more details on the program execution.
Definition at line 119 of file O3prmrInterpreter.cpp.
void gum::prm::o3prmr::O3prmrInterpreter::showElegantErrors | ( | std::ostream & | o = std::cerr | ) | const |
send on std::cerr the list of errors
Definition at line 959 of file O3prmrInterpreter.cpp.
void gum::prm::o3prmr::O3prmrInterpreter::showElegantErrorsAndWarnings | ( | std::ostream & | o = std::cerr | ) | const |
send on std::cerr the list of errors or warnings
Definition at line 964 of file O3prmrInterpreter.cpp.
void gum::prm::o3prmr::O3prmrInterpreter::showErrorCounts | ( | std::ostream & | o = std::cerr | ) | const |
send on std::cerr the number of errors and the number of warnings
Definition at line 969 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 745 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 791 of file O3prmrInterpreter.cpp.
Size gum::prm::o3prmr::O3prmrInterpreter::warnings | ( | ) | const |
Definition at line 944 of file O3prmrInterpreter.cpp.
|
private |
Definition at line 170 of file O3prmrInterpreter.h.
|
private |
Definition at line 175 of file O3prmrInterpreter.h.
|
private |
Definition at line 167 of file O3prmrInterpreter.h.
|
private |
Definition at line 181 of file O3prmrInterpreter.h.
|
private |
Definition at line 174 of file O3prmrInterpreter.h.
|
private |
Definition at line 177 of file O3prmrInterpreter.h.
|
private |
Definition at line 172 of file O3prmrInterpreter.h.
|
private |
Definition at line 173 of file O3prmrInterpreter.h.
|
private |
Definition at line 180 of file O3prmrInterpreter.h.
|
private |
Definition at line 169 of file O3prmrInterpreter.h.
|
private |
Definition at line 168 of file O3prmrInterpreter.h.
|
private |
Definition at line 176 of file O3prmrInterpreter.h.
|
private |
Definition at line 178 of file O3prmrInterpreter.h.
|
private |
Definition at line 179 of file O3prmrInterpreter.h.