|
BPMN-OS
BPMN for optimization and simulation
|
Class generating a lookup table from a CSV file. More...
A LookupTable loads a CSV file with header line and allows to retrieve entries using a list of key-value pairs. Should multiple entries match the given key-value pairs, the first match is returned.
Definition at line 29 of file LookupTable.h.
#include <LookupTable.h>
Public Member Functions | |
| LookupTable (const std::string &name, const std::string &source, const std::vector< std::string > &folders) | |
| Constructs a LookupTable object using data from a CSV file. | |
| double | at (const std::vector< double > &keys) const |
| size_t | size () const |
Public Attributes | |
| const std::string | name |
Protected Member Functions | |
| CSVReader | openCsv (const std::string &filename, const std::vector< std::string > &folders) |
| void | createMap (const std::string &source, const std::vector< std::string > &folders) |
Protected Attributes | |
| BPMNOS::vector_map< std::vector< double >, double > | lookupMap |
| LookupTable::LookupTable | ( | const std::string & | name, |
| const std::string & | source, | ||
| const std::vector< std::string > & | folders ) |
This constructor initializes a LookupTable object using the data read from a CSV file specified by the filename and folders. It first tries to read the file using the provided filename. If the file is not found in the current working directory, the function looks for the file in the list of folders provided in the folders parameter.
| filename | The name of the CSV file to read the data from. |
Definition at line 7 of file LookupTable.cpp.
| double LookupTable::at | ( | const std::vector< double > & | keys | ) | const |
Definition at line 61 of file LookupTable.cpp.
|
protected |
Definition at line 31 of file LookupTable.cpp.
|
protected |
Definition at line 13 of file LookupTable.cpp.
|
inline |
Definition at line 45 of file LookupTable.h.
|
protected |
Definition at line 49 of file LookupTable.h.
| const std::string BPMNOS::Model::LookupTable::name |
Definition at line 42 of file LookupTable.h.