for r in self.model.rules:
label = r.name + ":"
reactants_code = " + ".join([format_monomerpattern(mp) for mp in r.reactants])
products_code = " + ".join([format_monomerpattern(mp) for mp in r.products])
self.__content += (" %-" + str(max_length) + "s %s -> %s %s\n") % (label, reactants_code, products_code, r.rate.name)
self.__content += "end reaction rules\n\n"
def generate_observables(self):
After Change
max_length = max([len(r.name) for r in self.model.rules]) + 1 // +1 for the colon
for r in self.model.rules:
label = r.name + ":"
reactants_code = format_reactionpattern(r.reactant_pattern)
products_code = format_reactionpattern(r.product_pattern)
arrow = "->"
if r.is_reversible:
arrow = "<->"