mailr7129 - /1.3/generic_fns/monte_carlo.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on August 10, 2008 - 13:50:
Author: bugman
Date: Sun Aug 10 13:50:55 2008
New Revision: 7129

URL: http://svn.gna.org/viewcvs/relax?rev=7129&view=rev
Log:
The Monte Carlo error_analysis() function now uses the unimplemented specific 
model_loop() method.


Modified:
    1.3/generic_fns/monte_carlo.py

Modified: 1.3/generic_fns/monte_carlo.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/monte_carlo.py?rev=7129&r1=7128&r2=7129&view=diff
==============================================================================
--- 1.3/generic_fns/monte_carlo.py (original)
+++ 1.3/generic_fns/monte_carlo.py Sun Aug 10 13:50:55 2008
@@ -136,21 +136,18 @@
     if not hasattr(cdp, 'sim_state'):
         raise RelaxError, "Monte Carlo simulations have not been set up."
 
-    # Specific number of instances, return simulation chi2 array, return 
selected simulation array, return simulation parameter array, and set error 
functions.
-    count_num_instances = get_specific_fn('num_instances', cdp.pipe_type)
+    # Model loop, return simulation chi2 array, return selected simulation 
array, return simulation parameter array, and set error functions.
+    model_loop = get_specific_fn('model_loop', cdp.pipe_type)
     if prune > 0.0:
         return_sim_chi2 = get_specific_fn('return_sim_chi2', cdp.pipe_type)
     return_selected_sim = get_specific_fn('return_selected_sim', 
cdp.pipe_type)
     return_sim_param = get_specific_fn('return_sim_param', cdp.pipe_type)
     set_error = get_specific_fn('set_error', cdp.pipe_type)
 
-    # Count the number of instances.
-    num_instances = count_num_instances()
-
-    # Loop over the instances.
-    for instance in xrange(num_instances):
+    # Loop over the models.
+    for model_info in model_loop():
         # Get the selected simulation array.
-        select_sim = return_selected_sim(instance)
+        select_sim = return_selected_sim(model_info)
 
         # Initialise an array of indices to prune (an empty array means no 
pruning).
         indices_to_skip = []
@@ -158,7 +155,7 @@
         # Pruning.
         if prune > 0.0:
             # Get the array of simulation chi-squared values.
-            chi2_array = return_sim_chi2(instance)
+            chi2_array = return_sim_chi2(model_info)
 
             # The total number of simulations.
             n = len(chi2_array)
@@ -182,7 +179,7 @@
         index = 0
         while 1:
             # Get the array of simulation parameters for the index.
-            param_array = return_sim_param(instance, index)
+            param_array = return_sim_param(model_info, index)
 
             # Break (no more parameters).
             if param_array == None:
@@ -249,7 +246,7 @@
                 sd = None
 
             # Set the parameter error.
-            set_error(instance, index, sd)
+            set_error(model_info, index, sd)
 
             # Increment the parameter index.
             index = index + 1




Related Messages


Powered by MHonArc, Updated Mon Aug 11 12:00:45 2008