Skip to content
neta-r edited this page Dec 19, 2020 · 1 revision

NodeData

Implemets node_data and Comparable.

Data Structor & Fields:

  • An int key which represents the uniq key of the vertex.
  • An int tag to be used freely.
  • A GeoLocation loc which represents the geographical location of the vertex in the graph.
  • A String info to be used freely.
  • A double weight which represents the weight of the node.
  • A boolean isVis which represents whether or not the vertex has been visited in the Tarjan's algorithm.
  • A NodeData pred which represents predecessor (father) node.
  • A HashMap of Integer and node_data neighbors which represents the edged that are coming out of the vertex.
  • An ArrayList of Integer cToMe which represents the edged that are coming in the vertex.

Functions:

  • A regular constructor.
  • An override of the equals, hashCode and compareTo functions- allowing to compare to vertices based on their weight, location and list of neighbors. Will be used later on DWGraph_DS.
  • Getter and setters. to key , loc , weight , info , tag , isVis , pred

Inner Class:

GeoLocation

Implemets geo_location.

Data Structor & Fields:

  • A double x,y,z represents the location on a 3D graph.

Functions:

  • An override of the equals and hashCode functions- allowing to compare to locations based on their x,y,z.
  • Getter and setters. to x, y, z.
  • Distance which returns the distance between the currenct location anda given location.

Menu

Clone this wiki locally