if( cluster1.compareTo( cluster2 ) == 0 )
{
- d = 1 ;
+ d = 10 ;
} else {
if( site1.compareTo( site2 ) == 0 )
{
- d = 2 ;
+ d = 20 ;
} else {
- d = 3 ;
+ d = 30 ;
}
}
return ret ;
}
+
/**
* Compute the heterogeneity degree of the grid.
* This is based on the relative standard deviation.
double average = 0 ;
double std = 0 ;
double temp = 0 ;
+ long nb_freenodes = 0 ;
/** Computation of the average power of computing nodes **/
for( int i = 0 ; i < gnodesList.size() ; i++ )
{
- temp += gnodesList.get(i).getPower() ;
+ if( ! gnodesList.get(i).getMapped() )
+ {
+ temp += gnodesList.get(i).getPower() ;
+ nb_freenodes++ ;
+ }
}
- average = temp / gnodesList.size() ;
+ average = temp / nb_freenodes ; //gnodesList.size() ;
/** Computation of the variance **/
temp = 0 ;
for( int i = 0 ; i < gnodesList.size() ; i++ )
{
- temp += Math.pow( ( gnodesList.get(i).getPower() - average ), 2 ) ;
+ if( ! gnodesList.get(i).getMapped() )
+ {
+ temp += Math.pow( ( gnodesList.get(i).getPower() - average ), 2 ) ;
+ }
}
/** Computation of the standard deviation **/
- temp = temp / gnodesList.size() ;
+ temp = temp / nb_freenodes ; //gnodesList.size() ;
std = Math.sqrt( temp ) ;
/** Computation of the relative standard deviation **/
return hd ;
}
+
+ /**
+ * Return the amount of nodes available in the cluster containing the
+ * maximum of available nodes.
+ * @return The maximum available nodes of the architecture
+ */
+ public int getMaxClusterNode()
+ {
+ int max = 0 ;
+
+ for( int i = 0 ; i < clusters.size() ; i++ )
+ {
+ if( max < clusters.get( i ).getNbFreeNodes() )
+ {
+ max = clusters.get( i ).getNbFreeNodes() ;
+ }
+ }
+
+ return max ;
+ }
+
+
/**
* Initialization of computing nodes in the grid. Set all
* of these nodes to be not mapped on, and do the same thing in each