Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Adding some new functions.
[mapping.git] / src / and / Mapping / Grid.java
index 0370940..877ac33 100644 (file)
@@ -408,6 +408,49 @@ public class Grid implements Serializable
                return hd ;
        }
        
+       /**
+        * 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() ;
+               }
+       }
+       
+       
+       
+       /**
+        * 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 ) ;
+                               
+                               getClusterOfNode( _ag.get( i ) ).setGNodeStatus( _ag.get( i ), false ) ;
+                       }
+               }
+       }
+       
+       
        
        /**
         * Print a comprehensible text version of the grid.