44int main(
int argc,
char** argv) {
49 std::string parameter_file = argv[1];
53 std::unique_ptr<CoverageSystem> env;
56 std::cerr <<
"Please provide both position and IDF files" << std::endl;
57 std::cerr <<
"Usage: ./coverage_algorithm [parameter_file] "
58 "[<position_file> <idf_file>]"
61 }
else if (argc == 4) {
62 std::string pos_file = argv[2];
63 std::string idf_file = argv[3];
64 WorldIDF world_idf(params, idf_file);
65 env = std::make_unique<CoverageSystem>(params, world_idf, pos_file);
67 env = std::make_unique<CoverageSystem>(params);
70 auto init_objective = env->GetObjectiveValue();
71 std::cout <<
"Initial objective: " << init_objective << std::endl;
79 if (env->StepActions(actions)) {
80 std::cout <<
"Invalid action" << std::endl;
84 std::cout <<
"Step: " << ii << std::endl;
90 auto final_objective = env->GetObjectiveValue();
91 std::cout <<
"Improvement %: "
92 << (init_objective - final_objective) / init_objective * 100