$darkmode
DENOPTIM
IdFragmentAndAP.java
Go to the documentation of this file.
1/*
2 * DENOPTIM
3 * Copyright (C) 2019 Marco Foscato <marco.foscato@uib.no>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (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 Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19package denoptim.fragspace;
20
21
22import denoptim.graph.Vertex.BBType;
23
24
32public class IdFragmentAndAP
33{
37 private long vId = -1;
38
42 private int molId = -1;
43
48
52 private int apId = -1;
53
57 private int vSymSetId = -1;
58
62 private int apSymSetId = -1;
63
64//------------------------------------------------------------------------------
65
67 {
68 }
69
70//------------------------------------------------------------------------------
71
72 public IdFragmentAndAP(long vIdx, int molId, BBType molTyp, int apId,
73 int vSymSetId, int apSymSetId)
74 {
75 this.vId = vIdx;
76 this.molId = molId;
77 this.molTyp = molTyp;
78 this.apId = apId;
79 this.vSymSetId = vSymSetId;
80 this.apSymSetId = apSymSetId;
81 }
82
83//------------------------------------------------------------------------------
84
85 public long getVertexId()
86 {
87 return vId;
88 }
89
90//------------------------------------------------------------------------------
91
92 public int getVertexMolId()
93 {
94 return molId;
95 }
96
97//------------------------------------------------------------------------------
98
100 {
101 return molTyp;
102 }
103
104//------------------------------------------------------------------------------
105
106 public int getApId()
107 {
108 return apId;
109 }
110
111//------------------------------------------------------------------------------
112
113 public int getVrtSymSetId()
114 {
115 return vSymSetId;
116 }
117
118//------------------------------------------------------------------------------
119
120 public int getApSymSetId()
121 {
122 return apSymSetId;
123 }
124
125//------------------------------------------------------------------------------
126
127 public void setVrtSymSetId(int vSymSetId)
128 {
129 this.vSymSetId = vSymSetId;
130 }
131
132//------------------------------------------------------------------------------
133
142 public boolean sameFragAndAp(IdFragmentAndAP other)
143 {
144 if (this.getApId()==other.getApId()
145 && this.getVertexMolId()==other.getVertexMolId()
146 && this.getVertexMolType()==other.getVertexMolType())
147 {
148 return true;
149 }
150 return false;
151 }
152
153//------------------------------------------------------------------------------
154
155 @Override
156 public String toString()
157 {
158 StringBuilder sb = new StringBuilder();
159 sb.append("IdFragmentAndAP [vId=").append(vId);
160 sb.append(", molId=").append(molId);
161 sb.append(", molTyp=").append(molTyp);
162 sb.append(", apId=").append(apId);
163 sb.append(", vSymSetId=").append(vSymSetId);
164 sb.append(", aSymSetId=").append(apSymSetId).append("]");
165 return sb.toString();
166 }
167
168//------------------------------------------------------------------------------
169
170}
Data structure containing information that identifies a single AP of a vertex/fragment.
int apId
the index of a specific attachment point.
int vSymSetId
the index of the symmetric set the vertex belongs to.
long vId
the ID of the vertex containing the fragment.
int molId
the index of the fragment in that library.
BBType molTyp
the type of library containing the fragment.
IdFragmentAndAP(long vIdx, int molId, BBType molTyp, int apId, int vSymSetId, int apSymSetId)
int apSymSetId
the index of the symmetric set the AP belongs to.
boolean sameFragAndAp(IdFragmentAndAP other)
Compares this and another identifier considering solely the fragment ID in the type-specific fragment...
The type of building block.
Definition: Vertex.java:86