|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjist.swans.field.Spatial
jist.swans.field.Spatial.Grid
public static class Spatial.Grid
Grid-based binning.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class jist.swans.field.Spatial |
---|
Spatial.Grid, Spatial.HierGrid, Spatial.LinearList, Spatial.SpatialTransmitVisitor, Spatial.SpatialVisitor, Spatial.TiledWraparound |
Field Summary | |
---|---|
private Spatial.LinearList[][] |
bins
grid of sub-bins. |
private float |
di
bin dimensions. |
private float |
dj
bin dimensions. |
Fields inherited from class jist.swans.field.Spatial |
---|
bl, br, size, tl, tr |
Constructor Summary | |
---|---|
Spatial.Grid(Location tr,
int divisions)
Create a new grid bin. |
|
Spatial.Grid(Location bl,
Location tr,
int divisions)
Create a new grid bin. |
|
Spatial.Grid(Location bl,
Location br,
Location tl,
Location tr,
int divisions)
Create a new grid bin. |
Method Summary | |
---|---|
void |
add(Field.RadioData radioData)
Add a radio to bin. |
void |
del(Field.RadioData radioData)
Delete a radio from bin. |
private Spatial.LinearList |
getBin(Location l)
Return grid sub-bin. |
private int |
getBinI(Location l)
Return grid bin x-coordinate. |
private int |
getBinJ(Location l)
Return grid bin y-coordinate. |
Field.RadioData |
move(Field.RadioData radioData,
Location newLoc)
Update a radio location. |
int |
visit(Spatial.SpatialVisitor visitor)
Visit radios in bin. |
private int |
visitBin(Spatial.SpatialTransmitVisitor visitor,
RadioInfo srcInfo,
Location srcLoc,
Message msg,
java.lang.Long durationObj,
double limit,
int di,
int dj)
Helper method to visit a sub-bin within grid. |
int |
visitTransmit(Spatial.SpatialTransmitVisitor visitor,
RadioInfo srcInfo,
Location srcLoc,
Message msg,
java.lang.Long durationObj,
double limit)
Visit radios in bin with transmission visitor. |
Methods inherited from class jist.swans.field.Spatial |
---|
area, getBottomLeft, getNearest, getSize, getTopRight, moveInside |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Spatial.LinearList[][] bins
private float di
private float dj
Constructor Detail |
---|
public Spatial.Grid(Location tr, int divisions)
tr
- top-right corner locationdivisions
- grid divisionspublic Spatial.Grid(Location bl, Location tr, int divisions)
bl
- bottom-left corner locationtr
- top-right corner locationdivisions
- grid divisionspublic Spatial.Grid(Location bl, Location br, Location tl, Location tr, int divisions)
bl
- bottom-left corner locationbr
- bottom-right corner locationtl
- top-left corner locationtr
- top-right corner locationdivisions
- grid divisionsMethod Detail |
---|
private int getBinI(Location l)
l
- spatial location desired
private int getBinJ(Location l)
l
- spatial location desired
private Spatial.LinearList getBin(Location l)
l
- spatial location desired
public void add(Field.RadioData radioData)
add
in class Spatial
radioData
- radio information (location inside bin limits)public void del(Field.RadioData radioData)
del
in class Spatial
radioData
- radio information (location inside bin limits)public Field.RadioData move(Field.RadioData radioData, Location newLoc)
move
in class Spatial
radioData
- radio informationnewLoc
- destination of move
public int visitTransmit(Spatial.SpatialTransmitVisitor visitor, RadioInfo srcInfo, Location srcLoc, Message msg, java.lang.Long durationObj, double limit)
visitTransmit
in class Spatial
visitor
- transmission visitor objectsrcInfo
- transmission source radiosrcLoc
- transmission source locationmsg
- message to transmitdurationObj
- transmission durationlimit
- propagation limit
private int visitBin(Spatial.SpatialTransmitVisitor visitor, RadioInfo srcInfo, Location srcLoc, Message msg, java.lang.Long durationObj, double limit, int di, int dj)
visitor
- visitor objectsrcInfo
- source radio informationsrcLoc
- source locationmsg
- message to transmitdurationObj
- duration of message transmissionlimit
- propagation limitdi
- grid x-coordinatedj
- grid y-coordinate
public int visit(Spatial.SpatialVisitor visitor)
visit
in class Spatial
visitor
- visitor object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |