src/main/java/com/mobiquityinc/packer/Packer.java
protected static int calculateFactor(List<Thing> things) {
        int result = 1;
        for (Thing thing : things) {
            if (hasDecimal(thing.getWeight())) {
                result = 10;
            }
            if (hasCentesimal(thing.getWeight())) {
                return 100;
            }
        }
        return result;
    }
/**
     * We can't effectively solve 0-1 Knapsack problem for non-integer
     * values of weights, so we need to scale them to integers and
     * for that the scale factor need to be calculated.
     * @param things list of parsed items.
     * @return factor value can be 1, 10 or 100.
     */
We can't effectively solve 0-1 Knapsack problem for non-integer
values of weights, so we need to scale them to integers and
for that the scale factor need to be calculated.
@param things list of parsed items.
@return factor value can be 1, 10 or 100.
We can ' t effectively solve 0 - 1 Knapsack problem for non - integer values of weights so we need to scale them to integers and for that the scale factor need to be calculated . @param things list of parsed items . @return factor value can be 1 10 or 100 .
protected static int calculateFactor(List<Thing> things) {
        int result = 1;
        for (Thing thing : things) {
            if (hasDecimal(thing.getWeight())) {
                result = 10;
            }
            if (hasCentesimal(thing.getWeight())) {
                return 100;
            }
        }
        return result;
    }
protected static int calculateFactor ( List < Thing > things ) { int result = 1 ; for ( Thing thing : things ) { if ( hasDecimal ( thing . getWeight ( ) ) ) { result = 10 ; } if ( hasCentesimal ( thing . getWeight ( ) ) ) { return 100 ; } } return result ; }
We can't effectively solve 0-1 Knapsack problem for non-integer
 values of weights, so we need to scale them to integers and
 for that the scale factor need to be calculated.
We can ' t effectively solve 0 - 1 Knapsack problem for non - integer values of weights so we need to scale them to integers and for that the scale factor need to be calculated .