return reactantString + productString + repeatedProductString + kString;
}
public String checkReactionBalance()
{
LSVList cnsrvdRctnts = new LSVList();
cnsrvdRctnts.add("Check balance for conserved reactants");
String outString = new String();
// Generate a list of conserved reactants/products
for (Reactant r : this.reactants)
{
double rStoich = r.stoich;
double pStoich = 0.0;
boolean conserved = false;
for (Product p : this.products)
{
// if the names are the same and the pools are the same they are
// the same entity and conserved
if(r.name == p.name && r.pool == p.pool)
{
conserved = true;
// add up all the products (they are different because of
// delays)
pStoich += p.stoich;
}
}
if(conserved)
{
// add to the list, and display the reactant product stoich
outString = r.name + ": " + rStoich + " , " + pStoich;
cnsrvdRctnts.add(outString);
}
}
return cnsrvdRctnts.toString();
}