use of cbit.vcell.solver.stoch.StochFileWriter in project vcell by virtualcell.
the class VCellSedMLSolver method solveGibson.
private static ODESolverResultSet solveGibson(File outDir, BioModel bioModel) throws Exception {
String docName = bioModel.getName();
Simulation sim = bioModel.getSimulation(0);
File gibsonInputFile = new File(outDir, docName + SimDataConstants.STOCHINPUT_DATA_EXTENSION);
PrintWriter gibsonPW = new java.io.PrintWriter(gibsonInputFile);
SimulationJob simJob = new SimulationJob(sim, 0, null);
SimulationTask simTask = new SimulationTask(simJob, 0);
StochFileWriter stFileWriter = new StochFileWriter(gibsonPW, simTask, false);
stFileWriter.write();
gibsonPW.close();
File gibsonOutputFile = new File(outDir, docName + SimDataConstants.IDA_DATA_EXTENSION);
writeFunctionFile(outDir, docName, SimDataConstants.FUNCTIONFILE_EXTENSION, simTask);
String executableName = null;
try {
executableName = SolverUtilities.getExes(SolverDescription.StochGibson)[0].getAbsolutePath();
} catch (IOException e) {
throw new RuntimeException("failed to get executable for solver " + SolverDescription.StochGibson.getDisplayLabel() + ": " + e.getMessage(), e);
}
Executable executable = new Executable(new String[] { executableName, "gibson", gibsonInputFile.getAbsolutePath(), gibsonOutputFile.getAbsolutePath() });
executable.start();
ODESolverResultSet odeSolverResultSet = VCellSBMLSolver.getODESolverResultSet(simJob, gibsonOutputFile.getPath());
return odeSolverResultSet;
}
Aggregations