Class: Roby::EventConstraints::UnboundTaskPredicate::Negate

Inherits:
Roby::EventConstraints::UnboundTaskPredicate show all
Defined in:
lib/roby/event_constraints.rb

Overview

Representation of predicates UnboundPredicateSupport#negate and UnboundTaskPredicate#negate

See documentation from UnboundTaskPredicate

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Roby::EventConstraints::UnboundTaskPredicate

#and, #compile, #evaluate, #negate, #or, #pretty_print, #to_unbound_task_predicate

Constructor Details

#initialize(pred) ⇒ Negate

Returns a new instance of Negate.



454
455
456
457
# File 'lib/roby/event_constraints.rb', line 454

def initialize(pred)
    @predicate = pred
    super()
end

Instance Attribute Details

#predicateObject (readonly)

Returns the value of attribute predicate.



452
453
454
# File 'lib/roby/event_constraints.rb', line 452

def predicate
  @predicate
end

Instance Method Details

#==(other) ⇒ Object



459
460
461
# File 'lib/roby/event_constraints.rb', line 459

def ==(other)
    other.kind_of?(Negate) && other.predicate == predicate
end

#codeObject



479
480
481
# File 'lib/roby/event_constraints.rb', line 479

def code
    "!(#{predicate.code})"
end

#explain_false(task) ⇒ Object



467
468
469
# File 'lib/roby/event_constraints.rb', line 467

def explain_false(task)
    predicate.explain_true(task)
end

#explain_static(task) ⇒ Object



471
472
473
# File 'lib/roby/event_constraints.rb', line 471

def explain_static(task)
    predicate.explain_static(task)
end

#explain_true(task) ⇒ Object



463
464
465
# File 'lib/roby/event_constraints.rb', line 463

def explain_true(task)
    predicate.explain_false(task)
end

#required_eventsObject



475
476
477
# File 'lib/roby/event_constraints.rb', line 475

def required_events
    predicate.required_events
end

#static?(task) ⇒ Boolean

Returns:

  • (Boolean)


483
484
485
# File 'lib/roby/event_constraints.rb', line 483

def static?(task)
    predicate.static?(task)
end

#to_sObject



487
488
489
# File 'lib/roby/event_constraints.rb', line 487

def to_s
    "!#{predicate}"
end