Statistics
| Revision:

root / trunk / extensions / extGraph_predes / src / com / iver / cit / gvsig / graph / core / GvNode.java @ 8192

History | View | Annotate | Download (3.62 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package com.iver.cit.gvsig.graph.core;
42

    
43
import java.util.ArrayList;
44

    
45
public class GvNode {
46
        public final static int statNotInList = 0;
47
        public final static int statNowInList = 1;
48
        public final static int statWasInList = 2;
49
        private int idNode;
50
        private double x;
51
        private double y;
52
        
53
        int from_link = -1; // id del Arco desde el que hemos llegado
54
        int   numSoluc = 0; // Empezamos con esto a cero en toda la red. 
55
                                        // De manera global, habr? una variable numSolucGlobal que indica el n? de cada petici?n de ruta.
56
                                        // Sirve para no tener que inicializar siempre tooooda la red. Lo que hacemos es comparar el 
57
                                        // n? de petici?n global con este. Si no coinciden, antes de hacer nada hay que inicializar su
58
                                        // best_cost a infinito.
59

    
60
        double best_cost = Double.MAX_VALUE;
61
        double estimacion = Double.MAX_VALUE; // bestCost + algo relacionado con la distancia al destino
62
        int status;
63
        ArrayList enlaces  = new ArrayList(); // Enlaces con los vecinos
64
        ArrayList giros = new ArrayList(); // Costes de los giros. Si existe un CGiro, miraremos su coste y lo a?adimos.
65
                                                  // Si es negativo, suponemos que es un giro prohibido.
66

    
67
        public void initialize() {
68
                numSoluc = AbstractNetSolver.numSolucGlobal;
69
                from_link = -1;
70
                best_cost = Double.MAX_VALUE;
71
                estimacion = Double.MAX_VALUE;
72
                status = statNotInList;
73

    
74
        }
75
        
76
        public int getIdNode() {
77
                return idNode;
78
        }
79
        public void setIdNode(int idNode) {
80
                this.idNode = idNode;
81
        }
82
        public double getX() {
83
                return x;
84
        }
85
        public void setX(double x) {
86
                this.x = x;
87
        }
88
        public double getY() {
89
                return y;
90
        }
91
        public void setY(double y) {
92
                this.y = y;
93
        }
94
        public double getBestCost() {
95
                return best_cost;
96
        }
97
        public void setBestCost(double best_cost) {
98
                this.best_cost = best_cost;
99
        }
100
        public ArrayList getEnlaces() {
101
                return enlaces;
102
        }
103
        public void setEnlaces(ArrayList enlaces) {
104
                this.enlaces = enlaces;
105
        }
106
        public double getEstimacion() {
107
                return estimacion;
108
        }
109
        public void setEstimacion(double estimacion) {
110
                this.estimacion = estimacion;
111
        }
112
        public int getFromLink() {
113
                return from_link;
114
        }
115
        public void setFromLink(int from_link) {
116
                this.from_link = from_link;
117
        }
118
        public ArrayList getTurns() {
119
                return giros;
120
        }
121
        public void setTurns(ArrayList turns) {
122
                this.giros = turns;
123
        }
124
        public int getNumSoluc() {
125
                return numSoluc;
126
        }
127
        public void setNumSoluc(int numSoluc) {
128
                this.numSoluc = numSoluc;
129
        }
130
        public int getStatus() {
131
                return status;
132
        }
133
        public void setStatus(int status) {
134
                this.status = status;
135
        }
136

    
137
}
138

    
139