edu.washington.cs.supple.render.utility
Class BasicFactoredCostCalculator

java.lang.Object
  extended byedu.washington.cs.supple.render.utility.BasicFactoredCostCalculator
All Implemented Interfaces:
FactoredCostCalculator

public class BasicFactoredCostCalculator
extends java.lang.Object
implements FactoredCostCalculator

Author:
kgajos

Constructor Summary
BasicFactoredCostCalculator()
           
 
Method Summary
 double calculateCost(int strategy, Solution solution, FactoredCostFunction costFunction)
          Calculates the cost of an entire solution
 float calculateCost(int strategy, Widget reference, java.util.Collection feasibleWidgets, java.util.Collection factors)
          Computes cost for a reference widget and a domain of feasible widgets
protected  double calculateCost(Widget root, FactoredCostFunction costFunction)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicFactoredCostCalculator

public BasicFactoredCostCalculator()
Method Detail

calculateCost

public float calculateCost(int strategy,
                           Widget reference,
                           java.util.Collection feasibleWidgets,
                           java.util.Collection factors)
Description copied from interface: FactoredCostCalculator
Computes cost for a reference widget and a domain of feasible widgets

Specified by:
calculateCost in interface FactoredCostCalculator
Parameters:
strategy - an optional argument if more than one variant of a method is possible
reference - reference widget
feasibleWidgets - all feasible widgets
factors - a collection of factors
Returns:
the cost

calculateCost

public double calculateCost(int strategy,
                            Solution solution,
                            FactoredCostFunction costFunction)
Description copied from interface: FactoredCostCalculator
Calculates the cost of an entire solution

Specified by:
calculateCost in interface FactoredCostCalculator
Parameters:
strategy - an optional argument if more than one variant of a method is possible
solution - a solution to be evaluated
costFunction - the cost function to be used
Returns:
the cost

calculateCost

protected double calculateCost(Widget root,
                               FactoredCostFunction costFunction)