MATSIM
InitialNode.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * InitialNode.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2013 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;
22 
24 
31 public class InitialNode {
32  //cant make final, extended by OneToManyPathSearch.ToNode
33  //need a decision. Amit Sep'17
34 
35  public Node node;
36  // additional travel disutility related to visiting this node
37  public final double initialCost;
38  // additional travel time related to visiting this node
39  public final double initialTime;
40 
41  public InitialNode(final Node node, final double initialCost, final double initialTime) {
42  this.node = node;
43  this.initialCost = initialCost;
44  this.initialTime = initialTime;
45  }
46 
47  // allowing node as null; many duplicates of InitialNode does not require node thus removing such duplicate classes by setting node as null. Amit Sep'17
48  public InitialNode(final double initialCost, final double initialTime) {
49  this(null, initialCost, initialTime);
50  }
51 
52  @Override
53  public String toString() {
54  if (node == null) {
55  return "[id=" + " null " + "]" +
56  "[initialCost=" + this.initialCost + "]" +
57  "[initialTime=" + this.initialTime + "]";
58  } else {
59  return "[id=" + this.node.getId() + "]" +
60  "[initialCost=" + this.initialCost + "]" +
61  "[initialTime=" + this.initialTime + "]";
62  }
63 
64  }
65 }
InitialNode(final Node node, final double initialCost, final double initialTime)
InitialNode(final double initialCost, final double initialTime)