Class: Roby::Test::RunPlanners::ActionPlanningHandler
- Defined in:
- lib/roby/test/run_planners.rb
Overview
Planning handler for #roby_run_planner that handles roby action tasks
Instance Method Summary collapse
-
#finished? ⇒ Boolean
Whether planning is finished for the given tasks.
-
#initialize(test) ⇒ ActionPlanningHandler
constructor
A new instance of ActionPlanningHandler.
-
#start(tasks) ⇒ Object
Start planning these tasks.
Constructor Details
#initialize(test) ⇒ ActionPlanningHandler
Returns a new instance of ActionPlanningHandler.
190 191 192 |
# File 'lib/roby/test/run_planners.rb', line 190 def initialize(test) @test = test end |
Instance Method Details
#finished? ⇒ Boolean
Whether planning is finished for the given tasks
This is called within a propagation context
205 206 207 |
# File 'lib/roby/test/run_planners.rb', line 205 def finished? @planning_tasks.all?(&:finished?) end |
#start(tasks) ⇒ Object
Start planning these tasks
This is called within a propagation context
195 196 197 198 199 200 201 202 |
# File 'lib/roby/test/run_planners.rb', line 195 def start(tasks) @planning_tasks = tasks.map do |planned_task| planning_task = planned_task.planning_task execution_engine = planning_task.execution_engine planning_task.start! unless execution_engine.scheduler.enabled? planning_task end end |