Module org.jgrapht.core
Package org.jgrapht.alg.shortestpath
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) int
End if the working segment invertices
exclusively.(package private) int
Start if the working segment invertices
inclusively.(package private) int
Id of this task. -
Constructor Summary
ConstructorsConstructorDescriptionContractionTask
(int taskId) Constructs an instance of the task for the giventaskId
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.
-
Field Details
-
taskId
int taskIdId of this task. -
segmentStart
int segmentStartStart if the working segment invertices
inclusively. -
segmentsEnd
int segmentsEndEnd if the working segment invertices
exclusively. -
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
public void 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
-