#include #include #include #include #include "quantum.h" #include "scheduler.h" void printhelp(char* arg0){ using namespace std; cerr << "usage: " << arg0 << "[inputs] [args]" << endl; cerr << "args:" << endl; cerr << "inputs:" << endl; cerr << "\t( ) appears in pair" << "\tset input qasm files and their repeat times" << endl; } int main(int argc, char** argv){ if(argc < 2){ printhelp(argv[0]); } else if(argc %2 ==0){ std::cerr << "Illegal input number." << std::endl; exit(1); } //Load useful information std::vector input_programs; for(int i=0; i> program.name; input >> program.bit_useage; input >> program.time_cost; program.repeat_times = atoi(argv[i*2+2]); input_programs.push_back(program); input.close(); } //Schedule std::cout << input_programs.size() << std::endl; int total_time = greedy_scheduler(input_programs); //Output std::cout << "Total time cost: " << total_time << std::endl; for(auto p:input_programs){ std::cout << "Program: " << p.name << std::endl; for(int i=0; i\tstart point: " << p.start_points[i] << "\t\tend point: " << p.end_points[i] << std::endl; } } }