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

Attributes inherited from Relations::Graph

#observer, #parent, #subsets

Attributes inherited from Relations::BidirectionalDirectedAdjacencyGraph

#backward_edges, #forward_edges_with_info

Instance Method Summary collapse

Methods inherited from Relations::Graph

#add_edge, #add_relation, #copy_subgraph_to, #copy_to, #each_child_vertex, #each_parent_vertex, #find_edge_difference, #has_edge_in_hierarchy?, #include?, #inspect, #leaf_relation?, #link, #linked?, #linked_in_hierarchy?, #merge!, #merge_info, #recursive_subsets, #remove, #remove_relation, #remove_vertex!, #replace_vertex, #root_graph, #root_relation?, #set_edge_info, #size, #subset?, #superset_of, #to_s, #try_updating_existing_edge_info, #unlink

Methods included from DRoby::Identifiable

#droby_id, #initialize_copy

Methods included from DRoby::V5::DRobyConstant::Dump

#droby_dump, #droby_marshallable?

Methods inherited from Relations::BidirectionalDirectedAdjacencyGraph

#==, [], #add_edge, #add_vertex, #clear, #dedupe, #difference, #directed?, #each_edge, #each_in_neighbour, #each_out_neighbour, #each_vertex, #edge_info, #eql?, #freeze, #has_edge?, #has_vertex?, #hash, #in_degree, #in_neighbours, #initialize_copy, #leaf?, #merge, #move_edges, #num_edges, #num_vertices, #out_degree, #out_neighbours, #propagate_transitive_closure, #replace, #reverse, #reverse!, #root?, #same_structure?, #set_edge_info, #to_a, #verify_consistency, #vertices

Methods included from DRoby::V5::BidirectionalGraphDumper

#droby_dump

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