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
Class DoubleGrid2D

    java.lang.Object
      sim.field.grid.AbstractGrid2D
          sim.field.grid.DoubleGrid2D

All Implemented Interfaces:
  Grid2D, java.io.Serializable

public class DoubleGrid2D
extends AbstractGrid2D

A wrapper for 2D arrays of doubles.

This object expects that the 2D arrays are rectangular. You are encouraged to access the array directly. The object implements all of the Grid2D interface. See Grid2D for rules on how to properly implement toroidal or hexagonal grids.

The width and height of the object are provided to avoid having to say field[x].length, etc.

See Also:
  Serialized Form

Field Summary
`double[][]` | `field`

Fields inherited from class sim.field.grid.AbstractGrid2D
`height, width`

Constructor Summary
`DoubleGrid2D(DoubleGrid2D values)`
`DoubleGrid2D(int xdim, int ydim)`
`DoubleGrid2D(int xdim, int ydim, double initialValue)`

Method Summary
`DoubleGrid2D` | `add(double withThisMuch)`
`DoubleGrid2D` | `add(DoubleGrid2D withThis)`
`DoubleGrid2D` | `add(IntGrid2D withThis)`
`DoubleGrid2D` | `ceiling()`
`DoubleGrid2D` | `floor()`
`double` | `get(int x, int y)`
`double[][]` | `getField()`
`void` | `getNeighborsHamiltonianDistance(int x, int y, int dist, boolean toroidal, DoubleBag result, IntBag xPos, IntBag yPos)`
`void` | `getNeighborsHexagonalDistance(int x, int y, int dist, boolean toroidal, DoubleBag result, IntBag xPos, IntBag yPos)`
`void` | `getNeighborsMaxDistance(int x, int y, int dist, boolean toroidal, DoubleBag result, IntBag xPos, IntBag yPos)`
`DoubleGrid2D` | `lowerBound(double toNoLowerThanThisMuch)`
`double` | `max()`
`double` | `mean()`
`double` | `min()`
`DoubleGrid2D` | `multiply(double byThisMuch)`
`DoubleGrid2D` | `multiply(DoubleGrid2D withThis)`
`DoubleGrid2D` | `multiply(IntGrid2D withThis)`
`DoubleGrid2D` | `rint()`
`void` | `set(int x, int y, double val)`
`DoubleGrid2D` | `setTo(double thisMuch)`
`DoubleGrid2D` | `setTo(DoubleGrid2D values)`
`DoubleGrid2D` | `truncate()` round towards zero
`DoubleGrid2D` | `upperBound(double toNoMoreThanThisMuch)`

Methods inherited from class sim.field.grid.AbstractGrid2D
`dlx, dly, downx, downy, drx, dry, getHeight, getNeighborsHamiltonianDistance, getNeighborsHexagonalDistance, getNeighborsMaxDistance, getWidth, stx, sty, trb, trt, tx, ty, ulx, uly, upx, upy, urx, ury`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### field

    public double[][] field

Constructor Detail

### DoubleGrid2D

    public DoubleGrid2D(int xdim,
                        int ydim)

### DoubleGrid2D

    public DoubleGrid2D(int xdim,
                        int ydim,
                        double initialValue)

### DoubleGrid2D

    public DoubleGrid2D(DoubleGrid2D values)

Method Detail

### getField

    public double[][] getField()

### set

    public final void set(int x,
                          int y,
                          double val)

### get

    public final double get(int x,
                            int y)

### setTo

    public final DoubleGrid2D setTo(double thisMuch)

### setTo

    public final DoubleGrid2D setTo(DoubleGrid2D values)

### max

    public final double max()

### min

    public final double min()

### mean

    public final double mean()

### upperBound

    public final DoubleGrid2D upperBound(double toNoMoreThanThisMuch)

### lowerBound

    public final DoubleGrid2D lowerBound(double toNoLowerThanThisMuch)

### add

    public final DoubleGrid2D add(double withThisMuch)

### add

    public final DoubleGrid2D add(IntGrid2D withThis)

### add

    public final DoubleGrid2D add(DoubleGrid2D withThis)

### multiply

    public final DoubleGrid2D multiply(double byThisMuch)

### multiply

    public final DoubleGrid2D multiply(IntGrid2D withThis)

### multiply

    public final DoubleGrid2D multiply(DoubleGrid2D withThis)

### floor

    public final DoubleGrid2D floor()

### ceiling

    public final DoubleGrid2D ceiling()

### truncate

    public final DoubleGrid2D truncate()

  round towards zero

### rint

    public final DoubleGrid2D rint()

### getNeighborsMaxDistance

    public final void getNeighborsMaxDistance(int x,
                                              int y,
                                              int dist,
                                              boolean toroidal,
                                              DoubleBag result,
                                              IntBag xPos,
                                              IntBag yPos)

### getNeighborsHamiltonianDistance

    public final void getNeighborsHamiltonianDistance(int x,
                                                      int y,
                                                      int dist,
                                                      boolean toroidal,
                                                      DoubleBag result,
                                                      IntBag xPos,
                                                      IntBag yPos)

### getNeighborsHexagonalDistance

    public final void getNeighborsHexagonalDistance(int x,
                                                    int y,
                                                    int dist,
                                                    boolean toroidal,
                                                    DoubleBag result,
                                                    IntBag xPos,
                                                    IntBag yPos)

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