class Roby::EventStructure::TemporalConstraints

Public Instance Methods

check_structure(plan) click to toggle source

Check the temporal constraint structure

What it needs to do is check that events that should have been emitted had been. The emission of events outside of allowed intervals is already taken care of.

Optimize by keeping the list of of maximum bounds at which an event should be emitted.

# File lib/roby/event_structure/temporal_constraints.rb, line 600
def check_structure(plan)
    deadlines = plan.emission_deadlines

    # Now look for the timeouts
    errors = []
    deadlines.missed_deadlines(Time.now).
        each do |deadline, event, generator|
            errors << MissedDeadlineError.new(generator, event, deadline)
        end

    errors
end
merge_info(parent, child, opt1, opt2) click to toggle source

Returns the DisjointIntervalSet that represent the merge of the deadlines represented by opt1 and opt2

# File lib/roby/event_structure/temporal_constraints.rb, line 570
def merge_info(parent, child, opt1, opt2)
    result = TemporalConstraintSet.new
    if opt1.intervals.size > opt2.intervals.size
        result.intervals.concat(opt1.intervals)
        for i in opt2.intervals
            result.add(*i)
        end
    else
        result.intervals.concat(opt2.intervals)
        for i in opt1.intervals
            result.add(*i)
        end
    end

    result.occurence_constraints.merge!(opt1.occurence_constraints)
    opt2.occurence_constraints.each do |recurrent, spec|
        result.add_occurence_constraint(spec[0], spec[1], recurrent)
    end

    result
end