Class: NoSE::Random::BarbasiAlbertNetwork

Inherits:
Network show all
Defined in:
lib/nose/random/barbasi_albert.rb

Overview

Generates a random graph using the Barbasi-Albert model

Instance Attribute Summary

Attributes inherited from Network

#entities

Instance Method Summary collapse

Methods inherited from Network

#inspect

Constructor Details

#initialize(params = {}) ⇒ BarbasiAlbertNetwork

Returns a new instance of BarbasiAlbertNetwork.



7
8
9
10
11
12
13
14
# File 'lib/nose/random/barbasi_albert.rb', line 7

def initialize(params = {})
  super params

  # We assume for now that m0 = m = 2

  create_entities
  add_foreign_keys
end