use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.
the class MathModelMetaDataPanel method setMathModelInfo.
/**
* Sets the mathModelInfo property (cbit.vcell.mathmodel.MathModelInfo) value.
* @param mathModelInfo The new value for the property.
* @see #getMathModelInfo
*/
public void setMathModelInfo(MathModelInfo mathModelInfo) {
MathModelInfo oldValue = fieldMathModelInfo;
fieldMathModelInfo = mathModelInfo;
firePropertyChange("mathModelInfo", oldValue, mathModelInfo);
}
use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.
the class MathModelMetaDataTreeModel method setMathModelInfo.
/**
* Sets the mathModelInfo property (cbit.vcell.mathmodel.MathModelInfo) value.
* @param mathModelInfo The new value for the property.
* @see #getMathModelInfo
*/
public void setMathModelInfo(MathModelInfo mathModelInfo) {
if (mathModelInfo == fieldMathModelInfo) {
return;
}
MathModelInfo oldValue = fieldMathModelInfo;
fieldMathModelInfo = mathModelInfo;
firePropertyChange("mathModelInfo", oldValue, mathModelInfo);
refreshTree();
}
use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.
the class VCDocumentDbTreeModel method initOwners.
protected static synchronized TreeMap<String, BioModelNode> initOwners(VCDocumentInfo[] vcDocumentInfos, User loginUser, VCDocumentDbTreeModel subTreeParent, Method subTreeMethod) {
//
// get list of users (owners)
//
Vector<User> userList = new Vector<User>();
userList.addElement(loginUser);
for (int i = 0; i < vcDocumentInfos.length; i++) {
VCDocumentInfo vcDocumentInfo = vcDocumentInfos[i];
if (!userList.contains(vcDocumentInfo.getVersion().getOwner())) {
userList.addElement(vcDocumentInfo.getVersion().getOwner());
}
}
//
// for each user
//
TreeMap<String, BioModelNode> treeMap = new TreeMap<String, BioModelNode>(new Comparator<String>() {
public int compare(String o1, String o2) {
return o1.compareToIgnoreCase(o2);
}
});
for (int ownerIndex = 0; ownerIndex < userList.size(); ownerIndex++) {
User owner = (User) userList.elementAt(ownerIndex);
BioModelNode ownerNode = null;
try {
if (vcDocumentInfos instanceof BioModelInfo[]) {
ownerNode = (BioModelNode) subTreeMethod.invoke(subTreeParent, new Object[] { owner, (BioModelInfo[]) vcDocumentInfos });
} else if (vcDocumentInfos instanceof MathModelInfo[]) {
ownerNode = (BioModelNode) subTreeMethod.invoke(subTreeParent, new Object[] { owner, (MathModelInfo[]) vcDocumentInfos });
} else if (vcDocumentInfos instanceof GeometryInfo[]) {
ownerNode = (BioModelNode) subTreeMethod.invoke(subTreeParent, new Object[] { owner, (GeometryInfo[]) vcDocumentInfos });
} else {
throw new Exception("Unimplemented VCDocumentInfo type=" + vcDocumentInfos.getClass().getName());
}
} catch (Exception e) {
ownerNode = new BioModelNode("Error" + e.getMessage());
}
if (owner.equals(loginUser) || ownerNode.getChildCount() > 0) {
treeMap.put(owner.getName(), ownerNode);
}
}
return treeMap;
}
use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.
the class EditTestCriteriaPanel method resetTextFields.
/**
* Sets the testSuiteInfo property (cbit.vcell.numericstest.TestSuiteInfo) value.
* @param testSuiteInfo The new value for the property.
* @see #getTestSuiteInfo
*/
public void resetTextFields() {
// If the chosen simInfo already has test criteria defined, set the fields with the appropriate values
// Else set them to blank.
getRelErrTextField().setText("");
getAbsErrTextField().setText("");
if (getExistingTestCriteria() != null) {
Double relErr = getExistingTestCriteria().getMaxRelError();
Double absErr = getExistingTestCriteria().getMaxAbsError();
getRelErrTextField().setText((relErr != null ? relErr.toString() : null));
getAbsErrTextField().setText((absErr != null ? absErr.toString() : null));
}
// Depending on test case soultion type (which is set by testingFrameworkWindowManager based on the test case
// the simulation belongs to), enable apprpriate (ref MathModel, ref simInfo buttons) fields.
// if (!getSolutionType().equals(TestCaseNew.REGRESSION)) {
getRefMathModelLabel().setText(null);
getRefSimLabel().setText(null);
getBioModelAppLabel().setText(null);
getBmAppSimLabel().setText(null);
getRefMathModelButton().setEnabled(false);
getRefMathModelLabel().setEnabled(false);
getRefSimButton().setEnabled(false);
getRefSimLabel().setEnabled(false);
getSelectRefBMAppJButton().setEnabled(false);
getBioModelAppLabel().setEnabled(false);
getSelectRefSimJButton().setEnabled(false);
getBmAppSimLabel().setEnabled(false);
// } else {
if (getExistingTestCriteria() instanceof TestCriteriaNewMathModel && getSolutionType().equals(TestCaseNew.REGRESSION)) {
getRefMathModelButton().setEnabled(true);
getRefMathModelLabel().setEnabled(true);
getRefSimButton().setEnabled(true);
getRefSimLabel().setEnabled(true);
} else if (getExistingTestCriteria() instanceof TestCriteriaNewBioModel && getSolutionType().equals(TestCaseNew.REGRESSION)) {
getSelectRefBMAppJButton().setEnabled(true);
getBioModelAppLabel().setEnabled(true);
getSelectRefSimJButton().setEnabled(true);
getBmAppSimLabel().setEnabled(true);
}
if (getExistingTestCriteria() != null && getExistingTestCriteria().getRegressionSimInfo() != null) {
if (getExistingTestCriteria() instanceof TestCriteriaNewMathModel) {
MathModelInfo refMMInfo = ((TestCriteriaNewMathModel) getExistingTestCriteria()).getRegressionMathModelInfo();
if (refMMInfo == null) {
PopupGenerator.showErrorDialog(this, "No MathModelInfo found for SimInfo Key " + getExistingTestCriteria().getRegressionSimInfo().getVersion().getVersionKey());
}
SimulationInfo refSimInfo = null;
refSimInfo = getExistingTestCriteria().getRegressionSimInfo();
if (refSimInfo == null) {
PopupGenerator.showErrorDialog(this, "No SimulationInfo found for simInfo Key " + getExistingTestCriteria().getRegressionSimInfo().getVersion().getVersionKey());
}
setReferenceMathModelInfo(refMMInfo);
setReferenceSimInfo(refSimInfo);
getRefMathModelLabel().setText("<html>" + refMMInfo.getVersion().getName() + "<br>(MathModelKey=" + refMMInfo.getVersion().getVersionKey() + ")<br>" + refMMInfo.getVersion().getDate() + "<html>");
getRefSimLabel().setText("<html>" + refSimInfo.getVersion().getName() + "<br>(SimulationKey:" + refSimInfo.getVersion().getVersionKey() + ")</html>");
} else if (getExistingTestCriteria() instanceof TestCriteriaNewBioModel) {
BioModelInfo refBMInfo = ((TestCriteriaNewBioModel) getExistingTestCriteria()).getRegressionBioModelInfo();
if (refBMInfo == null) {
PopupGenerator.showErrorDialog(this, "No bioModelInfo found for SimInfo Key " + getExistingTestCriteria().getRegressionSimInfo().getVersion().getVersionKey());
}
SimulationInfo refSimInfo = null;
refSimInfo = getExistingTestCriteria().getRegressionSimInfo();
if (refSimInfo == null) {
PopupGenerator.showErrorDialog(this, "No SimulationInfo found for simInfo Key " + getExistingTestCriteria().getRegressionSimInfo().getVersion().getVersionKey());
}
setbioModelInfo(refBMInfo);
setbmAppSimInfo(refSimInfo);
setappName(((TestCriteriaNewBioModel) getExistingTestCriteria()).getRegressionApplicationName());
getBioModelAppLabel().setText("<html>" + refBMInfo.getVersion().getName() + "/" + getappName() + "<br>(BioModelKey=" + refBMInfo.getVersion().getVersionKey() + ")<br>" + refBMInfo.getVersion().getDate() + "</html>");
getBmAppSimLabel().setText("<html>" + refSimInfo.getVersion().getName() + "<br>(SimulationKey:" + refSimInfo.getVersion().getVersionKey() + ")</html>");
}
} else {
setReferenceMathModelInfo(null);
setReferenceSimInfo(null);
getRefMathModelLabel().setText("");
getRefSimLabel().setText("");
setbioModelInfo(null);
setbmAppSimInfo(null);
setappName(null);
getBioModelAppLabel().setText(null);
getBmAppSimLabel().setText(null);
}
// }
}
use of org.vcell.util.document.MathModelInfo 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);
}
Aggregations