File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments