3 import java.io.Serializable;
4 import java.util.ArrayList;
8 * Abstract class defining the structure for mapping algorithms
9 * @author Sébastien Miquée
11 public abstract class Algo implements Serializable
13 private static final long serialVersionUID = 1L;
18 protected Mapping mp ;
19 protected String ids ;
20 protected String name ;
21 protected int nb_fault ;
25 * Default constructor.
40 * @param _gr Tasks graph to be mapped
41 * @param _gl Grid graph
43 public Algo( Graph _gr, Grid _gl )
58 public abstract void map() ;
62 * Replace a fallen node by a new one, according to the mapping policy.
63 * @param _dead The fallen node to be replaced
64 * @param _ag The list of all available computing nodes
65 * @return The new node
67 public abstract GNode replaceNode( GNode _dead, ArrayList<GNode> _ag ) ;
71 * Find a new node, which may not takes part into the computation process.
72 * Typically such kind of node is used to create a new spawner or a new super-node,
73 * in order to bring fault tolerance.
74 * @return Another node which will not compute
76 public abstract GNode getOtherGNode( ArrayList<GNode> _ag ) ;
80 * Return mapping done.
81 * @return The mapping done
83 public Mapping getMapping()
90 * Return the grid used in the algorithm.
100 * Return the graph used in the algorithm.
103 public Graph getGraph()
110 * Set the string identifier for the algorithm.
111 * @param _s The algorithm's identifier
113 public void setIdS( String _s )
123 * Set the algorithms parameters when this one is instanciated
124 * by a class load mechanism.
125 * @param _params The parameter(s)
126 * @return The state of setting parameter(s)
128 public abstract boolean setParams( Object[] _params ) ;
131 * Return the string identifier of the algorithm.
132 * @return The algorithm's identifier
134 public String getIdS()
141 * Set the name of the mapping algorithm.
142 * @param _n The new name
144 public void setName( String _n )
154 * Return the name of the mapping algorithm.
155 * @return The algorithm's name
157 public String getName()
163 /** La programmation est un art, respectons ceux qui la pratiquent !! **/