Search in sources :

Example 6 with ParameterEstimationTask

use of cbit.vcell.modelopt.ParameterEstimationTask in project vcell by virtualcell.

the class ParameterEstimationPanel method analysisTaskComboBox_ActionPerformed.

private void analysisTaskComboBox_ActionPerformed() {
    ParameterEstimationTask selectedItem = (ParameterEstimationTask) getAnalysisTaskComboBox().getSelectedItem();
    setParameterEstimationTask(selectedItem);
    setSelectedObjects(new Object[] { selectedItem });
}
Also used : ParameterEstimationTask(cbit.vcell.modelopt.ParameterEstimationTask)

Example 7 with ParameterEstimationTask

use of cbit.vcell.modelopt.ParameterEstimationTask in project vcell by virtualcell.

the class ParameterEstimationPanel method onSelectedObjectsChange.

@Override
protected void onSelectedObjectsChange(Object[] selectedObjects) {
    if (selectedObjects == null || selectedObjects.length != 1 || !(selectedObjects[0] instanceof ParameterEstimationTask)) {
        return;
    }
    ParameterEstimationTask parameterEstimationTask = (ParameterEstimationTask) selectedObjects[0];
    setParameterEstimationTask(parameterEstimationTask);
}
Also used : ParameterEstimationTask(cbit.vcell.modelopt.ParameterEstimationTask)

Example 8 with ParameterEstimationTask

use of cbit.vcell.modelopt.ParameterEstimationTask in project vcell by virtualcell.

the class BioModelEditor method setRightBottomPanelOnSelection.

@Override
protected void setRightBottomPanelOnSelection(Object[] selections) {
    if (selections == null) {
        return;
    }
    JComponent bottomComponent = rightBottomEmptyPanel;
    int destComponentIndex = DocumentEditorTabID.object_properties.ordinal();
    boolean bShowInDatabaseProperties = false;
    boolean bShowPathway = false;
    if (selections.length == 1) {
        Object singleSelection = selections[0];
        if (singleSelection instanceof ReactionStep) {
            bottomComponent = getReactionPropertiesPanel();
        } else if (singleSelection instanceof ReactionRule) {
            bottomComponent = getReactionRulePropertiesPanel();
        } else if (singleSelection instanceof SpeciesContext) {
            bottomComponent = getSpeciesPropertiesPanel();
        } else if (singleSelection instanceof MolecularType) {
            bottomComponent = getMolecularTypePropertiesPanel();
        } else if (singleSelection instanceof RbmObservable) {
            bottomComponent = getObservablePropertiesPanel();
        } else if (singleSelection instanceof Structure) {
            bottomComponent = getStructurePropertiesPanel();
            getStructurePropertiesPanel().setModel(bioModel.getModel());
        } else if (singleSelection instanceof Parameter) {
            bottomComponent = getParameterPropertiesPanel();
        } else if (singleSelection instanceof SimulationContext) {
            bottomComponent = getApplicationPropertiesPanel();
        } else if (singleSelection instanceof ParameterEstimationTask) {
            bottomComponent = parameterEstimationTaskPropertiesPanel;
        } else if (singleSelection instanceof Product || singleSelection instanceof Reactant) {
            bottomComponent = getReactionParticipantPropertiesPanel();
        } else if (singleSelection instanceof BioModelInfo) {
            bShowInDatabaseProperties = true;
            bottomComponent = bioModelMetaDataPanel;
        } else if (singleSelection instanceof MathModelInfo) {
            bShowInDatabaseProperties = true;
            bottomComponent = mathModelMetaDataPanel;
        } else if (singleSelection instanceof GeometryInfo) {
            bShowInDatabaseProperties = true;
            bottomComponent = geometryMetaDataPanel;
        } else if (singleSelection instanceof SpeciesContextSpec) {
            bottomComponent = getSpeciesContextSpecPanel();
        } else if (singleSelection instanceof ReactionSpec) {
            bottomComponent = getKineticsTypeTemplatePanel();
        } else if (singleSelection instanceof ReactionRuleSpec) {
            // 
            bottomComponent = getReactionRuleSpecPropertiesPanel();
        } else if (singleSelection instanceof BioModelsNetModelInfo) {
            bShowInDatabaseProperties = true;
            bottomComponent = getBioModelsNetPropertiesPanel();
        } else if (singleSelection instanceof Simulation) {
            bottomComponent = getSimulationSummaryPanel();
        } else if (singleSelection instanceof DataSymbol) {
            bottomComponent = getDataSymbolsSpecPanel();
        } else if (singleSelection instanceof BioEvent) {
            bottomComponent = getEventPanel();
        } else if (singleSelection instanceof SpatialObject) {
            bottomComponent = getSpatialObjectPropertyPanel();
        } else if (singleSelection instanceof SpatialProcess) {
            bottomComponent = getSpatialProcessPropertyPanel();
        } else if (singleSelection instanceof BioPaxObject) {
            bottomComponent = bioPaxObjectPropertiesPanel;
        } else if (singleSelection instanceof BioModel || singleSelection instanceof VCMetaData) {
            bottomComponent = bioModelEditorAnnotationPanel;
        } else if (singleSelection instanceof PathwayData) {
            bShowPathway = true;
            bottomComponent = getBioModelEditorPathwayPanel();
        } else if (singleSelection instanceof Model) {
        } else if (singleSelection instanceof RuleParticipantSignature) {
            bottomComponent = getReactionRuleParticipantSignaturePropertiesPanel();
        } else if (singleSelection instanceof CSGObject) {
            bottomComponent = csgObjectPropertiesPanel;
            csgObjectPropertiesPanel.setSimulationContext(getSelectedSimulationContext());
        } else if (singleSelection instanceof DocumentEditorTreeFolderNode) {
            DocumentEditorTreeFolderClass folderClass = ((DocumentEditorTreeFolderNode) singleSelection).getFolderClass();
            if ((folderClass == DocumentEditorTreeFolderClass.REACTIONS_NODE) && !(singleSelection instanceof ReactionRule)) {
                bottomComponent = getReactionPropertiesPanel();
            } else if ((folderClass == DocumentEditorTreeFolderClass.REACTIONS_NODE) && (singleSelection instanceof ReactionRule)) {
                bottomComponent = getReactionRulePropertiesPanel();
            } else if (folderClass == DocumentEditorTreeFolderClass.STRUCTURES_NODE) {
                bottomComponent = getStructurePropertiesPanel();
            } else if (folderClass == DocumentEditorTreeFolderClass.SPECIES_NODE) {
                bottomComponent = getSpeciesPropertiesPanel();
            } else if (folderClass == DocumentEditorTreeFolderClass.MOLECULAR_TYPES_NODE) {
                bottomComponent = getMolecularTypePropertiesPanel();
            } else if (folderClass == DocumentEditorTreeFolderClass.OBSERVABLES_NODE) {
                bottomComponent = getObservablePropertiesPanel();
            } else if (folderClass == DocumentEditorTreeFolderClass.APPLICATIONS_NODE) {
                bottomComponent = getApplicationsPropertiesPanel();
                getApplicationsPropertiesPanel().setBioModel(bioModel);
            } else if (folderClass == DocumentEditorTreeFolderClass.PARAMETER_ESTIMATION_NODE) {
                bottomComponent = parameterEstimationTaskPropertiesPanel;
            }
        }
    }
    if (bShowPathway) {
        for (destComponentIndex = 0; destComponentIndex < rightBottomTabbedPane.getTabCount(); destComponentIndex++) {
            if (rightBottomTabbedPane.getComponentAt(destComponentIndex) == bottomComponent) {
                break;
            }
        }
        String tabTitle = "Pathway Preview";
        if (rightBottomTabbedPane.getTabCount() == destComponentIndex) {
            rightBottomTabbedPane.addTab(tabTitle, new TabCloseIcon(), bottomComponent);
        }
    } else if (bShowInDatabaseProperties) {
        for (destComponentIndex = 0; destComponentIndex < rightBottomTabbedPane.getTabCount(); destComponentIndex++) {
            Component c = rightBottomTabbedPane.getComponentAt(destComponentIndex);
            if (c == bioModelMetaDataPanel || c == mathModelMetaDataPanel || c == geometryMetaDataPanel || c == getBioModelsNetPropertiesPanel()) {
                break;
            }
        }
        if (rightBottomTabbedPane.getTabCount() == destComponentIndex) {
            rightBottomTabbedPane.addTab(DATABASE_PROPERTIES_TAB_TITLE, new TabCloseIcon(), bottomComponent);
        }
    }
    if (rightBottomTabbedPane.getComponentAt(destComponentIndex) != bottomComponent) {
        bottomComponent.setBorder(GuiConstants.TAB_PANEL_BORDER);
        rightBottomTabbedPane.setComponentAt(destComponentIndex, bottomComponent);
        rightSplitPane.repaint();
    }
    if (rightBottomTabbedPane.getSelectedComponent() != bottomComponent) {
        rightBottomTabbedPane.setSelectedComponent(bottomComponent);
    }
}
Also used : RuleParticipantSignature(cbit.vcell.model.RuleParticipantSignature) BioPaxObject(org.vcell.pathway.BioPaxObject) Product(cbit.vcell.model.Product) PathwayData(cbit.vcell.client.desktop.biomodel.BioModelEditorPathwayCommonsPanel.PathwayData) SpeciesContext(cbit.vcell.model.SpeciesContext) SpeciesContextSpec(cbit.vcell.mapping.SpeciesContextSpec) Reactant(cbit.vcell.model.Reactant) SpatialObject(cbit.vcell.mapping.spatial.SpatialObject) VCMetaData(cbit.vcell.biomodel.meta.VCMetaData) SpatialProcess(cbit.vcell.mapping.spatial.processes.SpatialProcess) GeometryInfo(cbit.vcell.geometry.GeometryInfo) Structure(cbit.vcell.model.Structure) CSGObject(cbit.vcell.geometry.CSGObject) Component(java.awt.Component) JComponent(javax.swing.JComponent) ReactionRule(cbit.vcell.model.ReactionRule) ReactionSpec(cbit.vcell.mapping.ReactionSpec) ReactionRuleSpec(cbit.vcell.mapping.ReactionRuleSpec) RbmObservable(cbit.vcell.model.RbmObservable) JComponent(javax.swing.JComponent) BioModelInfo(org.vcell.util.document.BioModelInfo) DocumentEditorTreeFolderNode(cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderNode) MathModelInfo(org.vcell.util.document.MathModelInfo) SimulationContext(cbit.vcell.mapping.SimulationContext) DocumentEditorTreeFolderClass(cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderClass) MolecularType(org.vcell.model.rbm.MolecularType) ParameterEstimationTask(cbit.vcell.modelopt.ParameterEstimationTask) DataSymbol(cbit.vcell.data.DataSymbol) Simulation(cbit.vcell.solver.Simulation) ReactionStep(cbit.vcell.model.ReactionStep) BioModel(cbit.vcell.biomodel.BioModel) Model(cbit.vcell.model.Model) ListSelectionModel(javax.swing.ListSelectionModel) BioModel(cbit.vcell.biomodel.BioModel) Parameter(cbit.vcell.model.Parameter) BioPaxObject(org.vcell.pathway.BioPaxObject) SpatialObject(cbit.vcell.mapping.spatial.SpatialObject) CSGObject(cbit.vcell.geometry.CSGObject) BioEvent(cbit.vcell.mapping.BioEvent)

Example 9 with ParameterEstimationTask

use of cbit.vcell.modelopt.ParameterEstimationTask in project vcell by virtualcell.

the class ParameterEstimationRunTaskPanel method setParameterEstimationTask.

/**
 * Sets the parameterEstimationTask property (cbit.vcell.modelopt.ParameterEstimationTask) value.
 * @param newValue The new value for the property.
 * @see #getParameterEstimationTask
 */
public void setParameterEstimationTask(ParameterEstimationTask newValue) {
    ParameterEstimationTask oldValue = parameterEstimationTask;
    parameterEstimationTask = newValue;
    /* Stop listening for events from the current object */
    optSolverCallbacks.removePropertyChangeListener(eventHandler);
    optSolverCallbacks = new CopasiOptSolverCallbacks();
    optSolverCallbacks.addPropertyChangeListener(eventHandler);
    if (oldValue != null) {
        oldValue.removePropertyChangeListener(eventHandler);
    }
    /* Listen for events from the new object */
    if (newValue != null) {
        newValue.addPropertyChangeListener(eventHandler);
    }
    getOptimizeResultsTextPane().setText(this.getSolverMessageText());
    // set table data
    if (parameterEstimationTask != null && parameterEstimationTask.getOptimizationSolverSpec() != null) {
        if (parameterEstimationTask.getOptimizationSolverSpec().getCopasiOptimizationMethod() != null) {
            optimizationMethodComboBox.setSelectedItem(parameterEstimationTask.getOptimizationSolverSpec().getCopasiOptimizationMethod().getType());
            optimizationMethodParameterTableModel.setCopasiOptimizationMethod(parameterEstimationTask.getOptimizationSolverSpec().getCopasiOptimizationMethod());
        }
        numberOfRunComboBox.setSelectedItem(parameterEstimationTask.getOptimizationSolverSpec().getNumOfRuns() + "");
    }
    // set result table data
    if (parameterEstimationTask != null && parameterEstimationTask.getOptimizationResultSet() != null && parameterEstimationTask.getOptimizationResultSet().getOptSolverResultSet() != null && parameterEstimationTask.getOptimizationResultSet().getOptSolverResultSet().getBestEstimates() != null && parameterEstimationTask.getOptimizationResultSet().getOptSolverResultSet().getBestEstimates().length > 0) {
        optimizationResultSet_This();
    }
}
Also used : ParameterEstimationTask(cbit.vcell.modelopt.ParameterEstimationTask) CopasiOptSolverCallbacks(org.vcell.optimization.CopasiOptSolverCallbacks)

Example 10 with ParameterEstimationTask

use of cbit.vcell.modelopt.ParameterEstimationTask in project vcell by virtualcell.

the class ParameterMappingTableModel method setParameterEstimationTask.

/**
 * Sets the parameterEstimationTask property (cbit.vcell.modelopt.ParameterEstimationTask) value.
 * @param parameterEstimationTask The new value for the property.
 * @see #getParameterEstimationTask
 */
public void setParameterEstimationTask(ParameterEstimationTask newValue) {
    if (fieldParameterEstimationTask == newValue) {
        return;
    }
    ParameterEstimationTask oldValue = fieldParameterEstimationTask;
    if (oldValue != null) {
        oldValue.removePropertyChangeListener(this);
        oldValue.getModelOptimizationSpec().removePropertyChangeListener(this);
        ParameterMappingSpec[] oldPMS = oldValue.getModelOptimizationSpec().getParameterMappingSpecs();
        for (int i = 0; oldPMS != null && i < oldPMS.length; i++) {
            oldPMS[i].removePropertyChangeListener(this);
        }
    }
    fieldParameterEstimationTask = newValue;
    if (newValue != null) {
        newValue.addPropertyChangeListener(this);
        newValue.getModelOptimizationSpec().addPropertyChangeListener(this);
        ParameterMappingSpec[] newPMS = newValue.getModelOptimizationSpec().getParameterMappingSpecs();
        for (int i = 0; newPMS != null && i < newPMS.length; i++) {
            newPMS[i].addPropertyChangeListener(this);
        }
    }
    refreshData();
}
Also used : ParameterEstimationTask(cbit.vcell.modelopt.ParameterEstimationTask) ParameterMappingSpec(cbit.vcell.modelopt.ParameterMappingSpec)

Aggregations

ParameterEstimationTask (cbit.vcell.modelopt.ParameterEstimationTask)16 AnalysisTask (cbit.vcell.modelopt.AnalysisTask)4 BioEvent (cbit.vcell.mapping.BioEvent)3 SimulationContext (cbit.vcell.mapping.SimulationContext)3 SpatialObject (cbit.vcell.mapping.spatial.SpatialObject)3 SpatialProcess (cbit.vcell.mapping.spatial.processes.SpatialProcess)3 PropertyVetoException (java.beans.PropertyVetoException)3 Element (org.jdom.Element)3 ImageException (cbit.image.ImageException)2 DataSymbol (cbit.vcell.data.DataSymbol)2 GeometryException (cbit.vcell.geometry.GeometryException)2 RateRule (cbit.vcell.mapping.RateRule)2 ReactionRuleSpec (cbit.vcell.mapping.ReactionRuleSpec)2 ReactionSpec (cbit.vcell.mapping.ReactionSpec)2 SimulationContextParameter (cbit.vcell.mapping.SimulationContext.SimulationContextParameter)2 MathException (cbit.vcell.math.MathException)2 ModelException (cbit.vcell.model.ModelException)2 ExpressionBindingException (cbit.vcell.parser.ExpressionBindingException)2 ExpressionException (cbit.vcell.parser.ExpressionException)2 AnnotatedFunction (cbit.vcell.solver.AnnotatedFunction)2