Module: Roby::TaskStructure::ModelLevelExecutionAgent
- Defined in:
- lib/roby/relations/executed_by.rb
Overview
This module defines model-level definition of execution agent, for instance to Roby::Task
Instance Method Summary collapse
-
#executed_by(agent) ⇒ Object
Defines a model of execution agent.
-
#execution_agent ⇒ Object
The model of execution agent for this class.
Instance Method Details
#executed_by(agent) ⇒ Object
Defines a model of execution agent. Doing
TaskModel.executed_by ExecutionAgentModel
is equivalent to
task = TaskModel.new
exec = <find a suitable ExecutionAgentModel instance in the plan or
create a new one>
task.executed_by exec
for all instances of TaskModel. The actual job is done in the ExecutionAgentSpawn module
30 31 32 |
# File 'lib/roby/relations/executed_by.rb', line 30 def executed_by(agent) @execution_agent = agent end |
#execution_agent ⇒ Object
The model of execution agent for this class
8 9 10 11 12 13 14 15 |
# File 'lib/roby/relations/executed_by.rb', line 8 def execution_agent for klass in ancestors if klass.instance_variable_defined?(:@execution_agent) return klass.instance_variable_get(:@execution_agent) end end nil end |