use of cbit.vcell.model.ModelRuleFactory.ModelRuleEntry in project vcell by virtualcell.
the class ParticipantSignatureShapePanel method refreshRuleAnalysis.
private void refreshRuleAnalysis() {
reportMap.clear();
modelRuleEntryMap.clear();
bRuleAnalysisFailedMap.clear();
if (reactionRuleMap == null || reactionRuleMap.isEmpty()) {
return;
}
for (Map.Entry<String, ReactionRule> entry : reactionRuleMap.entrySet()) {
String key = entry.getKey();
ReactionRule rr = entry.getValue();
ModelRuleFactory factory = new ModelRuleFactory();
ModelRuleEntry modelRuleEntry = factory.createRuleEntry(rr, 0, ReactionRuleDirection.forward);
try {
RuleAnalysisReport report = RuleAnalysis.analyze(modelRuleEntry, false);
reportMap.put(key, report);
modelRuleEntryMap.put(key, modelRuleEntry);
bRuleAnalysisFailedMap.put(key, false);
} catch (Exception e) {
e.printStackTrace();
System.err.println("exception computing RuleAnalysis report for " + key + ": " + e.getMessage());
bRuleAnalysisFailedMap.put(key, true);
bRuleAnalysisFailed = true;
}
}
}
use of cbit.vcell.model.ModelRuleFactory.ModelRuleEntry in project vcell by virtualcell.
the class ParticipantSignatureShapePanel method hasStateChanged.
public RuleAnalysisChanged hasStateChanged(String key, MolecularComponentPattern molecularComponentPattern) {
ReactionRule reactionRule = reactionRuleMap.get(key);
if (reactionRule == null) {
return RuleAnalysisChanged.ANALYSISFAILED;
}
ModelRuleEntry modelRuleEntry = modelRuleEntryMap.get(key);
RuleAnalysisReport report = reportMap.get(key);
if (modelRuleEntry == null || report == null) {
System.out.println("modelRuleEntry == null || report == null, NOT GOOD!");
// refreshRuleAnalysis();
}
if (!bRuleAnalysisFailed && report != null) {
MolecularComponentEntry molecularComponentEntry = modelRuleEntry.findMolecularComponentEntry(molecularComponentPattern);
if (report.hasStateChanged(molecularComponentEntry)) {
return RuleAnalysisChanged.CHANGED;
} else {
return RuleAnalysisChanged.UNCHANGED;
}
} else {
return RuleAnalysisChanged.ANALYSISFAILED;
}
}
use of cbit.vcell.model.ModelRuleFactory.ModelRuleEntry in project vcell by virtualcell.
the class ParticipantSignatureShapePanel method hasBondChanged.
public RuleAnalysisChanged hasBondChanged(String key, MolecularComponentPattern molecularComponentPattern) {
ReactionRule reactionRule = reactionRuleMap.get(key);
if (reactionRule == null) {
return RuleAnalysisChanged.ANALYSISFAILED;
}
ModelRuleEntry modelRuleEntry = modelRuleEntryMap.get(key);
RuleAnalysisReport report = reportMap.get(key);
if (modelRuleEntry == null || report == null) {
System.out.println("modelRuleEntry == null || report == null, NOT GOOD!");
// refreshRuleAnalysis();
}
if (!bRuleAnalysisFailed && report != null) {
MolecularComponentEntry molecularComponentEntry = modelRuleEntry.findMolecularComponentEntry(molecularComponentPattern);
if (report.hasBondChanged(molecularComponentEntry)) {
return RuleAnalysisChanged.CHANGED;
} else {
return RuleAnalysisChanged.UNCHANGED;
}
} else {
return RuleAnalysisChanged.ANALYSISFAILED;
}
}
use of cbit.vcell.model.ModelRuleFactory.ModelRuleEntry in project vcell by virtualcell.
the class ParticipantSignatureShapePanel method hasNoMatch.
public RuleAnalysisChanged hasNoMatch(String key, MolecularTypePattern molecularTypePattern) {
ReactionRule reactionRule = reactionRuleMap.get(key);
if (reactionRule == null) {
return RuleAnalysisChanged.ANALYSISFAILED;
}
ModelRuleEntry modelRuleEntry = modelRuleEntryMap.get(key);
RuleAnalysisReport report = reportMap.get(key);
if (modelRuleEntry == null || report == null) {
System.out.println("modelRuleEntry == null || report == null, NOT GOOD!");
// refreshRuleAnalysis();
}
if (!bRuleAnalysisFailed && report != null) {
MolecularTypeEntry molecularTypeEntry = modelRuleEntry.findMolecularTypeEntry(molecularTypePattern);
if (report.hasNoMatch(molecularTypeEntry)) {
return RuleAnalysisChanged.CHANGED;
} else {
return RuleAnalysisChanged.UNCHANGED;
}
} else {
return RuleAnalysisChanged.ANALYSISFAILED;
}
}
Aggregations