Class ContractionHierarchyPrecomputation.ContractionTask
java.lang.Object
org.jgrapht.alg.shortestpath.ContractionHierarchyPrecomputation.ContractionTask
- All Implemented Interfaces:
Runnable
- Enclosing class:
ContractionHierarchyPrecomputation<V,E>
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.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Consumer<ContractionHierarchyPrecomputation.ContractionVertex<V>> Performs needed action with vertices.(package private) intEnd if the working segment inverticesexclusively.(package private) intStart if the working segment inverticesinclusively.(package private) intId of this task. -
Constructor Summary
ConstructorsConstructorDescriptionContractionTask(int taskId) Constructs an instance of the task for the giventaskId. -
Method Summary
Modifier and TypeMethodDescriptionvoidrun()private intworkerSegmentEnd(int segmentStart, int segmentEnd) Computes end of the working chunk for this task.private intworkerSegmentStart(int segmentStart, int segmentEnd) Computes start of the working chunk for this task.
-
Field Details
-
taskId
int taskIdId of this task. -
segmentStart
int segmentStartStart if the working segment inverticesinclusively. -
segmentsEnd
int segmentsEndEnd if the working segment inverticesexclusively. -
consumer
Performs needed action with vertices.
-
-
Constructor Details
-
ContractionTask
public ContractionTask(int taskId) Constructs an instance of the task for the giventaskId.- Parameters:
taskId- id of this task
-
-
Method Details
-
run
-
workerSegmentStart
private int workerSegmentStart(int segmentStart, int segmentEnd) Computes start of the working chunk for this task.- Parameters:
segmentStart- working segment startsegmentEnd- 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 startsegmentEnd- working segment end- Returns:
- working chunk end
-