Remove try and catch from writer close

This commit is contained in:
leandrohw 2018-01-08 12:05:39 -07:00
parent 0d5367e836
commit f2b929909f
7 changed files with 46 additions and 57 deletions

View file

@ -15,8 +15,11 @@ package edu.utah.ece.async.ibiosim.learn.parameterestimator.methods.sres;
import static java.lang.Math.abs;
import java.io.IOException;
import java.util.List;
import javax.xml.stream.XMLStreamException;
import edu.utah.ece.async.ibiosim.analysis.simulation.hierarchical.HierarchicalSimulation;
import edu.utah.ece.async.ibiosim.analysis.simulation.hierarchical.methods.HierarchicalODERKSimulator;
import edu.utah.ece.async.ibiosim.learn.genenet.Experiments;
@ -121,13 +124,21 @@ public class ObjectiveSqureError extends Objective
{
odeSim.setTimeLimit(experiment.get(i + 1).get(0));
odeSim.simulate();
for (int j = 1; j < speciesCollection.length; j++)
try
{
double tmp = odeSim.getTopLevelValue(speciesCollection[j]) - experiment.get(i + 1).get(j);
tmp = tmp * tmp;
sum = sum + tmp;
}
odeSim.simulate();
for (int j = 1; j < speciesCollection.length; j++)
{
double tmp = odeSim.getTopLevelValue(speciesCollection[j]) - experiment.get(i + 1).get(j);
tmp = tmp * tmp;
sum = sum + tmp;
}
}
catch (XMLStreamException | IOException e)
{
sum = Double.MAX_VALUE;
}
}