for (Entry<String, Integer> e : map.entrySet()) {
int i = states.indexOf(e.getKey());
a.addCondition(new StateCondition(i, e.getValue(), e.getValue()));
}
return new CARule(new CurrentStateCondition(states.indexOf(currentState)),
a, states.indexOf(targetState), 1d);
}