Iterator bcit = conditions.keySet().iterator();
while (bcit.hasNext())
{
BinaryComparator bc = (BinaryComparator) bcit.next();
BigDecimal comp = bc.second.getValue(null);
Action a = (Action) conditions.get(bc);
if (bc.type == MetricSymbolStore.LESS_THAN || bc.type == MetricSymbolStore.LESS_THAN_EQUAL)
{
BigDecimal value = findBeforeMin(a);
if (value.compareTo(comp) >= 0)
{
//move an unordered consumer back
Set u = getUnorderedConsumers(a);
Action a2 = stn.getEarliest(u);
stn.addConstraint(TemporalConstraint.getConstraint((InstantAction)a2, (InstantAction)a));
changed = true;
}
}
else if (bc.type == MetricSymbolStore.GREATER_THAN || bc.type == MetricSymbolStore.GREATER_THAN_EQUAL)
{
BigDecimal value = findBeforeMax(a);
if (value.compareTo(comp) <= 0)
{
//move an unordered producer back
Set u = getUnorderedProducers(a);
Action a2 = stn.getEarliest(u);
stn.addConstraint(TemporalConstraint.getConstraint((InstantAction)a2, (InstantAction)a));
changed = true;
}
}
}