Class DynamicGraphMinFixedPoint
java.lang.Object
net.minecraft.world.level.lighting.DynamicGraphMinFixedPoint
- Direct Known Subclasses:
ChunkTracker, SectionTracker
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.longs.Long2ByteMapprivate booleanprotected final intprivate static final intprivate final LeveledPriorityQueuestatic final long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDynamicGraphMinFixedPoint(int levelCount, int minQueueSize, int minMapSize) -
Method Summary
Modifier and TypeMethodDescriptionprivate intcalculatePriority(int level, int computedLevel) protected voidcheckEdge(long from, long to, int newLevelFrom, boolean onlyDecreased) private voidcheckEdge(long from, long to, int newLevelFrom, int levelTo, int oldComputedLevel, boolean onlyDecreased) protected final voidcheckNeighbor(long from, long to, int level, boolean onlyDecreased) protected abstract voidcheckNeighborsAfterUpdate(long node, int level, boolean onlyDecrease) protected voidcheckNode(long node) protected abstract intcomputeLevelFromNeighbor(long from, long to, int fromLevel) Returns level propagated from start position with specified level to the neighboring end position.protected abstract intgetComputedLevel(long node, long knownParent, int knownLevelFromParent) Computes level propagated from neighbors of specified position with given existing level, excluding the given source position.protected abstract intgetLevel(long node) intprotected final booleanhasWork()protected booleanisSource(long node) protected voidremoveFromQueue(long node) voidremoveIf(LongPredicate pred) protected final intrunUpdates(int count) protected abstract voidsetLevel(long node, int level)
-
Field Details
-
SOURCE
public static final long SOURCE- See Also:
-
NO_COMPUTED_LEVEL
private static final int NO_COMPUTED_LEVEL- See Also:
-
levelCount
protected final int levelCount -
priorityQueue
-
computedLevels
private final it.unimi.dsi.fastutil.longs.Long2ByteMap computedLevels -
hasWork
private volatile boolean hasWork
-
-
Constructor Details
-
DynamicGraphMinFixedPoint
protected DynamicGraphMinFixedPoint(int levelCount, int minQueueSize, int minMapSize)
-
-
Method Details
-
removeFromQueue
protected void removeFromQueue(long node) -
removeIf
-
calculatePriority
private int calculatePriority(int level, int computedLevel) -
checkNode
protected void checkNode(long node) -
checkEdge
protected void checkEdge(long from, long to, int newLevelFrom, boolean onlyDecreased) -
checkEdge
private void checkEdge(long from, long to, int newLevelFrom, int levelTo, int oldComputedLevel, boolean onlyDecreased) -
checkNeighbor
protected final void checkNeighbor(long from, long to, int level, boolean onlyDecreased) -
hasWork
protected final boolean hasWork() -
runUpdates
protected final int runUpdates(int count) -
getQueueSize
public int getQueueSize() -
isSource
protected boolean isSource(long node) -
getComputedLevel
protected abstract int getComputedLevel(long node, long knownParent, int knownLevelFromParent) Computes level propagated from neighbors of specified position with given existing level, excluding the given source position. -
checkNeighborsAfterUpdate
protected abstract void checkNeighborsAfterUpdate(long node, int level, boolean onlyDecrease) -
getLevel
protected abstract int getLevel(long node) -
setLevel
protected abstract void setLevel(long node, int level) -
computeLevelFromNeighbor
protected abstract int computeLevelFromNeighbor(long from, long to, int fromLevel) Returns level propagated from start position with specified level to the neighboring end position.
-