Removed original files
This commit is contained in:
parent
63e1867cbc
commit
0682b42cb4
@ -1,7 +1,6 @@
|
|||||||
add_executable(n_queens
|
add_executable(n_queens
|
||||||
./n_queens.cpp
|
./n_queens.cpp
|
||||||
./chess.cpp
|
./chess.cpp
|
||||||
./genetic_algorithm.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(n_queens PUBLIC ${CMAKE_CURRENT_LIST_DIR})
|
target_include_directories(n_queens PUBLIC ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#include "chess.hpp"
|
#include "chess.hpp"
|
||||||
#include "genetic_algorithm.hpp"
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -34,34 +33,4 @@ int main(int argc, char* argv[]) {
|
|||||||
std::cout << "Generation limit reached." << std::endl;
|
std::cout << "Generation limit reached." << std::endl;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/*
|
|
||||||
unsigned char population[N] = {0};
|
|
||||||
int selected[N] = {-1};
|
|
||||||
int generation_count = 0;
|
|
||||||
int i;
|
|
||||||
srand(time(NULL));
|
|
||||||
|
|
||||||
|
|
||||||
//basic genetic algorithm skeleton
|
|
||||||
init_population(population);
|
|
||||||
print_population(population);
|
|
||||||
|
|
||||||
while( generation_count < G ){
|
|
||||||
do_selection(population, selected);
|
|
||||||
do_crossover(population, selected);
|
|
||||||
do_mutation(population);
|
|
||||||
printf("%4d: ", generation_count);
|
|
||||||
print_population(population);
|
|
||||||
for( i=0; i<N; i++){
|
|
||||||
if (population[i]==0xFF){
|
|
||||||
printf("Max fit reached.\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
generation_count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user