Class: Roby::Coordination::Models::FaultHandler::ResponseLocationVisitor

Inherits:
RGL::DFSVisitor
  • Object
show all
Defined in:
lib/roby/coordination/models/fault_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(graph, predicate) ⇒ ResponseLocationVisitor

Returns a new instance of ResponseLocationVisitor.



150
151
152
153
154
# File 'lib/roby/coordination/models/fault_handler.rb', line 150

def initialize(graph, predicate)
    super(graph)
    @predicate = predicate
    @selected = Set.new
end

Instance Attribute Details

#predicateObject (readonly)

Returns the value of attribute predicate.



148
149
150
# File 'lib/roby/coordination/models/fault_handler.rb', line 148

def predicate
  @predicate
end

#selectedObject (readonly)

Returns the value of attribute selected.



148
149
150
# File 'lib/roby/coordination/models/fault_handler.rb', line 148

def selected
  @selected
end

Instance Method Details

#follow_edge?(u, v) ⇒ Boolean

Returns:

  • (Boolean)


162
163
164
165
166
167
168
# File 'lib/roby/coordination/models/fault_handler.rb', line 162

def follow_edge?(u, v)
    if selected.include?(u)
        false
    else
        super
    end
end

#handle_examine_vertex(u) ⇒ Object



156
157
158
159
160
# File 'lib/roby/coordination/models/fault_handler.rb', line 156

def handle_examine_vertex(u)
    if predicate.call(u)
        selected << u
    end
end