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);
}
Aggregations