@@ -357,15 +357,6 @@ def on_myStream_message(self, message):
357357 self .runTextEdit .moveCursor (QtGui .QTextCursor .End )
358358 self .runTextEdit .insertPlainText (message )
359359
360- class WilsonCowanPositive (models .WilsonCowan ):
361- "Declares a class of Wilson-Cowan models that use the default TVB parameters but"
362- "only allows values between 0 and 1 at integration time. In other words, it clips state"
363- "variables to the range [0,1] when a stochastic integration is used"
364- def dfun (self , state_variables , coupling , local_coupling = 0.0 ):
365- state_variables [state_variables < 0.0 ] = 0.0
366- state_variables [state_variables > 1.0 ] = 1.0
367- return super (WilsonCowanPositive , self ).dfun (state_variables , coupling , local_coupling )
368-
369360class TaskThread (QtCore .QThread ):
370361
371362 def __init__ (self ):
@@ -433,6 +424,7 @@ def run(self):
433424
434425 # now load white matter connectivity (998 ROI matrix from TVB demo set, AKA Hagmann's connectome)
435426 if useTVBConnectome == True :
427+ WC = models .WilsonCowan ()
436428 white_matter = connectivity .Connectivity .from_file ("connectivity_998.zip" )
437429
438430 # Define the transmission speed of white matter tracts (4 mm/ms)
@@ -450,7 +442,7 @@ def run(self):
450442 what_to_watch = monitors .Raw ()
451443
452444 # Initialize a TVB simulator
453- sim = simulator .Simulator (model = WilsonCowanPositive () , connectivity = white_matter ,
445+ sim = simulator .Simulator (model = WC , connectivity = white_matter ,
454446 coupling = white_matter_coupling ,
455447 integrator = euler_int , monitors = what_to_watch )
456448
@@ -686,7 +678,7 @@ def run(self):
686678 # now we decide whether the weights will be multiplied by a random amount
687679 # varying between that amount and 1.0 in order to generate a new subject
688680 if generateSubject == True :
689- connectionWeight = destination [1 ] * random .uniform (subject_variation , 1 )
681+ connectionWeight = destination [1 ] * rdm .uniform (subject_variation , 1 )
690682 else :
691683 connectionWeight = destination [1 ]
692684
@@ -1005,7 +997,7 @@ def run(self):
1005997 in_value = in_value - threshold
1006998
1007999 # now compute a random value between -0.5 and 0.5
1008- r_value = random .uniform (0 ,1 ) - 0.5
1000+ r_value = rdm .uniform (0 ,1 ) - 0.5
10091001
10101002 # multiply it by the noise parameter and add it to input value
10111003 in_value = in_value + r_value * noise
@@ -1147,7 +1139,7 @@ def run(self):
11471139 in_value = in_value - threshold
11481140
11491141 # now compute a random value between -0.5 and 0.5
1150- r_value = random .uniform (0 ,1 ) - 0.5
1142+ r_value = rdm .uniform (0 ,1 ) - 0.5
11511143
11521144 # multiply it by the noise parameter and add it to input value
11531145 in_value = in_value + r_value * noise
0 commit comments