|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcalculation.Graph
public class Graph
This class presents the net of vertices.
Field Summary | |
---|---|
private Vertex |
airportVertex
Vertex acting as airport. |
private java.util.ArrayList[] |
arcpoints
Mergepoint candidates, that is arc points. |
private double |
cornerlat
Variables for the corner of the map. |
private double |
cornerlon
Variables for the corner of the map. |
private DataCollection |
dataCollection
reference to dataCollection interface. |
private double |
end
Arc point sector end angle. |
private Vertex[][] |
graph
graph matrix has a point (0,0) at left bottom corner. |
private WeatherMap |
map
Address of the WeatherMap class. |
(package private) static int |
MAP_HEIGHT
graph height. |
(package private) static int |
MAP_WIDTH
graph width. |
private int[][] |
mapMatrix
Address of the weather matrix. |
private Vertex |
nullVertex
Vertex to be null. |
private Parameters |
param
reference to Parameters class. |
private int |
safety
Safety zone distance for storms (how many graph nodes). |
(package private) static int |
SCALE
matrix scale to graph. |
private double |
start
Arc point sector start angle. |
private double |
startPointCount
Number of start points for planes. |
(package private) static int |
STORM
The storm limit of the weather matrix. |
Constructor Summary | |
---|---|
Graph(DataCollection data,
int width,
int height)
This is the constructor for the graph. |
|
Graph(Vertex[][] gRaph)
a Constructor for testing purposes only. |
Method Summary | |
---|---|
void |
calculateArcPoints(double start,
double end,
double startPointCount)
Set merge points. |
boolean |
checkSquare(int size,
int x,
int y,
int[][] matrix)
Checks a certain size square in a two dimensional matrix, if it has a value larger than something (STORM). |
Vertex[][] |
createGraph(int width,
int height)
A graph creation method. |
Vertex |
getAirport()
Return Airport vertex. |
java.util.ArrayList<Vertex>[] |
getArcPoints()
Return ArcPoints. |
Vertex[][] |
getGraph()
Returns the current graph. |
java.util.ArrayList<Vertex> |
getOuterArc()
Returns ArcPoints of outermost arc. |
boolean |
graphUpdate(int scale,
int[][] matrix,
Vertex[][] graph,
int safety)
This method updates the graph, by the weatherdata included in the matrix. |
void |
printgraph()
Ascii presentation of the graph! |
boolean |
resetGraph(Vertex[][] net)
Resets the graph. |
void |
setArcPoints(java.util.ArrayList[] arcPoints)
a Method to set self defined arc points for testing. |
void |
setSafezone(boolean state,
Vertex node,
int width)
This method sets nodes around a storm not available, thus setting an unavailable perimeter around the bad weather. |
void |
testCalculateArcPoints(double start,
double end,
double num)
Public method to test private method calculateArcPoints(). |
boolean |
update()
The update method for Graph class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Vertex airportVertex
private java.util.ArrayList[] arcpoints
private double cornerlat
private double cornerlon
private DataCollection dataCollection
private double end
private Vertex[][] graph
private WeatherMap map
static final int MAP_HEIGHT
static final int MAP_WIDTH
private int[][] mapMatrix
private Vertex nullVertex
private Parameters param
private int safety
static final int SCALE
private double start
private double startPointCount
static final int STORM
Constructor Detail |
---|
public Graph(DataCollection data, int width, int height)
data
- the DataCollection address as as parameter.width
- is the weather matrix width.height
- is the weather matrix height.public Graph(Vertex[][] gRaph)
gRaph
- Self made graph to class.Method Detail |
---|
public void calculateArcPoints(double start, double end, double startPointCount)
start
- start angle of arrival tree sector.end
- angle of arrival tree sector.startPointCount
- number of startpoints in the secotr.public boolean checkSquare(int size, int x, int y, int[][] matrix)
size
- the size of the square to checkx
- coordinate in the matrixy
- coordinate in the matrixmatrix
- a two dimensional matrix
public Vertex[][] createGraph(int width, int height)
width
- width of graph.height
- heigth of graph.
public Vertex getAirport()
public java.util.ArrayList<Vertex>[] getArcPoints()
public Vertex[][] getGraph()
public java.util.ArrayList<Vertex> getOuterArc()
public boolean graphUpdate(int scale, int[][] matrix, Vertex[][] graph, int safety)
scale
- The scale by which the map will be scaled to graph size.matrix
- a two dimensional matrix, holding the weather data.graph
- is the graph to update.safety
- safety border size to storms.
public void printgraph()
public boolean resetGraph(Vertex[][] net)
net
- The graph to reset.
public void setArcPoints(java.util.ArrayList[] arcPoints)
arcPoints
- An ArrayList[] of arc points to set.public void setSafezone(boolean state, Vertex node, int width)
state
- boolean value to set to node.node
- node to start fromwidth
- size of the unavailable zonepublic void testCalculateArcPoints(double start, double end, double num)
start
- start angle of arrival tree sector.end
- angle of arrival tree sector.num
- number of startpoints in the secotr.public boolean update()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |