mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Fixed seed for the genetic optimizer for support generation
This commit is contained in:
		
							parent
							
								
									6ae869f3b1
								
							
						
					
					
						commit
						1778c51af1
					
				
					 2 changed files with 4 additions and 0 deletions
				
			
		|  | @ -14,6 +14,8 @@ public: | |||
|         localmethod_ = m; | ||||
|         return *this; | ||||
|     } | ||||
| 
 | ||||
|     inline void seed(unsigned long val) { nlopt::srand(val); } | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
|  |  | |||
|  | @ -1479,6 +1479,7 @@ public: | |||
|                     stc.relative_score_difference = m_cfg.optimizer_rel_score_diff; | ||||
|                     stc.stop_score = w; // space greater than w is enough
 | ||||
|                     GeneticOptimizer solver(stc); | ||||
|                     solver.seed(0); // we want deterministic behavior
 | ||||
| 
 | ||||
|                     auto oresult = solver.optimize_max( | ||||
|                         [this, pin_r, w, hp](double plr, double azm) | ||||
|  | @ -1778,6 +1779,7 @@ public: | |||
|             stc.relative_score_difference = m_cfg.optimizer_rel_score_diff; | ||||
|             stc.stop_score = 1e6; | ||||
|             GeneticOptimizer solver(stc); | ||||
|             solver.seed(0); // we want deterministic behavior
 | ||||
| 
 | ||||
|             double r_back = head.r_back_mm; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 tamasmeszaros
						tamasmeszaros