Struct Node

Struct Documentation

struct Node

struct node

Contains the x, y coordinates of the locationof the node, its id, its demand, and whether it has been added to the routes of any of the vehicles

Public Functions

Node(const int x = 0, const int y = 0, const int id = 0, const int demand = 0, const bool is_routed = true)

Consructor.

Constructor for a node

Return
no return parameter
Parameters
  • x: x coordinate
  • y: y coordinate
  • id: node id
  • demand: node demand
  • is_routed: has the node been included in a route

Public Members

int x_
int y_
int id_
int demand_
bool is_routed_

Friends

std::ostream &operator<<(std::ostream &os, const Node &node)

Overloads the << operator to print the data in the Node struct.

Return
ostream
Parameters
  • os: ostream to which the printing is to be done
  • node: node who’s status is to be printed