Class: Bio::AssemblyGraphAlgorithms::Dijkstra::DistancedOrientedNode
- Inherits:
-
Object
- Object
- Bio::AssemblyGraphAlgorithms::Dijkstra::DistancedOrientedNode
- Defined in:
- lib/assembly/dijkstra.rb
Overview
An oriented node some distance from the origin of exploration
Instance Attribute Summary collapse
-
#distance ⇒ Object
Returns the value of attribute distance.
-
#first_side ⇒ Object
Returns the value of attribute first_side.
-
#node ⇒ Object
Returns the value of attribute node.
Instance Method Summary collapse
- #inspect ⇒ Object (also: #to_s)
- #next_neighbours(graph) ⇒ Object
-
#second_side ⇒ Object
Which side of the node is not first?.
-
#to_settable ⇒ Object
Using Set object, often we want two separate objects to be considered equal even if they are distinct objects.
Instance Attribute Details
#distance ⇒ Object
Returns the value of attribute distance.
189 190 191 |
# File 'lib/assembly/dijkstra.rb', line 189 def distance @distance end |
#first_side ⇒ Object
Returns the value of attribute first_side.
189 190 191 |
# File 'lib/assembly/dijkstra.rb', line 189 def first_side @first_side end |
#node ⇒ Object
Returns the value of attribute node.
189 190 191 |
# File 'lib/assembly/dijkstra.rb', line 189 def node @node end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
211 212 213 |
# File 'lib/assembly/dijkstra.rb', line 211 def inspect "DistancedOrientedNode #{object_id}: node=#{@node.node_id} first=#{@first_side} distance=#{@distance}" end |
#next_neighbours(graph) ⇒ Object
204 205 206 207 208 209 |
# File 'lib/assembly/dijkstra.rb', line 204 def next_neighbours(graph) onode = Bio::Velvet::Graph::OrientedNodeTrail::OrientedNode.new onode.node = @node onode.first_side = @first_side return onode.next_neighbours(graph) end |
#second_side ⇒ Object
Which side of the node is not first?
198 199 200 201 202 |
# File 'lib/assembly/dijkstra.rb', line 198 def second_side @first_side == Bio::Velvet::Graph::OrientedNodeTrail::START_IS_FIRST ? Bio::Velvet::Graph::OrientedNodeTrail::END_IS_FIRST : Bio::Velvet::Graph::OrientedNodeTrail::START_IS_FIRST end |
#to_settable ⇒ Object
Using Set object, often we want two separate objects to be considered equal even if they are distinct objects
193 194 195 |
# File 'lib/assembly/dijkstra.rb', line 193 def to_settable [@node.node_id, @first_side] end |