Skip to content

Commit

Permalink
Version 0.1 working when fec = 0. For boundary condition, the structu…
Browse files Browse the repository at this point in the history
…re of the prog must change, especially Env. This is going to be done in next release
  • Loading branch information
amael-ls committed Aug 30, 2020
1 parent ee3dd21 commit 05cb03a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cpp/Forest.c++
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void Forest::spatialDynamics()
}
}

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

for (pop_it = m_popVec.begin(); pop_it != m_popVec.end(); ++pop_it)
for (env_it = m_land->m_envVec.begin(); pop_it != m_land->m_envVec.end(); ++env_it)
{
neighbours_indices((pop_it->m_env)->m_patchId, boundingBox);
}
Expand Down
17 changes: 10 additions & 7 deletions cpp/main.c++
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,16 @@ int main(int argc, char *argv[])
par::Params simulationParameters(argv[1], ": "); // Be extremely careful with the delimiter, especially white spaces
// std::cout << simulationParameters << std::endl;

unsigned int maxCohorts = simulationParameters.get_val<unsigned int>("maxCohorts");
double n_t = simulationParameters.get_val<double>("n_t");
double t0 = simulationParameters.get_val<double>("t0");
double t_max = simulationParameters.get_val<double>("t_max");
// unsigned int maxCohorts = simulationParameters.get_val<unsigned int>("maxCohorts");
// double n_t = simulationParameters.get_val<double>("n_t");
// double t0 = simulationParameters.get_val<double>("t0");
// double t_max = simulationParameters.get_val<double>("t_max");
std::string climate_file = simulationParameters.get_val<std::string>("climate_file");
std::string species_filenames = simulationParameters.get_val<std::string>("species_filenames");
std::string species_path = simulationParameters.get_val<std::string>("species_path");
std::string init_filenamePattern = simulationParameters.get_val<std::string>("init_filenamePattern");
std::string init_path = simulationParameters.get_val<std::string>("init_path");
// std::string init_filenamePattern = simulationParameters.get_val<std::string>("init_filenamePattern");
// std::string init_path = simulationParameters.get_val<std::string>("init_path");
std::string forestDataFile = simulationParameters.get_val<std::string>("forestDataFile");

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

Forest forest(land, sp, init_path, init_filenamePattern, maxCohorts);
Forest forest(land, sp, forestDataFile);
forest.print();

forest.spatialDynamics();

// double a = 0.84;
// double b = 2.87;
// double c = 5;
Expand Down

0 comments on commit 05cb03a

Please sign in to comment.