-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindividual.h
70 lines (51 loc) · 1.42 KB
/
individual.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
/*
* File: individual.h
* Author: chris
*
* Created on 17 November 2014, 20:47
*/
#ifndef INDIVIDUAL_H
#define INDIVIDUAL_H
#include "navigation.h"
typedef struct {
char species;
unsigned int sighting_num;
sighting_list *sightings;
location position;
} individual;
typedef struct list_ind {
individual *content;
struct list_ind *next;
} individual_list;
/*
* Takes in two sightings, then returns the distance between the two of them.
*/
double get_distance (sighting *species1, sighting *species2);
/*
* Takes in a linked list of sightings and, using the get_distance function,
* determines which of those sightings are the same creature.
*
* Returns a linked list of individual creatures.
*/
individual_list* find_individuals(sighting_list *sightings);
#endif /* INDIVIDUAL_H */
/*
* Takes in two sightings and returns if they are the same creature.
*/
int is_individual (sighting *sighting1, sighting *sighting2);
/*
* Takes in a linked list of sightings and returns an individual
*/
individual* gen_individual(sighting_list *collection);
/*
* Takes in a linked list of individuals and removes any duplicates
*/
void remove_duplicates(individual_list *list);
/*
* Prints out an organised list of individual creatures
*/
void print_individuals(individual_list *list);
/*
* Returns 1 if main contains test, or 0 if not.
*/
int ind_contains(individual_list *main, individual_list *test);