-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimulation.h
More file actions
65 lines (50 loc) · 2.1 KB
/
Simulation.h
File metadata and controls
65 lines (50 loc) · 2.1 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
/*
* Simulation.h
*
* Created on: 18 Dec 2013
* Author: rusty
*/
#ifndef SIMULATION_H_
#define SIMULATION_H_
#include "IUnitUpdater.h"
#include "IFileWriter.h"
#include "FullFileWriter.h" // not needed if combine header files
#include "IFunctionalResponse.h"
#include "NicheModel.h"
#include "RM_Nsp_Parameters.h"
#include "IDynamicalUnit.h"
#include "RM_Nsp_unit.h"
#include "IVariableTracker.h"
class Simulation{
private:
// simulation information (for model construction + reference)
string modelType, responseType;
//simulation parameters
int simID, unitCount, timestepCount;
double dt;
// simulation objects
IFunctionalResponse* defaultResponse;
IDynamicalUnit** units;
NicheModel* model;
RM_Nsp_Parameters* parameters;
//determine additional calculations to perform and save
bool trackBiomass;
bool trackInteractions;
IVariableTracker* biomassTracker, *interactionTracker;
public:
~Simulation();
// Simulation(int simID=0, int unitCount=2, int nTimesteps=1000, double dt=0.01, string modelType = "LV", string responseType="linear"); // defaults to pure GLV simulation
Simulation(int simID=0, int unitCount=2, int nTimesteps=1000, double dt=0.01, string modelType = "LV", string responseType="linear", string parameterFilename="", bool trackBiomass=true, bool trackInteractions=true);
// Simulation(int unitCount, int nTimesteps, double dt, IDynamicalUnit** units, IUnitUpdater* updater, INetwork* network, IFileWriter* fileWriter);
void printStates();
bool run(IUnitUpdater* updater);
bool save(string suffix="");
// ohter results we want to know about?
bool getSimulationResults(vector<vector<double> >& populationTimeseries);
bool getSimulationResults(vector<vector<double> >& populationTimeseries, vector<vector< vector<double> > >& interactionTimeseries);
// bool getSimulationResults(vector<vector<double> >& populationTimeseries, vector<vector< vector<double> > >& interactionTimeseries, vector<vector< vector<double> > >& biomassTimeseriesvector);
private:
bool step(int masterClock, IUnitUpdater* updater);
void createFunctionalResponse(string responseType);
};
#endif /* SIMULATION_H_ */