Java passport office simulator using queues, deques, priority queues and stack-based undo.
# Ghana Immigration Service Passport Office Simulator
A Java console application that simulates applicant flow at a Ghana Immigration Service passport office using custom data structures.
The project models normal applications, urgent cases and applications that require document corrections. It demonstrates how queues, deques, priority queues and stacks can work together in a realistic service-centre scenario.
## Features
- Processes normal applicants in FIFO arrival order while prioritising urgent and correction cases according to defined service rules
- Uses a circular queue for normal applicants
- Uses a double-ended queue for document-correction cases
- Uses a priority queue for urgent and emergency applications
- Uses a stack to support undo operations
- Loads 38 sample requests from a CSV file
- Detects queue overflow and records applicants who must return later
- Produces a trace table and final service report
- Simulates passport collections, renewals, new applications, diplomatic travel and emergency travel
## Data Structures
| Structure | Purpose |
|---|---|
| `CircularQueue` | Handles normal applicants in FIFO order while reusing array space |
| `CorrectionDeque` | Handles correction cases from either end based on urgency |
| `PriorityQueue ` | Serves the most urgent eligible applicants first |
| `ActionStack` | Records recent actions for undo functionality |
## Service Rules
1. Applicants requiring corrections enter the correction deque.
2. Urgent correction cases are inserted at the front.
3. Routine correction cases are inserted at the rear.
4. Urgent applicants without corrections enter the priority queue.
5. Other applicants enter the normal circular queue.
6. Service order is urgent queue, correction deque, then normal queue.
## Priority Calculation
Urgent applicants are ordered using:
```text
priority = urgencyLevel × 100
+ urgencyBonus
- estimatedMinutes ÷ 3
- arrivalOrder ÷ 5
```
This ensures that medical emergencies outrank lower-urg …