public abstract class AbstractLearningExperiment extends AbstractCloneableSerializable implements LearningExperiment
AbstractLearningExperiment
class implements the general
functionality of the LearningExperiment
interface, which is mainly
the handling of listeners and firing of events.Modifier and Type | Field and Description |
---|---|
protected java.util.LinkedList<LearningExperimentListener> |
listeners
The listeners for the experiment.
|
Constructor and Description |
---|
AbstractLearningExperiment()
Creates a new instance of AbstractLearningExperiment.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(LearningExperimentListener listener)
Adds the given listener to this object.
|
protected void |
fireExperimentEnded()
Fires the experimentEnded event for all listeners.
|
protected void |
fireExperimentStarted()
Fires the experimentStarted event for all listeners.
|
protected void |
fireTrialEnded()
Fires the trialEnded event for all listeners.
|
protected void |
fireTrialStarted()
Fires the trialStarted event for all listeners.
|
java.util.LinkedList<LearningExperimentListener> |
getListeners()
Gets the listeners for this experiment.
|
void |
removeListener(LearningExperimentListener listener)
Removes the given listener from this object.
|
protected void |
setListeners(java.util.LinkedList<LearningExperimentListener> listeners)
Sets the listeners for this experiment.
|
clone
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNumTrials
protected transient java.util.LinkedList<LearningExperimentListener> listeners
public AbstractLearningExperiment()
public void addListener(LearningExperimentListener listener)
LearningExperiment
addListener
in interface LearningExperiment
listener
- The listener to add.public void removeListener(LearningExperimentListener listener)
LearningExperiment
removeListener
in interface LearningExperiment
listener
- The listener to remove.protected void fireExperimentStarted()
protected void fireExperimentEnded()
protected void fireTrialStarted()
protected void fireTrialEnded()
public java.util.LinkedList<LearningExperimentListener> getListeners()
protected void setListeners(java.util.LinkedList<LearningExperimentListener> listeners)
listeners
- The listeners for this experiment.