and.Mapping
Class Grid

java.lang.Object
  extended by and.Mapping.Grid
All Implemented Interfaces:
java.io.Serializable

public class Grid
extends java.lang.Object
implements java.io.Serializable

Class representing a computing grid, composed of multiple clusters

Author:
Sébastien Miquée
See Also:
Serialized Form

Constructor Summary
Grid()
          Default constructor
 
Method Summary
 void addCluster(Cluster c)
          Add a cluster in the grid.
 void addClusters(java.util.ArrayList<Cluster> al)
          Add a clusters list in the grid.
 java.util.ArrayList<Cluster> getClusters()
          Return the grid in a clusters list view.
 double getDistance(GNode _g1, GNode _g2)
          Compute and return the distance between two clusters.
 java.util.ArrayList<GNode> getGNodes()
          Return the list of computing nodes in the grid.
 double getHeterogenityDegre()
          Compute the heterogeneity degree of the grid.
 int getNbCluster()
          Return the amount of clusters in the grid.
 int getNbGNode()
          Return the amount of computing nodes in the grid.
 void initClusters()
          Initialization of clusters.
 void print()
          Print a comprehensible text version of the grid.
 void removeGNode(GNode _dead)
          Remove a computing node from the grid.
 void updateGrid(java.util.ArrayList<GNode> _gnodes)
          Plop !!
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Grid

public Grid()
Default constructor

Method Detail

addCluster

public void addCluster(Cluster c)
Add a cluster in the grid.

Parameters:
c - Cluster to be add

addClusters

public void addClusters(java.util.ArrayList<Cluster> al)
Add a clusters list in the grid.

Parameters:
al - List of clusters to be add

getNbCluster

public int getNbCluster()
Return the amount of clusters in the grid.

Returns:
The amount of clusters

getNbGNode

public int getNbGNode()
Return the amount of computing nodes in the grid.

Returns:
The amount of computing nodes

getClusters

public java.util.ArrayList<Cluster> getClusters()
Return the grid in a clusters list view.

Returns:
Clusters list

initClusters

public void initClusters()
Initialization of clusters.


getDistance

public double getDistance(GNode _g1,
                          GNode _g2)
Compute and return the distance between two clusters.

Parameters:
_g1 - First cluster
_g2 - Second cluster
Returns:
The distance between the two clusters

getGNodes

public java.util.ArrayList<GNode> getGNodes()
Return the list of computing nodes in the grid.

Returns:
The list of computing nodes

updateGrid

public void updateGrid(java.util.ArrayList<GNode> _gnodes)
Plop !!

Parameters:
_gnodes -

removeGNode

public void removeGNode(GNode _dead)
Remove a computing node from the grid.

Parameters:
_dead - The node to be removed

getHeterogenityDegre

public double getHeterogenityDegre()
Compute the heterogeneity degree of the grid. This is based on a ratio between the average and the standard deviation of computing nodes' power.

Returns:
The heterogeneity degree of the grid

print

public void print()
Print a comprehensible text version of the grid.