int slotsPerWeek = 3;
int slotsPerDay = 3;
settings.setTimeslotsPerDay(slotsPerDay);
settings.setNumberOfDays(slotsPerWeek / slotsPerDay);
final Assignment a = newAssignment("a", -1, 1);
final Assignment b = newAssignment("b", -1, 1);
final Assignment c = newAssignment("c", -1, 1);
final Assignment d = newAssignment("d", -1, 1);
d.getEvent().putConstraint(newForbidden(1, 2));
final int LIMITING_CAPACITY = 5;
ConflictMatrix matrix = new ConflictMatrix(slotsPerWeek, slotsPerDay);
Map<Resource, Set<Assignment>> resources = newResources(Arrays.asList(d, b), Arrays.asList(d, a), Arrays.asList(c));
matrix.initFromResources(resources);
// add more visiors => force d into location with 10 seats
for (int i = 0; i < LIMITING_CAPACITY + 1; i++) {
b.getEvent().addPerson(new Person(), true);
c.getEvent().addPerson(new Person(), true);
}
List locations = Arrays.asList(new Location(10), new Location(LIMITING_CAPACITY));
periode = newPeriod(slotsPerWeek, locations, matrix);
assertTrue(periode.add(b, 0));
assertTrue(periode.add(a, 0));
assertTrue(periode.add(c, 1));
periode.add(d, -1);
assertEquals(true, d.getStart() < 0);
int depth = 2;
int collidingAssignment = 2;
assertEquals(true, periode.inject(d, depth, collidingAssignment));
assertEquals(0, d.getStart());
}