gov.sns.tools.optimizer
Class FunctionSolver

java.lang.Object
  |
  +--gov.sns.tools.optimizer.FunctionSolver
Direct Known Subclasses:
GraphDataSolver

public class FunctionSolver
extends java.lang.Object


Constructor Summary
FunctionSolver()
          Creates a new instance of FunctionSolver with simplex algorithm.
FunctionSolver(int algorithmType)
          Creates a new instance of FunctionSolver with an algorithm of certain type.
 
Method Summary
protected  void addFittingDataPoint(int i, double x, double y)
           
 double elapsedTime()
          Returns the time that has been spent.
 SearchAlgorithm getAlgorothm()
          Returns an inner search algorithm.
 double[] getBestParamsArray()
          Returns the best set of parameters as an array.
 double[] getBestParamsStepsArray()
          Returns the steps of the best set of parameters as an array.
 java.util.List getBestParamsStepsList()
          Returns the steps of the best set of parameters as a list.
 double getBestScore()
          Returns the best score.
 Scoreboard getScoreboard()
          Returns Scoreboard.
 Solver getSolver()
          Returns an inner solver.
 boolean isRunning()
          Returns true if it is runnung.
 int iterations()
          Returns the number of iterations.
 void setFittingData(double[] xA, double[] yA)
           
 void setFittingData(java.util.List xL, java.util.List yL)
           
protected  void setFittingDataCpacity(int n)
           
 void setFunction(FunctionWithArray fArr)
           
 void setFunction(FunctionWithList fList)
           
 void setInitialParameters(double[] params, double[] steps)
           
 void setInitialParameters(double[] params, double[] steps, double[] lower, double[] upper)
           
 void setInitialParameters(java.util.List params, java.util.List steps)
           
 void setSearchAlgorithm(int algorithmType)
          Sets the search algorithm of certain type.
 void setStopper(SolveStopper aStopper)
          Sets the SolveStopper.
 void solve()
          Finds the solution of the problem.
 void wantToStop()
          Notifies the solver that user wants to stop the process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctionSolver

public FunctionSolver()
Creates a new instance of FunctionSolver with simplex algorithm.


FunctionSolver

public FunctionSolver(int algorithmType)
Creates a new instance of FunctionSolver with an algorithm of certain type.

Method Detail

setSearchAlgorithm

public void setSearchAlgorithm(int algorithmType)
Sets the search algorithm of certain type.


setFunction

public void setFunction(FunctionWithArray fArr)

setFunction

public void setFunction(FunctionWithList fList)

setInitialParameters

public void setInitialParameters(double[] params,
                                 double[] steps)

setInitialParameters

public void setInitialParameters(double[] params,
                                 double[] steps,
                                 double[] lower,
                                 double[] upper)

setInitialParameters

public void setInitialParameters(java.util.List params,
                                 java.util.List steps)

setFittingData

public void setFittingData(double[] xA,
                           double[] yA)

setFittingData

public void setFittingData(java.util.List xL,
                           java.util.List yL)

setFittingDataCpacity

protected void setFittingDataCpacity(int n)

addFittingDataPoint

protected void addFittingDataPoint(int i,
                                   double x,
                                   double y)

solve

public void solve()
Finds the solution of the problem.


setStopper

public void setStopper(SolveStopper aStopper)
Sets the SolveStopper.


isRunning

public boolean isRunning()
Returns true if it is runnung.


wantToStop

public void wantToStop()
Notifies the solver that user wants to stop the process.


getAlgorothm

public SearchAlgorithm getAlgorothm()
Returns an inner search algorithm.


getSolver

public Solver getSolver()
Returns an inner solver. It can be used to add listeners.


getScoreboard

public Scoreboard getScoreboard()
Returns Scoreboard.


getBestParamsArray

public double[] getBestParamsArray()
Returns the best set of parameters as an array.


getBestParamsStepsArray

public double[] getBestParamsStepsArray()
Returns the steps of the best set of parameters as an array.


getBestParamsStepsList

public java.util.List getBestParamsStepsList()
Returns the steps of the best set of parameters as a list.


elapsedTime

public double elapsedTime()
Returns the time that has been spent.


getBestScore

public double getBestScore()
Returns the best score.


iterations

public int iterations()
Returns the number of iterations.