Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KeshUdana authored Sep 4, 2024
1 parent 1b2cb67 commit ea84f86
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,55 @@ def hash(password: str):

def verify(plain_password, hashed_password):
return pwd_context.verify(plain_password, hashed_password)

def generate_itineraryKESHAWA(budget, duration, diet_preference, activities):
# Step 1: Initialize and gather inputs

itinerary = []

# Step 2: Retrieve data based on user inputs
accommodations = get_accommodations(budget)
restaurants = get_restaurants(diet_preference, budget)
attractions = get_attractions(activities, budget)

# Step 3: Construct day-by-day itinerary
for day in range(1, duration + 1):
daily_plan = {}

# Morning activity
morning_activity = select_activity(attractions)
daily_plan['morning'] = morning_activity

# Lunch
lunch_spot = select_restaurant(restaurants, morning_activity['location'])
daily_plan['lunch'] = lunch_spot

# Afternoon activity
afternoon_activity = select_activity(attractions)
daily_plan['afternoon'] = afternoon_activity

# Dinner
dinner_spot = select_restaurant(restaurants, afternoon_activity['location'])
daily_plan['dinner'] = dinner_spot

# Accommodation
night_stay = select_accommodation(accommodations, dinner_spot['location'])
daily_plan['accommodation'] = night_stay

itinerary.append(daily_plan)

# Step 4: Budget Allocation
if not within_budget(itinerary, budget):
adjust_itinerary_to_fit_budget(itinerary, budget)

# Step 5: Final Adjustment
optimize_itinerary(itinerary)

# Step 6: Output Generation
output_itinerary(itinerary)

# Step 7: Save Itinerary
save_itinerary_to_database(itinerary)

return itinerary
#Ill take a look at the variables in this total code and make some changes, this is just from what ive written on paper

0 comments on commit ea84f86

Please sign in to comment.