Skip to content
Prev Previous commit
Next Next commit
Add check for states in TISEnsemble w/candidate
Enables the use of this with path reversal or 2-way shooting.
  • Loading branch information
dwhswenson committed Feb 10, 2017
commit 256d8d2857018ddab2e4ab26354e71e94d987da4
10 changes: 7 additions & 3 deletions openpathsampling/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -2792,12 +2792,16 @@ def __init__(self, initial_states, final_states, interface,
self.orderparameter = orderparameter
# TODO: add max_orderparameter as a traj CV
self.lambda_i = lambda_i
self._initial_volumes = volumes_a
self._final_volumes = volumes_b

def __call__(self, trajectory, trusted=None, candidate=False):
if candidate:
# we assume that initial and final frames are in appropriate
# states, and no other frames are in a state
return max(self.orderparameter(trajectory)) >= self.lambda_i
# as a candidate trajectory, we assume that only the first and
# final frames can be in a state
return (self._initial_volumes(trajectory[0])
& self._final_volumes(trajectory[-1])
& max(self.orderparameter(trajectory)) >= self.lambda_i)
else:
return super(TISEnsemble, self).__call__(trajectory, trusted)

Expand Down