test_class.file: singa-simulation/src/test/java/bio/singa/simulation/export/format/FormatReactionEquationTest.java
test_class.identifier: FormatReactionEquationTest
test_case.body: @Test
      void testNthOrderReactionFormat() {
          Simulation simulation = new Simulation();
  
          ChemicalEntity substrate1 = SimpleEntity.create("A").build();
          ChemicalEntity substrate2 = SimpleEntity.create("B").build();
          ChemicalEntity product1 = SimpleEntity.create("C").build();
          ChemicalEntity product2 = SimpleEntity.create("D").build();
  
          RateConstant k = RateConstant.create(1.0)
                  .forward().secondOrder()
                  .concentrationUnit(MOLE_PER_LITRE)
                  .timeUnit(SECOND)
                  .build();
  
          Reaction reaction = ReactionBuilder.staticReactants(simulation)
                  .addSubstrate(substrate1, 2)
                  .addSubstrate(substrate2)
                  .addProduct(product1)
                  .addProduct(product2)
                  .irreversible()
                  .rate(k)
                  .build();
  
          assertEquals("\\ch{ 2 A + B -> C + D}", FormatReactionEquation.formatTex(reaction).get(0));
      }
test_case.class_method_signature: FormatReactionEquationTest.testNthOrderReactionFormat()
test_case.full_signature: @Test void testNthOrderReactionFormat()
test_case.identifier: testNthOrderReactionFormat
test_case.invocations: build create build create build create build create build timeUnit concentrationUnit secondOrder forward create build rate irreversible addProduct addProduct addSubstrate addSubstrate staticReactants assertEquals get formatTex
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNthOrderReactionFormat()
focal_class.declarator: texPrefix = "\\ch{"
focal_class.modifier: private static
focal_class.original_string: private static String texPrefix = "\\ch{";
focal_class.type: String
focal_class.var_name: texPrefix
focal_class.declarator: texSuffix = "}"
focal_class.modifier: private static
focal_class.original_string: private static String texSuffix = "}";
focal_class.type: String
focal_class.var_name: texSuffix
focal_class.declarator: reversibleArrow = "<=>"
focal_class.modifier: private static
focal_class.original_string: private static String reversibleArrow = "<=>";
focal_class.type: String
focal_class.var_name: reversibleArrow
focal_class.declarator: irreversibleArrow = "->"
focal_class.modifier: private static
focal_class.original_string: private static String irreversibleArrow = "->";
focal_class.type: String
focal_class.var_name: irreversibleArrow
focal_class.declarator: caralystFormatting = "[ %s ] "
focal_class.modifier: private static
focal_class.original_string: private static String caralystFormatting = "[ %s ] ";
focal_class.type: String
focal_class.var_name: caralystFormatting
focal_class.declarator: michaelisMentenASCIITemplate = "%s - %s -> %s}"
focal_class.modifier: private static
focal_class.original_string: private static String michaelisMentenASCIITemplate = "%s - %s -> %s}";
focal_class.type: String
focal_class.var_name: michaelisMentenASCIITemplate
focal_class.declarator: irreversibleASCIITemplate = "%s -> %s"
focal_class.modifier: private static
focal_class.original_string: private static String irreversibleASCIITemplate = "%s -> %s";
focal_class.type: String
focal_class.var_name: irreversibleASCIITemplate
focal_class.declarator: reversibleASCIITemplate = "%s <=> %s"
focal_class.modifier: private static
focal_class.original_string: private static String reversibleASCIITemplate = "%s <=> %s";
focal_class.type: String
focal_class.var_name: reversibleASCIITemplate
focal_class.file: singa-simulation/src/main/java/bio/singa/simulation/export/format/FormatReactionEquation.java
focal_class.identifier: FormatReactionEquation
focal_class.class_method_signature: FormatReactionEquation.formatTex(Reaction reaction)
focal_class.full_signature: public static List<String> formatTex(Reaction reaction)
focal_class.identifier: formatTex
focal_class.modifiers: public static
focal_class.parameters: (Reaction reaction)
focal_class.return: List<String>
focal_class.signature: List<String> formatTex(Reaction reaction)
focal_class.class_method_signature: FormatReactionEquation.formatReactantSet(ReactantSet reactantSet, boolean isReversible)
focal_class.full_signature: private static String formatReactantSet(ReactantSet reactantSet, boolean isReversible)
focal_class.identifier: formatReactantSet
focal_class.modifiers: private static
focal_class.parameters: (ReactantSet reactantSet, boolean isReversible)
focal_class.return: String
focal_class.signature: String formatReactantSet(ReactantSet reactantSet, boolean isReversible)
focal_class.class_method_signature: FormatReactionEquation.formatReactantSet(List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, boolean isReversible)
focal_class.full_signature: private static String formatReactantSet(List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, boolean isReversible)
focal_class.identifier: formatReactantSet
focal_class.modifiers: private static
focal_class.parameters: (List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, boolean isReversible)
focal_class.return: String
focal_class.signature: String formatReactantSet(List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, boolean isReversible)
focal_class.class_method_signature: FormatReactionEquation.formatReactantsTex(Collection<Reactant> reactants, String delimiter)
focal_class.full_signature: private static String formatReactantsTex(Collection<Reactant> reactants, String delimiter)
focal_class.identifier: formatReactantsTex
focal_class.modifiers: private static
focal_class.parameters: (Collection<Reactant> reactants, String delimiter)
focal_class.return: String
focal_class.signature: String formatReactantsTex(Collection<Reactant> reactants, String delimiter)
focal_class.class_method_signature: FormatReactionEquation.formatReactantTex(Reactant reactant)
focal_class.full_signature: private static String formatReactantTex(Reactant reactant)
focal_class.identifier: formatReactantTex
focal_class.modifiers: private static
focal_class.parameters: (Reactant reactant)
focal_class.return: String
focal_class.signature: String formatReactantTex(Reactant reactant)
focal_class.class_method_signature: FormatReactionEquation.mapTopologyToString(CellTopology topology)
focal_class.full_signature: private static String mapTopologyToString(CellTopology topology)
focal_class.identifier: mapTopologyToString
focal_class.modifiers: private static
focal_class.parameters: (CellTopology topology)
focal_class.return: String
focal_class.signature: String mapTopologyToString(CellTopology topology)
focal_class.class_method_signature: FormatReactionEquation.formatASCII(List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, KineticLaw law)
focal_class.full_signature: public static String formatASCII(List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, KineticLaw law)
focal_class.identifier: formatASCII
focal_class.modifiers: public static
focal_class.parameters: (List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, KineticLaw law)
focal_class.return: String
focal_class.signature: String formatASCII(List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, KineticLaw law)
focal_class.class_method_signature: FormatReactionEquation.formatASCII(Reaction reaction)
focal_class.full_signature: public static String formatASCII(Reaction reaction)
focal_class.identifier: formatASCII
focal_class.modifiers: public static
focal_class.parameters: (Reaction reaction)
focal_class.return: String
focal_class.signature: String formatASCII(Reaction reaction)
focal_class.class_method_signature: FormatReactionEquation.formatSectionReactantsASCII(Collection<Reactant> reactants, String delimiter)
focal_class.full_signature: private static String formatSectionReactantsASCII(Collection<Reactant> reactants, String delimiter)
focal_class.identifier: formatSectionReactantsASCII
focal_class.modifiers: private static
focal_class.parameters: (Collection<Reactant> reactants, String delimiter)
focal_class.return: String
focal_class.signature: String formatSectionReactantsASCII(Collection<Reactant> reactants, String delimiter)
focal_class.class_method_signature: FormatReactionEquation.formatSectionReactantASCII(Reactant reactant)
focal_class.full_signature: private static String formatSectionReactantASCII(Reactant reactant)
focal_class.identifier: formatSectionReactantASCII
focal_class.modifiers: private static
focal_class.parameters: (Reactant reactant)
focal_class.return: String
focal_class.signature: String formatSectionReactantASCII(Reactant reactant)
focal_method.body: public static List<String> formatTex(Reaction reaction) {
          List<String> resultingStrings = new ArrayList<>();
          boolean isReversible = reaction.getKineticLaw() instanceof ReversibleKineticLaw;
          if (reaction.getReactantBehavior() instanceof RuleBasedReactantBehavior) {
              List<ReactantSet> reactantSets = reaction.getReactantBehavior().getReactantSets();
              for (ReactantSet reactantSet : reactantSets) {
                  resultingStrings.add(formatReactantSet(reactantSet, isReversible));
              }
          } else {
              resultingStrings.add(formatReactantSet(reaction.getReactantBehavior().getSubstrates(),
                      reaction.getReactantBehavior().getProducts(),
                      reaction.getReactantBehavior().getCatalysts(),
                      isReversible));
          }
          return resultingStrings;
      }
focal_method.class_method_signature: FormatReactionEquation.formatTex(Reaction reaction)
focal_method.full_signature: public static List<String> formatTex(Reaction reaction)
focal_method.identifier: formatTex
focal_method.invocations: getKineticLaw getReactantBehavior getReactantSets getReactantBehavior add formatReactantSet add formatReactantSet getSubstrates getReactantBehavior getProducts getReactantBehavior getCatalysts getReactantBehavior
focal_method.modifiers: public static
focal_method.parameters: (Reaction reaction)
focal_method.return: List<String>
focal_method.signature: List<String> formatTex(Reaction reaction)