protected Graph gr ;
protected Grid gl ;
protected Mapping mp ;
+ protected String ids ;
+ protected String name ;
+ protected int nb_fault ;
/**
gr = new Graph() ;
gl = new Grid() ;
mp = new Mapping() ;
+ ids = "" ;
+ name = "" ;
+ nb_fault = 0 ;
}
gr = _gr ;
gl = _gl ;
mp = new Mapping() ;
+ ids = "" ;
+ name = "" ;
+ nb_fault = 0 ;
}
* in order to bring fault tolerance.
* @return Another node which will not compute
*/
- public abstract GNode getOtherGNode() ;
+ public abstract GNode getOtherGNode( ArrayList<GNode> _ag ) ;
/**
{
return mp ;
}
+
+
+ /**
+ * Return the grid used in the algorithm.
+ * @return The Grid
+ */
+ public Grid getGrid()
+ {
+ return gl ;
+ }
+
+
+ /**
+ * Return the graph used in the algorithm.
+ * @return The Graph
+ */
+ public Graph getGraph()
+ {
+ return gr ;
+ }
+
+
+ /**
+ * Set the string identifier for the algorithm.
+ * @param _s The algorithm's identifier
+ */
+ public void setIdS( String _s )
+ {
+ if( _s != null )
+ {
+ ids = _s ;
+ }
+ }
+
+
+ /**
+ * Set the algorithms parameters when this one is instanciated
+ * by a class load mechanism.
+ * @param _params
+ * @return
+ */
+ public boolean setParams( Object[] _params )
+ {
+ if( _params.length >= 2 )
+ {
+ gr = (Graph) _params[0] ;
+ gl = (Grid) _params[1];
+ } else {
+ System.err.println( "Not enough parameters!" ) ;
+ return false ;
+ }
+
+ return true ;
+ }
+
+ /**
+ * Return the string identifier of the algorithm.
+ * @return The algorithm's identifier
+ */
+ public String getIdS()
+ {
+ return ids ;
+ }
+
+
+ /**
+ * Set the name of the mapping algorithm.
+ * @param _n The new name
+ */
+ public void setName( String _n )
+ {
+ if( _n != null )
+ {
+ name = _n ;
+ }
+ }
+
+
+ /**
+ * Return the name of the mapping algorithm.
+ * @return The algorithm's name
+ */
+ public String getName()
+ {
+ return name ;
+ }
}
/** La programmation est un art, respectons ceux qui la pratiquent !! **/