ArrayList<Double> calcMark = new ArrayList<Double>() ;
- hd = gl.getHeterogenityDegre() ;
+ double hd_g = gl.getHeterogenityDegre() ;
+
+ /* Correction of hd */
+ hd = calcNewHd( hd_g ) ;
+
+ System.out.println("Corrected hd value: " + hd + " (" + hd_g + ")" ) ;
/** Sorting clusters **/
ArrayList<Cluster> tmp = gl.getClusters() ;
normP = tmp.get( i ).getAvgAvailablePower() * 100 / Pm ;
/** The magic formula :P **/
- calcLoc = Math.sqrt( Math.pow( (normP * hd), 2) +
- Math.pow( (normN *(1 - hd)), 2 ) ) ;
+ calcLoc = Math.pow( (normP * hd), 2) +
+ Math.pow( (normN * (1 - hd)), 2 ) ;
ok = false ;
}
+ /**
+ * Compute the new value of hd, by taking care of the application
+ * and execution architecture characteristics.
+ * @param hd_g Original heterogeneity degree
+ * @return The new (corrected) heterogeneity degree
+ */
+ private double calcNewHd( double hd_g )
+ {
+ /* Variables */
+ double nhd = 0 ;
+
+ double nbTask = gr.getNbGTask() ;
+ double nbDep = gr.getMaxDep() ;
+ double maxNodes = gl.getMaxClusterNode() ;
+
+ /* Computation */
+ nhd = hd_g / ( 10 * ( (nbDep / nbTask) + (nbDep / maxNodes) ) ) ;
+
+ return nhd ;
+ }
+
+
@Override
public GNode replaceNode( GNode _dead, ArrayList<GNode> _ag )
{
return ret ;
}
+
+
+ @Override
+ public boolean setParams(Object[] _params) {
+ return true ;
+ }
}