use of cbit.vcell.mathmodel.MathModel in project vcell by virtualcell.
the class RuleBasedTest method main.
public static void main(String[] args) {
try {
PropertyLoader.loadProperties();
} catch (Exception e) {
e.printStackTrace();
}
final int numTrials = 40;
VCDatabaseVisitor vcDatabaseVisitor = new VCDatabaseVisitor() {
@Override
public void visitMathModel(MathModel mathModel, PrintStream logFilePrintStream) {
throw new IllegalArgumentException("Not Implemented");
}
@Override
public void visitGeometry(Geometry geometry, PrintStream logFilePrintStream) {
throw new IllegalArgumentException("Not Implemented");
}
@Override
public void visitBioModel(BioModel bioModel, PrintStream logFilePrintStream) {
SimulationContext[] simulationContexts = bioModel.getSimulationContexts();
for (SimulationContext simContext : simulationContexts) {
if ((simContext.getApplicationType() == Application.NETWORK_STOCHASTIC) && simContext.getGeometry().getDimension() == 0) {
File baseDirectory = createDirFile(simContext);
try {
checkNonspatialStochasticSimContext(simContext, baseDirectory, numTrials);
} catch (Exception e) {
e.printStackTrace();
if (!e.getMessage().contains("Only Mass Action Kinetics supported ")) {
writeMessageTofile(baseDirectory, e.getMessage());
}
}
}
}
}
@Override
public boolean filterMathModel(MathModelInfo mathModelInfo) {
return false;
}
@Override
public boolean filterGeometry(GeometryInfo geometryInfo) {
return false;
}
@Override
public boolean filterBioModel(BioModelInfo bioModelInfo) {
return // bioModelInfo.getVersion().getName().equals("model");
bioModelInfo.getVersion().getName().equals("simpleModel_Network_orig");
}
};
String currentUserID = "schaff";
String[] allUsers = new String[] { /*-all*/
currentUserID, "-" };
VCDatabaseScanner.scanBioModels(allUsers, vcDatabaseVisitor, false);
}
use of cbit.vcell.mathmodel.MathModel in project vcell by virtualcell.
the class MathGenerationDebugger method compareMath_4_8.
private void compareMath_4_8() {
try {
MathModel mathModel1 = new MathModel(null);
MathModel mathModel2 = new MathModel(null);
mathModel1.setMathDescription(mathGenerationResults.mathDesc_original);
mathModel2.setMathDescription(mathGenerationResults.mathDesc_4_8);
getMathDebuggerPanel().setMathModel1(mathModel1);
getMathDebuggerPanel().setMathModel2(mathModel2);
} catch (Exception e) {
e.printStackTrace(System.out);
DialogUtils.showErrorDialog(this, e.getMessage(), e);
}
}
use of cbit.vcell.mathmodel.MathModel in project vcell by virtualcell.
the class MathModelEditorTreeCellRenderer method getTreeCellRendererComponent.
// public void setMathModel(MathModel mm) {
// mathModel = mm;
// }
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
if (regularFont == null) {
regularFont = getFont();
boldFont = regularFont.deriveFont(Font.BOLD);
}
Font font = regularFont;
Icon icon = null;
String labelText = null;
String toolTipPrefix = "";
String toolTipSuffix = "";
if (value instanceof BioModelNode) {
BioModelNode node = (BioModelNode) value;
if (node.getChildCount() > 0) {
icon = getIcon();
}
Object userObj = node.getUserObject();
if (userObj instanceof MathModel) {
font = boldFont;
icon = VCellIcons.documentIcon;
labelText = ((MathModel) userObj).getName();
toolTipPrefix = "MathModel: ";
} else if (userObj instanceof DocumentEditorTreeFolderNode) {
// --- 1st level folders
DocumentEditorTreeFolderNode folder = (DocumentEditorTreeFolderNode) userObj;
labelText = folder.getName();
if (folder.isBold()) {
font = boldFont;
}
DocumentEditorTreeFolderClass folderClass = folder.getFolderClass();
switch(folderClass) {
case MATH_VCML_NODE:
icon = VCellIcons.textNotesIcon;
break;
case MATH_GEOMETRY_NODE:
icon = VCellIcons.geometryIcon;
break;
case MATH_SIMULATIONS_NODE:
icon = VCellIcons.simulationIcon;
break;
case MATH_OUTPUT_FUNCTIONS_NODE:
icon = VCellIcons.getOutputFunctionIcon();
break;
}
}
}
setIcon(icon);
setFont(font);
setText(labelText);
if (toolTipSuffix.length() == 0) {
toolTipSuffix = labelText;
}
setToolTipText(toolTipPrefix + toolTipSuffix);
return this;
}
use of cbit.vcell.mathmodel.MathModel in project vcell by virtualcell.
the class MathModelEditorTreeModel method setMathModel.
public void setMathModel(MathModel newValue) {
if (mathModel == newValue) {
return;
}
MathModel oldValue = this.mathModel;
mathModel = newValue;
populateRoot();
if (oldValue != null) {
oldValue.removePropertyChangeListener(this);
}
if (newValue != null) {
newValue.addPropertyChangeListener(this);
}
}
use of cbit.vcell.mathmodel.MathModel in project vcell by virtualcell.
the class VCMLEditorPanel method setMathModel.
/**
* Sets the mathModel property (cbit.vcell.mathmodel.MathModel) value.
* @param mathModel The new value for the property.
* @see #getMathModel
*/
public void setMathModel(MathModel newValue) {
if (fieldMathModel == newValue) {
return;
}
MathModel oldValue = fieldMathModel;
if (oldValue != null) {
oldValue.removePropertyChangeListener(ivjEventHandler);
if (oldValue.getGeometry() != null) {
oldValue.getGeometry().getGeometrySpec().removePropertyChangeListener(ivjEventHandler);
}
}
fieldMathModel = newValue;
if (newValue != null) {
newValue.addPropertyChangeListener(ivjEventHandler);
if (newValue.getGeometry() != null) {
newValue.getGeometry().getGeometrySpec().addPropertyChangeListener(ivjEventHandler);
}
getMathDescEditor().setMathDescription(fieldMathModel.getMathDescription());
}
}
Aggregations