class FifthedSim::LessNode
Public Class Methods
new(lhs, rhs)
click to toggle source
# File lib/fifthed_sim/nodes/less_node.rb, line 8 def initialize(lhs, rhs) @lhs, @rhs = lhs, rhs end
Public Instance Methods
distribution()
click to toggle source
# File lib/fifthed_sim/nodes/less_node.rb, line 28 def distribution @lhs.distribution.convolve_least(@rhs.distribution) end
equation_representation()
click to toggle source
# File lib/fifthed_sim/nodes/less_node.rb, line 32 def equation_representation "min(#{@lhs.equation_representation}, #{@rhs.equation_representation})" end
expression_equation()
click to toggle source
# File lib/fifthed_sim/nodes/less_node.rb, line 42 def expression_equation "min(#{@lhs.expression_equation}, #{@rhs.expression_equation})" end
max()
click to toggle source
# File lib/fifthed_sim/nodes/less_node.rb, line 20 def max [@lhs.max, @rhs.max].min end
min()
click to toggle source
# File lib/fifthed_sim/nodes/less_node.rb, line 24 def min [@lhs.min, @rhs.min].min end
reroll()
click to toggle source
# File lib/fifthed_sim/nodes/less_node.rb, line 16 def reroll self.class.new(@lhs.reroll, @rhs.reroll) end
value()
click to toggle source
# File lib/fifthed_sim/nodes/less_node.rb, line 12 def value [@lhs.value, @rhs.value].min end
value_equation(terminal: false)
click to toggle source
# File lib/fifthed_sim/nodes/less_node.rb, line 36 def value_equation(terminal: false) lhs = @lhs.value_equation(terminal: terminal) rhs = @rhs.value_equation(terminal: terminal) "min(#{lhs}, #{rhs})" end