//HJR
public String setFunctionalNodeParameter(int nodeIdx, int preyIdx, int paramIdx, double paramValue, List<ManipulatingParameter> sParams ,SpeciesZoneType szt)
{
ManipulatingParameter param = new ManipulatingParameter();
List<Integer> predatorIndex = szt.getlPredatorIndex();
List<Integer> preyIndex = szt.getlPreyIndex();
if(paramIdx == ManipulatingParameterName.x.getManipulatingParameterIndex())
{
if(paramValue <= 0)
return "Metabolic Rate for Plants should be bigger than 0";
param.setParamType(ManipulatingParameterName.x.getManipulatingParameterType());
param.setParamName(ManipulatingParameterName.x.name());
param.setParamIdx(ManipulatingParameterName.x.getManipulatingParameterIndex());
param.setNodeIdx(nodeIdx);
param.setParamValue(paramValue);
}
else if(paramIdx == ManipulatingParameterName.ax.getManipulatingParameterIndex())
{
if(paramValue <= 0)
return "Metabolic Rate for Animals should be bigger than 0";
param.setParamType(ManipulatingParameterName.ax.getManipulatingParameterType());
param.setParamName(ManipulatingParameterName.ax.name());
param.setParamIdx(ManipulatingParameterName.ax.getManipulatingParameterIndex());
param.setNodeIdx(nodeIdx);
param.setParamValue(paramValue);
}
else if(paramIdx == ManipulatingParameterName.e.getManipulatingParameterIndex())
{
if(paramValue < 0 || paramValue > 1)
return "Assimilation Efficiency should be between 0 and 1";
param.setParamType(ManipulatingParameterName.e.getManipulatingParameterType());
param.setParamName(ManipulatingParameterName.e.name());
param.setParamIdx(ManipulatingParameterName.e.getManipulatingParameterIndex());
param.setNodeIdx(nodeIdx);
param.setPreyIdx(preyIdx);
param.setPredIdx(nodeIdx);
param.setParamValue(paramValue);
}
else if(paramIdx == ManipulatingParameterName.d.getManipulatingParameterIndex())
{
if(paramValue < 0 || paramValue > 1)
return "Predator Interference should be between 0 and 1";
param.setParamType(ManipulatingParameterName.d.getManipulatingParameterType());
param.setParamName(ManipulatingParameterName.d.name());
param.setParamIdx(ManipulatingParameterName.d.getManipulatingParameterIndex());
param.setNodeIdx(nodeIdx);
param.setPreyIdx(preyIdx);
param.setPredIdx(nodeIdx);
param.setParamValue(paramValue);
}
else if(paramIdx == ManipulatingParameterName.q.getManipulatingParameterIndex())
{
if(paramValue < 0 || paramValue > 1)
return "Functional Response Control should be between 0 and 1";
param.setParamType(ManipulatingParameterName.q.getManipulatingParameterType());
param.setParamName(ManipulatingParameterName.q.name());
param.setParamIdx(ManipulatingParameterName.q.getManipulatingParameterIndex());
param.setNodeIdx(nodeIdx);
param.setPreyIdx(preyIdx);
param.setPredIdx(nodeIdx);
param.setParamValue(paramValue);
}
else if(paramIdx == ManipulatingParameterName.a.getManipulatingParameterIndex())
{
if(paramValue < 0 || paramValue > 1)
return "Relative Half Saturation Density should be between 0 and 1";
param.setParamType(ManipulatingParameterName.a.getManipulatingParameterType());
param.setParamName(ManipulatingParameterName.a.name());
param.setParamIdx(ManipulatingParameterName.a.getManipulatingParameterIndex());
param.setNodeIdx(nodeIdx);
param.setPreyIdx(preyIdx);
param.setPredIdx(nodeIdx);
param.setParamValue(paramValue);
}
else
{
return "that type of node parameter is not supported yet";
}