Class: Roby::EventStructure::Precedence

Inherits:
Relations::EventRelationGraph show all
Defined in:
lib/roby/event_structure/precedence.rb

Overview

Graph class that holds the precedence information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(observer: nil, distribute: self.class.distribute?, dag: self.class.dag?, weak: self.class.weak?, strong: self.class.strong?, copy_on_replace: self.class.copy_on_replace?, noinfo: !self.class.embeds_info?,, subsets: Set.new) ⇒ Precedence

rubocop:disable Metrics/ParameterLists



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/roby/event_structure/precedence.rb', line 13

def initialize( # rubocop:disable Metrics/ParameterLists
    observer: nil,
    distribute: self.class.distribute?,
    dag: self.class.dag?,
    weak: self.class.weak?,
    strong: self.class.strong?,
    copy_on_replace: self.class.copy_on_replace?,
    noinfo: !self.class.embeds_info?,
    subsets: Set.new
)
    super(
        observer: observer,
        distribute: distribute,
        dag: dag,
        weak: weak,
        strong: strong,
        copy_on_replace: copy_on_replace,
        noinfo: noinfo,
        subsets: subsets
    )
    @incremental_transitive_closure =
        Relations::IncrementalTransitiveClosure.new
end

Instance Attribute Details

#incremental_transitive_closureObject (readonly)

Returns the value of attribute incremental_transitive_closure.



11
12
13
# File 'lib/roby/event_structure/precedence.rb', line 11

def incremental_transitive_closure
  @incremental_transitive_closure
end

Instance Method Details

#reachable?(source, target) ⇒ Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/roby/event_structure/precedence.rb', line 47

def reachable?(source, target)
    @incremental_transitive_closure.reachable?(source, target, self)
end

#remove_edge(source, target) ⇒ Object



37
38
39
40
# File 'lib/roby/event_structure/precedence.rb', line 37

def remove_edge(source, target)
    super(source, target)
    @incremental_transitive_closure.removed_edge(source, target)
end

#remove_vertex(object) ⇒ Object



42
43
44
45
# File 'lib/roby/event_structure/precedence.rb', line 42

def remove_vertex(object)
    super(object)
    @incremental_transitive_closure.removed_vertex(object)
end