Logo AND Algorithmique Numérique Distribuée

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