osurs  0.0.1
optimize.h
Go to the documentation of this file.
1 
12 #ifndef OSURS_OPTIMIZE_H_
13 #define OSURS_OPTIMIZE_H_
14 
15 #include "osurs/types.h"
16 
26 Seat* new_seat(int seat_id);
27 
37 void seat_add_reservation(Seat* seat, int res_id);
38 
46 void delete_seat(Seat* seat);
47 
58 SeatCollection* new_seat_collection(int seat_count, int seat_ids[]);
59 
67 void delete_seat_collection(SeatCollection* collection);
68 
81 int space_available(unsigned int res_arr[], int res_count, int segment_count,
82  unsigned int seat_count, unsigned int new_res);
83 
97 SeatCollection* optimize_reservation(unsigned int res_arr[], int res_arr_count,
98  int res_ids[], int segment_count,
99  int seat_ids[], int seat_count);
100 
101 #endif // OSURS_OPTIMIZE_H_
void seat_add_reservation(Seat *seat, int res_id)
Adds a new reservation to the seat.
Definition: optimize.c:22
SeatCollection * optimize_reservation(unsigned int res_arr[], int res_arr_count, int res_ids[], int segment_count, int seat_ids[], int seat_count)
Optimize the reservations.
Definition: optimize.c:73
int space_available(unsigned int res_arr[], int res_count, int segment_count, unsigned int seat_count, unsigned int new_res)
Check if there is enough space available.
Definition: optimize.c:55
void delete_seat_collection(SeatCollection *collection)
Delete a seat collection.
Definition: optimize.c:47
SeatCollection * new_seat_collection(int seat_count, int seat_ids[])
Create a new seat collection.
Definition: optimize.c:35
void delete_seat(Seat *seat)
Delete a seat.
Definition: optimize.c:28
Seat * new_seat(int seat_id)
Create a new seat.
Definition: optimize.c:13
A seat collection.
Definition: types.h:190
A seat.
Definition: types.h:178
Data types of osurs.