| 
				
			 | 
			
			
				@@ -11,7 +11,7 @@ import time 
			 | 
		
	
		
			
			| 
				11
			 | 
			
				11
			 | 
			
			
				 from collections import OrderedDict 
			 | 
		
	
		
			
			| 
				12
			 | 
			
				12
			 | 
			
			
				 from random import randint 
			 | 
		
	
		
			
			| 
				13
			 | 
			
				13
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				14
			 | 
			
				
			 | 
			
			
				-from sandbox.perf.simulation import ComputeSubject 
			 | 
		
	
		
			
			| 
				
			 | 
			
				14
			 | 
			
			
				+from sandbox.perf.simulation import ComputeSubject, ComputeBehaviour, ComputeMechanism 
			 | 
		
	
		
			
			| 
				15
			 | 
			
				15
			 | 
			
			
				 from synergine2.config import Config 
			 | 
		
	
		
			
			| 
				16
			 | 
			
				16
			 | 
			
			
				 from synergine2.cycle import CycleManager 
			 | 
		
	
		
			
			| 
				17
			 | 
			
				17
			 | 
			
			
				 from synergine2.log import SynergineLogger 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -22,13 +22,18 @@ def simulate(complexity, subject_count, cycle_count, cores): 
			 | 
		
	
		
			
			| 
				22
			 | 
			
				22
			 | 
			
			
				     config = Config(dict(complexity=complexity, core=dict(use_x_cores=cores))) 
			 | 
		
	
		
			
			| 
				23
			 | 
			
				23
			 | 
			
			
				     simulation = Simulation(config) 
			 | 
		
	
		
			
			| 
				24
			 | 
			
				24
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				
			 | 
			
				25
			 | 
			
			
				+    simulation.add_to_index(ComputeSubject) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				26
			 | 
			
			
				+    simulation.add_to_index(ComputeBehaviour) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				27
			 | 
			
			
				+    simulation.add_to_index(ComputeMechanism) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				28
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				25
			 | 
			
				29
			 | 
			
			
				     subjects = Subjects(simulation=simulation) 
			 | 
		
	
		
			
			| 
				26
			 | 
			
				30
			 | 
			
			
				     for i in range(subject_count): 
			 | 
		
	
		
			
			| 
				27
			 | 
			
				
			 | 
			
			
				-        subjects.append(ComputeSubject( 
			 | 
		
	
		
			
			| 
				
			 | 
			
				31
			 | 
			
			
				+        subject = ComputeSubject( 
			 | 
		
	
		
			
			| 
				28
			 | 
			
				32
			 | 
			
			
				             config=config, 
			 | 
		
	
		
			
			| 
				29
			 | 
			
				33
			 | 
			
			
				             simulation=simulation, 
			 | 
		
	
		
			
			| 
				30
			 | 
			
				
			 | 
			
			
				-            data=[randint(0, 1000) for i in range(1000)] 
			 | 
		
	
		
			
			| 
				31
			 | 
			
				
			 | 
			
			
				-        )) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				34
			 | 
			
			
				+        ) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				35
			 | 
			
			
				+        subject.data = [randint(0, 1000) for i in range(1000)] 
			 | 
		
	
		
			
			| 
				
			 | 
			
				36
			 | 
			
			
				+        subjects.append(subject) 
			 | 
		
	
		
			
			| 
				32
			 | 
			
				37
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				33
			 | 
			
				38
			 | 
			
			
				     simulation.subjects = subjects 
			 | 
		
	
		
			
			| 
				34
			 | 
			
				39
			 | 
			
			
				  
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -54,10 +59,10 @@ def main(): 
			 | 
		
	
		
			
			| 
				54
			 | 
			
				59
			 | 
			
			
				     args = parser.parse_args() 
			 | 
		
	
		
			
			| 
				55
			 | 
			
				60
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				56
			 | 
			
				61
			 | 
			
			
				     host_cores = multiprocessing.cpu_count() 
			 | 
		
	
		
			
			| 
				57
			 | 
			
				
			 | 
			
			
				-    retry = 3 
			 | 
		
	
		
			
			| 
				
			 | 
			
				62
			 | 
			
			
				+    retry = 1 
			 | 
		
	
		
			
			| 
				58
			 | 
			
				63
			 | 
			
			
				     cycles = 10 
			 | 
		
	
		
			
			| 
				59
			 | 
			
				
			 | 
			
			
				-    subject_counts = [100, 500] 
			 | 
		
	
		
			
			| 
				60
			 | 
			
				
			 | 
			
			
				-    complexities = [100, 2000] 
			 | 
		
	
		
			
			| 
				
			 | 
			
				64
			 | 
			
			
				+    subject_counts = [500] 
			 | 
		
	
		
			
			| 
				
			 | 
			
				65
			 | 
			
			
				+    complexities = [200] 
			 | 
		
	
		
			
			| 
				61
			 | 
			
				66
			 | 
			
			
				     max_cores = args.max_cores or host_cores 
			 | 
		
	
		
			
			| 
				62
			 | 
			
				67
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				63
			 | 
			
				68
			 | 
			
			
				     results = [] 
			 |