1 package yawn.nn.gasart;
2
3 /***
4 * A Growing Neural Gas edge
5 *
6 * <p>$Id: GasEdge.java,v 1.9 2005/05/09 11:04:57 supermarti Exp $</p>
7 *
8 * @author Luis Martí (luis dot marti at uc3m dot es)
9 * @version $Revision: 1.9 $
10 */
11 public class GasEdge {
12
13 /***
14 *
15 * @uml.property name="vertexA"
16 * @uml.associationEnd multiplicity="(1 1)" inverse="toWhoIBelong:yawn.nn.gasart.GasRecognitionNode"
17 */
18 GasRecognitionNode vertexA;
19
20 /***
21 *
22 * @uml.property name="vertexB"
23 * @uml.associationEnd multiplicity="(1 1)"
24 */
25 GasRecognitionNode vertexB;
26
27 int age = 0;
28
29 double lastLength;
30
31 boolean doneDist = false;
32
33 public GasEdge(GasRecognitionNode a, GasRecognitionNode b) {
34 vertexA = a;
35 vertexB = b;
36 }
37
38 public int getVerAX() {
39 return (int) vertexA.getMu(0);
40 }
41
42 public int getVerAY() {
43 return (int) vertexA.getMu(1);
44 }
45
46 public int getVerBX() {
47 return (int) vertexB.getMu(0);
48 }
49
50 public int getVerBY() {
51 return (int) vertexB.getMu(1);
52 }
53
54 public double length() {
55
56
57 lastLength = doneDist ? lastLength : vertexA.position().dist(vertexB.position());
58
59 doneDist = true;
60 return lastLength;
61
62
63 }
64
65 }