Skip to content

Commit

Permalink
Merge pull request #225 from Pranjal360Agarwal/testing
Browse files Browse the repository at this point in the history
Recommendation feature added
  • Loading branch information
Pranjal360Agarwal authored Oct 21, 2023
2 parents 96a8344 + c323964 commit 0e5d2a4
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions New Features/recommendation_feature.py
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"])

1 comment on commit 0e5d2a4

@vercel
Copy link

@vercel vercel bot commented on 0e5d2a4 Oct 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.