-
Notifications
You must be signed in to change notification settings - Fork 0
/
lemin.h
84 lines (77 loc) · 2.4 KB
/
lemin.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
/* ************************************************************************** */
/* */
/* :::::::: */
/* lemin.h :+: :+: */
/* +:+ */
/* By: pacovali <marvin@codam.nl> +#+ */
/* +#+ */
/* Created: 2019/01/12 18:56:23 by pacovali #+# #+# */
/* Updated: 2019/01/23 17:53:36 by pacovali ######## odam.nl */
/* */
/* ************************************************************************** */
#ifndef __LEMIN_H
# define __LEMIN_H
# include "libft.h"
typedef struct s_room
{
int id_r;
int reserved;
int dist;
int dist2;
char *name;
int ant;
int is_set;
int path_id;
int *in_out;
int x;
int y;
} t_room;
typedef struct s_ant
{
int nr;
int *rout;
int room_id;
} t_ant;
typedef struct s_map
{
int over;
int b_res;
int d_res;
int start;
int min_id;
int max_id;
int stop;
t_room **rooms;
t_room **rooms_s;
int room_qty;
int room_del;
int ant_qty;
int ant_set;
t_ant *ants;
int **path;
int *path_len;
int *path_ids;
int ***x_path;
int ***clean;
int path_qty;
char *output;
int type;
} t_map;
void assign_distance1(t_map *map, int room_id, int dist);
void assign_distance2(t_map *map, int room_id, int dist);
void assign_distance3a(t_map *map, int room_id, int dist);
void assign_distance3b(t_map *map, int room_id, int dist);
void assign_paths(t_map *map, int tot_d, int n[], float prev);
void clean_and_sort1(t_map *map, int ***path, int i[]);
void clean_map(t_map *map);
void crossing_paths(t_map *map);
void distinct_paths(t_map *map);
void free_str_arr(char **s, char ***arr, int flag);
int hash(char *s);
void overlaying_paths(t_map *map);
void run_one(t_map *map);
void run_many(t_map *map, int qty, int fin, int i[]);
t_map *set_map(int fd);
int sort_connections(t_map *map, t_room *room);
int sort_connections2(t_map *map, t_room *room);
#endif