Commit 6d57478a authored by Jean-Francois Rey's avatar Jean-Francois Rey
Browse files

Merge branch 'multisusceptible' into 'master'

now the susceptible host (cultivar) is the first one without resistance genes.

See merge request CSIRO-INRA/landsepi_dev!11
parents ec8f3320 7a7346e2
......@@ -1002,16 +1002,17 @@ server <- function(input, output, session) {
# message("i ", cultivars_genesTable$row)
# message("j", cultivars_genesTable$col)
if (isTRUE(advanced_mode())) {
#if (isTRUE(advanced_mode())) {
if (checkCultivarsGenesTable(cultivars_genesTable$data) == FALSE) {
can_run_simul$cultivarsgenes <<- FALSE
}
else {
simul_params@CultivarsGenes <<- cultivars_genesTable$data
print(simul_params@CultivarsGenes)
simul_params_cultivarsgenes(simul_params@CultivarsGenes)
can_run_simul$cultivarsgenes <<- TRUE
}
}
#}
},
ignoreNULL = TRUE,
ignoreInit = TRUE
......
......@@ -723,6 +723,8 @@ void model_landsepi(Rcpp::List time_param, Rcpp::NumericVector area_vector, Rcpp
std::vector<int> total_genes_id(0); // Contains all the genes_id used by the cultivars
for(int i = 0; i < Nhost; i++) {
const std::vector<int> genes_id = Rcpp::as<std::vector<int>>(cultivars_genes_list[i]);
//Rcpp::Rcerr << "host " << i << std::endl;
//for(int t=0; t<genes_id.size();t++) Rcpp::Rcerr << "\tGenes " << genes_id[t] << std::endl;
cultivars.push_back(Cultivar(initial_density[i], max_density[i], growth_rate[i], reproduction_rate[i],
death_rate[i], genes_id));
total_genes_id.insert(total_genes_id.end(), genes_id.begin(), genes_id.end()); // Appends a vector to another
......
......@@ -126,8 +126,17 @@ Vector2D<int> Model::intro_H(const int& year) {
void Model::intro_I(Vector2D<int>& H, Vector3D<int>& I, Vector4D<int>& I2R, const Vector2D<int>& activeR) {
const int patho = 0; // Introduced pathotype is 0
const std::vector<int> aggr = switch_patho_to_aggr(patho);
const int host = 0; // Introduction on cultivar 0
int host = 0; // Introduction on cultivar 0
const int t = 0; // Introduction at t=0
// select susceptible host id
for(int s=0; s<this->cultivars.size(); s++) {
if(this->cultivars[s].genes_id.size() == 0) {
host = s;
break;
}
}
Rcpp::Rcerr << "Susceptible Host index : " << host <<std::endl;
for(int poly = 0; poly < this->Npoly; poly++) {
/* Infection */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment