Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Implementation of fault tolerance in Default Mapping.
[mapping.git] / src / and / Mapping / Mapping.java
index c6c4060..0499f1a 100644 (file)
@@ -225,6 +225,29 @@ public class Mapping implements Serializable
        }
        
        
+       /**
+        * Return the position of the association containing 
+        * the GNode _g.
+        * @param _g The GNode to be search
+        * @return The position of the association
+        */
+       public int getIdOfAssociation( GNode _g )
+       {
+               int ret = -1 ;
+               
+               for( int i = 0 ; i < mapping.size() ; i++ )
+               {
+                       if( mapping.get( i ).getGNode().getId() == _g.getId() )
+                       {
+                               i = ret ;
+                               break ;
+                       }
+               }
+               
+               return ret ;
+       }
+       
+       
        /**
         * Return the amount of external tasks dependencies, in cluster point of view.
         * @return The amount of external dependencies