Search in sources :

Example 1 with ModelRuleFactory

use of cbit.vcell.model.ModelRuleFactory 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;
        }
    }
}
Also used : ModelRuleFactory(cbit.vcell.model.ModelRuleFactory) RuleAnalysisReport(org.vcell.model.rbm.RuleAnalysisReport) ModelRuleEntry(cbit.vcell.model.ModelRuleFactory.ModelRuleEntry) ReactionRule(cbit.vcell.model.ReactionRule) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Example 2 with ModelRuleFactory

use of cbit.vcell.model.ModelRuleFactory in project vcell by virtualcell.

the class RulesShapePanel method refreshRuleAnalysis.

private void refreshRuleAnalysis() {
    if (reactionRule == null) {
        bRuleAnalysisFailed = true;
        return;
    }
    ModelRuleFactory factory = new ModelRuleFactory();
    this.modelRuleEntry = factory.createRuleEntry(reactionRule, 0, ReactionRuleDirection.forward);
    try {
        this.report = RuleAnalysis.analyze(modelRuleEntry, false);
        this.bRuleAnalysisFailed = false;
    } catch (Exception e) {
        e.printStackTrace();
        System.err.println("exception computing RuleAnalysis report: " + e.getMessage());
        bRuleAnalysisFailed = true;
    }
}
Also used : ModelRuleFactory(cbit.vcell.model.ModelRuleFactory)

Aggregations

ModelRuleFactory (cbit.vcell.model.ModelRuleFactory)2 ModelRuleEntry (cbit.vcell.model.ModelRuleFactory.ModelRuleEntry)1 ReactionRule (cbit.vcell.model.ReactionRule)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 RuleAnalysisReport (org.vcell.model.rbm.RuleAnalysisReport)1