public Rule calculateRates(Generator g, Rule in){
RuleGraph rg = new RuleToRuleGraphTransformer().transform(in);
Double forward = Math.pow(Math.E, getConstant(g) + shapes(g,rg, false, 0) - shapes(g,rg, true, 0) );
Double backward = Math.pow(Math.E, getConstant(g) + shapes(g,rg, false, 1) - shapes(g,rg, true, 1) );
return new Rule(in.getName(), in.getLhs(), in.getRhs(), true, forward, backward);
}