edu.bonn.xulu.model
Class AbstractStepModel

java.lang.Object
  extended by AbstractNamedObject
      extended by edu.bonn.xulu.model.AbstractXuluModel
          extended by edu.bonn.xulu.model.AbstractStepModel
All Implemented Interfaces:
StepModel, XuluModel
Direct Known Subclasses:
AbstractParallelStepModel, AverageNeighborhoodSerialDemoModel, CellularAutomaton, ClueModel, ClueModel_deterministic, ClueModel_Optimized, ClueModel_Original, CopyUrbanInActualLU, GameOfLife, ImpetusFireCA, MultiCellularAutomaton, MultipleResolutionValidation, MultipleResolutionValidation, SingleCellularAutomaton, SmallReservoirModel, TestModel, UrbanGrowthModel, UrbanGrowthModelSelfModifying

public abstract class AbstractStepModel
extends AbstractXuluModel
implements StepModel

Diese Klasse implementiert ein Modell, welches schrittweise ausgefuehrt wird. Das Modell arbeitet eine feste Anzahl von Arbeitsschritten ab, bevor es automatisch auslaeuft. Die Anzahl wird in der Variablen stepCount hinterlegt und muss von einer Implementierung befuellt werden!

Version:
1.0
Author:
Martin Schmitz (University of Bonn/Germany)

Field Summary
protected  int stepCount
          Speichert die Anzahl der zu modellierenden Schritte.
 
Fields inherited from class edu.bonn.xulu.model.AbstractXuluModel
contManager, disposed, events, initialised, listeners, modelResourceProvider, running, statusOut, stopped
 
Constructor Summary
AbstractStepModel(ModelContentManager contentManager)
          Erzeugt ein neues Model.
 
Method Summary
protected  void fireModelStepFinished(int step)
          Informiert alle ModelListener darueber, dass das Modell einen neuen Modellierungsschritt beendet hat.
protected  void fireModelStepStarted(int step)
          Informiert alle ModelListener darueber, dass das Modell einen neuen Modellierungsschritt beginnt.
 int getStepCount()
          Liefert die Anzahl der zu modellierenden Schritte.
 void performModelStart()
          Implementiert den Rahmen des Modellablaufs.
abstract  void performModelStep(int stepNo)
          Implementiert einen Modellschritt.
 
Methods inherited from class edu.bonn.xulu.model.AbstractXuluModel
addModelListener, checkBreakingCommands, determineCaption, disposeModel, fireModelDisposed, fireModelEvent, fireModelInitialised, fireModelStarted, fireModelStopped, getContentManager, getEvents, getModelSpecificGUI, getResourceProvider, getStatusOut, initModel, isDisposed, isInitialised, isRunning, isStopped, performError, performModelDispose, performModelInit, releaseAccess, removeModelListener, resetCaptions, setStatusOut, startModelling, stopModelling
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.bonn.xulu.model.XuluModel
addModelListener, disposeModel, getContentManager, getEvents, getModelSpecificGUI, getResourceProvider, getStatusOut, initModel, isDisposed, isInitialised, isRunning, isStopped, performError, removeModelListener, setStatusOut, startModelling, stopModelling
 

Field Detail

stepCount

protected int stepCount
Speichert die Anzahl der zu modellierenden Schritte. muss vor dem Modellstart von der Implementierung gefuellt werden!

Constructor Detail

AbstractStepModel

public AbstractStepModel(ModelContentManager contentManager)
Erzeugt ein neues Model.

Parameters:
contentManager - verwaltet die Ressourcen fuer das Model
Method Detail

performModelStart

public void performModelStart()
Implementiert den Rahmen des Modellablaufs. Ruft sukzessive performModelStep(int) in einer Schleife auf, bis die vorgegebene Schrittzahl erreicht ist. Wird das Modell zuvor unterbrochen (AbstractXuluModel.stopModelling() wird auch die Schleife unterbrochen. Loest fireModelStepStarted(int) und fireModelStepFinished(int) aus.

Specified by:
performModelStart in class AbstractXuluModel

performModelStep

public abstract void performModelStep(int stepNo)
Implementiert einen Modellschritt.

Specified by:
performModelStep in interface StepModel
Parameters:
stepNo - Nummer des Modellschritts (beginnend bei 1)

getStepCount

public int getStepCount()
Liefert die Anzahl der zu modellierenden Schritte.

Specified by:
getStepCount in interface StepModel
See Also:
stepCount

fireModelStepStarted

protected void fireModelStepStarted(int step)
Informiert alle ModelListener darueber, dass das Modell einen neuen Modellierungsschritt beginnt.


fireModelStepFinished

protected void fireModelStepFinished(int step)
Informiert alle ModelListener darueber, dass das Modell einen neuen Modellierungsschritt beendet hat.