|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.sandia.cognition.util.AbstractCloneableSerializable
gov.sandia.cognition.algorithm.AbstractIterativeAlgorithm
@CodeReviews(reviews={@CodeReview(reviewer="Kevin R. Dixon",date="2008-02-08",changesNeeded=false,comments="Class looks fine."),@CodeReview(reviewer="Justin Basilico",date="2006-10-02",changesNeeded=false,comments="Interface is fine.")})
public abstract class AbstractIterativeAlgorithm
The AbstractIterativeAlgorithm class implements a simple part of
the IterativeAlgorithm interface that manages the listeners for the
algorithm. It contains methods for firing off the various learning events.
IterativeAlgorithm,
Serialized Form| Field Summary | |
|---|---|
static int |
DEFAULT_ITERATION
The default iteration number is zero. |
protected int |
iteration
Number of iterations the algorithm has executed. |
| Constructor Summary | |
|---|---|
AbstractIterativeAlgorithm()
Creates a new instance of AbstractIterativeAlgorithm. |
|
AbstractIterativeAlgorithm(int iteration)
Creates a new instance of AbstractIterativeAlgorithm. |
|
| Method Summary | |
|---|---|
void |
addIterativeAlgorithmListener(IterativeAlgorithmListener listener)
Adds a listener for the iterations of the algorithm. |
AbstractIterativeAlgorithm |
clone()
This makes public the clone method on the Object class and
removes the exception that it throws. |
protected void |
fireAlgorithmEnded()
Fires off a algorithm ended event for the algorithm, which notifies all the listeners that the algorithm has ended. |
protected void |
fireAlgorithmStarted()
Fires off a algorithm started event for this algorithm, which notifies all of the listeners that the algorithm has started. |
protected void |
fireStepEnded()
Fires off a algorithm ended event for the algorithm, which notifies all the listeners that a step has ended. |
protected void |
fireStepStarted()
Fires off a algorithm started event for the algorithm, which notifies all the listeners that a step has started. |
int |
getIteration()
Gets the current number of iterations executed by this algorithm since its it was started. |
protected LinkedList<IterativeAlgorithmListener> |
getListeners()
Retrieves the list of listeners for this algorithm. |
void |
removeIterativeAlgorithmListener(IterativeAlgorithmListener listener)
Removes a listener for the iterations of the algorithm. |
protected void |
setIteration(int iteration)
Sets the current iteration number. |
protected void |
setListeners(LinkedList<IterativeAlgorithmListener> listeners)
Sets the list of listeners for this algorithm. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_ITERATION
protected int iteration
| Constructor Detail |
|---|
public AbstractIterativeAlgorithm()
AbstractIterativeAlgorithm.
public AbstractIterativeAlgorithm(int iteration)
AbstractIterativeAlgorithm.
iteration - The initial iteration number.| Method Detail |
|---|
public AbstractIterativeAlgorithm clone()
AbstractCloneableSerializableObject class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone() to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone() as the basis for your implementation.
clone in interface CloneableSerializableclone in class AbstractCloneableSerializableprotected void fireAlgorithmStarted()
protected void fireAlgorithmEnded()
protected void fireStepStarted()
protected void fireStepEnded()
public void addIterativeAlgorithmListener(IterativeAlgorithmListener listener)
IterativeAlgorithm
addIterativeAlgorithmListener in interface IterativeAlgorithmlistener - The listener to add.public void removeIterativeAlgorithmListener(IterativeAlgorithmListener listener)
IterativeAlgorithm
removeIterativeAlgorithmListener in interface IterativeAlgorithmlistener - The listener to remove.protected LinkedList<IterativeAlgorithmListener> getListeners()
protected void setListeners(LinkedList<IterativeAlgorithmListener> listeners)
listeners - The new list of listeners.public int getIteration()
IterativeAlgorithm
getIteration in interface IterativeAlgorithmprotected void setIteration(int iteration)
iteration - Number of iterations executed in the algorithm.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||