Repository navigation
Expand file tree
/
Copy pathCollagen_Monomer.java
More file actions
94 lines (80 loc) · 2.14 KB
/
Copy pathCollagen_Monomer.java
File metadata and controls
94 lines (80 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/**
* @author Kenneth McGuinness
* Creates a Diffusion Limited Aggregation Environment
*/
class Collagen_Monomer
{
public int m,n,z;
public int charge;
public Collagen_Monomer()
{
m = 0;
n = 0;
z = 0;
charge = 0;
}
public Collagen_Monomer(int cm, int cn, int cz)
{
m = cm;
n = cn;
z = cz;
}
public Collagen_Monomer(int cm, int cn, int cz, int ch)
{
m = cm;
n = cn;
z = cz;
charge = ch;
}
public Collagen_Monomer(Collagen_Monomer xyz)
{
m = xyz.m;
n = xyz.n;
z = xyz.z;
charge = xyz.charge;
}
public Collagen_Monomer(int[] mnzch)
{
m = mnzch[0];
n = mnzch[1];
z = mnzch[2];
charge = mnzch[3];
}
/*public int compareTo(Molecule other)
{
double thisdistance = Math.sqrt(Math.pow(this.cx,2)+Math.pow(this.cy,2)+ Math.pow(this.cz,2));
double otherdistance = Math.sqrt(Math.pow(other.cx,2)+Math.pow(other.cy,2)+ Math.pow(other.cz,2));
if (thisdistance > otherdistance)
{
return 1;
}
if (thisdistance < otherdistance)
{
return -1;
}
if(thisdistance == otherdistance && other.cx!=this.cx && other.cy!=this.cy && other.cz!=this.cz)
{
return 1;
}
return 0;
}*/
}
/*// intersection
Iterator<Molecule> iter = moleculeSet.iterator();
while (iter.hasNext())
{
Molecule m = iter.next();
// check whether m intersects newm, if so stop moving
if (m intersects newm)
{
moleculeSet.add(newm);
break;
}
}
Iterator<Molecule> mol1 = dla3d.moleculeSet.descendingIterator();
while(mol1.hasNext())
{
Molecule mol = new Molecule(mol1.next());
System.out.println("This is iterator distance: " + getDistance(mol,dla3d.start));
}
*/