Method: RoadForest::SourceRigor::CredenceAnnealer#resolve

Defined in:
lib/roadforest/source-rigor/credence-annealer.rb

#resolve(&block) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/roadforest/source-rigor/credence-annealer.rb', line 12

def resolve(&block)
  attempts = @attempts

  @graph.force_impulse

  begin
    raise "Annealing failed after #@attempts attempts" if (attempts -= 1) < 0
    @graph.next_impulse
    block.call
  end until @graph.quiet_impulse?
end