11package org .opentripplanner .astar .model ;
22
3- import com .google .common .collect .HashMultiset ;
4- import com .google .common .collect .Multiset ;
53import java .util .ArrayList ;
64import java .util .Collection ;
75import java .util .Collections ;
1513import org .opentripplanner .astar .spi .AStarState ;
1614import org .opentripplanner .astar .spi .AStarVertex ;
1715import org .opentripplanner .astar .spi .DominanceFunction ;
18- import org .slf4j .Logger ;
19- import org .slf4j .LoggerFactory ;
2016
2117/**
2218 * This class keeps track which graph vertices have been visited and their associated states, so
@@ -40,15 +36,10 @@ public class ShortestPathTree<
4036 Vertex extends AStarVertex <State , Edge , Vertex >
4137> {
4238
43- private static final Logger LOG = LoggerFactory .getLogger (ShortestPathTree .class );
44-
4539 public final DominanceFunction <State > dominanceFunction ;
4640
4741 private final Map <Vertex , List <State >> stateSets ;
4842
49- /** Indicates that the search timed out or was otherwise aborted. */
50- private boolean aborted = false ;
51-
5243 public ShortestPathTree (DominanceFunction <State > dominanceFunction ) {
5344 this .dominanceFunction = dominanceFunction ;
5445 // Initialized with a reasonable size, see #4445
@@ -80,37 +71,6 @@ public GraphPath<State, Edge, Vertex> getPath(Vertex dest) {
8071 }
8172 }
8273
83- /** Print out a summary of the number of states and vertices. */
84- public void dump () {
85- Multiset <Integer > histogram = HashMultiset .create ();
86- int statesCount = 0 ;
87- int maxSize = 0 ;
88- for (Map .Entry <Vertex , List <State >> kv : stateSets .entrySet ()) {
89- List <State > states = kv .getValue ();
90- int size = states .size ();
91- histogram .add (size );
92- statesCount += size ;
93- if (size > maxSize ) {
94- maxSize = size ;
95- }
96- }
97- LOG .info (
98- "SPT: vertices: " +
99- stateSets .size () +
100- " states: total: " +
101- statesCount +
102- " per vertex max: " +
103- maxSize +
104- " avg: " +
105- ((statesCount * 1.0 ) / stateSets .size ())
106- );
107- List <Integer > nStates = new ArrayList <>(histogram .elementSet ());
108- Collections .sort (nStates );
109- for (Integer nState : nStates ) {
110- LOG .info ("{} states: {} vertices." , nState , histogram .count (nState ));
111- }
112- }
113-
11474 public Set <Vertex > getVertices () {
11575 return stateSets .keySet ();
11676 }
@@ -240,10 +200,6 @@ public Collection<State> getAllStates() {
240200 return allStates ;
241201 }
242202
243- public void setAborted () {
244- aborted = true ;
245- }
246-
247203 public String toString () {
248204 return "ShortestPathTree(" + this .stateSets .size () + " vertices)" ;
249205 }
0 commit comments