public abstract class AbstractMethod extends AbstractComponent
AbstractRepresentation
s.
They implement the Runnable
interface meaning the algorithm will be executed on a separate thread.
Methods can save obtained results any time by calling the FrevoMain#saveResult(String, AbstractMethod)
static method.
Constructor and Description |
---|
AbstractMethod(NESRandom random) |
Modifier and Type | Method and Description |
---|---|
float |
getProgress()
Returns the current progress of this method mostly for display purposes.
|
NESRandom |
getRandom()
Returns the assigned random generator object of this method.
|
long |
getSeed()
Returns the current random seed associated with the random object of this method.
|
abstract java.util.ArrayList<java.util.ArrayList<AbstractRepresentation>> |
loadFromXML(org.dom4j.Document doc)
Returns a 2D array of representations from the given XML result file.
|
void |
pause()
Sends an interrupt flag to the method.
|
abstract void |
runOptimization(ProblemXMLData problemData,
ComponentXMLData representationData,
ComponentXMLData rankingData,
java.util.Hashtable<java.lang.String,XMLFieldEntry> properties) |
static void |
setProgress(float p)
Sets the progress of this method the given value.
|
void |
setRandom(long seed)
Sets the random seed for this method.
|
void |
setRandom(NESRandom generator)
Sets the random generator object to the given value.
|
void |
wakeUp() |
getProperties, getPropertyValue, getTypeOfProperty, getXMLData, setProperties, setXMLData
public AbstractMethod(NESRandom random)
public final void pause()
public final void wakeUp()
public abstract void runOptimization(ProblemXMLData problemData, ComponentXMLData representationData, ComponentXMLData rankingData, java.util.Hashtable<java.lang.String,XMLFieldEntry> properties)
public final float getProgress()
public static final void setProgress(float p)
p
- The new progress value to be used.public final NESRandom getRandom()
public final void setRandom(NESRandom generator)
generator
- The new random generator object to be used.public final void setRandom(long seed)
seed
- The new random seed to be used.public final long getSeed()
public abstract java.util.ArrayList<java.util.ArrayList<AbstractRepresentation>> loadFromXML(org.dom4j.Document doc)
If the loading takes considerable amount of time it is advised to provide visual feedback to the user. This can be done by calling the
FrevoMain.setLoadingProgress(float)
method.
doc
- The source Document
to be used for loading the representations.