Skip to content

Commit

Permalink
initial random configuration with constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
skasamatsu committed Oct 3, 2023
1 parent bcde2f6 commit 471cbc4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1482,7 +1482,7 @@ def dummy_structure_from_sublattice(self, defect_sublattice):
return dummy_structure

def shuffle(self):
max_trial = 1000
max_trial = 10000
num_trial = 0
while num_trial < max_trial:
for defect_sublattice in self.defect_sublattices:
Expand Down
3 changes: 2 additions & 1 deletion abics/scripts/activelearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ def main_impl(params_root: MutableMapping):
solver_input = solver.input
solver_input.from_directory(alparams.base_input_dir[0])
for i in range(ndata):
config.shuffle() # randomize config
constraint_fullfilled, msg = config.shuffle() # randomize config
print(msg)
config.structure.sort(key=lambda site: site.species_string)
structure0 = config.structure.copy()
perturb_structure(config.structure, perturb)
Expand Down

0 comments on commit 471cbc4

Please sign in to comment.