MATSIM
DijkstraNodeData.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * DijkstraNodeData.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2011 by the members listed in the COPYING, *
8  * LICENSE and WARRANTY file. *
9  * email : info at matsim dot org *
10  * *
11  * *********************************************************************** *
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * See also COPYING, LICENSE and WARRANTY file *
18  * *
19  * *********************************************************************** */
20 
21 package org.matsim.core.router.util;
22 
24 
29 public class DijkstraNodeData implements NodeData {
30 
31  private Link prev = null;
32 
33  private double cost = 0;
34 
35  private double time = 0;
36 
37  private int iterationID = Integer.MIN_VALUE;
38 
39  @Override
40  public void resetVisited() {
41  this.iterationID = Integer.MIN_VALUE;
42  }
43 
44  @Override
45  public void visit(final Link comingFrom, final double cost, final double time,
46  final int iterID) {
47  this.prev = comingFrom;
48  this.cost = cost;
49  this.time = time;
50  this.iterationID = iterID;
51  }
52 
53  @Override
54  public boolean isVisited(final int iterID) {
55  return (iterID == this.iterationID);
56  }
57 
58  @Override
59  public double getCost() {
60  return this.cost;
61  }
62 
63  @Override
64  public double getTime() {
65  return this.time;
66  }
67 
68  @Override
69  public Link getPrevLink() {
70  return this.prev;
71  }
72 }
void visit(final Link comingFrom, final double cost, final double time, final int iterID)