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
-
#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) ⇒ Branching
constructor
A new instance of Branching.
- #next_edge ⇒ Object
Constructor Details
#initialize(aVertex) ⇒ Branching
Returns a new instance of Branching.
50 51 52 53 54 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 50 def initialize(aVertex) super(aVertex) self.to_visit = aVertex.edges.dup self.visited = [] end |
Instance Attribute Details
#to_visit ⇒ Object
Returns the value of attribute to_visit
49 50 51 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 49 def to_visit @to_visit end |
#vertex ⇒ Object
Returns the value of attribute vertex
49 50 51 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 49 def vertex @vertex end |
#visited ⇒ Object
Returns the value of attribute visited
49 50 51 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 49 def visited @visited end |
Instance Method Details
#done? ⇒ Boolean
56 57 58 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 56 def done? to_visit.empty? end |
#next_edge ⇒ Object
60 61 62 63 64 65 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 60 def next_edge next_one = to_visit.shift visited << next_one.successor unless next_one.nil? return next_one end |