@@ -125,21 +125,21 @@ def setup_engine(options):
125
125
126
126
# reference points
127
127
ref_points = [tools .uniform_reference_points (
128
- NOBJ , p , s ) for p , s in zip (options ['P' ], options ['SCALES' ])]
128
+ n_objectives , p , s ) for p , s in zip (options ['P' ], options ['SCALES' ])]
129
129
ref_points = np .concatenate (ref_points )
130
130
_ , uniques = np .unique (ref_points , axis = 0 , return_index = True )
131
131
ref_points = ref_points [uniques ]
132
132
133
- creator .create ("FitnessMin" , base .Fitness , weights = (- 1.0 ,)* NOBJ )
133
+ creator .create ("FitnessMin" , base .Fitness , weights = (- 1.0 ,)* n_objectives )
134
134
creator .create ("Individual" , list , fitness = creator .FitnessMin )
135
135
136
- RANDINT_LOW = 0
137
- RANDINT_UP = options ['classes' ] - 1
136
+ randint_down = 0
137
+ randint_up = options ['classes' ] - 1
138
138
139
139
toolbox = base .Toolbox ()
140
- toolbox .register ("attr_int" , random .randint , RANDINT_LOW , RANDINT_UP )
140
+ toolbox .register ("attr_int" , random .randint , randint_down , randint_up )
141
141
toolbox .register ("individual" , tools .initRepeat ,
142
- creator .Individual , toolbox .attr_int , N_ATTRIBUTES )
142
+ creator .Individual , toolbox .attr_int , samples )
143
143
toolbox .register ("population" , tools .initRepeat , list , toolbox .individual )
144
144
toolbox .register ("evaluate" , my_evaluate )
145
145
toolbox .register ("mate" , tools .cxTwoPoint )
0 commit comments