|
@@ -5,10 +5,6 @@ import org.insa.graphs.model.Node;
|
5
|
5
|
|
6
|
6
|
public class Label {
|
7
|
7
|
|
8
|
|
- //comment avoir le nombre de nodes dans le graph? (pour lier un unique label à chaque node)
|
9
|
|
- private Label[] tablabel=new Label[50000000];//5000000 placeholder
|
10
|
|
-
|
11
|
|
-
|
12
|
8
|
//quelles valeurs de protection?
|
13
|
9
|
protected Node sommet_courant;
|
14
|
10
|
|
|
@@ -24,29 +20,20 @@ public class Label {
|
24
|
20
|
|
25
|
21
|
//constructeur
|
26
|
22
|
public Label(Node sommet,Arc padre, int prix) {
|
27
|
|
- if (tablabel[sommet.getId()]==null)
|
28
|
|
- this.sommet_courant=sommet;
|
|
23
|
+ this.sommet_courant=sommet;
|
29
|
24
|
this.pere=padre;
|
30
|
25
|
this.cout=prix;
|
31
|
26
|
this.marque=false;//!\\ pas sûr que ce soit une bonne idée
|
32
|
|
- tablabel[sommet.getId()]=this;
|
33
|
|
- }
|
|
27
|
+ }
|
34
|
28
|
|
35
|
|
- //la condition tablabel==null est un placeholder /!\
|
36
|
29
|
public Label(Node sommet,Arc padre, int prix, boolean mark) {
|
37
|
|
- if (tablabel[sommet.getId()]==null)
|
38
|
|
- this.sommet_courant=sommet;
|
|
30
|
+ this.sommet_courant=sommet;
|
39
|
31
|
this.pere=padre;
|
40
|
32
|
this.cout=prix;
|
41
|
33
|
this.marque=mark;
|
42
|
|
- tablabel[sommet.getId()]=this;
|
43
|
34
|
|
44
|
35
|
}
|
45
|
36
|
|
46
|
|
- public Label getLabel(Node unnode) {
|
47
|
|
- return tablabel[unnode.getId()];
|
48
|
|
- }
|
49
|
|
-
|
50
|
37
|
public int getCost() {
|
51
|
38
|
return this.cout;
|
52
|
39
|
}
|