Class: Roby::Coordination::Models::FaultHandler::ResponseLocationVisitor
- Inherits:
-
RGL::DFSVisitor
- Object
- RGL::DFSVisitor
- Roby::Coordination::Models::FaultHandler::ResponseLocationVisitor
- Defined in:
- lib/roby/coordination/models/fault_handler.rb
Instance Attribute Summary collapse
-
#predicate ⇒ Object
readonly
Returns the value of attribute predicate.
-
#selected ⇒ Object
readonly
Returns the value of attribute selected.
Instance Method Summary collapse
- #follow_edge?(u, v) ⇒ Boolean
- #handle_examine_vertex(u) ⇒ Object
-
#initialize(graph, predicate) ⇒ ResponseLocationVisitor
constructor
A new instance of ResponseLocationVisitor.
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
#predicate ⇒ Object (readonly)
Returns the value of attribute predicate.
148 149 150 |
# File 'lib/roby/coordination/models/fault_handler.rb', line 148 def predicate @predicate end |
#selected ⇒ Object (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
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 |