edu.neu.ccs.util
Class MinMaxSolver

java.lang.Object
  extended by edu.neu.ccs.util.MinMaxSolver

public class MinMaxSolver
extends java.lang.Object

Class for solving min max problem using numerical method

Since seller would want to minimize the satisfiability ratio and can set weights, and buyer would want to maximize the satisfiability and can set b, the function f is minimized wrt a and maximized wrt b

Author:
Charu Chandra and Wu Jiang

Constructor Summary
MinMaxSolver()
           
 
Method Summary
static double getOptimumBias(int rel1, int rel2)
          Calculate the optimum bias for the two relations
static double getOptimumPrice(edu.neu.ccs.demeterf.demfgen.lib.List<gen.TypeInstance> relations)
          Find the optimum price for input relations.
static double getOptimumPrice(gen.RelationNr relation1, gen.RelationNr relation2)
          Find the optimum price for two relations
static double getOptimumT(int rel1, int rel2)
          Calculate the optimum ratio x/x+y where x - weight for relation1 and y - weight for relation2
static double[] solveMinMax(int rel1, int rel2)
          Solves min max problem for two relations using numerical method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MinMaxSolver

public MinMaxSolver()
Method Detail

solveMinMax

public static double[] solveMinMax(int rel1,
                                   int rel2)
Solves min max problem for two relations using numerical method.

Parameters:
rel1 -
rel2 -
Returns:
a 2 value array. 1st element is the optimum value of a = x/y and 2nd is the optimum value of expected value

getOptimumT

public static double getOptimumT(int rel1,
                                 int rel2)
Calculate the optimum ratio x/x+y where x - weight for relation1 and y - weight for relation2

Parameters:
rel1 -
rel2 -
Returns:

getOptimumBias

public static double getOptimumBias(int rel1,
                                    int rel2)
Calculate the optimum bias for the two relations

Parameters:
rel1 -
rel2 -
Returns:

getOptimumPrice

public static double getOptimumPrice(edu.neu.ccs.demeterf.demfgen.lib.List<gen.TypeInstance> relations)
Find the optimum price for input relations. Currently processes only two relations

Parameters:
relations -
Returns:

getOptimumPrice

public static double getOptimumPrice(gen.RelationNr relation1,
                                     gen.RelationNr relation2)
Find the optimum price for two relations

Parameters:
relation1 -
relation2 -
Returns: