cloud-sat/light.hpp

47 lines
783 B
C++
Raw Normal View History

2022-08-30 15:42:35 +08:00
#ifndef _light_hpp_INCLUDED
#define _light_hpp_INCLUDED
#include "utils/paras.hpp"
#include "preprocess.hpp"
#include <atomic>
#include <iostream>
using namespace std;
typedef long long ll;
class basesolver;
2022-08-31 09:16:12 +00:00
struct thread_inf{
int id, inf;
bool operator < ( const thread_inf &other ) const
{
return inf > other.inf;
}
};
2022-08-30 15:42:35 +08:00
struct light
{
public:
light();
~light();
char *filename;
paras *opt;
preprocess *pre;
2022-08-31 09:16:12 +00:00
vec<basesolver *> workers;
2022-08-30 15:42:35 +08:00
int finalResult;
int winner;
int maxtime;
atomic<bool> globalEnding;
void arg_parse(int argc, char **argv);
2022-08-31 09:16:12 +00:00
void init_workers();
void diversity_workers();
2022-08-30 15:42:35 +08:00
void parse_input();
int run();
int solve();
2022-08-31 09:16:12 +00:00
void terminate_workers();
2022-08-30 15:42:35 +08:00
void print_model();
};
#endif