Search in sources :

Example 1 with StochFileWriter

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;
}
Also used : SimulationTask(cbit.vcell.messaging.server.SimulationTask) Simulation(cbit.vcell.solver.Simulation) StochFileWriter(cbit.vcell.solver.stoch.StochFileWriter) ODESolverResultSet(cbit.vcell.solver.ode.ODESolverResultSet) Executable(org.vcell.util.exe.Executable) SimulationJob(cbit.vcell.solver.SimulationJob)

Aggregations

SimulationTask (cbit.vcell.messaging.server.SimulationTask)1 Simulation (cbit.vcell.solver.Simulation)1 SimulationJob (cbit.vcell.solver.SimulationJob)1 ODESolverResultSet (cbit.vcell.solver.ode.ODESolverResultSet)1 StochFileWriter (cbit.vcell.solver.stoch.StochFileWriter)1 Executable (org.vcell.util.exe.Executable)1