Class: DataMining::Point

Inherits:
Object
  • Object
show all
Defined in:
lib/data_mining/point.rb

Overview

Point class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, value) ⇒ Point

Represents a Point

Arguments:

id: (symbol)
value: (array)


12
13
14
15
16
17
# File 'lib/data_mining/point.rb', line 12

def initialize(id, value)
  @id             = id
  @value          = value
  @visited        = false
  @in_a_cluster   = false
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/data_mining/point.rb', line 4

def id
  @id
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/data_mining/point.rb', line 4

def value
  @value
end

Instance Method Details

#assign_to_cluster!Object



23
24
25
# File 'lib/data_mining/point.rb', line 23

def assign_to_cluster!
  @in_a_cluster = true
end

#assigned_to_cluster?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/data_mining/point.rb', line 19

def assigned_to_cluster?
  @in_a_cluster
end

#visit!Object



31
32
33
# File 'lib/data_mining/point.rb', line 31

def visit!
  @visited = true
end

#visited?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/data_mining/point.rb', line 27

def visited?
  @visited
end