19package denoptim.graph.rings;
21import java.util.ArrayList;
22import java.util.logging.Level;
23import java.util.logging.Logger;
25import javax.vecmath.Point3d;
26import javax.vecmath.Vector3d;
28import denoptim.constants.DENOPTIMConstants;
134 this.distH1T2 =
h1.distance(
t2);
135 this.distH2T1 =
h2.distance(
t1);
136 this.distH2T2 =
h2.distance(
t2);
154 public boolean isClosable(ArrayList<Double> clsablConds,Logger logger)
185 double minDH2T1,
double maxDH2T1,
186 double minDH2T2,
double maxDH2T2,
187 double maxDotHT, Logger logger)
190 this.distH1T2 =
h1.distance(
t2);
191 this.distH2T1 =
h2.distance(
t1);
192 this.distH2T2 =
h2.distance(
t2);
193 if (logger.isLoggable(Level.FINEST))
195 StringBuilder sb =
new StringBuilder();
197 sb.append(
"Values for evaluation of closability:");
198 sb.append(
" distH1T2: " + String.format(
"%8.4f",
distH1T2));
199 sb.append(
" min: " + String.format(
"%8.4f",minDH1T2));
200 sb.append(
" max: " + String.format(
"%8.4f",maxDH1T2) + NL);
201 sb.append(
" distH2T1: " + String.format(
"%8.4f",
distH2T1));
202 sb.append(
" min: " + String.format(
"%8.4f",minDH2T1));
203 sb.append(
" max: " + String.format(
"%8.4f",maxDH2T1) + NL);
204 sb.append(
" distH2T2: " + String.format(
"%8.4f",
distH2T2));
205 sb.append(
" min: " + String.format(
"%8.4f",minDH2T2));
206 sb.append(
" max: " + String.format(
"%8.4f",maxDH2T2) + NL);
211 sb.append(
" dot: " + String.format(
"%8.4f",
h.dot(
t)));
212 sb.append(
" max: " + String.format(
"%8.4f%n", maxDotHT));
213 logger.log(Level.FINEST,sb.toString());
216 if (distH1T2 < maxDH1T2 && distH1T2 > minDH1T2 &&
217 distH2T1 < maxDH2T1 && distH2T1 > minDH2T1 &&
218 distH2T2 < maxDH2T2 && distH2T2 > minDH2T2)
225 if (
h.dot(
t) <= maxDotHT)
227 logger.log(Level.FINEST,
" CLOSABLE!");
245 double lenH =
h1.distance(
h2);
246 double lenT =
t1.distance(
t2);
247 double optDistH1T2 = 0.0;
248 double optDistH2T1 = 0.0;
249 double optDistH1T1 = 0.0;
250 double optDistH2T2 = 0.0;
251 optDistH1T1 = (lenH + lenT) / 2.0;
252 optDistH2T2 = optDistH1T1;
254 qscore = Math.abs(
h1.distance(
t1) - optDistH1T1) +
255 Math.abs(
h2.distance(
t2) - optDistH2T2) +
256 Math.abs(
h1.distance(
t2) - optDistH1T2) +
257 Math.abs(
h2.distance(
t1) - optDistH2T1);
318 ArrayList<Double> clsablConds =
new ArrayList<Double>();
321 double lenH =
h1.distance(
h2);
322 double lenT =
t1.distance(
t2);
323 double distTolerance = (lenH + lenT) / 2.0;
325 double minDistH1T2 = -1.0;
326 double minDistH2T1 = -1.0;
327 double minDistH2T2 = -1.0;
328 double maxDistH1T2 = 0.0;
329 double maxDistH2T1 = 0.0;
330 double maxDistH2T2 = 0.0;
332 maxDistH1T2 = distTolerance;
333 maxDistH2T1 = distTolerance;
334 maxDistH2T2 = lenH + lenT;
337 clsablConds.add(minDistH1T2);
338 clsablConds.add(maxDistH1T2);
339 clsablConds.add(minDistH2T1);
340 clsablConds.add(maxDistH2T1);
341 clsablConds.add(minDistH2T2);
342 clsablConds.add(maxDistH2T2);
343 clsablConds.add(maxDotProdHT);
356 Point3d nH1 =
new Point3d(
h1.x,
h1.y,
h1.z);
357 Point3d nH2 =
new Point3d(
h2.x,
h2.y,
h2.z);
358 Point3d nT1 =
new Point3d(
t1.x,
t1.y,
t1.z);
359 Point3d nT2 =
new Point3d(
t2.x,
t2.y,
t2.z);
372 String s =
"RingClosure [" +
h1 +
" " +
h2 +
" " +
t1 +
" " +
t2 +
"]";
General set of constants used in DENOPTIM.
static final String EOL
new line character
RingClosure represents the arrangement of atoms and PseudoAtoms identifying the head and tail of a ch...
Vector3d h
vector head of chain
double distH2T2
Distance H2 T2.
boolean isClosable(ArrayList< Double > clsablConds, Logger logger)
Evaluate closability by comparing the distances and the dot product with the given critera.
Point3d getPoint(int i)
Returns the point requested.
ArrayList< Double > getClosabilityConditions(double etrxTol)
Returns the list of min/max values defining the closability conditions.
double qscore
Quality score of the head and tail vectors alignement.
RingClosure deepCopy()
Returns a deep copy of this RingClosure object.
boolean isClosable(double minDH1T2, double maxDH1T2, double minDH2T1, double maxDH2T1, double minDH2T2, double maxDH2T2, double maxDotHT, Logger logger)
Evaluate closability by comparing the distances and the dot product with the given critera (i....
double distH1T2
Distance H1 T2.
void calculateDescriptors()
Calculate desctiprots (distances and dot product).
Point3d t2
The second point defining the tail vector.
Vector3d t
vector tail of chain
Point3d t1
The firs point defining the tail vector.
double distH2T1
Distance H2 T1.
RingClosure(Point3d h1, Point3d h2, Point3d t1, Point3d t2)
Constructs a RingClosure from the involved points.
Point3d h2
The second point defining the head vector.
RingClosureParameters settings
Parameters.
RingClosure(RingClosureParameters settings)
Constructs an empty RingClosure.
double getRingClosureQuality()
Returns the score evaluating the overal closure quality of this ring closure.
Point3d h1
The firs point defining the head vector.
Parameters and setting related to handling ring closures.
double getRCDistTolerance()
double getRCDotPrTolerance()