def test_randomized_committor(self):
     raise SkipTest
     # this shows that we get both states even with forward-only
     # shooting, if the randomizer gives the negative velocities
     randomizer = paths.RandomVelocities(beta=1.0)
     sim = CommittorSimulation(storage=self.storage,
                               engine=self.engine,
                               states=[self.left, self.right],
                               randomizer=randomizer,
                               initial_snapshots=self.snap0,
                               direction=1)
     sim.run(50)
     assert_equal(len(sim.storage.steps), 50)
     counts = {'None-Right' : 0,
               'Left-None' : 0,
               'None-Left' : 0,
               'Right-None' : 0}
     for step in sim.storage.steps:
         step.active.sanity_check()  # traj is in ensemble
         traj = step.active[0].trajectory
         traj_str = traj.summarize_by_volumes_str(self.state_labels)
         try:
             counts[traj_str] += 1
         except KeyError:
             msg = "Got trajectory described as '{0}', length {1}"
             # this might be okay if it is 'None', length 100000
             raise AssertionError(msg.format(traj_str, len(traj)))
     assert_equal(counts['Left-None'], 0)
     assert_equal(counts['Right-None'], 0)
     assert_true(counts['None-Left'] > 0)
     assert_true(counts['None-Right'] > 0)
     assert_equal(sum(counts.values()), 50)
def create_randomizer(engine):
    from simtk import unit as u
    # only support OpenMM so far
    # this might raise an AttributeError if using an engine or
    # integrator that isn't supported
    # integrator = engine.integrator
    # temperature = integrator.temperature
    temperature = 300 * u.kelvin  # TODO: hard coding this for now
    beta = 1.0 / (temperature * u.BOLTZMANN_CONSTANT_kB)

    randomizer = paths.RandomVelocities(beta=beta, engine=engine)
    return randomizer