Search in sources :

Example 6 with SimulationInfo

use of org.vcell.sbmlsim.api.common.SimulationInfo in project vcell by virtualcell.

the class VCellSbmlSimCLI method process_simdata.

private void process_simdata() throws Exception {
    Gson gson = new Gson();
    SimulationInfo simInfo = null;
    if (simhandle != null) {
        simInfo = new SimulationInfo(simhandle);
    } else {
        throw new CliException("simhandle (simulation handle) not specified");
    }
    VariableInfo varInfo = null;
    if (varinfoJSON != null) {
        try {
            varInfo = gson.fromJson(varinfoJSON, VariableInfo.class);
        } catch (Exception e) {
            throw new CliException("failed to parse JSON text for varInfo: " + e.getMessage(), e);
        }
    } else {
        throw new CliException("varinfo (variableInfo) not specified");
    }
    if (timepointIndex == null) {
        throw new CliException("timepoint index not specified");
    }
    if (outputfile == null) {
        throw new CliException("outputfile not specified");
    }
    SimData simdata = simService.getData(simInfo, varInfo, timepointIndex);
    String simdataJSON = gson.toJson(simdata);
    FileUtils.write(outputfile, simdataJSON);
}
Also used : SimData(org.vcell.sbmlsim.api.common.SimData) VariableInfo(org.vcell.sbmlsim.api.common.VariableInfo) Gson(com.google.gson.Gson) SimulationInfo(org.vcell.sbmlsim.api.common.SimulationInfo)

Aggregations

SimulationInfo (org.vcell.sbmlsim.api.common.SimulationInfo)6 Gson (com.google.gson.Gson)4 File (java.io.File)2 SBMLModel (org.vcell.sbmlsim.api.common.SBMLModel)2 SimulationSpec (org.vcell.sbmlsim.api.common.SimulationSpec)2 TimePoints (org.vcell.sbmlsim.api.common.TimePoints)2 VariableInfo (org.vcell.sbmlsim.api.common.VariableInfo)2 VCImage (cbit.image.VCImage)1 BioModel (cbit.vcell.biomodel.BioModel)1 GeometrySpec (cbit.vcell.geometry.GeometrySpec)1 MathMappingCallbackTaskAdapter (cbit.vcell.mapping.MathMappingCallbackTaskAdapter)1 SimulationContext (cbit.vcell.mapping.SimulationContext)1 MathMappingCallback (cbit.vcell.mapping.SimulationContext.MathMappingCallback)1 MathModel (cbit.vcell.mathmodel.MathModel)1 SimulationTask (cbit.vcell.messaging.server.SimulationTask)1 Simulation (cbit.vcell.solver.Simulation)1 SimulationJob (cbit.vcell.solver.SimulationJob)1 TempSimulation (cbit.vcell.solver.TempSimulation)1 TimeBounds (cbit.vcell.solver.TimeBounds)1 UniformOutputTimeSpec (cbit.vcell.solver.UniformOutputTimeSpec)1