Class edu.cornell.lassp.houle.HysSym.HysLattice
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.cornell.lassp.houle.HysSym.HysLattice

java.lang.Object
   |
   +----edu.cornell.lassp.houle.HysSym.HysLattice

public class HysLattice
extends Object
implements Runnable
HysLattice is a simulation of a random-field Ising model on a 2D lattice that demonstrates hysteresis. HysLattice is based on work by Jim Sethna and his group, more information is availible about the physics. HysLattice is a model under the model-view-controller (MVC) paradigm. HysLattice is controlled through calls to the runTo() method and sends to simulations to Consumers that are registed using the registerConsumer() method. This method of registration will change in the next major revision.
Source code is available.

For examples of controllers see hys and HysControlBar. For information on consumers, see AvalancheConsumer, RunStopConsumer, and XyConsumer.

Version:
0.9a
Author:
Paul A. Houle (E-mail: ph18@cornell.edu )
See Also:
RandomElement, AvalancheConsumer, XyConsumer, RunStopConsumer, hys, HysControlBar

Constructor Index

 o HysLattice(int, int, double)

Method Index

 o bmax()
 o bmin()
 o getCell(int, int)
 o getDirection()
 o getGoal()
 o getXSize()
 o getYSize()
 o isRunning()
 o nDown(int, int)
 o registerConsumer(Object)
Register consumer takes an object as an argument, identifies which consumer interfaces it implements, and registers them.
 o run()
run implements the interface runnable, and is the main thread of execution.
 o runTo(double)
runTo instructs the simulation to start a thread that changes the magnetic field from it's current value to the specified goal value.
 o stop()
Stop execution of the HysLattice thread in an orderly manner.

Constructors

 o HysLattice
  public HysLattice(int nx,
                    int ny,
                    double R)
Parameters:
nx - number of spins in x direction
ny - number of spins in y direction
R - random field value

Methods

 o getXSize
  public final int getXSize()
Returns:
the number of cells in the lattice in the X direction
 o getYSize
  public final int getYSize()
Returns:
the number of cells in the lattice in the Y direction.
 o getCell
  public final int getCell(int i,
                           int j)
Returns:
the value of the spin at coordinates (i,j) [always +1 or -1]
 o getDirection
  public final int getDirection()
Returns:
the direction that the model is running in: the sign of the increment of the magnetic field.
 o getGoal
  public final double getGoal()
Returns:
s the magnetic field towards which the system is evolving.
 o isRunning
  public final boolean isRunning()
Returns:
true if the model is running, false if it isn't.
 o bmax
  public double bmax()
Returns:
the maximum magnetic field, past which all spins will be up.
 o bmin
  public double bmin()
Returns:
the minimum magnetic field, past which all spins will be down.
 o nDown
  public final int nDown(int i,
                         int j)
Parameters:
i - i index of a spin.
j - j index of a spin.
Returns:
s the number of neighbors of the spin (i,j) that are spin down.
 o registerConsumer
  public void registerConsumer(Object o)
Register consumer takes an object as an argument, identifies which consumer interfaces it implements, and registers them. It will soon be replaced by a better mechanism.
 o runTo
  public boolean runTo(double g)
runTo instructs the simulation to start a thread that changes the magnetic field from it's current value to the specified goal value. The thread continues until it reaches the specified goal or until there are no spins left to flip
Parameters:
g - goal magnetic field.
Returns:
true if model isn't already running (and thus has been started successfully), and false if it is running (and hasn't been started successfully)
 o run
  public void run()
run implements the interface runnable, and is the main thread of execution. It is not intended to be called directly. Run the simulation using the runTo method.
 o stop
  public void stop()
Stop execution of the HysLattice thread in an orderly manner. Causes HysLattice to quit once it is done executing the step it is currently on.

All Packages  Class Hierarchy  This Package  Previous  Next  Index