Module: BehaviorTree::TreeStructure::Printer
- Included in:
- BehaviorTree::Tree
- Defined in:
- lib/behavior_tree/concerns/tree_structure/printer.rb
Overview
Algorithm to print tree.
Instance Method Summary collapse
Instance Method Details
#print ⇒ Object
9 10 11 |
# File 'lib/behavior_tree/concerns/tree_structure/printer.rb', line 9 def print puts to_s end |
#to_s ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/behavior_tree/concerns/tree_structure/printer.rb', line 13 def to_s lines = [] lines << '∅' # Style for the root node. lines += tree_lines lines << '' lines << cycle_string lines << uniq_nodes_string lines << size_string lines << tree_tick_count_string lines.join "\n" end |