Class TSimulation (unit SandSim)

Inherits from

TThread

The simulation logic (based on the TThread class

Constructors


constructor Create;

Are we in trace mode?

-------------------- TSimulation ---------------------



Functions

destructor Destroy;

FreeOnTerminate := True;

procedure Trace;

Log1.

procedure DrawCell(X, Y: Integer);


procedure Execute;

Shows statistics on the sandpile

procedure ShowStatistics;

Updates a cell in the grid

procedure DoDrawCell;

Queue of points that have toppled

This method is a wrapper for the method DoDrawCell.


procedure DoShowStatistics;

This method is a wrapper for the method DoShowStatistics.

Properties

Events

Variables

Rounds : Longint;


Tracing : Boolean;

# rounds so far

CurrentCell : TField;


Q : TQueue;

Used when updating a cell


Constructors


constructor Create;

Are we in trace mode?

-------------------- TSimulation ---------------------


Functions


destructor Destroy;

FreeOnTerminate := True;


procedure Trace;

Log1.Log;


procedure DrawCell(X, Y: Integer);


procedure Execute;

Shows statistics on the sandpile


procedure ShowStatistics;

Updates a cell in the grid


procedure DoDrawCell;

Queue of points that have toppled

This method is a wrapper for the method DoDrawCell. It ensures synchronization with the PileForm TDrawGrid VCL component.


procedure DoShowStatistics;

This method is a wrapper for the method DoShowStatistics. It ensures synchronization with the MainForm TLabel VCL components.


Properties


Events


Variables


Rounds : Longint;


Tracing : Boolean;

# rounds so far


CurrentCell : TField;


Q : TQueue;

Used when updating a cell