use of org.vcell.vmicro.workflow.data.OptModelTwoDiffWithoutPenalty in project vcell by virtualcell.
the class GenerateRefSimOptModel method compute0.
@Override
protected void compute0(TaskContext context, final ClientTaskStatusSupport clientTaskStatusSupport) throws Exception {
RowColumnResultSet refSimDataset = context.getData(refSimData);
double[] refSimTimePoints = refSimDataset.extractColumn(0);
int numRois = refSimDataset.getDataColumnCount() - 1;
int numRefSimTimes = refSimDataset.getRowCount();
double[][] refSimData = new double[numRois][numRefSimTimes];
for (int roi = 0; roi < numRois; roi++) {
double[] roiData = refSimDataset.extractColumn(roi + 1);
for (int t = 0; t < numRefSimTimes; t++) {
refSimData[roi][t] = roiData[t];
}
}
ModelType modelType = ModelType.valueOf(context.getData(this.modelType));
OptModel optModel = null;
Double refSimDiff = context.getData(refSimDiffusionRate);
switch(modelType) {
case DiffOne:
{
optModel = new OptModelOneDiff(refSimData, refSimTimePoints, refSimDiff);
break;
}
case DiffTwoWithoutPenalty:
{
optModel = new OptModelTwoDiffWithoutPenalty(refSimData, refSimTimePoints, refSimDiff);
break;
}
case DiffTwoWithPenalty:
{
optModel = new OptModelTwoDiffWithPenalty(refSimData, refSimTimePoints, refSimDiff);
break;
}
default:
{
throw new RuntimeException("model type " + modelType + " not supported");
}
}
context.setData(this.optModel, optModel);
}
Aggregations