These pages are auto-generated from self-documenting comments embedded in class files.

For more information on breve and steve, refer to the breve homepage.

Abstract : PatchGrid

Class Description:

PatchGrid is a class which allows you to create "patches". A Patch is a non-physical object which is associated with a specific area in the 3D world. This allows you to associate information or actions with specific areas in space, such as the presence of a chemical or nutrient at that area.

Use init-with or init-at the create a PatchGrid.

Class methods:


get-patch at-location theLocation (vector)

Returns the Patch in which theLocation resides. Make sure you test for the validity of the returned object, since it is possible that there is no patch at the specified location.


get-patch-at x xind (int) y yind (int) z zind (int)

Returns the patch object associated with the specified indices. Note that this method may return a NULL object in the case that the indices given are out of bounds.


get-patch-size

Returns the vector size of a single patch.


get-patches

Returns a list of all patch objects.


get-x-count

If the grid is initialized, returns the size of the grid on the X-axis.


get-y-count

If the grid is initialized, returns the size of the grid on the Y-axis.


get-z-count

If the grid is initialized, returns the size of the grid on the Z-axis.


init-at location gridCenter (vector) with-patch-size pSize (vector) with-x-count x (int) with-y-count y (int) with-z-count z (int) with-patch-class class (string)

Creates a PatchGrid in which each Patch is a member of class and is the size pSize and in which the total grid dimensions are x by y by z.

Bear in mind that this will create a large number of objects: x * y * z. If you have an iterate method in your patch-class, then this can amount to a great deal of computation which can slow down your simulation.


init-with patch-size pSize (vector) with-x-count x (int) with-y-count y (int) with-z-count z (int) with-patch-class class (string)

Like init-at, but centers the patch grid at the origin of the world.


Documentation created Tue May 11 10:28:37 2004