use of cbit.vcell.math.ReservedVariable in project vcell by virtualcell.
the class ParameterEstimationPanel method initialize.
@Override
protected void initialize() {
super.initialize();
setName("Parameter Estimation");
setLayout(new java.awt.BorderLayout());
referenceDataPanel = new ReferenceDataPanel();
runTaskPanel = new ParameterEstimationRunTaskPanel();
getparameterMappingPanel().setBorder(GuiConstants.TAB_PANEL_BORDER);
referenceDataPanel.setBorder(GuiConstants.TAB_PANEL_BORDER);
getDataMappingPanel().setBorder(GuiConstants.TAB_PANEL_BORDER);
runTaskPanel.setBorder(GuiConstants.TAB_PANEL_BORDER);
tabbedPane.addTab(ParameterEstimationPanelTabID.parameters.title, getparameterMappingPanel());
tabbedPane.addTab(ParameterEstimationPanelTabID.experimental_data_import.title, referenceDataPanel);
tabbedPane.addTab(ParameterEstimationPanelTabID.experimental_data_mapping.title, getDataMappingPanel());
tabbedPane.addTab(ParameterEstimationPanelTabID.run_task.title, runTaskPanel);
add(tabbedPane, BorderLayout.CENTER);
add(getButtonPanel(), BorderLayout.NORTH);
getNewAnalysisTaskButton().addActionListener(eventHandler);
getDeleteAnalysisTaskButton().addActionListener(eventHandler);
getCopyButton().addActionListener(eventHandler);
getAnalysisTaskComboBox().addActionListener(eventHandler);
getMapButton().addActionListener(eventHandler);
getEvaluateConfidenceIntervalButton().addActionListener(eventHandler);
getDataModelMappingTable().getSelectionModel().addListSelectionListener(eventHandler);
dataModelMappingTable.addMouseListener(eventHandler);
getDataModelMappingTable().setDefaultRenderer(SymbolTableEntry.class, new DefaultScrollTableCellRenderer() {
public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (value == null) {
setText("unmapped");
return this;
}
SymbolTableEntry ste = (SymbolTableEntry) value;
if (ste instanceof Model.ReservedSymbol) {
setText(ste.getName());
} else if (ste instanceof SpeciesContext) {
setText("[" + ste.getName() + "]");
} else if (ste instanceof KineticsParameter) {
setText(ste.getNameScope().getName() + ":" + ste.getName());
} else if (ste instanceof ModelParameter) {
setText(ste.getName());
} else if (ste instanceof ReservedVariable) {
setText(ste.getName());
} else {
setText(ste.getNameScope().getAbsoluteScopePrefix() + ste.getName());
}
return this;
}
});
getDataModelMappingTable().setModel(getreferenceDataMappingSpecTableModel());
getDataModelMappingTable().createDefaultColumnsFromModel();
}
use of cbit.vcell.math.ReservedVariable in project vcell by virtualcell.
the class SimulationSymbolTable method hasTimeVaryingDiffusionOrAdvection.
public boolean hasTimeVaryingDiffusionOrAdvection(Variable variable) throws MathException, ExpressionException {
Enumeration<SubDomain> enum1 = simulation.getMathDescription().getSubDomains();
while (enum1.hasMoreElements()) {
SubDomain subDomain = enum1.nextElement();
Equation equation = subDomain.getEquation(variable);
//
if (equation instanceof PdeEquation) {
Vector<Expression> spatialExpressionList = new Vector<Expression>();
spatialExpressionList.add(((PdeEquation) equation).getDiffusionExpression());
if (((PdeEquation) equation).getVelocityX() != null) {
spatialExpressionList.add(((PdeEquation) equation).getVelocityX());
}
if (((PdeEquation) equation).getVelocityY() != null) {
spatialExpressionList.add(((PdeEquation) equation).getVelocityY());
}
if (((PdeEquation) equation).getVelocityZ() != null) {
spatialExpressionList.add(((PdeEquation) equation).getVelocityZ());
}
for (int i = 0; i < spatialExpressionList.size(); i++) {
Expression spatialExp = spatialExpressionList.elementAt(i);
spatialExp = substituteFunctions(spatialExp);
String[] symbols = spatialExp.getSymbols();
if (symbols != null) {
for (int j = 0; j < symbols.length; j++) {
SymbolTableEntry entry = spatialExp.getSymbolBinding(symbols[j]);
if (entry instanceof ReservedVariable) {
if (((ReservedVariable) entry).isTIME()) {
return true;
}
}
if (entry instanceof VolVariable) {
return true;
}
if (entry instanceof VolumeRegionVariable) {
return true;
}
if (entry instanceof MemVariable || entry instanceof MembraneRegionVariable) {
return true;
}
}
}
}
}
}
return false;
}
use of cbit.vcell.math.ReservedVariable in project vcell by virtualcell.
the class OutputFunctionContext method getAutoCompleteSymbolFilter.
public AutoCompleteSymbolFilter getAutoCompleteSymbolFilter(final Domain functionDomain) {
AutoCompleteSymbolFilter stef = new AutoCompleteSymbolFilter() {
public boolean accept(SymbolTableEntry ste) {
if (simulationOwner.getGeometry().getDimension() > 0) {
if (functionDomain == null) {
return true;
}
if (ste.getName().endsWith(InsideVariable.INSIDE_VARIABLE_SUFFIX) || ste.getName().endsWith(OutsideVariable.OUTSIDE_VARIABLE_SUFFIX)) {
return false;
}
if (ste instanceof ReservedVariable) {
return true;
}
if (ste instanceof AnnotatedFunction) {
return functionDomain.compareEqual(((AnnotatedFunction) ste).getDomain());
}
if (ste instanceof Variable) {
Variable var = (Variable) ste;
if (var.getDomain() == null) {
return true;
}
GeometryClass gc = simulationOwner.getGeometry().getGeometryClass(functionDomain.getName());
GeometryClass vargc = simulationOwner.getGeometry().getGeometryClass(var.getDomain().getName());
if (gc instanceof SurfaceClass && vargc instanceof SubVolume) {
if (((SurfaceClass) gc).isAdjacentTo((SubVolume) vargc)) {
return true;
} else {
return false;
}
} else {
return var.getDomain().compareEqual(functionDomain);
}
}
}
return true;
}
public boolean acceptFunction(String funcName) {
return true;
}
};
return stef;
}
use of cbit.vcell.math.ReservedVariable in project vcell by virtualcell.
the class SymbolTableEntryTableCellRenderer method getTableCellRendererComponent.
public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (value == null) {
setText("unmapped");
return this;
}
SymbolTableEntry ste = (SymbolTableEntry) value;
if (ste instanceof Model.ReservedSymbol) {
setText(ste.getName());
} else if (ste instanceof SpeciesContext) {
setText("[" + ste.getName() + "]");
} else if (ste instanceof KineticsParameter) {
setText(ste.getNameScope().getName() + ":" + ste.getName());
} else if (ste instanceof ModelParameter) {
setText(ste.getName());
} else if (ste instanceof ReservedVariable) {
setText(ste.getName());
} else {
setText(ste.getNameScope().getAbsoluteScopePrefix() + ste.getName());
}
// setToolTipText("Kinetic parameter \""+ste.getName()+"\" in reaction "+);
return this;
}
use of cbit.vcell.math.ReservedVariable in project vcell by virtualcell.
the class DataSetControllerImpl method identifyDataDependencies.
private Vector<DataSetIdentifier> identifyDataDependencies(AnnotatedFunction function) {
//
// identify data dependencies
//
Expression exp = function.getExpression();
String[] dependentIDs = exp.getSymbols();
Vector<DataSetIdentifier> dependencyList = new Vector<DataSetIdentifier>();
//
// get Dependents
// variables are indexed by a number, t=0, x=1, y=2, z=3, a(i) = 4+i where a's are other variables
//
int varIndex = TXYZ_OFFSET;
for (int i = 0; dependentIDs != null && i < dependentIDs.length; i++) {
SymbolTableEntry ste = exp.getSymbolBinding(dependentIDs[i]);
if (ste instanceof DataSetIdentifier) {
DataSetIdentifier dsi = (DataSetIdentifier) ste;
dependencyList.addElement(dsi);
dsi.setIndex(varIndex++);
} else if (ste instanceof ReservedVariable) {
ReservedVariable rv = (ReservedVariable) ste;
if (rv.isTIME()) {
rv.setIndex(0);
} else if (rv.isX()) {
rv.setIndex(1);
} else if (rv.isY()) {
rv.setIndex(2);
} else if (rv.isZ()) {
rv.setIndex(3);
}
}
}
return dependencyList;
}
Aggregations