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 ;
22 * Default constructor.
34 * @param _gr Tasks graph to be mapped
35 * @param _gl Grid graph
37 public Algo( Graph _gr, Grid _gl )
48 public abstract void map() ;
52 * Replace a fallen node by a new one, according to the mapping policy.
53 * @param _dead The fallen node to be replaced
54 * @param _ag The list of all available computing nodes
55 * @return The new node
57 public abstract GNode replaceNode( GNode _dead, ArrayList<GNode> _ag ) ;
61 * Find a new node, which may not takes part into the computation process.
62 * Typically such kind of node is used to create a new spawner or a new super-node,
63 * in order to bring fault tolerance.
64 * @return Another node which will not compute
66 public abstract GNode getOtherGNode( ArrayList<GNode> _ag ) ;
70 * Return mapping done.
71 * @return The mapping done
73 public Mapping getMapping()
80 * Return the grid used in the algorithm.
90 * Return the graph used in the algorithm.
93 public Graph getGraph()
99 /** La programmation est un art, respectons ceux qui la pratiquent !! **/