Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New stable version with the add of the Maheve algorithm.
[mapping.git] / src / and / Mapping / Architecture.java
1 package and.Mapping ;
2
3 import java.io.Serializable;
4 import java.util.ArrayList;
5
6
7 /**
8  * Class representing a set of clusters forming a network architecture
9  * @author Sébastien Miquée
10  *
11  */
12 public class Architecture implements Serializable
13 {
14         private static final long serialVersionUID = 1L;
15         
16         private ArrayList<Cluster> archi ;
17         private int nbNodes ;
18         private int nbClusters ;
19         
20         
21         /**
22          * Default constructor.
23          */
24         public Architecture()
25         {
26                 archi = new ArrayList<Cluster>() ;
27                 nbNodes = 0 ;
28                 nbClusters = 0 ;
29         }
30         
31         
32         /**
33          * Add a cluster in the architecture.
34          * @param c Cluster to be add.
35          */
36         public void addCluster( Cluster c ) 
37         {
38                 archi.add( c ) ;
39                 nbNodes += c.getNbGNode() ;
40                 nbClusters ++ ;
41         }
42         
43         
44         /**
45          * Return the amount of computing nodes in the architecture.
46          * @return The amount of nodes
47          */
48         public int getNbNodes()
49         {
50                 return nbNodes ;
51         }
52         
53         
54         /**
55          * Return the amount of clusters in the architecture.
56          * @return The amoutn of clusters
57          */
58         public int getNbClusters()
59         {
60                 return nbClusters ;
61         }
62         
63         
64         /**
65          * Return the architecture in a clusters list form.
66          * @return A clusters list
67          */
68         public ArrayList<Cluster> getArchi()
69         {
70                 return archi ;
71         }       
72         
73 }
74
75 /** La programmation est un art, respectons ceux qui la pratiquent !! **/