Skip to content

Commit

Permalink
randomize the initial position of the guest before Monte Carlo docking
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Schwalbe-Koda committed Nov 3, 2020
1 parent a10748c commit 540da57
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions VOID/dockers/mcdocker.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ def dock(self, attempts):

def copy(self):
return self.__class__(**self.__dict__.copy())

def on_start(self, cpx):
v = np.random.rand(1, 3)
lattice = cpx.host.lattice.matrix
translation = (v @ lattice).reshape(-1)

cpx.guest_transform.translate(translation)
return cpx
2 changes: 1 addition & 1 deletion VOID/dockers/tests/test_mcdocker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def setUp(self):
self.fitness = MinDistanceFitness(threshold=1.5)

self.num_steps = 100
self.temperature = 0
self.temperature = 0.1

self.mcdocker = MonteCarloDocker(
self.host, self.guest,
Expand Down

0 comments on commit 540da57

Please sign in to comment.