dd.hurricane
Class LanduseManager

java.lang.Object
  extended bydd.hurricane.LanduseManager

public class LanduseManager
extends java.lang.Object


Constructor Summary
LanduseManager()
           
 
Method Summary
static int convert(GameRoot root, java.util.Random rng, java.util.Collection sites, java.lang.String luFrom, java.lang.String luTo, double prob)
          Converts LU (on the landuse layer of the map, in the locations specified by sites) from LU "luFrom" to LU "luTo") with the specified probability.
static int convert(GameRoot root, java.util.Random rng, java.lang.String luFrom, java.lang.String luTo, double prob)
          Converts LU everywhere on the map from LU "luFrom" to LU "luTo" with the specified probability
static boolean isFull(Map map, MapCell cell, java.lang.String lu)
          Indicates whether a cell has room in its luArray for a new landuse.
static void rebuild(GameRoot root, java.util.Random rng, java.lang.String oldLayer, double prob)
          Converts "destroyed" LU everywhere on the map back to whatever value that LU had on the "oldLayer" layer with specified probability.
static void rebuild(GameRoot root, java.lang.String oldLayer)
          Converts "destroyed" LU everywhere on the map back to whatever value that LU had on the "oldLayer" layer.
static void rebuild(GameRoot root, java.lang.String oldLayer, java.util.Collection sites)
          Converts "destroyed" LU in the specified sites back to whatever value that LU had on the "oldLayer" layer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LanduseManager

public LanduseManager()
Method Detail

rebuild

public static void rebuild(GameRoot root,
                           java.lang.String oldLayer)
Converts "destroyed" LU everywhere on the map back to whatever value that LU had on the "oldLayer" layer.

Parameters:
oldLayer - the name of the Layer to find the restored state on.

rebuild

public static void rebuild(GameRoot root,
                           java.lang.String oldLayer,
                           java.util.Collection sites)
Converts "destroyed" LU in the specified sites back to whatever value that LU had on the "oldLayer" layer.

Parameters:
oldLayer - the name of the Layer to find the restored state on.
sites - a Collection of MapCells.

rebuild

public static void rebuild(GameRoot root,
                           java.util.Random rng,
                           java.lang.String oldLayer,
                           double prob)
Converts "destroyed" LU everywhere on the map back to whatever value that LU had on the "oldLayer" layer with specified probability.

Parameters:
oldLayer - the name of the Layer to find the restored state on.

convert

public static int convert(GameRoot root,
                          java.util.Random rng,
                          java.lang.String luFrom,
                          java.lang.String luTo,
                          double prob)
Converts LU everywhere on the map from LU "luFrom" to LU "luTo" with the specified probability

Parameters:
prob - probability of LU conversion
Returns:
the number of LU converted.

convert

public static int convert(GameRoot root,
                          java.util.Random rng,
                          java.util.Collection sites,
                          java.lang.String luFrom,
                          java.lang.String luTo,
                          double prob)
Converts LU (on the landuse layer of the map, in the locations specified by sites) from LU "luFrom" to LU "luTo") with the specified probability.

Parameters:
sites - a Collection of MapCells.
prob - probability of LU conversion.
Returns:
the number of LU converted.

isFull

public static boolean isFull(Map map,
                             MapCell cell,
                             java.lang.String lu)
Indicates whether a cell has room in its luArray for a new landuse. If the attribute "mixedUse" is set on the "landuse" layer, that means that all sites are filled either with "mixed" or with the specified landuse; if unset, it means that no sites are occupied by "none".

Parameters:
map - the map
cell - map location to be checked
lu - landuse to check
Returns:
true if it is impossible for a landuse of the specified type to be added at this location; false otherwise