uk.ac.leeds.ccg.andyt.grids.examples
Class GenerateTestData

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.grids.core.OutOfMemoryErrorHandler
      extended by uk.ac.leeds.ccg.andyt.grids.process.Grid2DSquareCellProcessor
          extended by uk.ac.leeds.ccg.andyt.grids.examples.GenerateTestData
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable

public class GenerateTestData
extends Grid2DSquareCellProcessor
implements java.lang.Runnable

TODO: docs

See Also:
Serialized Form

Field Summary
 
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.process.Grid2DSquareCellProcessor
grid2DSquareCellDoubleChunk64CellMapFactory, grid2DSquareCellDoubleChunkArrayFactory, grid2DSquareCellDoubleChunkFactory, grid2DSquareCellDoubleChunkJAIFactory, grid2DSquareCellDoubleChunkMapFactory, grid2DSquareCellDoubleChunkRAFFactory, grid2DSquareCellDoubleFactory, grid2DSquareCellIntChunk64CellMapFactory, grid2DSquareCellIntChunkArrayFactory, grid2DSquareCellIntChunkFactory, grid2DSquareCellIntChunkJAIFactory, grid2DSquareCellIntChunkMapFactory, grid2DSquareCellIntChunkRAFFactory, grid2DSquareCellIntFactory, grid2DSquareCells, gridStatistics, gridStatistics0, gridStatistics1, log, logIndentation, startTime, workspace
 
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.core.OutOfMemoryErrorHandler
handleOutOfMemoryErrorFalse, handleOutOfMemoryErrorTrue, memoryReserve
 
Constructor Summary
GenerateTestData()
          Creates new GenerateTestData.
GenerateTestData(java.io.File workspace)
          Creates new GenerateTestData.
 
Method Summary
 Grid2DSquareCellDouble[] generateCatchment(boolean handleOutOfMemoryError)
           
 Grid2DSquareCellDouble[] generateCircularData(boolean handleOutOfMemoryError)
           
 Grid2DSquareCellDouble[] generateSquareData(boolean handleOutOfMemoryError)
           
 java.util.HashSet getCellIDs(Grid2DSquareCellDouble grid, long row, long col, double minRadius, double maxRadius, boolean handleOutOfMemoryError)
           
 java.util.HashSet getCellIDsHashSet(Grid2DSquareCellDouble grid, long row, long col, double radius, boolean handleOutOfMemoryError)
           
 long getRandomCol(long ncols, double maxRadius)
           
 long getRandomRow(long nrows, double maxRadius)
           
static void main(java.lang.String[] args)
           
 void printCircularFeatureInfo(java.io.PrintWriter pw, double minRadius, double maxRadius, double height, long row, long col)
           
 double random(double min, double max)
           
 void removeAll(java.util.HashSet cellIDHashSetToRemoveFrom, java.util.HashSet cellIDHashSetToRemove)
          Taken from HashSet.removeAll(Collection)
 void run()
           
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.process.Grid2DSquareCellProcessor
addToGrid, addToGrid, addToGrid, addToGrid, addToGrid, addToGrid, addToGrid, addToGrid, addToGrid, addToGrid, aggregate, aggregate, angle, angle, angle, copyAndSetUpNewLog, distance, distance, distance, getGrid2DSquareCell, getGrid2DSquareCell, getGrid2DSquareCells, getRowProcessData, getRowProcessInitialData, getTime0, getWorkspace, linearRescale, linearRescale, log, log, log, logRescale, logRescale, mask, mask, mask, mask, mask, mask, mask, mask, mask, mask, mask, setValueALittleBitLarger, setValueALittleBitLarger, setValueALittleBitSmaller, setValueALittleBitSmaller, setWorkspace, setWorkspace, setWorkspace, swapToFileGrid2DSquareCellChunk, swapToFileGrid2DSquareCellChunkExcept
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.core.OutOfMemoryErrorHandler
clearMemoryReserve, initMemoryReserve, initMemoryReserve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenerateTestData

public GenerateTestData()
                 throws java.io.IOException
Creates new GenerateTestData.

Throws:
java.io.IOException

GenerateTestData

public GenerateTestData(java.io.File workspace)
                 throws java.io.IOException
Creates new GenerateTestData.

Throws:
java.io.IOException
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException

run

public void run()
Specified by:
run in interface java.lang.Runnable

generateCircularData

public Grid2DSquareCellDouble[] generateCircularData(boolean handleOutOfMemoryError)

printCircularFeatureInfo

public void printCircularFeatureInfo(java.io.PrintWriter pw,
                                     double minRadius,
                                     double maxRadius,
                                     double height,
                                     long row,
                                     long col)

getCellIDs

public java.util.HashSet getCellIDs(Grid2DSquareCellDouble grid,
                                    long row,
                                    long col,
                                    double minRadius,
                                    double maxRadius,
                                    boolean handleOutOfMemoryError)

removeAll

public void removeAll(java.util.HashSet cellIDHashSetToRemoveFrom,
                      java.util.HashSet cellIDHashSetToRemove)
Taken from HashSet.removeAll(Collection)


getCellIDsHashSet

public java.util.HashSet getCellIDsHashSet(Grid2DSquareCellDouble grid,
                                           long row,
                                           long col,
                                           double radius,
                                           boolean handleOutOfMemoryError)

getRandomRow

public long getRandomRow(long nrows,
                         double maxRadius)

getRandomCol

public long getRandomCol(long ncols,
                         double maxRadius)

random

public double random(double min,
                     double max)

generateSquareData

public Grid2DSquareCellDouble[] generateSquareData(boolean handleOutOfMemoryError)

generateCatchment

public Grid2DSquareCellDouble[] generateCatchment(boolean handleOutOfMemoryError)