|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--Geometry.Topology
Builds the positions that can be randomly selected within the region it is associated with. The random distribution is based on the shape of the region; currently only wedges and toroids are supported. A bell curve with adjustable decay rate is applied to make positions nearer the center more probable than those at the edges.
Region| Field Summary | |
private static float |
CELL_BASE
|
static float |
DEFAULT_DECAY_RATE
|
private int |
GENERATION_BASE
|
private java.util.ArrayList |
m_cell_list
|
private float[][] |
m_generation_count
|
private float |
m_max_generation_count
|
private Region |
m_region
|
static int |
NUM_CELL_SUBDIVISIONS
|
static int |
NUM_RINGS
|
static int |
NUM_SECTORS
|
| Constructor Summary | |
protected |
Topology(Region parent_region,
float decay_rate)
Creates a new topology for distributing random coordinates over a region. |
protected |
Topology(Region parent_region,
Topology topology1,
Topology topology2)
Creates a new topology for distributing random coordinates over a region. |
| Method Summary | |
private void |
createDistribution(float decay_rate)
Creates a distribution of random coordinates over a region based on its shape. |
private void |
createToroidDistribution(int sector_start,
int sector_end,
int sector_center,
int ring_start,
int ring_end,
int ring_center,
float decay_rate)
Creates a random distribution over a toroid-shaped region. |
private void |
createWedgeDistribution(int sector_start,
int sector_end,
int sector_center,
int ring_start,
int ring_end,
int ring_center,
float decay_rate)
Creates a random distribution over a wedge-shaped region. |
void |
dumpActualDistribution(int sample_size)
Dumps to stdout a list of actual random coordinates over a sample to show how an actual distribution corresponds to the predicted one. |
void |
dumpPredictedDistribution(boolean is_histogram_otherwise_gnuplot)
Dumps to stdout a list of predicted random coordinates to show how an actual distribution should look. |
private void |
generateRandomList()
Generates a list of random coordinates based on the distribution. |
java.util.ArrayList |
getCellMesh(int geometry_ring,
int geometry_sector)
Returns a list RegionCoordinates corresponding to the corners of all topology cells within a region cell. |
protected float |
getGenerationCount(int ring,
int sector)
Returns the number of random coordinates to generate for a topology cell. |
static int |
getNextSector(int sector)
Returns the next topology sector number. |
static int |
getPreviousSector(int sector)
Returns the previous topology sector number. |
RegionCoordinate |
getRandomCoordinate()
Returns a random coordinate distributed over the topology. |
int |
getRandomPoolSize()
Returns the number of random coordinates available. |
static float |
getRegionRing(int topology_ring)
Returns the Region ring (or fraction thereof) corresponding to a Topology ring. |
static float |
getRegionSector(int topology_sector)
Returns the Region sector (or fraction thereof) corresponding to a Topology sector. |
static int |
getTopologyRingLowerBound(int region_ring)
Returns the smallest Topology ring corresponding to a Region ring. |
static int |
getTopologyRingUpperBound(int region_ring)
Returns the largest Topology ring corresponding to a Region ring. |
static int |
getTopologySectorLowerBound(int region_sector)
Returns the smallest Topology sector corresponding to a Region sector. |
static int |
getTopologySectorUpperBound(int region_sector)
Returns the largest Topology sector corresponding to a Region sector. |
private void |
initialize()
Initializes the topology. |
private void |
joinDistributions(Topology topology1,
Topology topology2)
Builds a new topology as the sum of two existing topologies. |
java.lang.String |
toString()
Returns a string representation of this object. |
java.lang.String |
toString(boolean list_cells)
Returns a string representation of this object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int NUM_CELL_SUBDIVISIONS
private static final float CELL_BASE
private int GENERATION_BASE
public static final int NUM_RINGS
public static final int NUM_SECTORS
public static final float DEFAULT_DECAY_RATE
private float[][] m_generation_count
private float m_max_generation_count
private java.util.ArrayList m_cell_list
private Region m_region
| Constructor Detail |
protected Topology(Region parent_region,
float decay_rate)
parent_region - - the region this topology is associated withdecay_rate - - the decay rate of the distribution curve: 0=uniform, 1=concave, 2+=bell (larger produces a wider
bell), negative=bimodal
protected Topology(Region parent_region,
Topology topology1,
Topology topology2)
parent_region - - the region this topology is associated withtopology1 - - the topology of the first region contributing to the jointopology2 - - the topology of the second region contributing to the join| Method Detail |
private void createDistribution(float decay_rate)
decay_rate - - the decay rate of the distribution curve, as defined in the constructorTopology(Geometry.Region, Geometry.Topology, Geometry.Topology)
private void createToroidDistribution(int sector_start,
int sector_end,
int sector_center,
int ring_start,
int ring_end,
int ring_center,
float decay_rate)
The distribution is based on the following equation (formatted for GnuPlot):
plot [0:1] 100**-x**decay_rate * GENERATION_BASE + 1
sector_start - - the start sectorsector_end - - the end sectorsector_center - - the best-fitting center sectorring_start - - the start ringring_end - - the end ringring_center - - the best-fitting center ringdecay_rate - - the decay rate of the distribution curve, as defined in the constructorTopology(Geometry.Region, Geometry.Topology, Geometry.Topology)
private void createWedgeDistribution(int sector_start,
int sector_end,
int sector_center,
int ring_start,
int ring_end,
int ring_center,
float decay_rate)
The distribution is based on the following equation (formatted for GnuPlot):
plot [0:1] 100**-x**decay_rate * GENERATION_BASE + 1
sector_start - - the start sectorsector_end - - the end sectorsector_center - - the best-fitting center sectorring_start - - the start ringring_end - - the end ringring_center - - the best-fitting center ringdecay_rate - - the decay rate of the distribution curve, as defined in the constructorTopology(Geometry.Region, Geometry.Topology, Geometry.Topology)public void dumpActualDistribution(int sample_size)
This is for development use only.
sample_size - - the sample sizepublic void dumpPredictedDistribution(boolean is_histogram_otherwise_gnuplot)
This is for development use only.
protected float getGenerationCount(int ring,
int sector)
ring - - the ringsector - - the sector
public static int getNextSector(int sector)
sector - - the sector
public static int getPreviousSector(int sector)
sector - - the sector
private void generateRandomList()
public java.util.ArrayList getCellMesh(int geometry_ring,
int geometry_sector)
geometry_ring - - the region ringgeometry_sector - - the region sector
RegionCoordinatepublic RegionCoordinate getRandomCoordinate()
public int getRandomPoolSize()
public static float getRegionRing(int topology_ring)
topology_ring - - the topology ring
public static float getRegionSector(int topology_sector)
topology_sector - - the topology sector
public static int getTopologyRingLowerBound(int region_ring)
region_ring - - the region ring
public static int getTopologyRingUpperBound(int region_ring)
region_ring - - the region ring
public static int getTopologySectorLowerBound(int region_sector)
public static int getTopologySectorUpperBound(int region_sector)
private void initialize()
private void joinDistributions(Topology topology1,
Topology topology2)
topology1 - - the topology of the first region contributing to the jointopology2 - - the topology of the second region contributing to the joinpublic java.lang.String toString()
toString in class java.lang.ObjectSupport.toPrettyString(java.lang.String),
toString(boolean)public java.lang.String toString(boolean list_cells)
list_cells - - whether the contents of each cell should be listed
Support.toPrettyString(java.lang.String)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||