Class: Roby::Plan::UsefulFreeEventVisitor
- Defined in:
- lib/roby/plan.rb
Instance Attribute Summary collapse
-
#stack ⇒ Object
readonly
Returns the value of attribute stack.
-
#task_events ⇒ Object
readonly
Returns the value of attribute task_events.
-
#useful_free_events ⇒ Object
readonly
Returns the value of attribute useful_free_events.
Instance Method Summary collapse
- #follow_edge?(_u, v) ⇒ Boolean
- #handle_examine_edge(_u, v) ⇒ Object
-
#initialize(graph, task_events, permanent_events) ⇒ UsefulFreeEventVisitor
constructor
A new instance of UsefulFreeEventVisitor.
- #useful? ⇒ Boolean
Constructor Details
#initialize(graph, task_events, permanent_events) ⇒ UsefulFreeEventVisitor
Returns a new instance of UsefulFreeEventVisitor.
1345 1346 1347 1348 1349 1350 |
# File 'lib/roby/plan.rb', line 1345 def initialize(graph, task_events, permanent_events) super(graph) @task_events = task_events @useful_free_events = permanent_events.dup @useful = false end |
Instance Attribute Details
#stack ⇒ Object (readonly)
Returns the value of attribute stack.
1343 1344 1345 |
# File 'lib/roby/plan.rb', line 1343 def stack @stack end |
#task_events ⇒ Object (readonly)
Returns the value of attribute task_events.
1343 1344 1345 |
# File 'lib/roby/plan.rb', line 1343 def task_events @task_events end |
#useful_free_events ⇒ Object (readonly)
Returns the value of attribute useful_free_events.
1343 1344 1345 |
# File 'lib/roby/plan.rb', line 1343 def useful_free_events @useful_free_events end |
Instance Method Details
#follow_edge?(_u, v) ⇒ Boolean
1364 1365 1366 |
# File 'lib/roby/plan.rb', line 1364 def follow_edge?(_u, v) !task_events.include?(v) end |
#handle_examine_edge(_u, v) ⇒ Object
1356 1357 1358 1359 1360 1361 1362 |
# File 'lib/roby/plan.rb', line 1356 def handle_examine_edge(_u, v) if task_events.include?(v) || useful_free_events.include?(v) color_map[v] = :BLACK @useful = true end nil end |
#useful? ⇒ Boolean
1352 1353 1354 |
# File 'lib/roby/plan.rb', line 1352 def useful? @useful end |