forked from lilborgo/min2phaseCXX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
24 lines (18 loc) · 892 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <chrono>
#include <iostream>
#include <min2phase/min2phase.h>
#include <min2phase/tools.h>
#include <string>
int main(int argc, char *argv[]){
uint8_t movesUsed;
min2phase::tools::setRandomSeed(time(nullptr));
auto start = std::chrono::high_resolution_clock::now();
min2phase::init();
auto end = std::chrono::high_resolution_clock::now();
std::cout << std::chrono::duration_cast<std::chrono::milliseconds>(end-start).count() << "ms\n";
start = std::chrono::high_resolution_clock::now();
std::cout << min2phase::solve(min2phase::tools::randomCube(), 21, 1000000, 0, min2phase::APPEND_LENGTH | min2phase::USE_SEPARATOR | min2phase::OPTIMAL_SOLUTION, &movesUsed) << std::endl;
end = std::chrono::high_resolution_clock::now();
std::cout << std::chrono::duration_cast<std::chrono::microseconds>(end-start).count() << "ms\n";
return 0;
}