Package de.timefinder.data.set

Examples of de.timefinder.data.set.Raster


            if (ass.getStart() >= 0)
                throw new IllegalStateException("at this point assignments' start cannot be positive:" + ass);
            // 3 b) The order limits the search interval:
            int searchInterval[] = currentWeek.getSearchInterval(ass);
            if (searchInterval != null) {
                Raster raster = conflictMatrix.getConflictingRaster(ass);

                // Step 4: Place Event in a timeslot or put it into
                // the unassigned array, if adding was not successfull
                int duration = ass.getEvent().getDuration();
                for (int startTime = raster.getNextFree(searchInterval[0], duration);
                        startTime >= 0 && startTime < searchInterval[1];
                        startTime = raster.getNextFree(startTime + 1, duration)) {

                    if (currentWeek.add(ass, startTime)) {
                        assigned = true;
//                        logger.info("\n\n\n#################################################");
//                        logger.info(ass);
View Full Code Here


        matrix.add(ev1);
        matrix.add(ev2);

        // test if combinedRaster of ev2 works
        Raster combinedRaster = matrix.getConflictingRaster(ev2);
        assertEquals(5, combinedRaster.getNextFree(0, 1));
        assertEquals(6, combinedRaster.getNextFree(0, 2));
        assertEquals(7, combinedRaster.getNextFree(7, 2));

        // test if remove works
        matrix.remove(ev1);
        assertSame(combinedRaster, matrix.getConflictingRaster(ev2));
        assertEquals(0, combinedRaster.getNextFree(0, 1));
        assertEquals(1, combinedRaster.getNextFree(1, 1));

        // test if bitRaster is included and combinedRaster recognizes ev1
        Raster combinedRasterEv1 = matrix.getConflictingRaster(ev1);
        assertEquals(9, combinedRasterEv1.getNextFree(8, 1));
        assertEquals(-1, combinedRasterEv1.getNextFree(7, 2));
    }
View Full Code Here

TOP

Related Classes of de.timefinder.data.set.Raster

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.