Skip to content

Commit 05cb03a

Browse files
committed
Version 0.1 working when fec = 0. For boundary condition, the structure of the prog must change, especially Env. This is going to be done in next release
1 parent ee3dd21 commit 05cb03a

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

cpp/Forest.c++

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void Forest::spatialDynamics()
140140
}
141141
}
142142

143-
for (pop_it = m_popVec.begin(); pop_it != m_popVec.end(); ++pop_it)
143+
for (env_it = m_land->m_envVec.begin(); pop_it != m_land->m_envVec.end(); ++env_it) // Starting reproduction prog
144144
{
145145
neighbours_indices((pop_it->m_env)->m_patchId, boundingBox);
146146
}
@@ -167,7 +167,7 @@ void Forest::spatialDynamics()
167167
(pop_it->m_currentIter)++;
168168
}
169169

170-
for (pop_it = m_popVec.begin(); pop_it != m_popVec.end(); ++pop_it)
170+
for (env_it = m_land->m_envVec.begin(); pop_it != m_land->m_envVec.end(); ++env_it)
171171
{
172172
neighbours_indices((pop_it->m_env)->m_patchId, boundingBox);
173173
}

cpp/main.c++

+10-7
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ int main(int argc, char *argv[])
4949
par::Params simulationParameters(argv[1], ": "); // Be extremely careful with the delimiter, especially white spaces
5050
// std::cout << simulationParameters << std::endl;
5151

52-
unsigned int maxCohorts = simulationParameters.get_val<unsigned int>("maxCohorts");
53-
double n_t = simulationParameters.get_val<double>("n_t");
54-
double t0 = simulationParameters.get_val<double>("t0");
55-
double t_max = simulationParameters.get_val<double>("t_max");
52+
// unsigned int maxCohorts = simulationParameters.get_val<unsigned int>("maxCohorts");
53+
// double n_t = simulationParameters.get_val<double>("n_t");
54+
// double t0 = simulationParameters.get_val<double>("t0");
55+
// double t_max = simulationParameters.get_val<double>("t_max");
5656
std::string climate_file = simulationParameters.get_val<std::string>("climate_file");
5757
std::string species_filenames = simulationParameters.get_val<std::string>("species_filenames");
5858
std::string species_path = simulationParameters.get_val<std::string>("species_path");
59-
std::string init_filenamePattern = simulationParameters.get_val<std::string>("init_filenamePattern");
60-
std::string init_path = simulationParameters.get_val<std::string>("init_path");
59+
// std::string init_filenamePattern = simulationParameters.get_val<std::string>("init_filenamePattern");
60+
// std::string init_path = simulationParameters.get_val<std::string>("init_path");
61+
std::string forestDataFile = simulationParameters.get_val<std::string>("forestDataFile");
6162

6263
Species* sp = new Species(species_filenames, species_path, " = "); // Be extremely careful with the delimiter, especially white spaces
6364
// std::cout << *sp << std::endl;
@@ -67,9 +68,11 @@ int main(int argc, char *argv[])
6768
Landscape *land = new Landscape(climate_file);
6869
// std::cout << *land << std::endl;
6970

70-
Forest forest(land, sp, init_path, init_filenamePattern, maxCohorts);
71+
Forest forest(land, sp, forestDataFile);
7172
forest.print();
7273

74+
forest.spatialDynamics();
75+
7376
// double a = 0.84;
7477
// double b = 2.87;
7578
// double c = 5;

0 commit comments

Comments
 (0)