All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----edu.cornell.lassp.mck10.HysteresisApplet.ProcessAvalanche
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.
ProcessAvalanche(model) constructor connects the
class to the hysteresis model, so that it is ready to start displaying
avalanches to standard out.
notify(av,p) is called every time a new avalanche is
generated by the model.
update(obs,obj) is called every time a new pass through
the simulation is started.
public ProcessAvalanche(HysteresisLattice model)
ProcessAvalanche(model) constructor connects the
class to the hysteresis model, so that it is ready to start displaying
avalanches to standard out.
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.
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.
All Packages Class Hierarchy This Package Previous Next Index