/** * Returns {@code true} if this {@link Model} contains a reference to the * given {@link Reaction}. * * @param id * the identifier of a potential reaction. * @return {@code true} if this {@link Model} contains a reference to the * given {@link Reaction}. */ public boolean containsReaction(String id) { return getReaction(id) != null; }
/** * Initializes the Converter */ private void init() { svariables = new ArrayList<SBase>(); reactants = new HashSet<String>(); for (int i = 0; i < model.getReactionCount(); i++) { if (model.getReaction(i).isSetListOfProducts()) { for (SpeciesReference sref : model.getReaction(i).getListOfProducts()) { reactants.add(sref.getSpecies()); } } if (model.getReaction(i).isSetListOfReactants()) { for (SpeciesReference sref : model.getReaction(i).getListOfReactants()) { reactants.add(sref.getSpecies()); } } } // Build the graph the matching and try to improve the matching buildGraph(); buildMatching(); augmentMatching(); }
Reaction r = model.getReaction(i);
@Override public boolean check(ValidationContext ctx, Model m) { boolean extendUsed = false; for (int n = 0; !extendUsed && n < m.getNumReactions(); n++) { if (m.getReaction(n).isSetKineticLaw()) { extendUsed = true; } } return !extendUsed || m.isSetExtentUnits(); } };
Reaction reaction = model.getReaction(i); if (reaction.isSetCompartment() && !reaction.isSetCompartmentInstance()) {
Reaction reaction = model.getReaction(reactsIds[j]);
Reaction uncheckedReaction = node.getParentSBMLObject().getModel().getReaction(reactionId);
@Override public boolean check(ValidationContext ctx, Model m) { boolean timeUsed = m.getNumRules() > 0 || m.getNumConstraints() > 0 || m.getNumEvents() > 0; for (int n = 0; !timeUsed && n < m.getNumReactions(); n++) { if (m.getReaction(n).isSetKineticLaw()) { timeUsed = true; } } return !timeUsed || m.isSetTimeUnits(); } };
SBase child = m.isSetListOfReactions() ? m.getReaction(id) : null;
@Override public boolean check(ValidationContext ctx, LocalParameter lp) { Model m = lp.getModel(); if (m != null) { String id = lp.getId(); // ID should't be used by anything else return m.getFunctionDefinition(id) == null && m.getCompartment(id) == null && m.getSpecies(id) == null && m.getParameter(id) == null && m.getReaction(id) == null; } return true; } };
&& (!allowReaction || m.getReaction(name) == null) && (!allowSpeciesRef || !ValidationTools.isSpeciesReference(m, name)))
Reaction relatedReaction = model.getReaction(reactsIds[i]);