Package de.timefinder.data

Examples of de.timefinder.data.Location


        assertNotNull(aManager.remove(ass1));
    }

    @Test
    public void testAssignedLocationAfterRollback2() {
        Location loc2 = newLocation("loc2", 5);
        allLocations.add(loc2);
        Feature special = newFeature("loc1");
        loc1.addFeature(special);

        aManager = new AssignmentManager(0, allLocations);
View Full Code Here


        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);
        periode.setRandom(new Random());
View Full Code Here

        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());

        assertTrue(periode.add(b, 0));
View Full Code Here

    }

    @Test
    public void testTestReassignmentDifferentDuration() {
        // two rooms
        Location loc2 = newLocation("loc2", 5);
        allLocations.add(loc2);
        aManager = new AssignmentManager(0, allLocations);
        AssignmentManager aManagerForSlot2 = new AssignmentManager(0, allLocations);

        Assignment ass1 = newAssignment("1", 0, 2);
        Assignment ass2 = newAssignment("2", 0, 4);

        Location loc = aManagerForSlot2.calculateLocation(ass1);
        assertNotNull(loc);

        // force assignment, so that only one matrix entry is possible
        assertNotNull(aManager.forceAssignment(ass1, loc));
View Full Code Here

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

        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);
        periode.setRandom(new Random());
View Full Code Here

        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);

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

    @Test
    public void testUniDirectional() {
        System.out.println("test:uniDirectional");

        Location r = new Location();
        r.setName("uniRoom");

        Event tmpTI = new Event();

        tmpTI.setLocation(r, true);

        Event persistTI = new Event();
        persistTI.setLocation(r, false);

        Iterator iter = r.getEvents().iterator();
        assertEquals(tmpTI, iter.next());
        assertFalse(iter.hasNext());

        Event ti = new Event();
        r = new Location();
        r.setName("testRoom");
        ti.setLocation(r, true);
        assertEquals(r, ti.getLocation());
        assertTrue(r.getEvents().iterator().hasNext());

        Location r2 = new Location();
        r2.setName("testRoom2");
        Event ti2 = new Event();

        ti2.setLocation(r2, false);
        assertEquals(r2, ti2.getLocation());
        assertFalse(r2.getEvents().iterator().hasNext());
    }
View Full Code Here

    }
   
    @Test
    public void testAttach() {
        assertEquals(0, lDao.getAll().size());
        lDao.attach(new Location());
        assertEquals(1, lDao.getAll().size());
    }
View Full Code Here

        }
        for (Person p : teachers.values()) {
            pDao.put(pCounter++, p);
        }
        for (long i = 0; i < 20; i++) {
            Location loc = new Location("Raum " + i, 40);
            lDao.put(i, loc);
        }

        // courses
        for (WinQDCourse course : courses.values()) {
View Full Code Here

TOP

Related Classes of de.timefinder.data.Location

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.