コード例 #1
0
ParticleIndexes DummyPairContainer::get_all_possible_indexes() const {
  ParticleIndexes ret = c_->get_all_possible_indexes();
  ModelObjectsTemp mos =
      cpf_->get_inputs(get_model(), c_->get_indexes());
  for (unsigned int i = 0; i < mos.size(); ++i) {
    ModelObject *o = mos[i];
    Particle *p = dynamic_cast<Particle *>(o);
    if (p) ret.push_back(p->get_index());
  }
  return ret;
}
コード例 #2
0
ファイル: MonteCarlo.cpp プロジェクト: AljGaber/imp
ParticleIndexes MonteCarlo::get_movable_particles() const {
    ParticleIndexes movable;
    for (unsigned int i = 0; i < get_number_of_movers(); ++i) {
        ModelObjectsTemp t = get_mover(i)->get_outputs();
        for (unsigned int j = 0; j < t.size(); ++j) {
            ModelObject *mo = t[j];
            if (dynamic_cast<Particle *>(mo)) {
                movable.push_back(dynamic_cast<Particle *>(mo)->get_index());
            }
        }
    }
    return movable;
}
コード例 #3
0
ファイル: RevoluteJointMover.cpp プロジェクト: salilab/imp
core::MonteCarloMoverResult RevoluteJointMover::do_propose() {
  IMP_OBJECT_LOG;
  boost::normal_distribution<double> mrng(0, stddev_);
  boost::variate_generator<RandomNumberGenerator &,
                           boost::normal_distribution<double> >
      sampler(random_number_generator, mrng);

  for (unsigned int i = 0; i < joints_.size(); ++i) {
    originals_[i] = joints_[i]->get_angle();
    joints_[i]->set_angle(originals_[i] + sampler());
  }
  //get changed particles' coordinates
  ParticleIndexes idx;
  core::RigidMembers tmp(joints_[0]->get_parent_node().get_rigid_members());
  for (unsigned int i = 0; i < tmp.size(); ++i)
      idx.push_back(tmp[i]->get_index());
  for (unsigned int j = 0; j < joints_.size(); ++j) {
      tmp = joints_[j]->get_child_node().get_rigid_members();
      for (unsigned int i = 0; i < tmp.size(); ++i)
          idx.push_back(tmp[i]->get_index());
  }
  return core::MonteCarloMoverResult(idx, 1.0);
}
コード例 #4
0
ファイル: Simulator.cpp プロジェクト: AljGaber/imp
ParticleIndexes Simulator::get_simulation_particle_indexes() const {
  IMP_OBJECT_LOG;
  ParticleIndexes ps;
  if (get_number_of_particles() == 0) {
    Model *m = get_model();
    ParticleIndexes pis = m->get_particle_indexes();
    for (ParticleIndexes::const_iterator it = pis.begin();
         it != pis.end(); ++it) {
      if (get_is_simulation_particle(*it)) {
        ps.push_back(*it);
      }
    }
  } else {
    ps = IMP::internal::get_index(
        ParticlesTemp(particles_begin(), particles_end()));
  }
  return ps;
}