Search in sources :

Example 1 with OptModelTwoDiffWithoutPenalty

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);
}
Also used : OptModelOneDiff(org.vcell.vmicro.workflow.data.OptModelOneDiff) OptModelTwoDiffWithPenalty(org.vcell.vmicro.workflow.data.OptModelTwoDiffWithPenalty) RowColumnResultSet(cbit.vcell.math.RowColumnResultSet) OptModel(org.vcell.vmicro.workflow.data.OptModel) OptModelTwoDiffWithoutPenalty(org.vcell.vmicro.workflow.data.OptModelTwoDiffWithoutPenalty)

Aggregations

RowColumnResultSet (cbit.vcell.math.RowColumnResultSet)1 OptModel (org.vcell.vmicro.workflow.data.OptModel)1 OptModelOneDiff (org.vcell.vmicro.workflow.data.OptModelOneDiff)1 OptModelTwoDiffWithPenalty (org.vcell.vmicro.workflow.data.OptModelTwoDiffWithPenalty)1 OptModelTwoDiffWithoutPenalty (org.vcell.vmicro.workflow.data.OptModelTwoDiffWithoutPenalty)1