Class: Amor::Objective
- Inherits:
-
Object
- Object
- Amor::Objective
- Defined in:
- lib/amor/objective.rb
Instance Attribute Summary collapse
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
Instance Method Summary collapse
-
#initialize(direction, expression) ⇒ Objective
constructor
A new instance of Objective.
- #lp_string ⇒ Object
Constructor Details
#initialize(direction, expression) ⇒ Objective
Returns a new instance of Objective.
6 7 8 9 |
# File 'lib/amor/objective.rb', line 6 def initialize(direction, expression) @direction = direction @expression = Expression.new(expression) end |
Instance Attribute Details
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
4 5 6 |
# File 'lib/amor/objective.rb', line 4 def direction @direction end |
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
4 5 6 |
# File 'lib/amor/objective.rb', line 4 def expression @expression end |
Instance Method Details
#lp_string ⇒ Object
11 12 13 14 |
# File 'lib/amor/objective.rb', line 11 def lp_string direction_string = (@direction == :maximize ? "Maximize" : "Minimize") "#{direction_string}\n obj: #{@expression.lp_string}" end |