Class: DataMining::Point
- Inherits:
-
Object
- Object
- DataMining::Point
- Defined in:
- lib/data_mining/point.rb
Overview
Point class
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #assign_to_cluster! ⇒ Object
- #assigned_to_cluster? ⇒ Boolean
-
#initialize(id, value) ⇒ Point
constructor
Represents a Point.
- #visit! ⇒ Object
- #visited? ⇒ Boolean
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
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/data_mining/point.rb', line 4 def id @id end |
#value ⇒ Object (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
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
27 28 29 |
# File 'lib/data_mining/point.rb', line 27 def visited? @visited end |