class Roby::Actions::Models::CoordinationAction

Action defined by a coordination model

Attributes

coordination_model[RW]

If this action is actually a coordination model, returns it

@return [nil,Coordination::Models::Base]

Public Class Methods

new(coordination_model, doc = nil) click to toggle source
Calls superclass method Roby::Actions::Models::Action#new
# File lib/roby/actions/models/coordination_action.rb, line 11
def initialize(coordination_model, doc = nil)
    super(doc)
    @coordination_model = coordination_model
end

Public Instance Methods

==(other) click to toggle source
# File lib/roby/actions/models/coordination_action.rb, line 21
def ==(other)
    other.kind_of?(self.class) &&
        other.coordination_model == coordination_model
end
action_interface_model() click to toggle source

The underlying action interface model

# File lib/roby/actions/models/coordination_action.rb, line 17
def action_interface_model
    coordination_model.action_interface
end
instanciate(plan, arguments = Hash.new) click to toggle source
# File lib/roby/actions/models/coordination_action.rb, line 36
def instanciate(plan, arguments = Hash.new)
    plan.add(root = coordination_model.task_model.new)
    coordination_model.new(root, arguments)
    root
end
plan_pattern(arguments = Hash.new) click to toggle source

Returns the plan pattern that will deploy this action on the plan

# File lib/roby/actions/models/coordination_action.rb, line 43
def plan_pattern(arguments = Hash.new)
    job_id, arguments = Kernel.filter_options arguments, :job_id

    planner = Roby::Actions::Task.new(
        Hash[action_model: self,
             action_arguments: arguments].merge(job_id))
    planner.planning_result_task
end
rebind(action_interface_model) click to toggle source

(see MethodAction#rebind)

# File lib/roby/actions/models/coordination_action.rb, line 27
def rebind(action_interface_model)
    rebound = dup
    if action_interface_model < self.action_interface_model
        rebound.coordination_model = coordination_model.
            rebind(action_interface_model)
    end
    rebound
end
to_s() click to toggle source
# File lib/roby/actions/models/coordination_action.rb, line 52
def to_s
    "#{action_interface_model.name}.#{name}[#{coordination_model}]"
end