|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrescuecore.tools.mapgenerator.RescueMap
An internal representation of a city map used in Robocup Rescue simulation. This includes information on nodes, roads and buildings.
| Constructor Summary | |
RescueMap(int nodeCount,
int width,
int height)
Constructs new RescueMap. |
|
| Method Summary | |
void |
addBuilding(int[][] api,
int entrance,
int floors,
int type)
Adds a new building. |
void |
addNode()
Adds a node to the map. |
void |
align()
Finds the lowest x and y coordinates and aligns the map so these have value 1. |
int |
distance(int n1,
int n2)
Gets the Euclidean distance between two nodes. |
int[] |
edges(int[] bIds,
int[] rIds,
int n)
Get a list of edge IDs for a node. |
int |
getHeight()
Get the height of the map. |
int |
getInDegree(int node)
Gets the indegree of a node. |
int[] |
getNeighbours(int node)
Get a list of neighbours of a node. |
int |
getNodeCount()
Get the number of nodes in this map. |
int |
getOutDegree(int node)
Gets the outdegree of a node. |
int |
getRoad(int n1,
int n2)
Gets the size of the road between two nodes. |
int[][] |
getRoads()
Get a list of roads in the underlying graph. |
int[] |
getUnderlyingNeighbours(int node)
Get a list of neighbours of a node in the underlying graph. |
int |
getWidth()
Get the width of the map. |
int |
getX(int node)
Get the x coordinate of a node. |
int |
getY(int node)
Get the y coordinate of a node. |
boolean |
pathExists(int start,
int end)
Checks whether a path exists between two nodes. |
void |
setRoad(int a,
int b,
int size)
Add, remove or resize a road between two nodes. |
void |
setX(int node,
int x)
Set the x coordinate of the node. |
void |
setY(int node,
int y)
Set the y coordinate of the node. |
void |
toFile()
Writes this RescueMap to three files - road.bin, building.bin and node.bin. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RescueMap(int nodeCount,
int width,
int height)
nodeCount - The number of potential intersections.width - The approximate width of the map.height - The approximate height of the map.| Method Detail |
public void setX(int node,
int x)
node - The node to change.x - The new x value.
public void setY(int node,
int y)
node - The node to change.y - The new y value.
public void setRoad(int a,
int b,
int size)
a - The 'from' node.b - The 'to' node.size - The number of lanes.public int getNodeCount()
public int getX(int node)
node - The node to get info from.
public int getY(int node)
node - The node to get info from.
public int getWidth()
public int getHeight()
public int getInDegree(int node)
node - The node to get info from.
public int getOutDegree(int node)
node - The node to get info from.
public int getRoad(int n1,
int n2)
n1 - The 'from' node.n2 - The 'to' node.
public void addNode()
public void addBuilding(int[][] api,
int entrance,
int floors,
int type)
api - The apexes of the building.entrance - The entrance node.public int[][] getRoads()
public int[] getNeighbours(int node)
node - The node to get the neighbours of.
public int[] getUnderlyingNeighbours(int node)
node - The node to get the neighbours of.
public int[] edges(int[] bIds,
int[] rIds,
int n)
bIds - The IDs assigned to each building.rIds - The IDs assigned to each road.n - The node to find the edges of.
public void toFile()
throws java.io.IOException
java.io.IOException
public int distance(int n1,
int n2)
n1 - The first node.n2 - The second node.
public boolean pathExists(int start,
int end)
start - The node to start the path from.end - The node we wish to reach.
public void align()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||