X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/mapping.git/blobdiff_plain/d5231d68ea145eedd724eb55d1fa56a1c5a7c660..04237b062ba76603c6be49d9ba84121691aa4009:/src/and/Mapping/Maheve.java diff --git a/src/and/Mapping/Maheve.java b/src/and/Mapping/Maheve.java index c22bfc9..f38b9fc 100644 --- a/src/and/Mapping/Maheve.java +++ b/src/and/Mapping/Maheve.java @@ -374,7 +374,12 @@ public class Maheve extends Algo ArrayList calcMark = new ArrayList() ; - 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 tmp = gl.getClusters() ; @@ -399,8 +404,8 @@ public class Maheve extends Algo 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 ; @@ -432,6 +437,28 @@ public class Maheve extends Algo } + /** + * 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 _ag ) { @@ -506,6 +533,12 @@ public class Maheve extends Algo return ret ; } + + + @Override + public boolean setParams(Object[] _params) { + return true ; + } }