Package de.timefinder.data

Examples of de.timefinder.data.IntervalLong


    @Test
    public void testCloseIntervalLongs() {
        System.out.println("CloseIntervalLongs");

        IntervalLong e1 = newIntervalLong(0, 1);
        instance.addInterval(e1);
        IntervalLong e2 = newIntervalLong(1, 2);
        instance.addInterval(e2);

        assertEquals(1, instance.getMaxAssignments(e1));
        assertEquals(0, instance.getOffset(e1));
        assertEquals(1, instance.getMaxAssignments(e2));
View Full Code Here


    @Test
    public void testConflictingIntervalLongs() {
        System.out.println("ConflictingIntervalLongs");

        IntervalLong e1 = newIntervalLong(0, 2);
        instance.addInterval(e1);
        IntervalLong e2 = newIntervalLong(1, 2);
        instance.addInterval(e2);

        assertEquals(2, instance.getMaxAssignments(e1));
        assertEquals(0, instance.getOffset(e1));
        assertEquals(2, instance.getMaxAssignments(e2));
View Full Code Here

    public void testConflictingIntervalLongs2() {
        System.out.println("ConflictingIntervalLongs2");

        // -22-
        // 1133
        IntervalLong e1 = newIntervalLong(0, 2);
        instance.addInterval(e1);
        IntervalLong e2 = newIntervalLong(1, 2);
        instance.addInterval(e2);
        IntervalLong e3 = newIntervalLong(2, 2);
        instance.addInterval(e3);


        assertEquals(2, instance.getMaxAssignments(e1));
        assertEquals(0, instance.getOffset(e1));

        assertEquals(2, instance.getMaxAssignments(e2));
        assertEquals(1, instance.getOffset(e2));

        assertEquals(2, instance.getMaxAssignments(e3));
        assertEquals(0, instance.getOffset(e3));

        // --44--
        // -22---
        // 113355
        IntervalLong e4 = newIntervalLong(2, 2);
        instance.addInterval(e4);
        IntervalLong e5 = newIntervalLong(4, 2);
        instance.addInterval(e5);

        assertEquals(3, instance.getMaxAssignments(e1));
        assertEquals(0, instance.getOffset(e1));
View Full Code Here

        // --3

        // -4
        // 54
        // 54
        IntervalLong e1 = newIntervalLong(0, 2);
        instance.addInterval(e1);
        IntervalLong e2 = newIntervalLong(0, 3);
        instance.addInterval(e2);
        IntervalLong e3 = newIntervalLong(1, 2);
        instance.addInterval(e3);
        IntervalLong e4 = newIntervalLong(3, 3);
        instance.addInterval(e4);
        IntervalLong e5 = newIntervalLong(4, 2);
        instance.addInterval(e5);

        assertEquals(3, instance.getMaxAssignments(e1));
        assertEquals(0, instance.getOffset(e1));
View Full Code Here

        assertEquals(1, instance.getOffset(e5));
    }

    @Test
    public void testDifferentLength_Consuming() {
        IntervalLong e1 = newIntervalLong(0, 3);
        instance.addInterval(e1);
        IntervalLong e2 = newIntervalLong(1, 1);
        instance.addInterval(e2);

        assertEquals(2, instance.getMaxAssignments(e1));
        assertEquals(0, instance.getOffset(e1));
View Full Code Here

        assertEquals(1, instance.getOffset(e2));
    }

    @Test
    public void testDifferentLength_Consuming2() {
        IntervalLong e1 = newIntervalLong(0, 3);
        instance.addInterval(e1);
        IntervalLong e2 = newIntervalLong(2, 1);
        instance.addInterval(e2);

        assertEquals(2, instance.getMaxAssignments(e1));
        assertEquals(0, instance.getOffset(e1));
View Full Code Here

        assertEquals(1, instance.getOffset(e2));
    }

    @Test
    public void testDifferentLength_Consuming3() {
        IntervalLong e1 = newIntervalLong(0, 3);
        instance.addInterval(e1);
        IntervalLong e2 = newIntervalLong(0, 1);
        instance.addInterval(e2);

        assertEquals(2, instance.getMaxAssignments(e1));
        assertEquals(0, instance.getOffset(e1));
View Full Code Here

        assertEquals(1, instance.getOffset(e2));
    }

    @Test
    public void testSameLengthOverlapping() {
        IntervalLong e1 = newIntervalLong(0, 2);
        instance.addInterval(e1);
        IntervalLong e2 = newIntervalLong(0, 2);
        instance.addInterval(e2);

        assertEquals(2, instance.getMaxAssignments(e1));
        assertEquals(0, instance.getOffset(e1));
View Full Code Here

        assertEquals(1, instance.getOffset(e2));
    }

    @Test
    public void testSameLengthOverlapping2() {
        IntervalLong e1 = newIntervalLong(0, 2);
        instance.addInterval(e1);
        IntervalLong e2 = newIntervalLong(1, 2);
        instance.addInterval(e2);

        assertEquals(2, instance.getMaxAssignments(e1));
        assertEquals(0, instance.getOffset(e1));
View Full Code Here

        assertEquals(1, instance.getOffset(e2));
    }

    @Test
    public void testSameLengthOverlapping3() {
        IntervalLong e1 = newIntervalLong(1, 2);
        instance.addInterval(e1);
        IntervalLong e2 = newIntervalLong(0, 2);
        instance.addInterval(e2);

        assertEquals(2, instance.getMaxAssignments(e1));
        assertEquals(0, instance.getOffset(e1));
View Full Code Here

TOP

Related Classes of de.timefinder.data.IntervalLong

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.