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 constraints 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.
 
Methods inherited from interface org.drools.planner.core.score.Score
add, divide, multiply, subtract, toDoubleArray
 
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


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