class ChaosDetector::ChaosGraphs::DomainNode

Attributes

root_node[R]

Public Class Methods

new(domain_name: nil, node_origin: nil, is_root: false, reduction: nil) click to toggle source
Calls superclass method ChaosDetector::GraphTheory::Node::new
# File lib/chaos_detector/chaos_graphs/domain_node.rb, line 8
def initialize(domain_name: nil, node_origin: nil, is_root: false, reduction: nil)
  super(name: domain_name, root: is_root, node_origin: node_origin, reduction: reduction)
end

Public Instance Methods

==(other) click to toggle source
# File lib/chaos_detector/chaos_graphs/domain_node.rb, line 20
def ==(other)
  domain_name&.to_s == other&.domain_name&.to_s
end
eql?(other) click to toggle source
# File lib/chaos_detector/chaos_graphs/domain_node.rb, line 16
def eql?(other)
  self == other
end
graph_props() click to toggle source
# File lib/chaos_detector/chaos_graphs/domain_node.rb, line 32
def graph_props
  props = super
  if reduction
    props.merge!(
      cardinality_modules: reduction.reduction_count,
      cardinality_functions: reduction.reduction_sum
    )
  end
  super.merge(props)
end
hash() click to toggle source
# File lib/chaos_detector/chaos_graphs/domain_node.rb, line 12
def hash
  domain_name.hash
end
subtitle() click to toggle source
# File lib/chaos_detector/chaos_graphs/domain_node.rb, line 28
def subtitle
  root? ? 'Root Node' : ''
end
title() click to toggle source
Calls superclass method ChaosDetector::GraphTheory::Node#title
# File lib/chaos_detector/chaos_graphs/domain_node.rb, line 24
def title
  super
end
to_s() click to toggle source

Must be name/domain_name for comparisons:

# File lib/chaos_detector/chaos_graphs/domain_node.rb, line 44
def to_s
  domain_name
end