public class TileManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
COLS |
static double |
DLAT |
static double |
DLON |
static double |
DX_KM |
static double |
DY_KM |
static double |
LAT_RANGE |
static double |
LON_RANGE |
static double |
MAX_LAT |
static double |
MAX_LON |
static double |
MIN_LAT |
static double |
MIN_LON |
static LandTile |
NO_DATA |
static double |
NOISE_RADIUS |
static int |
ROWS |
| Constructor and Description |
|---|
TileManager() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<LandTile> |
allTiles() |
float |
calcTileDelta(double min,
double max,
double r1,
double r2)
Calculates the delta value used to add noise to tiles, given a maximum and
minimum value for the parameter, and two random numbers in range [0,1]
To use this for the annual rainfall delta, use 0 as the minimum.
|
static double |
colToLon(int col) |
java.util.List<LandTile> |
countryTiles()
Returns a Collection of tiles that have been registered with a country.
|
LandTile[] |
dataTiles()
Returns a Collection of the tiles held by this TileManager that actually
contain data.
|
float |
getRainfall(float lat,
float lon)
Get the annual rainfall at a location in the current simulation year.
|
float |
getTemperatureDay(float lat,
float lon)
Get the average daytime temperature at a location in the current simulation year.
|
float |
getTemperatureMax(float lat,
float lon)
Get the max temperature at a location in the current simulation year.
|
float |
getTemperatureMin(float lat,
float lon)
Get the min temperature at a location in the current simulation year.
|
float |
getTemperatureNight(float lat,
float lon)
Get the average nighttime temperature at a location in the current simulation year.
|
LandTile |
getTile(double lon,
double lat)
Get a tile by longitude and latitude
|
void |
putTile(LandTile tile)
Add a given tile to the data set.
|
void |
registerCountryTile(LandTile tile)
Registers a tile as having been associated with a country.
|
boolean |
removeTile(LandTile tile)
remove a given tile from the underlying set of tiles.
|
static double |
rowToLat(int row) |
float |
scaleDeltaByDistance(double delta,
double distance,
double r3)
Calculates the actual amount to add to a given parameter in a LandTile, given
the delta value, the distance between the tile from which noise is being added
and a random number in range [0,2]
|
void |
setClimate(int year)
Mutates all the tile data based on projections maintained within each tile
and noise added randomly.
|
public static final LandTile NO_DATA
public static final int ROWS
public static final int COLS
public static final double MIN_LAT
public static final double MAX_LAT
public static final double MIN_LON
public static final double MAX_LON
public static final double LAT_RANGE
public static final double LON_RANGE
public static final double DLON
public static final double DLAT
public static final double DX_KM
public static final double DY_KM
public static final double NOISE_RADIUS
public float getTemperatureMax(float lat,
float lon)
lat - [-90.0 to 90.0], South latitudes are less than 0.lon - [-180.0 to 180.0], West longitudes are less than 0.public float getTemperatureMin(float lat,
float lon)
lat - [-90.0 to 90.0], South latitudes are less than 0.lon - [-180.0 to 180.0], West longitudes are less than 0.public float getTemperatureDay(float lat,
float lon)
lat - [-90.0 to 90.0], South latitudes are less than 0.lon - [-180.0 to 180.0], West longitudes are less than 0.public float getTemperatureNight(float lat,
float lon)
lat - [-90.0 to 90.0], South latitudes are less than 0.lon - [-180.0 to 180.0], West longitudes are less than 0.public float getRainfall(float lat,
float lon)
lat - [-90.0 to 90.0], South latitudes are less than 0.lon - [-180.0 to 180.0], West longitudes are less than 0.public void setClimate(int year)
year - The simulation year.public float calcTileDelta(double min,
double max,
double r1,
double r2)
min - minimum value in the range of the datamax - maximum value in the range of the datar1 - first random number between 0 and 1r2 - second random number between 0 and 1public float scaleDeltaByDistance(double delta,
double distance,
double r3)
delta - calculated delta valuedistance - r3 - public LandTile getTile(double lon, double lat)
lon - degrees longitudelat - degrees latitudepublic void putTile(LandTile tile)
tile - LandTile to addpublic void registerCountryTile(LandTile tile)
tile - tile to registerpublic java.util.List<LandTile> countryTiles()
public LandTile[] dataTiles()
public java.util.List<LandTile> allTiles()
public boolean removeTile(LandTile tile)
tile - tile to removepublic static double rowToLat(int row)
public static double colToLon(int col)