Class: CycleDetector::DKWonMLPrintStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/kwala/lib/cycle_detector.rb

Instance Method Summary collapse

Constructor Details

#initializeDKWonMLPrintStrategy

Returns a new instance of DKWonMLPrintStrategy.



550
551
552
553
554
555
# File 'lib/kwala/lib/cycle_detector.rb', line 550

def initialize
  @visited = Hash.new(false)
  @edges = []
  @nodeid = Hash.new
  @cid = 0
end

Instance Method Details



569
570
571
572
573
574
575
576
577
578
579
# File 'lib/kwala/lib/cycle_detector.rb', line 569

def print_cycles(cycles)
  print_ml_wrapper do
    if cycles.size > 0

      cycles.each do |path|
        puts "Nothing"
      end

    end
  end
end


557
558
559
560
561
562
563
564
565
566
567
# File 'lib/kwala/lib/cycle_detector.rb', line 557

def print_graph(graph)
  print_ml_wrapper do

    noedge, edge = graph.sort.partition { |k,v| v.edges.empty? }

    (edge + noedge).each do |k, v|
      print_node(v)
    end
    
  end
end