Module org.jgrapht.core
Package org.jgrapht.alg.shortestpath
Class ContractionHierarchyPrecomputation.ContractionTask
- java.lang.Object
-
- org.jgrapht.alg.shortestpath.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 invertices
is divided into chunks usingtaskId
.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.function.Consumer<ContractionHierarchyPrecomputation.ContractionVertex<V>>
consumer
Performs needed action with vertices.(package private) int
segmentsEnd
End if the working segment invertices
exclusively.(package private) int
segmentStart
Start if the working segment invertices
inclusively.(package private) int
taskId
Id of this task.
-
Constructor Summary
Constructors Constructor Description ContractionTask(int taskId)
Constructs an instance of the task for the giventaskId
.
-
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.
-
-
-
Field Detail
-
taskId
int taskId
Id of this task.
-
segmentStart
int segmentStart
Start if the working segment invertices
inclusively.
-
segmentsEnd
int segmentsEnd
End if the working segment invertices
exclusively.
-
consumer
java.util.function.Consumer<ContractionHierarchyPrecomputation.ContractionVertex<V>> consumer
Performs needed action with vertices.
-
-
Method Detail
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
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
-
-