use of cbit.vcell.modelopt.ParameterEstimationTask in project vcell by virtualcell.
the class ReferenceDataPanel method setParameterEstimationTask.
public void setParameterEstimationTask(ParameterEstimationTask newValue) {
ParameterEstimationTask oldValue = fieldParameterEstimationTask;
fieldParameterEstimationTask = newValue;
if (oldValue != null) {
oldValue.getModelOptimizationSpec().removePropertyChangeListener(ivjEventHandler);
ReferenceDataMappingSpec[] refDataMappingSpecs = oldValue.getModelOptimizationSpec().getReferenceDataMappingSpecs();
if (refDataMappingSpecs != null) {
for (ReferenceDataMappingSpec refDataMappingSpec : refDataMappingSpecs) {
refDataMappingSpec.removePropertyChangeListener(ivjEventHandler);
}
}
}
if (fieldParameterEstimationTask != null) {
newValue.getModelOptimizationSpec().addPropertyChangeListener(ivjEventHandler);
ReferenceDataMappingSpec[] refDataMappingSpecs = fieldParameterEstimationTask.getModelOptimizationSpec().getReferenceDataMappingSpecs();
if (refDataMappingSpecs != null) {
for (ReferenceDataMappingSpec refDataMappingSpec : refDataMappingSpecs) {
refDataMappingSpec.addPropertyChangeListener(ivjEventHandler);
}
}
timeIndex = fieldParameterEstimationTask.getModelOptimizationSpec().getReferenceDataTimeColumnIndex();
} else {
// fieldParameterEstimationTask is null, so referenceData cannot have any data, should be null too?
timeIndex = 0;
}
updatePlot();
}
use of cbit.vcell.modelopt.ParameterEstimationTask in project vcell by virtualcell.
the class Xmlproducer method getXML.
/**
* Insert the method's description here.
* Creation date: (5/5/2006 9:25:06 AM)
* @return Element
* @param analysisTasks cbit.vcell.modelopt.AnalysisTask[]
*/
private Element getXML(AnalysisTask[] analysisTasks) {
Element analysisTaskListElement = new Element(XMLTags.AnalysisTaskListTag);
for (int i = 0; i < analysisTasks.length; i++) {
Element analysisTaskElement = null;
if (analysisTasks[i] instanceof ParameterEstimationTask) {
analysisTaskElement = ParameterEstimationTaskXMLPersistence.getXML((ParameterEstimationTask) analysisTasks[i]);
} else {
throw new RuntimeException("XML persistence not supported for analysis type " + analysisTasks[i].getClass().getName());
}
analysisTaskListElement.addContent(analysisTaskElement);
}
return analysisTaskListElement;
}
use of cbit.vcell.modelopt.ParameterEstimationTask in project vcell by virtualcell.
the class ParameterEstimationPanel method setParameterEstimationTask.
/**
* Sets the parameterEstimationTask property (cbit.vcell.modelopt.ParameterEstimationTask) value.
* @param newValue The new value for the property.
* @see #getParameterEstimationTask
*/
private void setParameterEstimationTask(ParameterEstimationTask newValue) {
ParameterEstimationTask oldValue = fieldParameterEstimationTask;
/* Stop listening for events from the current object */
if (oldValue != null) {
oldValue.removePropertyChangeListener(eventHandler);
if (oldValue.getModelOptimizationSpec() != null) {
oldValue.getModelOptimizationSpec().removePropertyChangeListener(eventHandler);
}
}
fieldParameterEstimationTask = newValue;
/* Listen for events from the new object */
if (newValue != null) {
newValue.addPropertyChangeListener(eventHandler);
if (newValue.getModelOptimizationSpec() != null) {
newValue.getModelOptimizationSpec().addPropertyChangeListener(eventHandler);
}
}
getreferenceDataMappingSpecTableModel().setModelOptimizationSpec(fieldParameterEstimationTask == null ? null : fieldParameterEstimationTask.getModelOptimizationSpec());
referenceDataPanel.setParameterEstimationTask(fieldParameterEstimationTask);
getparameterMappingPanel().setParameterEstimationTask(fieldParameterEstimationTask);
getAnalysisTaskComboBox().setSelectedItem(fieldParameterEstimationTask);
runTaskPanel.setParameterEstimationTask(fieldParameterEstimationTask);
}
use of cbit.vcell.modelopt.ParameterEstimationTask in project vcell by virtualcell.
the class ParameterEstimationPanel method newParameterEstimationTaskButton_ActionPerformed.
private void newParameterEstimationTaskButton_ActionPerformed() {
try {
String parameterEstimationName = "task0";
if (simulationContext == null) {
return;
}
AnalysisTask[] analysisTasks = simulationContext.getAnalysisTasks();
boolean found = true;
while (found) {
found = false;
parameterEstimationName = TokenMangler.getNextEnumeratedToken(parameterEstimationName);
for (int i = 0; analysisTasks != null && i < analysisTasks.length; i++) {
if (analysisTasks[i].getName().equals(parameterEstimationName)) {
found = true;
continue;
}
}
}
String newParameterEstimationName = null;
try {
newParameterEstimationName = DialogUtils.showInputDialog0(this, "name for new parameter estimation set", parameterEstimationName);
} catch (UtilCancelException ex) {
// user canceled; it's ok
}
if (newParameterEstimationName != null) {
if (newParameterEstimationName.length() == 0) {
PopupGenerator.showErrorDialog(this, "Error:\n name for new parameter estimation can't be empty");
} else {
final String finalname = newParameterEstimationName;
AsynchClientTask task1 = new AsynchClientTask("init task", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
ParameterEstimationTask newParameterEstimationTask = new ParameterEstimationTask(simulationContext);
newParameterEstimationTask.setName(finalname);
hashTable.put("newParameterEstimationTask", newParameterEstimationTask);
}
};
AsynchClientTask task2 = new AsynchClientTask("add task", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
ParameterEstimationTask newParameterEstimationTask = (ParameterEstimationTask) hashTable.get("newParameterEstimationTask");
simulationContext.addAnalysisTask(newParameterEstimationTask);
getAnalysisTaskComboBox().setSelectedItem(newParameterEstimationTask);
refreshAnalysisTaskEnables();
}
};
ClientTaskDispatcher.dispatch(this, new Hashtable<String, Object>(), new AsynchClientTask[] { task1, task2 });
}
}
} catch (Exception e) {
e.printStackTrace(System.out);
DialogUtils.showErrorDialog(this, e.getMessage(), e);
}
}
use of cbit.vcell.modelopt.ParameterEstimationTask in project vcell by virtualcell.
the class ParameterEstimationTaskPropertiesPanel method onSelectedObjectsChange.
@Override
protected void onSelectedObjectsChange(Object[] selectedObjects) {
ParameterEstimationTask pet = null;
if (selectedObjects != null && selectedObjects.length == 1 && selectedObjects[0] instanceof ParameterEstimationTask) {
pet = (ParameterEstimationTask) selectedObjects[0];
}
setParameterEstimationTask(pet);
}
Aggregations