+ /**
+ * 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 ;
+ }
+
+
+ /**
+ * Return the average amount of nodes available in all clusters.
+ * @return The average available nodes of the architecture
+ */
+ public double getAvgClusterNode()
+ {
+ int nb = 0 ;
+
+ for( int i = 0 ; i < clusters.size() ; i++ )
+ {
+ nb += clusters.get( i ).getNbFreeNodes() ;
+ }
+
+ return ( nb / getNbFreenodes() ) ;
+ }
+
+
+ /**
+ * Initialization of computing nodes in the grid. Set all
+ * of these nodes to be not mapped on, and do the same thing in each
+ * of its clusters.
+ */
+ public void initGNodes()
+ {
+ /** Initialization of the local nodes **/
+ for( int i = 0 ; i < gnodesList.size() ; i++ )
+ {
+ gnodesList.get( i ).setMapped( false ) ;
+ }
+
+ /** Initialization in clusters **/
+ for( int i = 0 ; i < clusters.size() ; i++ )
+ {
+ clusters.get( i ).initGNodes() ;
+ clusters.get( i ).initMoreGNode() ;
+ }
+ }
+
+
+
+ /**
+ * Initialization of a set of computing nodes in the grid. Set all
+ * of these given nodes to be not mapped on, and propagates in each
+ * of its clusters.
+ * @param _ag The nodes' list to initialize
+ */
+ public void initGNodes( ArrayList<GNode> _ag )
+ {
+ if( _ag != null && _ag.size() > 0 )
+ {
+ /** Initialization of the local and clusters nodes **/
+ for( int i = 0 ; i < _ag.size() ; i++ )
+ {
+ setMappedStatus( _ag.get( i ), false ) ;
+
+ int id = getClusterOfNode( _ag.get( i ) ) ;
+
+ if( id != -1 )
+ {
+ clusters.get(id).setGNodeStatus( _ag.get( i ), false ) ;
+ } else {
+ System.err.println( "Cluster not found" ) ;
+ }
+ }
+ }
+ }
+
+
+