class FifthedSim::GreaterNode
Public Class Methods
new(lhs, rhs)
click to toggle source
# File lib/fifthed_sim/nodes/greater_node.rb, line 7 def initialize(lhs, rhs) @lhs, @rhs = lhs, rhs end
Public Instance Methods
distribution()
click to toggle source
# File lib/fifthed_sim/nodes/greater_node.rb, line 15 def distribution @lhs.distribution.convolve_greater(@rhs.distribution) end
expression_equation()
click to toggle source
# File lib/fifthed_sim/nodes/greater_node.rb, line 37 def expression_equation "max(#{lhs.expression_equation}, #{rhs.expression_equation})" end
max()
click to toggle source
# File lib/fifthed_sim/nodes/greater_node.rb, line 27 def max [@lhs.max, @rhs.max].max end
min()
click to toggle source
# File lib/fifthed_sim/nodes/greater_node.rb, line 23 def min [@lhs.min, @rhs.min].max end
reroll()
click to toggle source
# File lib/fifthed_sim/nodes/greater_node.rb, line 19 def reroll self.class.new(@lhs.reroll, @rhs.reroll) end
value()
click to toggle source
# File lib/fifthed_sim/nodes/greater_node.rb, line 11 def value [@lhs.value, @rhs.value].max end
value_equation(terminal: false)
click to toggle source
# File lib/fifthed_sim/nodes/greater_node.rb, line 31 def value_equation(terminal: false) lhs = @lhs.value_equation(terminal: terminal) rhs = @rhs.value_equation(terminal: terminal) "max(#{lhs}, #{rhs}" end