#import #define POP_SIZE 10 @interface Solution : NSObject @end @implementation Solution + (NSArray *)solveProblem:(id)problem { // ?????????????????? return nil; } @end int main(int argc, char **argv) { // ???????????????????? NSPopulation *population = [NSPopulation populationWithPopSize:POP_SIZE]; [population setFitnessFunction:^float(id pop, id individual) { // ????????????????? return 0; // ?????? }]; [population setSelectionOperator:^id(id pop, id a, id b) { // ?????????????? return nil; // ??????? }]; [population setCrossoverOperator:^id(id pop, id a, id b) { // ?????????????? return nil; // ???????? }]; [population setMutationOperator:^id(id pop, id individual) { // ?????????????? return nil; // ???????? }]; // ???????? [population evolve]; // ???? return 0; } ?????????????????????????????????????????????????????????????????????????
????? - `#import
`????Objective-C????????????????? - `#define POP_SIZE 10`?????????? - `@interface Solution : NSObject`???????????????NSObject? - `@implementation Solution`??????????????? - `+ (NSArray *)solveProblem:(id)problem`?????????????????????????? - `int main(int argc, char **argv)`???????????????????? ????? ???????????????????????????? - ??????????? roulette wheel selection ? tournament selection? - ?????????????????????? - ?????????????????????????
????? ??????????????????????????? - ?????? - ?????? - ???????
????? ?????????????????? - ??????????????????????????????????? - ???????????????????????????? - ?????????????????????