Class: Roby::Plan::UsefulFreeEventVisitor

Inherits:
RGL::DFSVisitor
  • Object
show all
Defined in:
lib/roby/plan.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#stackObject (readonly)

Returns the value of attribute stack.



1343
1344
1345
# File 'lib/roby/plan.rb', line 1343

def stack
  @stack
end

#task_eventsObject (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_eventsObject (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

Returns:

  • (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

Returns:

  • (Boolean)


1352
1353
1354
# File 'lib/roby/plan.rb', line 1352

def useful?
    @useful
end