Package de.timefinder.algo

Examples of de.timefinder.algo.ConflictMatrix


            for (Constraint c : person.getConstraints()) {
                c.transformEvents(eventToAss);
            }
        }

        conflictMatrix = new ConflictMatrix(dataPoolSettings.getTimeslotsPerWeek(), dataPoolSettings.getTimeslotsPerDay());

        // TODO LATER: use only as many assignment as it should (e.g. if a course is splitted into several sections)      
        List<Assignment> allAssignments = new ArrayList<Assignment>(conflictMatrix.initFromResources(personToAssignments));

        doIntegrityChecks(allAssignments, allLocations);
View Full Code Here


    @Before
    @Override
    public void setUp() {
        super.setUp();
        conflictingMatrix = new ConflictMatrix(5, 5);
        List locArray = Arrays.asList(new Location(10));
        periode = newPeriod(5, locArray, conflictingMatrix);
    }
View Full Code Here

        final Assignment a = newAssignment("a", -1, 1);
        final Assignment b = newAssignment("b", -1, 1);
        final Assignment c = newAssignment("c", -1, 1);

        ConflictMatrix matrix = new ConflictMatrix(slotsPerWeek, slotsPerDay);
        Map<Resource, Set<Assignment>> resources = newResources(Arrays.asList(a, b), Arrays.asList(a, c));

        matrix.initFromResources(resources);
        Location loc1 = new Location(10);
        Location loc2 = new Location(5);
        List locations = Arrays.asList(loc1, loc2);

        periode = newPeriod(slotsPerWeek, locations, matrix);

        assertTrue(periode.add(b, 0));
        assertEquals(loc1, b.getLocation());
        assertTrue(periode.add(c, 1));
        assertEquals(loc1, c.getLocation());
        periode.add(a, -1);

        // no more free slots are available for event A
        assertEquals(-1, matrix.getConflictingRaster(a).getLastFreePlus1(0));

        // but we could injectAt event A, if we allow moving at least one colliding event
        int depth = 1;
        int collidingAssignments = 0;
        assertEquals(false, periode.inject(a, depth, collidingAssignments));
View Full Code Here

        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);
View Full Code Here

        final Assignment a = newAssignment("a", -1, 1);
        final Assignment b = newAssignment("b", -1, 1);
        final Assignment c = newAssignment("c", -1, 1);

        ConflictMatrix matrix = new ConflictMatrix(slotsPerWeek, slotsPerDay);

        matrix.initFromResources(newResources(Arrays.asList(a, b), Arrays.asList(a, c), Arrays.asList(b, c)));

        List locations = Arrays.asList(new Location(5));

        periode = newPeriod(slotsPerWeek, locations, matrix);
        periode.setRandom(new Random());
View Full Code Here

        settings.setTimeslotsPerDay(slotsPerDay);
        settings.setNumberOfDays(slotsPerWeek / slotsPerDay);

        final Assignment a = newAssignment("a", -1, 1);

        ConflictMatrix matrix = new ConflictMatrix(slotsPerWeek, slotsPerDay);
        matrix.initFromResources(newResources(Arrays.asList(a)));

        Location loc = new Location(5);
        List locations = Arrays.asList(loc);

        periode = newPeriod(slotsPerWeek, locations, matrix);
View Full Code Here

        final Assignment a = newAssignment("a", -1, 2);
        final Assignment b = newAssignment("b", -1, 2);
        final Assignment c = newAssignment("c", -1, 2);

        ConflictMatrix matrix = new ConflictMatrix(slotsPerWeek, slotsPerDay);

        matrix.initFromResources(newResources(Arrays.asList(a, b), Arrays.asList(a, c), Arrays.asList(b, c)));

        List locations = Arrays.asList(new Location(5));

        periode = newPeriod(slotsPerWeek, locations, matrix);
        periode.setRandom(new Random());
View Full Code Here

        final Assignment a = newAssignment("a", -1, 2);
        final Assignment b = newAssignment("b", -1, 2);
        final Assignment c = newAssignment("c", -1, 2);

        ConflictMatrix conflictMatrix = new ConflictMatrix(slotsPerWeek, slotsPerDay);
        conflictMatrix.initFromResources(newResources(Arrays.asList(a, b), Arrays.asList(a, c), Arrays.asList(b, c)));

        List locations = Arrays.asList(new Location(5));

        periode = newPeriod(slotsPerWeek, locations, conflictMatrix);
        periode.setRandom(new Random());

        // 'spread'
        assertTrue(periode.add(b, 0));
        periode.add(c, -1);

        // 'compress' with injectAt which is not possible
        assertEquals(3, conflictMatrix.getConflictingAssignments(b).size());
        assertEquals(3, conflictMatrix.getConflictingAssignments(c).size());

        // again spread; show the different use cases of move and addToUnassignedHead
        periode.moveToUnassignedHead(b);
        periode.clearInvalid();
View Full Code Here

        settings.setNumberOfDays(slotsPerWeek / slotsPerDay);

        final Assignment a = newAssignment("a", -1, 1);
        final Assignment b = newAssignment("b", -1, 2);

        ConflictMatrix conflictMatrix = new ConflictMatrix(slotsPerWeek, slotsPerDay);
        conflictMatrix.initFromResources(newResources(Arrays.asList(a), Arrays.asList(b)));
        final Location loc1 = new Location(5);
        final Location loc2 = new Location(10);
        List locations = Arrays.asList(loc1, loc2);

        periode = newPeriod(slotsPerWeek, locations, conflictMatrix);
View Full Code Here

        Assignment ass1 = newAssignment("1", -1, 2);
        ass1.getEvent().addFeature(loc1Feature);
        Assignment ass2 = newAssignment("2", -1, 2);
        Assignment ass3 = newAssignment("3", -1, 1);

        ConflictMatrix conflictMatrix = new ConflictMatrix(slotsPerWeek, slotsPerDay);
        conflictMatrix.initFromResources(newResources(Arrays.asList(ass1), Arrays.asList(ass2), Arrays.asList(ass3)));
        final Location loc1 = new Location(5);
        final Location loc2 = new Location(10);
        loc1.addFeature(loc1Feature);
        List locations = Arrays.asList(loc1, loc2);
View Full Code Here

TOP

Related Classes of de.timefinder.algo.ConflictMatrix

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.