Exception: Roby::EventStructure::OccurenceConstraintViolation

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, count, allowed_interval, since) ⇒ OccurenceConstraintViolation

Returns a new instance of OccurenceConstraintViolation.



106
107
108
109
110
111
112
# File 'lib/roby/event_structure/temporal_constraints.rb', line 106

def initialize(event, parent_generator, count, allowed_interval, since)
    super(event)
    @parent_generator = parent_generator
    @count = count
    @allowed_interval = allowed_interval
    @since = since
end

Instance Attribute Details

#allowed_intervalObject (readonly)

Returns the value of attribute allowed_interval.



104
105
106
# File 'lib/roby/event_structure/temporal_constraints.rb', line 104

def allowed_interval
  @allowed_interval
end

#countObject (readonly)

Returns the value of attribute count.



104
105
106
# File 'lib/roby/event_structure/temporal_constraints.rb', line 104

def count
  @count
end

#parent_generatorObject (readonly)

Returns the value of attribute parent_generator.



104
105
106
# File 'lib/roby/event_structure/temporal_constraints.rb', line 104

def parent_generator
  @parent_generator
end

#sinceObject (readonly)

Returns the value of attribute since.



104
105
106
# File 'lib/roby/event_structure/temporal_constraints.rb', line 104

def since
  @since
end

Instance Method Details

#pretty_print(pp) ⇒ Object



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/roby/event_structure/temporal_constraints.rb', line 114

def pretty_print(pp)
    pp.text "Got "
    failed_event.pretty_print(pp)
    pp.breakable
    pp.text "This does not satisfy the occurance constraint [#{allowed_interval[0]}, #{allowed_interval[1]}] from"
    pp.nest(2) do
        pp.breakable
        parent_generator.pretty_print(pp)
    end
    pp.breakable
    pp.text "which has been emitted #{count} times"
    if since
        pp.text " since #{since}"
    end
end