use of ffx.potential.bonded.Rotamer in project ffx by mjschnie.
the class RosenbluthChiAllMove method boltzmannTorsionSet.
private TrialSet boltzmannTorsionSet(Torsion tors, int chiIndex, int setSize, String snapSuffix) {
report.append(String.format(" TrialSet for Chi%d\t\t(Theta uDep uExt)\n", chiIndex));
TrialSet trialSet = new TrialSet(setSize);
double[] origChi = RotamerLibrary.measureRotamer(target, false);
int i = 0;
while (i < setSize) {
double theta = rand.nextDouble(360.0) - 180;
double[] newChi = new double[origChi.length];
System.arraycopy(origChi, 0, newChi, 0, origChi.length);
newChi[chiIndex] = theta;
Rotamer newState = createRotamer(target, newChi);
RotamerLibrary.applyRotamer(target, newState);
double uBond = tors.energy(false);
double criterion = FastMath.exp(-beta * uBond);
double rng = rand.nextDouble();
if (rng < criterion) {
trialSet.theta[i] = theta;
trialSet.rotamer[i] = newState;
trialSet.uDep[i] = uBond;
trialSet.uExt[i] = totalEnergy() - uBond;
i++;
writeSnapshot(snapSuffix, true);
report.append(String.format(" %3s %d: %5.2f\t%5.2f\t%5.2f\n", snapSuffix, i, theta, trialSet.uDep[i - 1], trialSet.uExt[i - 1]));
}
}
target.revertState(origState);
updateAll();
return trialSet;
}
Aggregations