models
Class UnrestrictedBalance

java.lang.Object
  extended by abstractions.Balance
      extended by models.UnrestrictedBalance
All Implemented Interfaces:
BalanceSpecification

public class UnrestrictedBalance
extends Balance


Constructor Summary
UnrestrictedBalance(int[] weights)
           
 
Method Summary
 void weigh(int x)
           
 
Methods inherited from class abstractions.Balance
addLeft, addRight, maxNumberOfWeights, maxThatCanBeWeighed, moveAllToTable, removeLeft, removeRight, toString, weighing, weightsInLeft, weightsInRight
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnrestrictedBalance

public UnrestrictedBalance(int[] weights)
Method Detail

weigh

public void weigh(int x)
Parameters:
x - is the weight that we wish to weigh in the right pan. This method should move the weights around in order to weigh this amount. If no exact solution is found then it should find a solution as close as possible to the one required.