-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from Pranjal360Agarwal/testing
Recommendation feature added
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import random | ||
|
||
def recommend_best_bus(user_preferences, available_buses): | ||
# Simulated recommendation algorithm | ||
recommended_bus = random.choice(available_buses) | ||
return recommended_bus | ||
|
||
# Example usage: | ||
user_preferences = { | ||
"source": "City A", | ||
"destination": "City B", | ||
"date_of_travel": "2023-10-25", | ||
"number_of_tickets": 2, | ||
# Add more user preferences as needed | ||
} | ||
|
||
available_buses = [ | ||
{"bus_name": "Bus X", "price": 50, "available_seats": 20}, | ||
{"bus_name": "Bus Y", "price": 40, "available_seats": 10}, | ||
# Add more bus options | ||
] | ||
|
||
recommended_bus = recommend_best_bus(user_preferences, available_buses) | ||
|
||
print("Recommended Bus:") | ||
print("Bus Name:", recommended_bus["bus_name"]) | ||
print("Price:", recommended_bus["price"]) | ||
print("Available Seats:", recommended_bus["available_seats"]) |
0e5d2a4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
apna-bharat-bus-booking-reservation-system – ./
apna-bharat-bus-booking-reservation-system.vercel.app
apna-bharat-bus-booking-reservation-system-pranjal360agarwal.vercel.app
apna-bharat-bus-booking-reservatio-git-e01564-pranjal360agarwal.vercel.app