# Module dc_centroids

- Description
- Data Types
- Function Index
- Function Details

Centroids data structure for dc_clustering.

Copyright © 2012 Zuse Institute Berlin

Version: $Id$

Authors: Magnus Mueller (`mamuelle@informatik.hu-berlin.de`).

References

- T. Schuett, A. Reinefeld,F. Schintke, M. Hoffmann. Gossip-based Topology Inference for Efficient Overlay Mapping on Data Centers. 9th Int. Conf. on Peer-to-Peer Computing Seattle, Sept. 2009.

## Description

Centroids data structure for dc_clustering.

## Data Types

### centroid()

    centroid() =
        #centroid{coordinate = coordinate(),
                  relative_size = relative_size()}

### centroids()

    centroids() = [centroid()]

### coordinate()

    coordinate() = gossip_vivaldi:network_coordinate()

### relative_size()

    relative_size() = float()

## Function Index

distance/2 | Get the distance between two centroids.
empty_centroids_list/0 | Helper to return an empty list of centroids.
get_coordinate/1 | Get centroid's coordinate.
get_coordinate_and_relative_size/1 | Get a centroid's coordinate and relative size as a tuple.
get_relative_size/1 | Get centroid's relative size.
new/2 | Create a new centroid.
set_relative_size/2 | Set the relative size of a centroid.

## Function Details

### new/2

    new(Coordinate :: coordinate(), RelativeSize :: relative_size()) ->
           centroid()

Create a new centroid.

### get_coordinate/1

    get_coordinate(Centroid :: centroid()) -> coordinate()

Get centroid's coordinate

### get_relative_size/1

    get_relative_size(Centroid :: centroid()) -> relative_size()

Get centroid's relative size

### get_coordinate_and_relative_size/1

    get_coordinate_and_relative_size(Centroid :: centroid()) ->
                                        {coordinate(),
                                         relative_size()}

Get a centroid's coordinate and relative size as a tuple

### set_relative_size/2

    set_relative_size(Centroid :: centroid(),
                      RelativeSize :: relative_size()) ->
                         centroid()

Set the relative size of a centroid

### empty_centroids_list/0

    empty_centroids_list() -> centroids()

Helper to return an empty list of centroids.

### distance/2

    distance(U :: centroid(), V :: centroid()) -> float()

Get the distance between two centroids

Generated by EDoc, Feb 29 2016, 16:12:17.