public class Environment
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private double[][] |
data
Raster dataset for environment.
|
private int |
height
Height of environment.
|
private int |
width
Width of environment.
|
Constructor and Description |
---|
Environment(int width,
int height)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double[][] |
getData()
Gets the data array.
|
double |
getDataValue(int x,
int y)
Accessor method for a single data point.
|
int |
getHeight()
Gets the height, as one might expect.
|
int |
getWidth()
Gets the width, as one might expect.
|
void |
setData(double[][] data)
Sets the data array.
|
void |
setDataValue(int x,
int y,
double value)
Mutator method for a single data point.
|
private int width
private int height
private double[][] data
public Environment(int width, int height)
width
- default environment widthheight
- default environment heightpublic int getWidth()
public int getHeight()
public void setData(double[][] data)
data
- 2D data arraypublic double[][] getData()
public void setDataValue(int x, int y, double value)
x
- location across a rowy
- location down a column / row numbervalue
- value to set at position y,xpublic double getDataValue(int x, int y)
x
- location across a rowy
- location down a column / row number