-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChainSimBuilder.h
56 lines (48 loc) · 1.85 KB
/
ChainSimBuilder.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef CHAINSIM_CHAINSIMBUILDER_H
#define CHAINSIM_CHAINSIMBUILDER_H
#include <QObject>
#include <QString>
#include <memory>
#include "ChainSim.h"
#include "utils/DemandSampler.hpp"
namespace qz
{
class ChainSimBuilder : public QObject
{
Q_OBJECT
public:
explicit ChainSimBuilder(QObject *parent = nullptr);
// Configuration methods
ChainSimBuilder &setSimulationName(const QString &simulationName);
ChainSimBuilder &setSimulationLength(quint64 simulationLength);
ChainSimBuilder &setLeadTime(quint64 leadTime);
ChainSimBuilder &setAverageDemand(double averageDemand);
ChainSimBuilder &setDemandStdDev(double stdDev);
ChainSimBuilder &setDeterministic(bool deterministic);
ChainSimBuilder &setSeed(unsigned seed);
ChainSimBuilder &setStartingInventory(quint64 startingInventory);
ChainSimBuilder &setLoggingLevel(quint32 loggingLevel);
ChainSimBuilder &setDemandDistribution(const QString &distribution);
ChainSimBuilder &setGammaParameters(double shape, double scale);
ChainSimBuilder &setUniformParameters(double min, double max);
// Create and return a new ChainSim instance
std::unique_ptr<ChainSim> create();
private:
void validateConfiguration() const;
QString m_simulation_name;
quint64 m_simulation_length{30};
quint64 m_lead_time{5};
double m_average_demand{50.0};
double m_demand_stddev{10.0};
bool m_deterministic{false};
unsigned m_seed{7};
quint64 m_starting_inventory{0};
quint32 m_logging_level{0};
QString m_demand_distribution{"normal"};
double m_gamma_shape{1.0};
double m_gamma_scale{1.0};
double m_uniform_min{0.0};
double m_uniform_max{100.0};
};
}
#endif // CHAINSIM_CHAINSIMBUILDER_H