/* aiutils.h */ struct city_list_link { city_record *this; struct city_list_link *next; }; typedef struct { struct city_list_link *first, *last; int num_entries; } list_of_cities; struct road_list_link { road_record *this; struct road_list_link *next; }; typedef struct { struct road_list_link *first, *last; float total_length; int num_entries; } list_of_roads; typedef struct { list_of_roads *route; city_record *from, *to; } state; struct state_set_link { state *this; struct state_set_link *next; }; typedef struct { struct state_set_link *links; int size; } set_of_states; list_of_cities *empty_list_of_cities(void); int is_city_list_empty(list_of_cities *list); int number_of_cities_in_list(list_of_cities *list); void add_city_to_front_of_list(list_of_cities *list, city_record *city); city_record *first_city_in_list(list_of_cities *list); city_record *remove_first_city_from_list(list_of_cities *list); void add_city_to_end_of_list(list_of_cities *list, city_record *city); city_record *last_city_in_list(list_of_cities *list); list_of_roads *empty_list_of_roads(void); void print_list_of_roads(list_of_roads *list); int is_road_list_empty(list_of_roads *list); int number_of_roads_in_list(list_of_roads *list); float total_length_of_path(list_of_roads *list); void add_road_to_front_of_list(list_of_roads *list, road_record *road); road_record *first_road_in_list(list_of_roads *list); road_record *remove_first_road_from_list(list_of_roads *list); void add_road_to_end_of_list(list_of_roads *list, road_record *road); road_record *last_road_in_list(list_of_roads *list); int is_empty_set(set_of_states *set); set_of_states *empty_set(void); void add_to_set(set_of_states *set, state *addition); int size_of_set(set_of_states *set); state *remove_random_member_from_set(set_of_states *set); state *new_state(city_record *from, city_record *to); state *duplicate_state(state *orig); list_of_roads *duplicate_list_of_roads(list_of_roads *orig); list_of_cities *duplicate_list_of_cities(list_of_cities *orig); int city_appears_in_list_of_roads(list_of_roads *lr, city_record *c);