Ejemplo n.º 1
0
 def __init__(self, network, selector=None, ensembles=None, engine=None):
     super(OneWayShootingMoveScheme, self).__init__(network)
     self.append(
         move_strategy.OneWayShootingStrategy(selector=selector,
                                              ensembles=ensembles,
                                              engine=engine))
     self.append(move_strategy.OrganizeByMoveGroupStrategy())
Ejemplo n.º 2
0
    def __init__(self, network, engine=None):
        super(DefaultScheme, self).__init__(network)
        n_ensembles = len(network.sampling_ensembles)
        self.append(move_strategy.NearestNeighborRepExStrategy())
        self.append(move_strategy.OneWayShootingStrategy(engine=engine))
        self.append(move_strategy.PathReversalStrategy())
        self.append(move_strategy.MinusMoveStrategy(engine=engine))
        global_strategy = move_strategy.OrganizeByMoveGroupStrategy()
        self.append(global_strategy)

        try:
            msouters = self.network.special_ensembles['ms_outer']
        except KeyError:
            # if no ms_outer, ignore the ms_outer setup for now; later we
            # might default to a state swap
            pass
        else:
            for ms in msouters.keys():
                self.append(
                    move_strategy.OneWayShootingStrategy(
                        ensembles=[ms],
                        group="ms_outer_shooting",
                        engine=engine))
                self.append(
                    move_strategy.PathReversalStrategy(ensembles=[ms],
                                                       replace=False))
                ms_neighbors = [t.ensembles[-1] for t in msouters[ms]]
                pairs = [[ms, neighb] for neighb in ms_neighbors]
                self.append(
                    move_strategy.SelectedPairsRepExStrategy(ensembles=pairs))