Collection<? extends Resource> resources, boolean throwExc) {
int counter = 0;
for (Resource res : resources) {
List<Event> events = new ArrayList(res.getEvents());
for (int i = 0; i < events.size(); i++) {
Event ev1 = events.get(i);
if (sol.isEventAssigned(ev1))
for (int j = i + 1; j < events.size(); j++) {
Event ev2 = events.get(j);
if (sol.isEventAssigned(ev2) && ev1.overlapps(ev2))
if (throwExc)
throw new IllegalStateException("conflicting events in resource " +
res + " ev1:" + ev1 + " " + ev1.getLocation() + " ev2:" + ev2 + " " + ev2.getLocation());
else
counter++;
}
}
}