Class: Rley::GFG::GrmFlowGraph::Branching
- Inherits:
-
Struct
- Object
- Struct
- Rley::GFG::GrmFlowGraph::Branching
- Defined in:
- lib/rley/gfg/grm_flow_graph.rb
Instance Attribute Summary collapse
-
#in_edge ⇒ Object
Returns the value of attribute in_edge.
-
#to_visit ⇒ Object
Returns the value of attribute to_visit.
-
#vertex ⇒ Object
Returns the value of attribute vertex.
-
#visited ⇒ Object
Returns the value of attribute visited.
Instance Method Summary collapse
- #done? ⇒ Boolean
-
#initialize(aVertex, aCallEdge) ⇒ Branching
constructor
A new instance of Branching.
- #next_edge ⇒ Object
Constructor Details
#initialize(aVertex, aCallEdge) ⇒ Branching
Returns a new instance of Branching.
100 101 102 103 104 105 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 100 def initialize(aVertex, aCallEdge) super(aVertex) self.in_edge = aCallEdge self.to_visit = aVertex.edges.dup self.visited = [] end |
Instance Attribute Details
#in_edge ⇒ Object
Returns the value of attribute in_edge
99 100 101 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 99 def in_edge @in_edge end |
#to_visit ⇒ Object
Returns the value of attribute to_visit
99 100 101 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 99 def to_visit @to_visit end |
#vertex ⇒ Object
Returns the value of attribute vertex
99 100 101 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 99 def vertex @vertex end |
#visited ⇒ Object
Returns the value of attribute visited
99 100 101 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 99 def visited @visited end |
Instance Method Details
#done? ⇒ Boolean
107 108 109 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 107 def done? to_visit.empty? end |
#next_edge ⇒ Object
111 112 113 114 115 116 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 111 def next_edge next_one = to_visit.shift visited << next_one.successor unless next_one.nil? return next_one end |