function (float)get_phenoFit_mhw (integer index, lifso bsi_given_dhw50_var, integer indices_of_interest, integer indices_of_quantiles)
{
return(bsi_given_dhw50_var.getValue(asString(indices_of_quantiles[index]))[indices_of_interest[index]]);
}
bsi_given_dhw50_df is the dictionary of values, from which I want to obtain the specific fitness of an individual, given its phenotype (row X) and given the severity of a marine heatwave experienced (column Y). ordered_indices_pop is simply a vector of indices that I'm using to obtain the corresponding phenotype and marine heatwave experienced for each individual, with both being unique for each (because in the model, the heat stress experienced by the individual is assumed to be dependent on its phenotype).
I know that the above part of the code is the bottleneck based on the profile, and also I saw someone experiencing the same issue here: