-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (30 loc) · 1.35 KB
/
main.cpp
File metadata and controls
33 lines (30 loc) · 1.35 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
//
// main.cpp
// FreeMarket
//
// Created by Olga on 02.12.14.
// Copyright (c) 2014 My Organization Name. All rights reserved.
//
#include "SimulationConfigReader.h"
#include "OneGood/OneGoodMarket.h"
#include "Substitutes/SubstitutesMarket.h"
#include "Complements/ComplementsMarket.h"
int main(int argc, const char *argv[]) {
SimulationConfigReader reader = SimulationConfigReader();
if (reader.getSimulationType() == BaseSimulationConfig::SimulationType::SUBSTITUTES) {
SubstitutesSimulationConfig* config = new SubstitutesSimulationConfig(reader.getPathToConfig());
SubstitutesMarket *market = new SubstitutesMarket(config);
market->simulate(config->getSimulationDuration());
}
if (reader.getSimulationType() == BaseSimulationConfig::SimulationType::ONE_GOOD) {
OneGoodSimulationConfig* config = new OneGoodSimulationConfig(reader.getPathToConfig());
OneGoodMarket* market = new OneGoodMarket(config);
market->simulate(config->getSimulationDuration());
}
if (reader.getSimulationType() == BaseSimulationConfig::SimulationType::COMPLEMENTS) {
ComplementsSimulationConfig* config = new ComplementsSimulationConfig(reader.getPathToConfig());
ComplementsMarket* market = new ComplementsMarket(config);
market->simulate(config->getSimulationDuration());
}
return 0;
}