Skip to content

Commit d0a6352

Browse files
committed
added successful_move and failled move counter
1 parent 042742f commit d0a6352

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/source/chapters/chapter6.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ Let us add a method named *monte_carlo_move* to the *MonteCarlo* class:
7070
acceptation_probability = np.min([1, np.exp(-beta*delta_E)])
7171
if random_number <= acceptation_probability: # Accept new position
7272
self.Epot = trial_Epot
73+
self.successful_move += 1
7374
else: # Reject new position
7475
self.atoms_positions = initial_positions # Revert to initial positions
76+
self.failed_move += 1
7577
7678
.. label:: end_MonteCarlo_class
7779

@@ -99,6 +101,8 @@ and the desired temperature (:math:`T`). Let us add these parameters to the
99101
self.desired_temperature = desired_temperature
100102
super().__init__(*args, **kwargs)
101103
self.nondimensionalize_units(["desired_temperature", "displace_mc"])
104+
self.successful_move = 0
105+
self.failed_move = 0
102106
103107
.. label:: end_MonteCarlo_class
104108

0 commit comments

Comments
 (0)