-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseSimulationConfig.h
More file actions
79 lines (58 loc) · 1.64 KB
/
Copy pathBaseSimulationConfig.h
File metadata and controls
79 lines (58 loc) · 1.64 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//
// Created by Olga on 3/17/15.
//
#ifndef _FREEMARKET_ISIMULATIONCONFIG_H_
#define _FREEMARKET_ISIMULATIONCONFIG_H_
#include <json/json.h>
// Base class for reading simulation of different types of market.
// SHOULD NOT BE USED BY ITSELF.
class BaseSimulationConfig {
protected:
int simulation_duration = 150;
int num_of_producers = 10;
int num_of_consumers = 10;
int max_starting_supply = 30;
int supply_increment = 100;
float price_increment = 1.1f;
float price_decrement = 0.9f;
std::string demand_file = "demand.txt";
std::string supply_file = "supply.csv";
std::string price_file = "price.csv";
virtual void readConfig(std::string path) = 0;
void argumentMissingExit(std::string name);
protected:
void readCommonConfig(Json::Value root);
public:
enum SimulationType {ONE_GOOD, SUBSTITUTES, COMPLEMENTS};
int getSimulationDuration() const {
return simulation_duration;
}
int getNumOfProducers() const {
return num_of_producers;
}
int getNumOfConsumers() const {
return num_of_consumers;
}
int getMaxStartingSupply() const {
return max_starting_supply;
}
int getSupplyIncrement() const {
return supply_increment;
}
float getPriceIncrement() const {
return price_increment;
}
float getPriceDecrement() const {
return price_decrement;
}
std::string &getDemandFile() {
return demand_file;
}
std::string &getSupplyFile() {
return supply_file;
}
std::string &getPriceFile() {
return price_file;
}
};
#endif //_FREEMARKET_ISIMULATIONCONFIG_H_