Class edu.cornell.lassp.mck10.HysteresisApplet.ProcessAvalanche
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.cornell.lassp.mck10.HysteresisApplet.ProcessAvalanche

java.lang.Object
   |
   +----edu.cornell.lassp.mck10.HysteresisApplet.ProcessAvalanche

public class ProcessAvalanche
extends Object
implements AvalancheConsumer, Observer
ProcessAvalanche simply outputs the avalanches produced by the class HysteresisLattice to standard out. A simple format is used for the output. Before each avalanche, the dimensions, the width, the direction and the external field are printed. Each spin in the avalanche is printed on a separate line, which contains the level of the spin and the coordinates of the spin. The avalanche is terminated with a -1 on a line by itself. Avalanches are only sent to standard out if they come in multiple chunks, or are the biggest avalanche so far.

Source Code is available.

Version:
1.0
Author:
Matt Kuntz (e-mail: mck10@cornell.edu)

Constructor Index

 o ProcessAvalanche(HysteresisLattice)
The ProcessAvalanche(model) constructor connects the class to the hysteresis model, so that it is ready to start displaying avalanches to standard out.

Method Index

 o notify(Avalanche, AvalancheProducer)
notify(av,p) is called every time a new avalanche is generated by the model.
 o update(Observable, Object)
update(obs,obj) is called every time a new pass through the simulation is started.

Constructors

 o ProcessAvalanche
  public ProcessAvalanche(HysteresisLattice model)
The ProcessAvalanche(model) constructor connects the class to the hysteresis model, so that it is ready to start displaying avalanches to standard out.
Parameters:
model - The model producing the avalanches.

Methods

 o notify
  public void notify(Avalanche av,
                     AvalancheProducer p)
notify(av,p) is called every time a new avalanche is generated by the model. This is where the avalanches are output to standard out.
Parameters:
av - The avalanche.
p - The model which produced the avalanche.
 o update
  public void update(Observable obs,
                     Object obj)
update(obs,obj) is called every time a new pass through the simulation is started. When this happens, we need to reset the size of the biggest avalanche. It is also called when the size of the model is changed, in which case we need to take note of the new size.
Parameters:
obs - The observable variable which has changed.
obj - An unused parameter.

All Packages  Class Hierarchy  This Package  Previous  Next  Index