Class ContractionHierarchyPrecomputation.ContractionTask

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    ContractionHierarchyPrecomputation<V,​E>

    private class ContractionHierarchyPrecomputation.ContractionTask
    extends java.lang.Object
    implements java.lang.Runnable
    Task that is used to perform computing of initial priorities, independent set and shortcuts, updating neighbours priorities and marking upward edges. To achieve good load balancing segment of vertices in vertices is divided into chunks using taskId.
    • Constructor Summary

      Constructors 
      Constructor Description
      ContractionTask​(int taskId)
      Constructs an instance of the task for the given taskId.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()  
      private int workerSegmentEnd​(int segmentStart, int segmentEnd)
      Computes end of the working chunk for this task.
      private int workerSegmentStart​(int segmentStart, int segmentEnd)
      Computes start of the working chunk for this task.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • taskId

        int taskId
        Id of this task.
      • segmentStart

        int segmentStart
        Start if the working segment in vertices inclusively.
      • segmentsEnd

        int segmentsEnd
        End if the working segment in vertices exclusively.
    • Constructor Detail

      • ContractionTask

        public ContractionTask​(int taskId)
        Constructs an instance of the task for the given taskId.
        Parameters:
        taskId - id of this task
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • workerSegmentStart

        private int workerSegmentStart​(int segmentStart,
                                       int segmentEnd)
        Computes start of the working chunk for this task.
        Parameters:
        segmentStart - working segment start
        segmentEnd - working segment end
        Returns:
        working chunk start
      • workerSegmentEnd

        private int workerSegmentEnd​(int segmentStart,
                                     int segmentEnd)
        Computes end of the working chunk for this task.
        Parameters:
        segmentStart - working segment start
        segmentEnd - working segment end
        Returns:
        working chunk end