Class: Roby::EventStructure::TemporalConstraintSet
- Inherits:
-
DisjointIntervalSet
- Object
- DisjointIntervalSet
- Roby::EventStructure::TemporalConstraintSet
- Defined in:
- lib/roby/event_structure/temporal_constraints.rb
Instance Attribute Summary collapse
-
#occurence_constraints ⇒ Object
readonly
Returns the value of attribute occurence_constraints.
Attributes inherited from DisjointIntervalSet
Instance Method Summary collapse
- #add_occurence_constraint(min, max, recurrent) ⇒ Object
-
#initialize ⇒ TemporalConstraintSet
constructor
A new instance of TemporalConstraintSet.
Methods inherited from DisjointIntervalSet
Constructor Details
#initialize ⇒ TemporalConstraintSet
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_constraints ⇒ Object (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 |