Exception: Roby::EventStructure::TemporalConstraintViolation

Inherits:
LocalizedError show all
Defined in:
lib/roby/event_structure/temporal_constraints.rb

Overview

Exception raised when an event gets emitted outside its specified temporal constraints

Instance Attribute Summary collapse

Attributes inherited from LocalizedError

#failed_event, #failed_generator, #failed_task, #failure_point

Attributes inherited from Roby::ExceptionBase

#original_exceptions

Instance Method Summary collapse

Methods inherited from LocalizedError

#fatal?, #involved_plan_object?, match, #propagated?, #to_execution_exception, to_execution_exception_matcher

Methods included from DRoby::V5::LocalizedErrorDumper

#droby_dump

Methods inherited from Roby::ExceptionBase

#each_original_exception, #report_exceptions_from

Methods included from DRoby::V5::ExceptionBaseDumper

#droby_dump

Methods included from DRoby::V5::Builtins::ExceptionDumper

#droby_dump

Constructor Details

#initialize(event, parent_generator, allowed_intervals) ⇒ TemporalConstraintViolation

Returns a new instance of TemporalConstraintViolation.



84
85
86
87
88
# File 'lib/roby/event_structure/temporal_constraints.rb', line 84

def initialize(event, parent_generator, allowed_intervals)
    super(event)
    @parent_generator = parent_generator
    @allowed_intervals = allowed_intervals.dup
end

Instance Attribute Details

#allowed_intervalsObject (readonly)

Returns the value of attribute allowed_intervals.



82
83
84
# File 'lib/roby/event_structure/temporal_constraints.rb', line 82

def allowed_intervals
  @allowed_intervals
end

#parent_generatorObject (readonly)

Returns the value of attribute parent_generator.



82
83
84
# File 'lib/roby/event_structure/temporal_constraints.rb', line 82

def parent_generator
  @parent_generator
end

Instance Method Details

#pretty_print(pp) ⇒ Object



90
91
92
93
94
95
96
97
98
# File 'lib/roby/event_structure/temporal_constraints.rb', line 90

def pretty_print(pp)
    pp.text "Got "
    failed_event.pretty_print(pp)
    pp.text "It breaks the temporal constraint(s) #{allowed_intervals.map { |min, max| "[#{min}, #{max}]" }.join(' | ')} from"
    pp.nest(2) do
        pp.breakable
        parent_generator.pretty_print(pp)
    end
end