Examples of calculateTimeGradient()


Examples of org.drools.planner.core.score.buildin.hardandsoft.HardAndSoftScoreDefinition.calculateTimeGradient()

        // No hard broken, more than total soft broken
        assertEquals(0.75, scoreDefinition.calculateTimeGradient(
                DefaultHardAndSoftScore.valueOf(-20, -400), DefaultHardAndSoftScore.valueOf(-10, -300),
                DefaultHardAndSoftScore.valueOf(-10, -900)), 0.0);
        // More than total hard broken, no soft broken
        assertEquals(0.0, scoreDefinition.calculateTimeGradient(
                DefaultHardAndSoftScore.valueOf(-20, -400), DefaultHardAndSoftScore.valueOf(-10, -300),
                DefaultHardAndSoftScore.valueOf(-90, -300)), 0.0);

        // Perfect min/max cases
        assertEquals(1.0, scoreDefinition.calculateTimeGradient(
View Full Code Here

Examples of org.drools.planner.core.score.buildin.hardandsoft.HardAndSoftScoreDefinition.calculateTimeGradient()

        assertEquals(0.0, scoreDefinition.calculateTimeGradient(
                DefaultHardAndSoftScore.valueOf(-20, -400), DefaultHardAndSoftScore.valueOf(-10, -300),
                DefaultHardAndSoftScore.valueOf(-90, -300)), 0.0);

        // Perfect min/max cases
        assertEquals(1.0, scoreDefinition.calculateTimeGradient(
                DefaultHardAndSoftScore.valueOf(-10, -300), DefaultHardAndSoftScore.valueOf(-10, -300),
                DefaultHardAndSoftScore.valueOf(-10, -300)), 0.0);
        assertEquals(0.0, scoreDefinition.calculateTimeGradient(
                DefaultHardAndSoftScore.valueOf(-20, -400), DefaultHardAndSoftScore.valueOf(-10, -300),
                DefaultHardAndSoftScore.valueOf(-20, -400)), 0.0);
View Full Code Here

Examples of org.drools.planner.core.score.buildin.hardandsoft.HardAndSoftScoreDefinition.calculateTimeGradient()

        // Perfect min/max cases
        assertEquals(1.0, scoreDefinition.calculateTimeGradient(
                DefaultHardAndSoftScore.valueOf(-10, -300), DefaultHardAndSoftScore.valueOf(-10, -300),
                DefaultHardAndSoftScore.valueOf(-10, -300)), 0.0);
        assertEquals(0.0, scoreDefinition.calculateTimeGradient(
                DefaultHardAndSoftScore.valueOf(-20, -400), DefaultHardAndSoftScore.valueOf(-10, -300),
                DefaultHardAndSoftScore.valueOf(-20, -400)), 0.0);
        assertEquals(1.0, scoreDefinition.calculateTimeGradient(
                DefaultHardAndSoftScore.valueOf(-20, -400), DefaultHardAndSoftScore.valueOf(-10, -300),
                DefaultHardAndSoftScore.valueOf(-10, -300)), 0.0);
View Full Code Here

Examples of org.drools.planner.core.score.buildin.hardandsoft.HardAndSoftScoreDefinition.calculateTimeGradient()

                DefaultHardAndSoftScore.valueOf(-10, -300), DefaultHardAndSoftScore.valueOf(-10, -300),
                DefaultHardAndSoftScore.valueOf(-10, -300)), 0.0);
        assertEquals(0.0, scoreDefinition.calculateTimeGradient(
                DefaultHardAndSoftScore.valueOf(-20, -400), DefaultHardAndSoftScore.valueOf(-10, -300),
                DefaultHardAndSoftScore.valueOf(-20, -400)), 0.0);
        assertEquals(1.0, scoreDefinition.calculateTimeGradient(
                DefaultHardAndSoftScore.valueOf(-20, -400), DefaultHardAndSoftScore.valueOf(-10, -300),
                DefaultHardAndSoftScore.valueOf(-10, -300)), 0.0);

        // Hard total delta is 0
        assertEquals(0.6, scoreDefinition.calculateTimeGradient(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.