Instance class

An instance of data.

Example:

final a = Instance([0, 3], id: "A"),
  b = Instance([4, 5], id: "B");
print(a.distanceFrom(b));

Constructors

Instance({required List<num> location, required String id})

Properties

cluster Cluster?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id String
getter/setter pair
location List<num>
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

distanceFrom(Location that) num
Returns the distance, as defined by distanceMeasure, between this and that item.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reallocate(List<Cluster> clusters) → void
Associate this instance with the nearest cluster in clusters.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited