Class: HG::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/zipf/hypergraph.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(label = nil, cat = nil, outgoing = [], incoming = [], score = nil) ⇒ Node

Returns a new instance of Node.



11
12
13
14
15
16
17
# File 'lib/zipf/hypergraph.rb', line 11

def initialize label=nil, cat=nil, outgoing=[], incoming=[], score=nil
  @label    = label
  @cat      = cat
  @outgoing = outgoing
  @incoming = incoming
  @score    = nil
end

Instance Attribute Details

#catObject

Returns the value of attribute cat.



9
10
11
# File 'lib/zipf/hypergraph.rb', line 9

def cat
  @cat
end

#incomingObject

Returns the value of attribute incoming.



9
10
11
# File 'lib/zipf/hypergraph.rb', line 9

def incoming
  @incoming
end

#labelObject

Returns the value of attribute label.



9
10
11
# File 'lib/zipf/hypergraph.rb', line 9

def label
  @label
end

#outgoingObject

Returns the value of attribute outgoing.



9
10
11
# File 'lib/zipf/hypergraph.rb', line 9

def outgoing
  @outgoing
end

#scoreObject

Returns the value of attribute score.



9
10
11
# File 'lib/zipf/hypergraph.rb', line 9

def score
  @score
end

Instance Method Details

#to_sObject



19
20
21
# File 'lib/zipf/hypergraph.rb', line 19

def to_s
  "Node<label:\"#{@label}\", cat:\"#{@cat}\", outgoing:#{@outgoing.size}, incoming:#{@incoming.size}>"
end