Class: Roby::Executives::Simple

Inherits:
Object
  • Object
show all
Defined in:
lib/roby/executives/simple.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSimple

Returns a new instance of Simple.



5
6
7
8
9
10
# File 'lib/roby/executives/simple.rb', line 5

def initialize
		@query = Roby.plan.find_tasks.
 executable.
 pending.
 self_owned
end

Instance Attribute Details

#queryObject (readonly)

Returns the value of attribute query.



4
5
6
# File 'lib/roby/executives/simple.rb', line 4

def query
  @query
end

Instance Method Details

#initial_eventsObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/roby/executives/simple.rb', line 11

def initial_events
		query.reset.each do |task|
 next unless task.event(:start).root? && task.event(:start).controlable?
 root_task = task.enum_for(:each_relation).all? do |rel|
			if task.root?(rel)
  true
			elsif rel == TaskStructure::PlannedBy 
  task.planned_tasks.all? { |t| !t.executable? }
			end
 end

 if root_task
			task.start!
 end
		end
end