class Roby::DecisionControl

Public Instance Methods

adding_plan_relation(transaction, parent, child, relations, info) click to toggle source

Called when a transaction/execution conflict occured, where relations have been added in the plan and are not present in the transaction.

The new relations are of types relations, between parent and child and with info as info object. The transaction has been invalidated prior to this call

The default action is to do nothing

# File lib/roby/decision_control.rb, line 42
def adding_plan_relation(transaction, parent, child, relations, info)
end
conflict(starting_task, running_tasks) click to toggle source

Called when there is a conflict between a set of running tasks and a task that should have been started. The default operation is to add an error about it

# File lib/roby/decision_control.rb, line 6
def conflict(starting_task, running_tasks)
    starting_task.failed_to_start! TaskStructure::ConflictError.new(starting_task, running_tasks)
end
execution_agent_failed_to_start(agent, tasks, reason = nil) click to toggle source

Called when an execution agent fails to start.

The default policy is to mark all executed tasks as failed to start

# File lib/roby/decision_control.rb, line 81
def execution_agent_failed_to_start(agent, tasks, reason = nil)
    tasks.each do |t|
        t.failed_to_start!(reason || agent.failure_reason || agent.terminal_event)
    end
end
finalized_plan_event(transaction, proxy) click to toggle source

Called when a transaction/execution conflict occured, where a task included in the transaction has been removed from the plan.

proxy is the transaction representation of the event which has been removed and transaction the transaction. The transaction has been invalidated prior to this call, and the event proxy has been removed from transaction.

The default action is to do nothing

# File lib/roby/decision_control.rb, line 31
def finalized_plan_event(transaction, proxy)
end
finalized_plan_task(transaction, proxy) click to toggle source

Called when a transaction/execution conflict occured, where a task included in the transaction has been removed from the plan.

proxy is the transaction's representation of the task which has been removed and transaction the transaction. The transaction has been invalidated prior to this call, and the task proxy has been removed from transaction.

The default action is to do nothing

# File lib/roby/decision_control.rb, line 19
def finalized_plan_task(transaction, proxy)
end
pending_dependency_failed(parent, child, reason) click to toggle source

Called when a child failed a dependency relation, but the parent is not running

It must return true if the dependency failure is considered an error, and false otherwise.

The default policy is to mark the parent as failed to start

# File lib/roby/decision_control.rb, line 64
def pending_dependency_failed(parent, child, reason)
    parent.failed_to_start!(reason)
    true
end
pending_executed_by_failed(agent, tasks) click to toggle source

Called when an execution agent fails to start.

The default policy is to mark all executed tasks as failed to start

# File lib/roby/decision_control.rb, line 72
def pending_executed_by_failed(agent, tasks)
    tasks.each do |t|
        t.failed_to_start!(agent.failure_reason || agent.terminal_event)
    end
end
removing_plan_relation(transaction, parent, child, relations) click to toggle source

Called when a transaction/execution conflict occured, where relations have been removed from the plan, which were present in the transaction.

The relations are of types relations, between parent and child and with info as info object. The transaction has been invalidated prior to this call

The default action is to do nothing

# File lib/roby/decision_control.rb, line 54
def removing_plan_relation(transaction, parent, child, relations)
end