|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjabble.ProblemSolver
public class ProblemSolver
The master class that brings all objects together to solve a given problem.
| Constructor Summary | |
|---|---|
ProblemSolver(Problem problem)
Creates a new ProblemSolver for the given Problem. |
|
| Method Summary | |
|---|---|
ProblemSolver |
addIndicator(java.lang.String shorthand)
Allows to create simple indicators for aggregate functions of a field. |
ProblemSolver |
addIndicator(java.lang.String name,
Indicator indicator)
Adds the given indicator so that it's value is computed and saved. |
ProblemSolver |
dontEvolveLastCoordinate()
Tells the ProblemSolver not to evolve the last coordinate, which is typically the time coordinate and is evolved with t = previousT + dt. |
long |
getElapsedMillisec()
Returns the time the computation took in milliseconds. |
java.util.Date |
getEndTime()
Returns the time at which the actual computation ended. |
int |
getNPerformedIterations()
Returns the number of iterations actually performed during the resolution. |
java.util.Date |
getStartTime()
Returns the time at which the actual computation started. |
ProblemSolver |
recordError(java.lang.String filename)
Changes the name of the file to which the error field output is saved. |
ProblemSolver |
recordEvolution(java.lang.String filename,
int interval)
Changes the filename for saving the output, and sets the number of iterations between two saves. |
ProblemSolver |
recordEvolutionInterval(int interval)
Saves the output of the computation every interval number of iterations. |
ProblemSolver |
setConstraintEvolver(Evolver evolver,
int maxIterations,
java.lang.String fieldName,
double truncationError)
Changes the constraint evolver. |
void |
setDataStructuresFactory(java.lang.String dataStructuresFactory)
Changes the implementation of the data structures. |
void |
setDebug(boolean debug)
Turns debugging on and off. |
ProblemSolver |
setEvolver(Evolver evolver)
Specifies which Evolver should be used for the evolution. |
ProblemSolver |
setFreeEvolution(boolean freeEvolution)
Solves the problem using Free Evolution. |
ProblemSolver |
setNumberOfIterations(int nIterations)
Specifies the number of iterations to be done to compute the solution. |
ProblemSolver |
setStopTrigger(Trigger stopTrigger)
Sets a Trigger to stop the evolution if a condition is met (look at the stopOnXxx methods to stop on simple conditions). |
void |
solve()
Starts the solution of the given problem with all the given options. |
ProblemSolver |
stopAfterTimePeriod(long millisec)
Stops the evolution after a given period of time. |
ProblemSolver |
stopOnConvergence(java.lang.String fieldName,
double truncationError)
Stops the evolution when the change of value for the given field is less than the truncationError. |
ProblemSolver |
stopOnIndicatorOutsideRange(java.lang.String indicatorShorthand,
double min,
double max)
Stops the evolution when the value of the indicator is outside the given range. |
ProblemSolver |
stopOnIndicatorOverThreshold(java.lang.String indicatorShorthand,
double threshold)
Stops the evolution when the value of the indicator is above the given threshold. |
ProblemSolver |
stopOnIndicatorUnderThreshold(java.lang.String indicatorShorthand,
double threshold)
Stops the evolution when the value of the indicator is below the given threshold. |
ProblemSolver |
stopOnNanOrInfinity()
Stops the evolution if a NAN or Infinity value appears on any Field. |
ProblemSolver |
verifyResult(double tolerance)
Compares the result of the evolution with the exact solution given in the problem. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProblemSolver(Problem problem)
problem - a Jabble Problem| Method Detail |
|---|
public void setDebug(boolean debug)
debug - new debugging settingpublic void setDataStructuresFactory(java.lang.String dataStructuresFactory)
dataStructuresFactory - class name that implements the DataStructuresFactory
public ProblemSolver addIndicator(java.lang.String name,
Indicator indicator)
name - the name given to distinguish the indicatorindicator - an indicator object
public ProblemSolver addIndicator(java.lang.String shorthand)
For example, given the field 'phi' in the equation, we can have the following:
shorthand - the name of the indicator (such as totalEnergy or averageMomentum)
public ProblemSolver setEvolver(Evolver evolver)
evolver - the evolver to be used to compute the solution
public ProblemSolver setConstraintEvolver(Evolver evolver,
int maxIterations,
java.lang.String fieldName,
double truncationError)
evolver - the Evolver to use to solve the constraintsmaxIterations - number of iterations for the constraints evolverfieldName - the name of the field to check for the truncation errortruncationError - acceptable truncation error
public ProblemSolver setFreeEvolution(boolean freeEvolution)
freeEvolution - true to set free evolution
public ProblemSolver setNumberOfIterations(int nIterations)
nIterations - a positive integer
public ProblemSolver setStopTrigger(Trigger stopTrigger)
stopTrigger - a Trigger object that will stop the evolution
public ProblemSolver dontEvolveLastCoordinate()
public ProblemSolver stopOnConvergence(java.lang.String fieldName,
double truncationError)
fieldName - the name of a fieldtruncationError - the truncation allowed
public ProblemSolver stopOnIndicatorOutsideRange(java.lang.String indicatorShorthand,
double min,
double max)
indicatorShorthand - an indicator (i.e. totalProbability, averagePhi, ...)min - the minimum value the indicator can have before stopping the evolutionmax - the maximum value the indicator can have before stopping the evolution
public ProblemSolver stopOnIndicatorOverThreshold(java.lang.String indicatorShorthand,
double threshold)
indicatorShorthand - the name of the indicatorthreshold - the maximum value the indicator can have before stopping the evolution
public ProblemSolver stopOnIndicatorUnderThreshold(java.lang.String indicatorShorthand,
double threshold)
indicatorShorthand - the name of the indicatorthreshold - the minimum value the indicator can have before stopping the evolution
public ProblemSolver stopAfterTimePeriod(long millisec)
millisec - the period of time expressed in milliseconds
public ProblemSolver stopOnNanOrInfinity()
public ProblemSolver verifyResult(double tolerance)
tolerance - the maximum difference allowed between calculated
solution and exact solution
public ProblemSolver recordEvolution(java.lang.String filename,
int interval)
filename - the name of the output fileinterval - number of iterations between saves
public ProblemSolver recordEvolutionInterval(int interval)
interval - number of iterations between saving to the output
public ProblemSolver recordError(java.lang.String filename)
filename - the name of a file
public void solve()
public java.util.Date getStartTime()
public java.util.Date getEndTime()
public long getElapsedMillisec()
public int getNPerformedIterations()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||