forked from XanClic/PSSAI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schedule.h
62 lines (43 loc) · 1.16 KB
/
schedule.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
#ifndef SCHEDULE_H
#define SCHEDULE_H
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
typedef uint16_t tl_config_t;
typedef struct Schedule {
tl_config_t *data;
int length;
int start_index, end_index;
bool is_rush;
struct {
float total, bbs_ss;
} evaluation;
} Schedule;
enum {
TLC_EAST_SR,
TLC_NORTH_SR,
TLC_WEST_SR,
TLC_SOUTH_SR,
TLC_EAST_L,
TLC_NORTH_L,
TLC_WEST_L,
TLC_SOUTH_L,
TLC_COUNT,
TLP_EAST = TLC_COUNT,
TLP_NORTH,
TLP_WEST,
TLP_SOUTH,
TL_COUNT
};
#define TLP_COUNT (TL_COUNT - TLC_COUNT)
Schedule *new_schedule(int seconds, int start_time, bool is_rush);
void schedule_destroy(Schedule *sched);
Schedule *schedule_copy(const Schedule *sched);
bool schedule_initial_constraints(Schedule *sched);
bool schedule_satisfied(const Schedule *sched, bool verbose);
bool schedule_mutate(Schedule *sched, int config_index, bool shorten);
void schedule_evaluate(Schedule *sched);
float schedule_compare(const Schedule *o, const Schedule *n);
void schedule_print(const Schedule *sched, FILE *fp);
void schedule_print_evaluation(const Schedule *sched, FILE *fp);
#endif