-
Notifications
You must be signed in to change notification settings - Fork 0
/
solution_manager.h
34 lines (28 loc) · 1.14 KB
/
solution_manager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef SOLUTION_MANAGER_H_
#define SOLUTION_MANAGER_H_
#include "solution.pb.h"
#include <memory>
#include <string>
#include <utility>
namespace drones {
class SolutionManager {
public:
// Returns true if the solution is valid.
static bool Simulate(const Solution& solution, int* score = nullptr);
// Load the solution from a solution file, as specified in the Hashcode task,
// and the given problem.
static std::unique_ptr<Solution> LoadFromSolutionFile(
const Problem& problem, const std::string& path);
// Save the solution to a solution file, as specified in the Hashcode task.
static bool SaveToSolutionFile(const Solution& solution,
const std::string& path);
// Loads the whole Solution proto (including the problem) from a
// serialized-proto file.
static std::unique_ptr<Solution> LoadFromProtoFile(const std::string& path);
// Saves the whole Solution proto (including the problem) to a
// serialized-proto file.
static bool SaveToProtoFile(const Solution& solution,
const std::string& path);
};
}; // namespace drones
#endif // SOLUTION_MANAGER_H_