public class UniformGrid
extends java.lang.Object
DeltaIndividual
Modifier and Type | Method and Description |
---|---|
double |
collide(Block b,
java.util.List<Block> deltas,
java.util.List<PlacementFrame.PlacementNode> nodesToPlace,
double[] overlaps)
Gets the change in collision area for the delta-position of the delta-block.
|
double |
collide(int nodeId,
java.util.List<PlacementFrame.PlacementNode> nodesToPlace,
double[] overlaps)
Gets the collision area for the Block b with the previous nodes.
|
double |
collideCell(Block b,
java.util.List<Block> deltas,
java.util.List<PlacementFrame.PlacementNode> nodesToPlace,
double[] overlaps,
int x,
int y,
boolean oldBlock)
Gets the change in collision area for the delta-block in a single grid cell.
|
double |
collideCell(Block b,
java.util.List<PlacementFrame.PlacementNode> nodesToPlace,
double[] overlaps,
int x,
int y)
Gets the collision area for the Block b with the previous nodes.
|
void |
draw(java.awt.Graphics g,
double scale) |
int |
getCellX(double xPos) |
int |
getCellY(double yPos) |
java.util.LinkedList<java.lang.Integer> |
insert(int i,
double xPos,
double yPos)
Insert index for a PlacementNode.
|
void |
remove(int nodeIndex) |
public int getCellX(double xPos)
public int getCellY(double yPos)
public java.util.LinkedList<java.lang.Integer> insert(int i, double xPos, double yPos)
i
- index of the PlacementNode.xPos
- x-coordinate of the PlacementNode.yPos
- y-coordinate of the PlacementNode.public void remove(int nodeIndex)
public double collide(Block b, java.util.List<Block> deltas, java.util.List<PlacementFrame.PlacementNode> nodesToPlace, double[] overlaps)
b
- Delta-block whose overlap is to be updated.deltas
- List of all delta-blocks.nodesToPlace
- All PlacementNodes of the reference placement.overlaps
- Partial overlaps for potential diversity comparison in the evolution.public double collideCell(Block b, java.util.List<Block> deltas, java.util.List<PlacementFrame.PlacementNode> nodesToPlace, double[] overlaps, int x, int y, boolean oldBlock)
b
- Delta-block whose overlap is to be updated.deltas
- List of all delta-blocks.nodesToPlace
- All PlacementNodes of the reference placement.overlaps
- Partial overlaps for potential diversity comparison in the evolution.x
- x-coordinate of the grid cell to check for collisions.y
- y-coordinate of the grid cell.public double collide(int nodeId, java.util.List<PlacementFrame.PlacementNode> nodesToPlace, double[] overlaps)
nodesToPlace
- All PlacementNodes of the reference placement.overlaps
- Partial overlaps for potential diversity comparison in the evolution.public double collideCell(Block b, java.util.List<PlacementFrame.PlacementNode> nodesToPlace, double[] overlaps, int x, int y)
b
- The values of a PlacementNode, inserted into a block.nodesToPlace
- All PlacementNodes of the reference placement.overlaps
- Partial overlaps for potential diversity comparison in the evolution.x
- x-coordinate of the grid cell to check for collisions.y
- y-coordinate of the grid cell.public void draw(java.awt.Graphics g, double scale)