-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodification.h
47 lines (37 loc) · 1008 Bytes
/
modification.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
#ifndef EAMA_ROUTES_MINIMIZATION_HEURISTIC_MODIFICATION_H
#define EAMA_ROUTES_MINIMIZATION_HEURISTIC_MODIFICATION_H
#include "customer.h"
#if defined(__cplusplus)
extern "C" {
#endif /* defined(__cplusplus) */
enum modification_type {
TWO_OPT,
OUT_RELOCATE,
EXCHANGE,
INSERT,
EJECT,
modification_max
};
struct modification {
enum modification_type type;
struct customer *v;
/** Used only in TWO_OPT, OUT_RELOCATE, EXCHANGE, INSERT */
struct customer *w;
struct {
bool delta_initialized;
double tw_penalty_delta;
double c_penalty_delta;
};
};
struct modification
modification_new(enum modification_type type, struct customer *v, struct customer *w);
bool
modification_applicable(struct modification m);
void
modification_apply(struct modification m);
double
modification_delta(struct modification m, double alpha, double beta);
#if defined(__cplusplus)
}
#endif /* defined(__cplusplus) */
#endif //EAMA_ROUTES_MINIMIZATION_HEURISTIC_MODIFICATION_H