-
Notifications
You must be signed in to change notification settings - Fork 0
/
solution_verifier.h
96 lines (75 loc) · 3.63 KB
/
solution_verifier.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef __SOLUTION_VERIFIER_H__
#define __SOLUTION_VERIFIER_H__
#include <vector>
#include <string>
#include "problems.h"
#include "solution.h"
template<typename>
struct Instance;
/*
* Generic Solution Verifier.
* To write a solution verifier class for a specific problem,
* speialize this class for the corresponding problem type.
*/
template<typename ProbT>
struct SolutionVerifier
{
static bool verify(const Instance<ProbT>& inst, const Solution<ProbT>& sol, std::vector<std::string>* error_msg = nullptr);
};
/*****************************************************************************************/
/** Bin Packing Problem ******************************************************************/
/*****************************************************************************************/
template<>
struct SolutionVerifier<BP>
{
static bool verify(const Instance<BP>& inst, const Solution<BP>& sol, std::vector<std::string>* error_msg = nullptr);
};
/*****************************************************************************************/
/** Multi-Level Bin Packing Problem ******************************************************/
/*****************************************************************************************/
template<>
struct SolutionVerifier<MLBP>
{
static bool verify(const Instance<MLBP>& inst, const Solution<MLBP>& sol, std::vector<std::string>* error_msg = nullptr);
};
/*****************************************************************************************/
/** Class Constrained Multi-Level Bin Packing Problem ************************************/
/*****************************************************************************************/
template<>
struct SolutionVerifier<CCMLBP>
{
static bool verify(const Instance<CCMLBP>& inst, const Solution<CCMLBP>& sol, std::vector<std::string>* error_msg = nullptr);
};
/*****************************************************************************************/
/** Multi-Level Bin Packing Problem with Conflict Constraints ****************************/
/*****************************************************************************************/
template<>
struct SolutionVerifier<MLBPCC>
{
static bool verify(const Instance<MLBPCC>& inst, const Solution<MLBPCC>& sol, std::vector<std::string>* error_msg = nullptr);
};
/*****************************************************************************************/
/** Multi-Level Bin Packing Problem with Partial Orders **********************************/
/*****************************************************************************************/
template<>
struct SolutionVerifier<MLBPPO>
{
static bool verify(const Instance<MLBPPO>& inst, const Solution<MLBPPO>& sol, std::vector<std::string>* error_msg = nullptr);
};
/*****************************************************************************************/
/** Multi-Level Bin Packing Problem with Time Windows ************************************/
/*****************************************************************************************/
template<>
struct SolutionVerifier<MLBPTW>
{
static bool verify(const Instance<MLBPTW>& inst, const Solution<MLBPTW>& sol, std::vector<std::string>* error_msg = nullptr);
};
/*****************************************************************************************/
/** Multi-Level Bin Packing Problem with Fragmentation Constraints ***********************/
/*****************************************************************************************/
template<>
struct SolutionVerifier<MLBPFC>
{
static bool verify(const Instance<MLBPFC>& inst, const Solution<MLBPFC>& sol, std::vector<std::string>* error_msg = nullptr);
};
#endif // __SOLUTION_VERIFIER_H__