Package eu.scape_project.planning.model.values

Examples of eu.scape_project.planning.model.values.TargetValues


     * is called.
     * @param values List of values to be transformed
     * @return {@link TargetValues}, which contains a list of all transformed values corresponding to the provided input
     */
    public TargetValues transformValues(Values values) {
        TargetValues result = new TargetValues();
        for (Value v : values.getList()) {
            if (v instanceof INumericValue) {
                result.add(transform((INumericValue) v));
            } else {
                result.add(transform((IOrdinalValue) v));
            }
        }
        return result;
    }
View Full Code Here


    private static final double EPSILON = 0.00001;

    @Test
    public void testWorstEmptyList() {
        TargetValues values = new TargetValues();
        assertEquals(0.0, values.worst(), EPSILON);
    }
View Full Code Here

        assertEquals(0.0, values.worst(), EPSILON);
    }

    @Test
    public void testWorstOneValue() {
        TargetValues values = new TargetValues();
        values.list().add(new TargetValue(1.0));
        assertEquals(1.0, values.worst(), EPSILON);
    }
View Full Code Here

        assertEquals(1.0, values.worst(), EPSILON);
    }

    @Test
    public void testWorstAscendingValues() {
        TargetValues values = new TargetValues();
        values.getList().add(new TargetValue(1.5));
        values.getList().add(new TargetValue(2.0));
        values.getList().add(new TargetValue(5.0));

        assertEquals(1.5, values.worst(), EPSILON);
    }
View Full Code Here

        assertEquals(1.5, values.worst(), EPSILON);
    }

    @Test
    public void testWorstDescendingValues() {
        TargetValues values = new TargetValues();
        values.getList().add(new TargetValue(5.0));
        values.getList().add(new TargetValue(2.0));
        values.getList().add(new TargetValue(1.5));

        assertEquals(1.5, values.worst(), EPSILON);
    }
View Full Code Here

        assertEquals(1.5, values.worst(), EPSILON);
    }

    @Test
    public void testAverageEmptyList() {
        TargetValues values = new TargetValues();
        assertEquals(0.0, values.average(), EPSILON);
    }
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.model.values.TargetValues

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.