org.drools.planner.core.score.buildin.hardandsoft
Interface HardAndSoftScore

All Superinterfaces:
Comparable<HardAndSoftScore>, Score<HardAndSoftScore>
All Known Implementing Classes:
DefaultHardAndSoftScore

public interface HardAndSoftScore
extends Score<HardAndSoftScore>

A HardAndSoftScore is a Score based on hard and soft int constraints. Hard constraints have priority over soft constraints.

Implementations must be immutable.

See Also:
Score, DefaultHardAndSoftScore

Method Summary
 int getHardScore()
          The total of the broken negative hard constraints and fulfilled positive hard constraints.
 int getSoftScore()
          The total of the broken negative soft constraints and fulfilled positive soft constraints.
 boolean isFeasible()
          A Solution is feasible if it has no broken hard constraints.
 
Methods inherited from interface org.drools.planner.core.score.Score
add, divide, multiply, subtract, toDoubleLevels
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getHardScore

int getHardScore()
The total of the broken negative hard constraints and fulfilled positive hard constraints. Their weight is included in the total. The hard score is usually a negative number because most use cases only have negative constraints.

Returns:
higher is better, usually negative, 0 if no hard constraints are broken/fulfilled

getSoftScore

int getSoftScore()
The total of the broken negative soft constraints and fulfilled positive soft constraints. Their weight is included in the total. The soft score is usually a negative number because most use cases only have negative constraints.

In a normal score comparison, the soft score is irrelevant if the 2 scores don't have the same hard score.

Returns:
higher is better, usually negative, 0 if no soft constraints are broken/fulfilled

isFeasible

boolean isFeasible()
A Solution is feasible if it has no broken hard constraints.

Returns:
true if the getHardScore() is 0 or higher


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.