synchronized Weight getMinimumStart ( ) { if ( calcMinStart == null ) { // Find the shortest distance from a start to time zero. Weight result = WeightFactory . NEG_INFINITY ; if ( shortestDistancesFromTimeZeroDestination == null ) { shortestDistancesFromTimeZeroDestination = BellmanFord . calcShortestDistances ( timeZero , directedGraph , BellmanFord . Mode . DESTINATION ) ; if ( shortestDistancesFromTimeZeroDestination == null ) { throw new IllegalStateException ( "Negative cycle detected!" ) ; } } for ( int i = 0 , n = intervals . size ( ) ; i < n ; i ++ ) { Object start = intervals . get ( i ) . getStart ( ) ; result = Weight . max ( result , ( Weight ) shortestDistancesFromTimeZeroDestination . get ( start ) ) ; } calcMinStart = result . invertSign ( ) ; } return calcMinStart ; }
Calculates and returns the minimum path from time zero to the start of an interval .