cloud-sat/workers/basesolver.hpp

37 lines
1.0 KiB
C++
Raw Normal View History

2022-08-30 15:42:35 +08:00
#ifndef _basesolver_hpp_INCLUDED
#define _basesolver_hpp_INCLUDED
#include "../light.hpp"
#include "../utils/vec.hpp"
2022-09-15 10:31:41 +08:00
#include "clause.hpp"
#include <fstream>
#include <iostream>
2022-12-04 23:30:36 +08:00
class sharer;
2022-08-30 15:42:35 +08:00
class basesolver {
public:
virtual void parse_dimacs(char* filename) = 0;
virtual void import_original_clause(preprocess* pre) = 0;
virtual void diversity(int id) = 0;
virtual int solve() = 0;
virtual void terminate() = 0;
virtual void get_model(vec<int> &model) = 0;
2022-08-31 09:16:12 +00:00
virtual int get_reset_data() = 0;
virtual void reset() = 0;
2022-09-08 13:54:29 +08:00
virtual void export_clauses_to(vec<clause_store *> &clauses) = 0;
virtual void import_clauses_from(vec<clause_store *> &clauses) = 0;
2022-09-15 10:31:41 +08:00
virtual void broaden_export_limit() = 0;
virtual void restrict_export_limit() = 0;
2022-08-30 15:42:35 +08:00
light * controller;
int id;
2022-12-04 23:30:36 +08:00
sharer* in_sharer;
2022-08-30 15:42:35 +08:00
basesolver(int sid, light* light) : id(sid), controller(light) {}
~basesolver() {
printf("destru %dbase\n", id);
if (controller) {
controller = NULL;
}
}
};
#endif