BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
ExpectedValueDataProvider.h
Go to the documentation of this file.
1#ifndef BPMNOS_Model_ExpectedValueDataProvider_H
2#define BPMNOS_Model_ExpectedValueDataProvider_H
3
7
8namespace BPMNOS::Model {
9
10/**
11 * @brief Data provider that accepts stochastic CSV format but uses expected values.
12 *
13 * ExpectedValueDataProvider accepts CSV files with 3, 4, or 6 columns:
14 * - 3-column: INSTANCE_ID; NODE_ID; INITIALIZATION
15 * - 4-column: INSTANCE_ID; NODE_ID; INITIALIZATION; DISCLOSURE
16 * - 6-column: INSTANCE_ID; NODE_ID; INITIALIZATION; DISCLOSURE; ARRIVAL; COMPLETION
17 *
18 * Behavior:
19 * - DISCLOSURE column is ignored (all values disclosed at time 0)
20 * - ARRIVAL column is ignored (not applicable for expected value computation)
21 * - COMPLETION column is ignored (operators can be used to compute expected values)
22 * - Random functions in INITIALIZATION return expected values instead of sampling
23 */
25public:
26 ExpectedValueDataProvider(const std::string& modelFile, const std::string& instanceFileOrString);
27 ExpectedValueDataProvider(const std::string& modelFile, const std::vector<std::string>& folders, const std::string& instanceFileOrString);
28 ~ExpectedValueDataProvider() override = default;
29
30 std::unique_ptr<Scenario> createScenario(unsigned int scenarioId = 0) override;
31
32protected:
33 void readInstances();
34 void readInstancesExtendedFormat(const CSVReader::Table& table, size_t columnCount);
35
36 /// Override to use expectedValueHandle instead of model->limexHandle
37 BPMNOS::number evaluateExpression(const std::string& expression) const override;
38
40
42 LIMEX::Handle<double> expectedValueHandle;
43};
44
45} // namespace BPMNOS::Model
46
47#endif // BPMNOS_Model_ExpectedValueDataProvider_H
std::vector< Row > Table
Definition CSVReader.h:17
Factory for expected value functions in LIMEX expressions.
Data provider that accepts stochastic CSV format but uses expected values.
ExpectedValueDataProvider(const std::string &modelFile, const std::string &instanceFileOrString)
BPMNOS::number evaluateExpression(const std::string &expression) const override
Override to use expectedValueHandle instead of model->limexHandle.
std::unique_ptr< Scenario > createScenario(unsigned int scenarioId=0) override
void readInstancesExtendedFormat(const CSVReader::Table &table, size_t columnCount)
Class representing a data provider for static BPMN instance data.
BPMNOS_NUMBER_TYPE number
Definition Number.h:50