|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fr.jussieu.gla.wasa.core.Engine
Use this class to apply the Adaptative Search Algorithm to a
Problem
.
Constructor Summary | |
Engine(Problem problem)
|
Method Summary | |
void |
configure(IEngineParameters parameters)
Configures the engine with the IEngineParameters passed in argument. |
Algorithm |
getAlgorithm()
Returns the effective algorithm used by the engine. |
boolean |
getAllowNoConstraintApplied()
|
Configuration |
getBest()
Returns the best Configuration found by the Engine. |
ICustomizer |
getCustomizer()
|
IEngineParameters |
getParameters()
Returns a copy of parameters currently in use. |
Problem |
getProblem()
Returns the Problem used by the engine. |
java.util.Random |
getRandom()
Returns the Random instance used by the engine. |
TabuList |
getTabuList()
Returns the TabuList in use, for allowing customizations. |
int |
getTabuListCapacity()
Returns the capacity of the TabuList . |
void |
reappropriateProblem()
Used only by Monitor GUI. |
void |
restoreBest()
Use this method to retsore states of your buisness objects with the best found configuration. |
int |
run(float errorThreshold)
Executes steps until the best found overall error is under |
void |
run(int stepCount)
Executes stepCount steps. |
int |
run(int guard,
float errorThreshold)
Executes at most guard times steps and returns when a configuration with an error under errorThreshold has benn found. |
int |
runQuiet(float errorThreshold)
Same as run( float ) but doesn't need to be inserted
in a try/catch block. |
void |
runQuiet(int stepCount)
Same as run( int ) with no need to insert into a try/catch block. |
int |
runQuiet(int guard,
float errorThreshold)
Same as run( int, float) but doesn't need to be inserted
in a try/catch block. |
void |
setAllowNoConstraintApplied(boolean allow)
Allows to avoid throwing a NoConstraintAppliedException when all Explorers did not set any Var error. |
void |
setCustomizer(ICustomizer customizer)
Use this method to plug your own Customizer . |
void |
setRandom(java.util.Random random)
Sets the randomizer used by the engine to generate random sequences. |
void |
setTabuListCapacity(int tabuListCapacity)
Sets the capacity of the TabuList. |
AlgorithmState |
step()
Runs one iteration of the Adaptative Search Algorithm. |
boolean |
step(float errorThreshold)
Same method as step() but returns true if a solution has been found. |
void |
stepQuiet()
Same method as step() , but doesn't need to be inserted
in a try/catch block. |
boolean |
stepQuiet(float errorThreshold)
Same as stepQuiet() . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Engine(Problem problem)
Method Detail |
public Algorithm getAlgorithm()
public Problem getProblem()
public void reappropriateProblem()
public void configure(IEngineParameters parameters)
IEngineParameters
passed in argument.public IEngineParameters getParameters()
public java.util.Random getRandom()
public void setRandom(java.util.Random random)
public int getTabuListCapacity()
TabuList
.public void setTabuListCapacity(int tabuListCapacity)
public TabuList getTabuList()
public void setAllowNoConstraintApplied(boolean allow)
allow
- true by default.public boolean getAllowNoConstraintApplied()
public AlgorithmState step() throws EngineException, java.lang.CloneNotSupportedException
Error handling
Any error occuring during this method execution will set the state
of the Engine to CRASHED.
EngineException
- java.lang.CloneNotSupportedException
- When a Buisness Object had a problem
with cloning. This exception is not wrapped into the
EngineException because it is useful for debugging to
get the entire stack trace.public void stepQuiet()
step()
, but doesn't need to be inserted
in a try/catch block.CascadingRuntimeException
- public boolean step(float errorThreshold) throws EngineException, java.lang.CloneNotSupportedException
step()
but returns true if a solution has been found.step()
public boolean stepQuiet(float errorThreshold)
stepQuiet()
.CascadingRuntimeException
- public void run(int stepCount) throws EngineException, java.lang.CloneNotSupportedException
step()
public void runQuiet(int stepCount)
run( int )
with no need to insert into a try/catch block.CascadingRuntimeException
- public int run(float errorThreshold) throws EngineException, java.lang.CloneNotSupportedException
public int runQuiet(float errorThreshold)
run( float )
but doesn't need to be inserted
in a try/catch block.CascadingRuntimeException
- public int run(int guard, float errorThreshold) throws EngineException, java.lang.CloneNotSupportedException
public int runQuiet(int guard, float errorThreshold)
run( int, float)
but doesn't need to be inserted
in a try/catch block.CascadingRuntimeException
- public Configuration getBest()
Configuration
found by the Engine.Configuration
found by the Engine.public void restoreBest()
public void setCustomizer(ICustomizer customizer)
Customizer
.public ICustomizer getCustomizer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |