Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## sim.field.grid
Interface Grid3D

All Superinterfaces:
  java.io.Serializable

All Known Implementing Classes:
  AbstractGrid3D

public interface Grid3D
extends java.io.Serializable

Method Summary
`int` | `getHeight()` Get the height
`int` | `getLength()` Get the length
`void` | `getNeighborsHamiltonianDistance(int x, int y, int z, int dist, boolean toroidal, IntBag xPos, IntBag yPos, IntBag zPos)`
`void` | `getNeighborsMaxDistance(int x, int y, int z, int dist, boolean toroidal, IntBag xPos, IntBag yPos, IntBag zPos)`
`int` | `getWidth()` Get the width
`int` | `stx(int x)` Simple [and fast] toroidal x.
`int` | `sty(int y)` Simple [and fast] toroidal y.
`int` | `stz(int z)` Simple [and fast] toroidal z.
`int` | `tx(int x)` Toroidal x.
`int` | `ty(int y)` Toroidal y.
`int` | `tz(int z)` Toroidal z.

Method Detail

### getWidth

    public int getWidth()

  Get the width

### getHeight

    public int getHeight()

  Get the height

### getLength

    public int getLength()

  Get the length

### tx

    public int tx(int x)

  Toroidal x. Defined as: (x%width+width)%width

### ty

    public int ty(int y)

  Toroidal y. Defined as: (y%height+height)%height

### tz

    public int tz(int z)

  Toroidal z. Defined as: (z%length+length)%length

### stx

    public int stx(int x)

  Simple [and fast] toroidal x. Use this if the values you'd pass in never stray beyond (-width ... width * 2) not inclusive. It's a bit faster than the full toroidal computation as it uses if statements rather than two modulos. The following definition:
  { if (x >= 0) { if (x < width) return x; return x - width; } return x + width; } ...produces the shortest code (28 bytes) and is inlined in Hotspot for 1.4.1.

### sty

    public int sty(int y)

  Simple [and fast] toroidal y. Use this if the values you'd pass in never stray beyond (-height ... height * 2) not inclusive. It's a bit faster than the full toroidal computation as it uses if statements rather than two modulos. The following definition:
  { if (y >= 0) { if (y < height) return y ; return y - height; } return y + height; } ...produces the shortest code (28 bytes) and is inlined in Hotspot for 1.4.1.

### stz

    public int stz(int z)

  Simple [and fast] toroidal z. Use this if the values you'd pass in never stray beyond (-length ... length * 2) not inclusive. It's a bit faster than the full toroidal computation as it uses if statements rather than two modulos. The following definition:
  { if (z >= 0) { if (z < length) return z ; return z - length; } return z + length; } ...produces the shortest code (28 bytes) and is inlined in Hotspot for 1.4.1.

### getNeighborsMaxDistance

    public void getNeighborsMaxDistance(int x,
                                        int y,
                                        int z,
                                        int dist,
                                        boolean toroidal,
                                        IntBag xPos,
                                        IntBag yPos,
                                        IntBag zPos)

### getNeighborsHamiltonianDistance

    public void getNeighborsHamiltonianDistance(int x,
                                                int y,
                                                int z,
                                                int dist,
                                                boolean toroidal,
                                                IntBag xPos,
                                                IntBag yPos,
                                                IntBag zPos)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD