// for example, if carrying capacity is 10, maximum biomass of species is 10.
// Higher growth rate means that species with higher growth rate will gain biomass faster.
// Metabolic rate (x) are effective for both animals and plants
// higher metabolic rate means that biomass of species will decrease compared to other species
ManipulatingParameter param = new ManipulatingParameter();
param.setParamType(ManipulatingParameterName.k.getManipulatingParameterType());
param.setParamName(ManipulatingParameterName.k.name());
param.setNodeIdx(nodeIdx);
param.setParamIdx(ManipulatingParameterName.k.getManipulatingParameterIndex());
// parameter k, r, x can't have negative value. if they have negative value, it means that data is not assigned yet.)
double paramKVal = species.getParamK();
if(paramKVal < 0)
param.setParamValue(Double.valueOf(propertiesConfig.getProperty("carryingCapacityDefault")));
else
param.setParamValue(paramKVal);
param.setTimestepIdx(timestepIdx);
sParams.add(param);
param = new ManipulatingParameter();
param.setParamType(ManipulatingParameterName.r.getManipulatingParameterType());
param.setParamName(ManipulatingParameterName.r.name());
param.setNodeIdx(nodeIdx);
param.setParamIdx(ManipulatingParameterName.r.getManipulatingParameterIndex());
double paramRVal = species.getParamR();
if(paramRVal < 0)
param.setParamValue(Double.valueOf(propertiesConfig.getProperty("growthRateDefault")));
else
param.setParamValue(paramRVal);
param.setTimestepIdx(timestepIdx);
sParams.add(param);
param = new ManipulatingParameter();
param.setParamType(ManipulatingParameterName.x.getManipulatingParameterType());
param.setParamName(ManipulatingParameterName.x.name());
param.setNodeIdx(nodeIdx);
param.setParamIdx(ManipulatingParameterName.x.getManipulatingParameterIndex());
double paramXVal = species.getParamR();
if(paramXVal < 0)
param.setParamValue(Double.valueOf(propertiesConfig.getProperty("metabolicRateDefault")));
else
param.setParamValue(paramXVal);
param.setTimestepIdx(timestepIdx);
sParams.add(param);
}
else if(type == SpeciesTypeEnum.ANIMAL)
{
// Metabolic rate (x) are effective for both animals and plants
// higher metabolic rate means that biomass of species will decrease compared to other species
// Assimilation efficiency (e) is only available for animals.
// higher assimilation efficiency means that biomass of species will increase.
ManipulatingParameter param = new ManipulatingParameter();
param.setParamType(ManipulatingParameterName.x.getManipulatingParameterType());
param.setParamName(ManipulatingParameterName.x.name());
param.setNodeIdx(nodeIdx);
param.setParamIdx(ManipulatingParameterName.x.getManipulatingParameterIndex());
double paramXVal = species.getParamR();
if(paramXVal < 0)
param.setParamValue(Double.valueOf(propertiesConfig.getProperty("metabolicRateDefault")));
else
param.setParamValue(paramXVal);
param.setTimestepIdx(timestepIdx);
sParams.add(param);
List<Integer> preys = species.getlPreyIndex();
if(preys != null)
{
for(Integer prey: preys)
{
param = new ManipulatingParameter();
param.setParamType(ManipulatingParameterName.e.getManipulatingParameterType());
param.setParamName(ManipulatingParameterName.e.name());
param.setPredIdx(nodeIdx);
param.setPreyIdx(prey);
param.setParamIdx(ManipulatingParameterName.e.getManipulatingParameterIndex());
if(species.getParamE() != null && species.getParamE(prey) != null)
param.setParamValue(species.getParamE(prey).getParamValue());
else
param.setParamValue(Double.valueOf(propertiesConfig.getProperty("assimilationEfficiencyDefault")));
param.setTimestepIdx(timestepIdx);
sParams.add(param);
}
for(Integer prey: preys)
{
param = new ManipulatingParameter();
param.setParamType(ManipulatingParameterName.a.getManipulatingParameterType());
param.setParamName(ManipulatingParameterName.a.name());
param.setPredIdx(nodeIdx);
param.setPreyIdx(prey);
param.setParamIdx(ManipulatingParameterName.a.getManipulatingParameterIndex());
if(species.getParamA() != null && species.getParamA(prey) != null)
param.setParamValue(species.getParamA(prey).getParamValue());
else
param.setParamValue(Double.valueOf(propertiesConfig.getProperty("relativeHalfSaturationDensityDefault")));
param.setTimestepIdx(timestepIdx);
sParams.add(param);
}
for(Integer prey: preys)
{
param = new ManipulatingParameter();
param.setParamType(ManipulatingParameterName.q.getManipulatingParameterType());
param.setParamName(ManipulatingParameterName.q.name());
param.setPredIdx(nodeIdx);
param.setPreyIdx(prey);
param.setParamIdx(ManipulatingParameterName.q.getManipulatingParameterIndex());
if(species.getParamQ() != null && species.getParamQ(prey) != null)
param.setParamValue(species.getParamQ(prey).getParamValue());
else
param.setParamValue(Double.valueOf(propertiesConfig.getProperty("functionalResponseControlParameterDefault")));
param.setTimestepIdx(timestepIdx);
sParams.add(param);
}
for(Integer prey: preys)
{
param = new ManipulatingParameter();
param.setParamType(ManipulatingParameterName.d.getManipulatingParameterType());
param.setParamName(ManipulatingParameterName.d.name());
param.setPredIdx(nodeIdx);
param.setPreyIdx(prey);
param.setParamIdx(ManipulatingParameterName.d.getManipulatingParameterIndex());
if(species.getParamD() != null && species.getParamD(prey) != null)
param.setParamValue(species.getParamD(prey).getParamValue());
else
param.setParamValue(Double.valueOf(propertiesConfig.getProperty("predatorInterferenceDefault")));
param.setTimestepIdx(timestepIdx);
sParams.add(param);
}
}
}