Class: Roby::EventStructure::TemporalConstraintSet

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

Instance Attribute Summary collapse

Attributes inherited from DisjointIntervalSet

#intervals

Instance Method Summary collapse

Methods inherited from DisjointIntervalSet

#add, #boundaries, #include?

Constructor Details

#initializeTemporalConstraintSet

Returns a new instance of TemporalConstraintSet.



215
216
217
218
219
220
221
222
# File 'lib/roby/event_structure/temporal_constraints.rb', line 215

def initialize
    super

    @occurence_constraints = {
        true => [0, Infinity],
        false => [0, Infinity]
    }
end

Instance Attribute Details

#occurence_constraintsObject (readonly)

Returns the value of attribute occurence_constraints.



213
214
215
# File 'lib/roby/event_structure/temporal_constraints.rb', line 213

def occurence_constraints
  @occurence_constraints
end

Instance Method Details

#add_occurence_constraint(min, max, recurrent) ⇒ Object



224
225
226
227
228
229
230
231
232
# File 'lib/roby/event_structure/temporal_constraints.rb', line 224

def add_occurence_constraint(min, max, recurrent)
    existing = occurence_constraints[!!recurrent]
    if existing[0] < min
        existing[0] = min
    end
    if existing[1] > max
        existing[1] = max
    end
end