Overview Function

Fridge.findBestRecipeFunction
findBestRecipe(fridgeList, csvPath; numRecipes=3, randRecipe=false)

This function combines all other functions. This function checks if your ingredients are in the database, if not it offers possible alternatives. Next it uses simulated annealing to find a better recipe combination.

Input:

  • fridgeList: A list containing the different foods in your fridge as a string.
  • dataPath: A relative or absolute path to a .csv or .jld2 file containing the recipe database.

Optional Inputs:

  • numRecipes: The max amount of recipes that a combo should contain.
  • randRecipe: A Boolean true or false value. When true, random recipes are used to find the neighbour in simulated annealing.
  • testmode: An optional Boolean argument. When true the function simulates user input.

Output:

  • SASolution: A dictionary containing the best found combination of recipes.
source

This function checks the ingredients by using the checkIngredients function:

Fridge.checkIngredientsFunction
checkIngredients(fridgeList, ingredientList)

This function checks if the foods in your fridge are also found in the ingredient overview of the recipe database. If they are not found in the database, regex is used to find possible alternatives. For instance cheese may be replaced by swiss cheese.

Input:

  • fridgeList: A list containing the different foods in your fridge as a string.
  • ingredientList: A list containing all the different ingredients that are used in the recipe database.
  • test: An optional Boolean argument. When true the function simulates user input.

Output:

  • fridgeList: The (adapted) given fridgeList
source