//Sort out the Durations
Map states = new Hashtable(); //Maps (Actions => states (which the actions are applied in))
Iterator ait = top.getActions().iterator();
TemporalMetricState state = problem.getTemporalMetricInitialState();
while (ait.hasNext())
{
Action a = (Action) ait.next();
if (a instanceof StartInstantAction)
{
StartInstantAction sia = (StartInstantAction) a;
List l = TemporalConstraint.getBounds(sia, sia.getSibling(), sia.parent.getMaxDuration(state), sia.parent.getMinDuration(state));
stn.addConstraints(new HashSet(l));
}
states.put(a, state);
state = (TemporalMetricState) state.apply(a);
}
stn.consistent();