diff --git a/src/main/java/fr/nabil/Main.java b/src/main/java/fr/nabil/Main.java index 149786c..b0ec413 100644 --- a/src/main/java/fr/nabil/Main.java +++ b/src/main/java/fr/nabil/Main.java @@ -29,8 +29,6 @@ public class Main { vrps.add(FileReader.readFile(p.toUri())); }); } - - System.out.println(vrps.getFirst().toString()); } } diff --git a/src/main/java/fr/nabil/data/Node.java b/src/main/java/fr/nabil/data/Node.java new file mode 100644 index 0000000..f221514 --- /dev/null +++ b/src/main/java/fr/nabil/data/Node.java @@ -0,0 +1,62 @@ +package fr.nabil.data; + +public class Node { + + private int id; // Site number + private int routeNumber; // Route as a whole and not as an arc + + private Node previousNode; + private Node nextNode; + private int demand; + + public Node(int id, int routeNumber, int demand, Node previousNode, Node nextNode) { + this.id = id; + this.routeNumber = routeNumber; + this.demand = demand; + this.previousNode = previousNode; + this.nextNode = nextNode; + } + + public Node(int id, int demand) { + this.id = id; + this.demand = demand; + } + + public void setAll(Node previousNode, Node nextNode, int routeNumber, int demand) { + this.previousNode = previousNode; + this.nextNode = nextNode; + this.routeNumber = routeNumber; + } + + public int getId() { + return id; + } + + public int getDemand() { + return demand; + } + + public int getRouteNumber() { + return routeNumber; + } + + public void setRouteNumber(int routeNumber) { + this.routeNumber = routeNumber; + } + + public Node getNextNode() { + return nextNode; + } + + public Node getPreviousNode() { + return previousNode; + } + + public void setNextNode(Node nextNode) { + this.nextNode = nextNode; + } + + public void setPreviousNode(Node previousNode) { + this.previousNode = previousNode; + } +}