Class SolnSearcher

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--SolnSearcher

class SolnSearcher
extends java.lang.Thread

Thread to search an interval for a solution to a Schrodinger equation.


Field Summary
protected  Schrodinger eqn
           
protected  boolean finished
           
protected  double hint
          If neither half of the interval is guaranteed to contain a solution, the search will move towards this value, which is initialised from the original energy parameter of the equation.
protected  double intRange
           
protected  boolean killed
           
protected  double max
           
protected  double maxValue
           
protected  double min
           
protected  double minValue
           
protected  EnergyListener owner
           
protected  int steps
           
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadQ, values
 
Constructor Summary
SolnSearcher(EnergyListener owner, Schrodinger eqn, double min, double max, double intRange, int steps)
          Creates a new solution searcher
 
Method Summary
 double getEstimate()
          Returns the current "best estimate" of the solution; that is, the midpoint of the bisection interval.
protected  void improveEstimate()
          Performs one step of the search.
 boolean isFinished()
          Returns true if the search is still in process, else false
 void kill()
          Requests that the search terminate at the next convenient opportunity.
 void run()
           
 double tryEnergy(double energy)
          Attempts to solve the equation with the specified energy, and returns the value at the end of the x range.
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hint

protected double hint
If neither half of the interval is guaranteed to contain a solution, the search will move towards this value, which is initialised from the original energy parameter of the equation.

min

protected double min

max

protected double max

minValue

protected double minValue

maxValue

protected double maxValue

intRange

protected double intRange

steps

protected int steps

finished

protected boolean finished

killed

protected boolean killed

eqn

protected Schrodinger eqn

owner

protected EnergyListener owner
Constructor Detail

SolnSearcher

public SolnSearcher(EnergyListener owner,
                    Schrodinger eqn,
                    double min,
                    double max,
                    double intRange,
                    int steps)
Creates a new solution searcher
Parameters:
owner - The EnergyListener to be notified when the best estimate changes
eqn - The equation to solve
min - A lower bound for the solution
max - An upper bound for the solution
intRange - The range over which the solution should be evaluated
steps - The number of steps to be used when evaluating the solution
Method Detail

run

public void run()
Overrides:
run in class java.lang.Thread

improveEstimate

protected void improveEstimate()
Performs one step of the search.

tryEnergy

public double tryEnergy(double energy)
Attempts to solve the equation with the specified energy, and returns the value at the end of the x range. For a solution to the Schrodinger equation, this method should return (approximately) zero.

getEstimate

public double getEstimate()
Returns the current "best estimate" of the solution; that is, the midpoint of the bisection interval.

isFinished

public boolean isFinished()
Returns true if the search is still in process, else false

kill

public void kill()
Requests that the search terminate at the next convenient opportunity.