Class ConvergenceDetector
Object
gudusoft.gsqlparser.resolver2.iterative.ConvergenceDetector
Detects when iterative resolution has converged.
Convergence is reached when one of these conditions is met: 1. No progress in current pass (no new columns resolved) 2. All columns are resolved 3. Maximum iterations reached 4. No change in last N passes (stable state) 5. Progress rate falls below threshold
The detector uses multiple strategies to avoid: - Infinite loops (max iterations) - Premature stopping (stable state detection) - Wasted iterations (progress rate threshold)
Example:
Pass 1: 10 columns resolved -> continue Pass 2: 5 columns resolved -> continue Pass 3: 2 columns resolved -> continue Pass 4: 0 columns resolved -> CONVERGED (no progress)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classResult of convergence check. -
Constructor Summary
ConstructorsConstructorDescriptionConvergenceDetector(int maxIterations, int stablePasses, double minProgressRate) -
Method Summary
Modifier and TypeMethodDescriptionCheck if resolution has converged.intGet the total number of passes so far.Get the pass history.Get statistics about the iteration process.voidrecordPass(ResolutionPass pass) Record a completed pass.
-
Constructor Details
-
ConvergenceDetector
public ConvergenceDetector() -
ConvergenceDetector
-
-
Method Details
-
recordPass
Record a completed pass.- Parameters:
pass- the completed pass
-
checkConvergence
Check if resolution has converged.- Returns:
- convergence result with reason
-
getPassCount
Get the total number of passes so far.- Returns:
- pass count
-
getPassHistory
Get the pass history.- Returns:
- list of all passes
-
getStatistics
Get statistics about the iteration process.- Returns:
- statistics summary
-