Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CSIRO-INRA
landsepi
Commits
7a7346e2
Commit
7a7346e2
authored
Jun 23, 2021
by
Jean-Francois Rey
☕
Browse files
now the susceptible host (cultivar) is the first one without resistance genes.
parent
ec8f3320
Changes
3
Hide whitespace changes
Inline
Side-by-side
inst/shiny-landsepi/server.R
View file @
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
...
...
src/Model.cpp
View file @
7a7346e2
...
...
@@ -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
...
...
src/initialisation.cpp
View file @
7a7346e2
...
...
@@ -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 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment