com.BuyTheElection
Class Solver

java.lang.Object
  |
  +--com.BuyTheElection.Solver

public class Solver
extends java.lang.Object

A Solver using a general Quadratic Programming approach. Given an N x M factor matrix of variable rows and factor columns, and a set of M targets, a N size array is returned which represents the minimum distance attainable between the target factors and the factor matrix, as detailed in:

"Buy The Election!"
by Charles Repetti
Editor, BuyTheElection.com
The intent is, given a set of target political biases, and a set of politicians which are evaluated into proportions of the biases, find the optimal weighting of campaign contributions and voting program.

       _ m         _ n                                                           
      \           \                                                         2   
 min  /         ( / (rank[Issue] * Issues[Issue][Candidate] - target[Issue])    
      - Issue=1   - Candidate=1                                                    
 
- n \ - / Rank[Issue] * alpha[Issue]) - Issue=1

Target Values and storage are submitted after the solver is kicked off, with actual values being submitted from within the objective function.


Constructor Summary
Solver()
          Creates a new "Solver".
 
Method Summary
static void main(java.lang.String[] args)
          A few sanity checks.
 boolean setFactors(double[][] theseFactors)
          Sets the Factors for the Optimization Problem.
 boolean setTargets(double[] theseTargets)
          Sets the Targets for the Optimization Problem.
 double version()
          Gets the Solver's version nnumber.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Solver

public Solver()
Creates a new "Solver". In order to prodvide meaningful solutions, the solver must be parameterized by its appropriate member functions.

Method Detail

version

public double version()
Gets the Solver's version nnumber. Just the version number for this Solver. This helps with the admininstration of multiple servers and development bulds.


setTargets

public boolean setTargets(double[] theseTargets)
Sets the Targets for the Optimization Problem. These are the desired values for the problem variables. The solver attempts to find a set of values for the input variable X's which evaluate to these targets, or at least as close to these targets as is feasible. In our case, these corrospond to the customer's responses the opinion poll.


setFactors

public boolean setFactors(double[][] theseFactors)
Sets the Factors for the Optimization Problem. These are the sets of factors, as matrix[factors][variables]. In our problem, the corrospond to the opinion of each candidate concerning each of the questions we use in our poll.


main

public static void main(java.lang.String[] args)
A few sanity checks. We like to keep this around to be sure things are working as we believe they should, irrespective of any web pages involved.