@@ -18,10 +18,10 @@ def map(self, action: Callable[[T], R], values: list[T]) -> list[R]:
1818    def  cache_scheduler_info (self ,
1919                             wg : WorkGraph ,
2020                             contractors : list [Contractor ],
21-                              landscape : LandscapeConfiguration ,
22-                              spec : ScheduleSpec ,
21+                              landscape : LandscapeConfiguration   =   LandscapeConfiguration () ,
22+                              spec : ScheduleSpec   =   ScheduleSpec () ,
2323                             rand : Random  |  None  =  None ,
24-                              work_estimator : WorkTimeEstimator  |   None   =   None ):
24+                              work_estimator : WorkTimeEstimator  =   DefaultWorkEstimator () ):
2525        self ._wg  =  wg 
2626        self ._contractors  =  contractors 
2727        self ._landscape  =  landscape 
@@ -31,18 +31,18 @@ def cache_scheduler_info(self,
3131        self ._toolbox  =  None 
3232
3333    def  cache_genetic_info (self ,
34-                            population_size : int ,
35-                            mutate_order : float ,
36-                            mutate_resources : float ,
37-                            mutate_zones : float ,
38-                            deadline : Time  |  None ,
39-                            weights : list [int ] |  None ,
40-                            init_schedules : dict [str , tuple [Schedule , list [GraphNode ] |  None , ScheduleSpec , float ]],
41-                            assigned_parent_time : Time ,
42-                            fitness_weights : tuple [int  |  float , ...],
43-                            sgs_type : ScheduleGenerationScheme ,
44-                            only_lft_initialization : bool ,
45-                            is_multiobjective : bool ):
34+                            population_size : int   =   50 ,
35+                            mutate_order : float   =   0.1 ,
36+                            mutate_resources : float   =   0.05 ,
37+                            mutate_zones : float   =   0.05 ,
38+                            deadline : Time  |  None   =   None ,
39+                            weights : list [int ] |  None   =   None ,
40+                            init_schedules : dict [str , tuple [Schedule , list [GraphNode ] |  None , ScheduleSpec , float ]]  =   None ,
41+                            assigned_parent_time : Time   =   Time ( 0 ) ,
42+                            fitness_weights : tuple [int  |  float , ...]  =   None ,
43+                            sgs_type : ScheduleGenerationScheme   =   ScheduleGenerationScheme . Parallel ,
44+                            only_lft_initialization : bool   =   False ,
45+                            is_multiobjective : bool   =   False ):
4646        self ._selection_size  =  population_size 
4747        self ._mutate_order  =  mutate_order 
4848        self ._mutate_resources  =  mutate_resources 
@@ -61,8 +61,11 @@ def _ensure_toolbox_created(self):
6161        if  self ._toolbox  is  None :
6262            from  sampo .scheduler .genetic .utils  import  init_chromosomes_f , create_toolbox_using_cached_chromosomes 
6363
64-             init_chromosomes  =  init_chromosomes_f (self ._wg , self ._contractors , self ._init_schedules ,
65-                                                   self ._landscape )
64+             if  self ._init_schedules :
65+                 init_chromosomes  =  init_chromosomes_f (self ._wg , self ._contractors , self ._init_schedules ,
66+                                                       self ._landscape )
67+             else :
68+                 init_chromosomes  =  []
6669
6770            rand  =  self ._rand  or  Random ()
6871            work_estimator  =  self ._work_estimator  or  DefaultWorkEstimator ()
0 commit comments