Пример #1
0
 def __init__(self, blmin, n_top, reflect=False, verbose=False):
     OffspringCreator.__init__(self, verbose)
     self.blmin = blmin
     self.n_top = n_top
     self.reflect = reflect
     self.descriptor = 'MirrorMutation'
     self.min_inputs = 1
Пример #2
0
 def __init__(self, slab, n_top, blmin, verbose=False):
     OffspringCreator.__init__(self, verbose)
     self.blmin = blmin
     self.slab = slab
     self.n_top = n_top
     self.descriptor = 'CutAndSplicePairing'
     self.min_inputs = 2
Пример #3
0
 def __init__(self, element_pool, verbose=False, num_muts=1):
     OffspringCreator.__init__(self, verbose, num_muts=num_muts)
     self.descriptor = 'FullElementMutation'
     if not isinstance(element_pool[0], (list, np.ndarray)):
         self.element_pools = [element_pool]
     else:
         self.element_pools = element_pool
Пример #4
0
 def __init__(self, blmin, n_top, reflect=False, verbose=False):
     OffspringCreator.__init__(self, verbose)
     self.blmin = blmin
     self.n_top = n_top
     self.reflect = reflect
     self.descriptor = 'MirrorMutation'
     self.min_inputs = 1
Пример #5
0
    def __init__(self, element_pool, max_diff_elements,
                 min_percentage_elements, verbose):
        OffspringCreator.__init__(self, verbose)
        if not isinstance(element_pool[0], (list, np.ndarray)):
            self.element_pools = [element_pool]
        else:
            self.element_pools = element_pool

        if max_diff_elements is None:
            self.max_diff_elements = [None for _ in self.element_pools]
        elif isinstance(max_diff_elements, int):
            self.max_diff_elements = [max_diff_elements]
        else:
            self.max_diff_elements = max_diff_elements
        assert len(self.max_diff_elements) == len(self.element_pools)

        if min_percentage_elements is None:
            self.min_percentage_elements = [0 for _ in self.element_pools]
        elif isinstance(min_percentage_elements, (int, float)):
            self.min_percentage_elements = [min_percentage_elements]
        else:
            self.min_percentage_elements = min_percentage_elements
        assert len(self.min_percentage_elements) == len(self.element_pools)
        
        self.min_inputs = 2
 def __init__(self, slab, n_top, blmin, verbose=False):
     OffspringCreator.__init__(self, verbose)
     self.blmin = blmin
     self.slab = slab
     self.n_top = n_top
     self.descriptor = 'CutAndSplicePairing'
     self.min_inputs = 2
Пример #7
0
    def __init__(self,
                 element_pool,
                 max_diff_elements,
                 min_percentage_elements,
                 verbose,
                 rng=np.random):
        OffspringCreator.__init__(self, verbose, rng=rng)

        if not isinstance(element_pool[0], (list, np.ndarray)):
            self.element_pools = [element_pool]
        else:
            self.element_pools = element_pool

        if max_diff_elements is None:
            self.max_diff_elements = [None for _ in self.element_pools]
        elif isinstance(max_diff_elements, int):
            self.max_diff_elements = [max_diff_elements]
        else:
            self.max_diff_elements = max_diff_elements
        assert len(self.max_diff_elements) == len(self.element_pools)

        if min_percentage_elements is None:
            self.min_percentage_elements = [0 for _ in self.element_pools]
        elif isinstance(min_percentage_elements, (int, float)):
            self.min_percentage_elements = [min_percentage_elements]
        else:
            self.min_percentage_elements = min_percentage_elements
        assert len(self.min_percentage_elements) == len(self.element_pools)

        self.min_inputs = 2
Пример #8
0
 def __init__(self, element_pool, verbose=False, num_muts=1):
     OffspringCreator.__init__(self, verbose, num_muts=num_muts)
     self.descriptor = 'FullElementMutation'
     if not isinstance(element_pool[0], (list, np.ndarray)):
         self.element_pools = [element_pool]
     else:
         self.element_pools = element_pool
Пример #9
0
    def __init__(self,
                 slab,
                 n_top,
                 blmin,
                 number_of_variable_cell_vectors=0,
                 p1=1,
                 p2=0.05,
                 minfrac=None,
                 cellbounds=None,
                 test_dist_to_slab=True,
                 use_tags=False,
                 rng=np.random,
                 verbose=False):

        OffspringCreator.__init__(self, verbose, rng=rng)
        self.slab = slab
        self.n_top = n_top
        self.blmin = blmin
        assert number_of_variable_cell_vectors in range(4)
        self.number_of_variable_cell_vectors = number_of_variable_cell_vectors
        self.p1 = p1
        self.p2 = p2
        self.minfrac = minfrac
        self.cellbounds = cellbounds
        self.test_dist_to_slab = test_dist_to_slab
        self.use_tags = use_tags

        self.scaling_volume = None
        self.descriptor = 'CutAndSplicePairing'
        self.min_inputs = 2
Пример #10
0
 def __init__(self, adsorbate, adsorption_sites=None, num_muts=1):
     OffspringCreator.__init__(self, num_muts=num_muts)
     self.adsorbate = self.convert_adsorbate(adsorbate)
     self.adsorbate_set = set(self.adsorbate.get_chemical_symbols())
     if adsorption_sites is None:
         raise NotImplementedError
     self.adsorption_sites = adsorption_sites
     self.descriptor = 'AdsorbateOperator'
Пример #11
0
 def __init__(self, blmin, n_top, rattle_strength=0.8,
              rattle_prop=0.4, verbose=False):
     OffspringCreator.__init__(self, verbose)
     self.blmin = blmin
     self.n_top = n_top
     self.rattle_strength = rattle_strength
     self.rattle_prop = rattle_prop
     self.descriptor = 'RattleMutation'
Пример #12
0
 def __init__(self, adsorbate, adsorption_sites=None, num_muts=1):
     OffspringCreator.__init__(self, num_muts=num_muts)
     self.adsorbate = self.convert_adsorbate(adsorbate)
     self.adsorbate_set = set(self.adsorbate.get_chemical_symbols())
     if adsorption_sites is None:
         raise NotImplementedError
     self.adsorption_sites = adsorption_sites
     self.descriptor = 'AdsorbateOperator'
Пример #13
0
 def __init__(self,
              blmin,
              n_top,
              rattle_prop=0.4,
              verbose=False,
              descriptor='RattleMutation_new'):
     OffspringCreator.__init__(self, verbose)
     self.blmin = blmin
     self.n_top = n_top
     self.rattle_prop = rattle_prop
     self.descriptor = descriptor
     self.min_inputs = 1
Пример #14
0
 def __init__(self,
              blmin,
              n_top,
              probability=0.33,
              verbose=False,
              descriptor='PermutationMutation'):
     OffspringCreator.__init__(self, verbose)
     self.blmin = blmin
     self.n_top = n_top
     self.probability = probability
     self.descriptor = descriptor
     self.min_inputs = 1
 def __init__(self,
              blmin,
              n_top,
              rattle_strength=0.8,
              rattle_prop=0.4,
              verbose=False):
     OffspringCreator.__init__(self, verbose)
     self.blmin = blmin
     self.n_top = n_top
     self.rattle_strength = rattle_strength
     self.rattle_prop = rattle_prop
     self.descriptor = 'RattleMutation'
Пример #16
0
    def __init__(self, verbose=False, num_muts=1,
                 allowed_compositions=None,
                 distribution_correction_function=None,
                 element_pools=None):
        OffspringCreator.__init__(self, verbose, num_muts=num_muts)

        self.allowed_compositions = allowed_compositions
        self.element_pools = element_pools
        if distribution_correction_function is None:
            self.dcf = dummy_func
        else:
            self.dcf = distribution_correction_function
Пример #17
0
 def __init__(self,
              blmin,
              cellbounds=None,
              stddev=0.7,
              use_tags=False,
              verbose=False):
     OffspringCreator.__init__(self, verbose)
     self.blmin = blmin
     self.cellbounds = cellbounds
     self.stddev = stddev
     self.use_tags = use_tags
     self.scaling_volume = None
     self.descriptor = 'StrainMutation'
     self.min_inputs = 1
Пример #18
0
 def __init__(self,
              n_top,
              probability=0.33,
              test_dist_to_slab=True,
              use_tags=False,
              blmin=None,
              verbose=False):
     OffspringCreator.__init__(self, verbose)
     self.n_top = n_top
     self.probability = probability
     self.test_dist_to_slab = test_dist_to_slab
     self.use_tags = use_tags
     self.blmin = blmin
     self.descriptor = 'PermutationMutation'
     self.min_inputs = 1
Пример #19
0
 def __init__(self,
              slab,
              n_top,
              blmin,
              n_clusters,
              n_parents=3,
              r_cut=11.9,
              verbose=False):
     OffspringCreator.__init__(self, verbose)
     self.slab = slab
     self.n_top = n_top
     self.blmin = blmin
     self.n_clusters = n_clusters
     self.r_cut = r_cut
     self.descriptor = 'ClusterDistanceMutation'
     self.min_inputs = n_parents
Пример #20
0
 def __init__(self,
              blmin,
              n_top,
              rattle_strength=0.8,
              rattle_prop=0.4,
              min_z=None,
              verbose=False,
              descriptor='RattleMutation'):
     OffspringCreator.__init__(self, verbose)
     self.blmin = blmin
     self.n_top = n_top
     self.rattle_strength = rattle_strength
     self.rattle_prop = rattle_prop
     self.min_z = min_z
     self.descriptor = descriptor
     self.min_inputs = 1
Пример #21
0
 def __init__(self,
              blmin,
              n_top,
              rattle_strength=0.8,
              rattle_prop=0.4,
              test_dist_to_slab=True,
              use_tags=False,
              verbose=False):
     OffspringCreator.__init__(self, verbose)
     self.blmin = blmin
     self.n_top = n_top
     self.rattle_strength = rattle_strength
     self.rattle_prop = rattle_prop
     self.test_dist_to_slab = test_dist_to_slab
     self.use_tags = use_tags
     self.descriptor = 'RattleMutation'
     self.min_inputs = 1
Пример #22
0
 def __init__(self,
              blmin,
              n_top=None,
              fraction=0.33,
              tags=None,
              min_angle=1.57,
              test_dist_to_slab=True,
              verbose=False):
     OffspringCreator.__init__(self, verbose)
     self.blmin = blmin
     self.n_top = n_top
     self.fraction = fraction
     self.tags = tags
     self.min_angle = min_angle
     self.test_dist_to_slab = test_dist_to_slab
     self.descriptor = 'RotationalMutation'
     self.min_inputs = 1
Пример #23
0
    def __init__(self,
                 blmin,
                 cellbounds=None,
                 stddev=0.7,
                 number_of_variable_cell_vectors=3,
                 use_tags=False,
                 rng=np.random,
                 verbose=False):
        OffspringCreator.__init__(self, verbose, rng=rng)
        self.blmin = blmin
        self.cellbounds = cellbounds
        self.stddev = stddev
        self.number_of_variable_cell_vectors = number_of_variable_cell_vectors
        self.use_tags = use_tags

        self.scaling_volume = None
        self.descriptor = 'StrainMutation'
        self.min_inputs = 1
Пример #24
0
    def __init__(self,
                 blmin,
                 n_top=None,
                 p1=1.,
                 p2=0.05,
                 minfrac=None,
                 cellbounds=None,
                 use_tags=False,
                 test_dist_to_slab=True,
                 verbose=False):
        OffspringCreator.__init__(self, verbose)
        self.blmin = blmin
        self.n_top = n_top
        self.p1 = p1
        self.p2 = p2
        self.minfrac = minfrac
        self.cellbounds = cellbounds
        self.use_tags = use_tags
        self.test_dist_to_slab = test_dist_to_slab

        self.scaling_volume = None
        self.descriptor = 'CutAndSplicePairing'
        self.min_inputs = 1
Пример #25
0
    def __init__(self,
                 blmin,
                 bounds=[0.5, 2.0],
                 calculator=BondElectroNegativityModel,
                 rcut=10.,
                 used_modes_file='used_modes.json',
                 use_tags=False,
                 verbose=False):
        OffspringCreator.__init__(self, verbose)
        self.blmin = blmin
        self.bounds = bounds
        self.calc = calculator
        self.rcut = rcut
        self.used_modes_file = used_modes_file
        self.use_tags = use_tags
        self.descriptor = 'SoftMutation'

        self.used_modes = {}
        if self.used_modes_file is not None:
            try:
                self.read_used_modes(self.used_modes_file)
            except IOError:
                # file doesn't exist (yet)
                pass
Пример #26
0
 def __init__(self, num_muts):
     OffspringCreator.__init__(self)
     self.descriptor = 'Mutation'
     self.num_muts = num_muts
Пример #27
0
 def __init__(self, rng=np.random):
     OffspringCreator.__init__(self, rng=rng)
     self.descriptor = 'Crossover'
     self.min_inputs = 2
Пример #28
0
 def __init__(self):
     OffspringCreator.__init__(self)
     self.descriptor = 'Crossover'
Пример #29
0
 def __init__(self, adsorbate):
     OffspringCreator.__init__(self)
     self.adsorbate = self.convert_adsorbate(adsorbate)
     self.descriptor = 'AdsorbateOperator'
Пример #30
0
 def __init__(self, num_muts):
     OffspringCreator.__init__(self)
     self.descriptor = 'Mutation'
     self.num_muts = num_muts
Пример #31
0
 def __init__(self, num_muts=1, rng=np.random):
     OffspringCreator.__init__(self, num_muts=num_muts, rng=rng)
     self.descriptor = 'Mutation'
     self.min_inputs = 1
Пример #32
0
 def __init__(self, n_top, probability=0.33, verbose=False):
     OffspringCreator.__init__(self, verbose)
     self.n_top = n_top
     self.probability = probability
     self.descriptor = 'PermutationMutation'
 def __init__(self, n_top, probability=0.33, verbose=False):
     OffspringCreator.__init__(self, verbose)
     self.n_top = n_top
     self.probability = probability
     self.descriptor = 'PermutationMutation'
Пример #34
0
 def __init__(self):
     OffspringCreator.__init__(self)
     self.descriptor = 'Crossover'
Пример #35
0
 def __init__(self, adsorbate):
     OffspringCreator.__init__(self)
     self.adsorbate = self.convert_adsorbate(adsorbate)
     self.descriptor = 'AdsorbateOperator'
Пример #36
0
 def __init__(self):
     OffspringCreator.__init__(self)
     self.descriptor = "Crossover"
     self.min_inputs = 2