File tree Expand file tree Collapse file tree 9 files changed +6
-30
lines changed
whisker-main/src/whisker/search Expand file tree Collapse file tree 9 files changed +6
-30
lines changed Original file line number Diff line number Diff line change @@ -63,13 +63,6 @@ export interface SearchAlgorithm<C extends Chromosome> {
63
63
*/
64
64
setFitnessFunctions ( fitnessFunctions : Map < number , FitnessFunction < C > > ) : void ;
65
65
66
- /**
67
- * Sets the functions for calculating the heuristic values.
68
- * @param heuristicFunctions The functions for calculating the heuristic values in the range of [0, 1]
69
- * from the fitness values, where 0 is the worst value and 1 is the best value.
70
- */
71
- setHeuristicFunctions ( heuristicFunctions : Map < number , ( number ) => number> ) : void ;
72
-
73
66
/**
74
67
* Sets the selection operator used by the search algorithm.
75
68
* @param selectionOperator the selection operator used by the algorithm
Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ export class SearchAlgorithmBuilder<C extends Chromosome> {
266
266
* A helper method that builds the 'MIO' search algorithm with all necessary properties.
267
267
*/
268
268
private _buildMIO ( ) : SearchAlgorithm < C > {
269
- const searchAlgorithm : SearchAlgorithm < C > = new MIO ( ) ;
269
+ const searchAlgorithm = new MIO < C > ( ) ;
270
270
searchAlgorithm . setFitnessFunctions ( this . _fitnessFunctions ) ;
271
271
searchAlgorithm . setHeuristicFunctions ( this . _heuristicFunctions ) ;
272
272
searchAlgorithm . setLocalSearchOperators ( this . _localSearchOperators ) ;
Original file line number Diff line number Diff line change @@ -166,6 +166,11 @@ export class MIO<C extends Chromosome> extends SearchAlgorithmDefault<C> {
166
166
StatisticsCollector . getInstance ( ) . fitnessFunctionCount = fitnessFunctions . size ;
167
167
}
168
168
169
+ /**
170
+ * Sets the functions for calculating the heuristic values.
171
+ * @param heuristicFunctions The functions for calculating the heuristic values in the range of [0, 1]
172
+ * from the fitness values, where 0 is the worst value and 1 is the best value.
173
+ */
169
174
setHeuristicFunctions ( heuristicFunctions : Map < number , ( number ) => number> ) : void {
170
175
this . _heuristicFunctions = heuristicFunctions ;
171
176
}
Original file line number Diff line number Diff line change @@ -424,8 +424,4 @@ export class MOSA<C extends Chromosome> extends SearchAlgorithmDefault<C> {
424
424
setFitnessFunction ( fitnessFunction : FitnessFunction < C > ) : void {
425
425
throw new Error ( 'Method not implemented.' ) ;
426
426
}
427
-
428
- setHeuristicFunctions ( heuristicFunctions : Map < number , ( number : any ) => number > ) : void {
429
- throw new Error ( 'Method not implemented.' ) ;
430
- }
431
427
}
Original file line number Diff line number Diff line change @@ -196,10 +196,6 @@ export class NEAT extends SearchAlgorithmDefault<NeatChromosome> {
196
196
throw new Error ( 'Method not implemented.' ) ;
197
197
}
198
198
199
- setHeuristicFunctions ( heuristicFunctions : Map < number , ( number : any ) => number > ) : void {
200
- throw new Error ( 'Method not implemented.' ) ;
201
- }
202
-
203
199
setSelectionOperator ( selectionOperator : Selection < NeatChromosome > ) : void {
204
200
throw new Error ( 'Method not implemented.' ) ;
205
201
}
Original file line number Diff line number Diff line change @@ -140,10 +140,6 @@ ${bestIndividual.toString()}`);
140
140
return this . _startTime ;
141
141
}
142
142
143
- setHeuristicFunctions ( heuristicFunctions : Map < number , ( number : any ) => number > ) : void {
144
- throw new Error ( 'Method not implemented.' ) ;
145
- }
146
-
147
143
setSelectionOperator ( selectionOperator : Selection < C > ) : void {
148
144
throw new Error ( 'Method not implemented.' ) ;
149
145
}
Original file line number Diff line number Diff line change @@ -120,10 +120,6 @@ export class RandomSearch<C extends Chromosome> extends SearchAlgorithmDefault<C
120
120
return this . _startTime ;
121
121
}
122
122
123
- setHeuristicFunctions ( heuristicFunctions : Map < number , ( number : any ) => number > ) : void {
124
- throw new Error ( 'Method not implemented.' ) ;
125
- }
126
-
127
123
setSelectionOperator ( selectionOperator : Selection < C > ) : void {
128
124
throw new Error ( 'Method not implemented.' ) ;
129
125
}
Original file line number Diff line number Diff line change @@ -98,8 +98,6 @@ export abstract class SearchAlgorithmDefault<C extends Chromosome> implements Se
98
98
99
99
abstract setFitnessFunctions ( fitnessFunctions : Map < number , FitnessFunction < C > > ) : void ;
100
100
101
- abstract setHeuristicFunctions ( heuristicFunctions : Map < number , ( number ) => number> ) : void ;
102
-
103
101
abstract setSelectionOperator ( selectionOperator : Selection < C > ) : void ;
104
102
105
103
abstract setLocalSearchOperators ( localSearchOperators : LocalSearch < C > [ ] ) : void ;
Original file line number Diff line number Diff line change @@ -229,10 +229,6 @@ export class SimpleGA<C extends Chromosome> extends SearchAlgorithmDefault<C> {
229
229
return this . _startTime ;
230
230
}
231
231
232
- setHeuristicFunctions ( heuristicFunctions : Map < number , ( number : any ) => number > ) : void {
233
- throw new Error ( 'Method not implemented.' ) ;
234
- }
235
-
236
232
setLocalSearchOperators ( localSearchOperators : LocalSearch < C > [ ] ) : void {
237
233
throw new Error ( 'Method not implemented.' ) ;
238
234
}
You can’t perform that action at this time.
0 commit comments