Class: Planner::Variable
- Inherits:
-
Array
- Object
- Array
- Planner::Variable
- Defined in:
- lib/sfpagent/sfplanner.rb
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
Returns the value of attribute dependencies.
-
#goal ⇒ Object
Returns the value of attribute goal.
-
#init ⇒ Object
Returns the value of attribute init.
-
#joints ⇒ Object
Returns the value of attribute joints.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#sym ⇒ Object
readonly
Returns the value of attribute sym.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, init = nil, goal = nil) ⇒ Variable
constructor
A new instance of Variable.
- #super_to_s ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, init = nil, goal = nil) ⇒ Variable
Returns a new instance of Variable.
106 107 108 109 110 111 112 113 114 115 |
# File 'lib/sfpagent/sfplanner.rb', line 106 def initialize(name, init=nil, goal=nil) @name = name @sym = @name.to_sym @values = [] @map = {} @init = init @goal = goal @joints = {} @dependencies = {} end |
Instance Attribute Details
#dependencies ⇒ Object
Returns the value of attribute dependencies.
92 93 94 |
# File 'lib/sfpagent/sfplanner.rb', line 92 def dependencies @dependencies end |
#goal ⇒ Object
Returns the value of attribute goal.
92 93 94 |
# File 'lib/sfpagent/sfplanner.rb', line 92 def goal @goal end |
#init ⇒ Object
Returns the value of attribute init.
92 93 94 |
# File 'lib/sfpagent/sfplanner.rb', line 92 def init @init end |
#joints ⇒ Object
Returns the value of attribute joints.
92 93 94 |
# File 'lib/sfpagent/sfplanner.rb', line 92 def joints @joints end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
91 92 93 |
# File 'lib/sfpagent/sfplanner.rb', line 91 def name @name end |
#sym ⇒ Object (readonly)
Returns the value of attribute sym.
91 92 93 |
# File 'lib/sfpagent/sfplanner.rb', line 91 def sym @sym end |
Class Method Details
.read(i, lines) ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/sfpagent/sfplanner.rb', line 94 def self.read(i, lines) var = Variable.new(lines[i+1]) i += 4 i.upto(lines.length) do |j| i = j break if lines[j] == 'end_variable' var << lines[j].to_sym end fail "Cannot find end_variable" if lines[i] != 'end_variable' [i, var] end |
Instance Method Details
#super_to_s ⇒ Object
117 |
# File 'lib/sfpagent/sfplanner.rb', line 117 alias :super_to_s :to_s |
#to_s ⇒ Object
118 119 120 |
# File 'lib/sfpagent/sfplanner.rb', line 118 def to_s @name + " " + super_to_s end |