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.
108 109 110 111 112 113 114 115 116 117 |
# File 'lib/sfpagent/sfplanner.rb', line 108 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.
94 95 96 |
# File 'lib/sfpagent/sfplanner.rb', line 94 def dependencies @dependencies end |
#goal ⇒ Object
Returns the value of attribute goal.
94 95 96 |
# File 'lib/sfpagent/sfplanner.rb', line 94 def goal @goal end |
#init ⇒ Object
Returns the value of attribute init.
94 95 96 |
# File 'lib/sfpagent/sfplanner.rb', line 94 def init @init end |
#joints ⇒ Object
Returns the value of attribute joints.
94 95 96 |
# File 'lib/sfpagent/sfplanner.rb', line 94 def joints @joints end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
93 94 95 |
# File 'lib/sfpagent/sfplanner.rb', line 93 def name @name end |
#sym ⇒ Object (readonly)
Returns the value of attribute sym.
93 94 95 |
# File 'lib/sfpagent/sfplanner.rb', line 93 def sym @sym end |
Class Method Details
.read(i, lines) ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/sfpagent/sfplanner.rb', line 96 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
119 |
# File 'lib/sfpagent/sfplanner.rb', line 119 alias :super_to_s :to_s |
#to_s ⇒ Object
120 121 122 |
# File 'lib/sfpagent/sfplanner.rb', line 120 def to_s @name + " " + super_to_s end |