lambdara / infoia Goto Github PK
View Code? Open in Web Editor NEWIntelligent Agents
Intelligent Agents
If I type an ingredient in the gui and click add, it won't add it. Only when I choose one from the list
When a shopping list is required to hit the threshold, it will start with replacing all missing ingredients for all recipes, then taking the recipe with the highest utility, and creating a shopping list until it hits the threshold. This is how it works from #46 on.
This is not necessarily optimal; There could be recipes which would hit the threshold with a smaller shopping list, because of different values for the available replacements.
The proper way to do it is this: Go through all the recipes, replacing (sorted by smallest effect on utility) ingredients without getting under the threshold. If you are about to go under the threshold but there are still ingredients missing, you add them to the shopping list. This leaves you with a shopping list for every recipe. Now you just choose the recipe with the smallest shopping list; break ties based on utility. (This is important especially if there are multiple recipes without a shopping list).
Compute a recipe by starting with a recipe we know, replace some ingredients up to some threshold of maximum dissimilarity, providing a shopping list of missing ingredients.
There should be some file that contains recipe with ingredients. There should also be some that reads this file and creates a list of recipes (with in each recipe a list of ingredients).
We have decided that for simplicity (for now) we will only use recipes/ingredients for different pasta's. The recipes need to change in such a way that is uses the exact names for the ingredients from the ontology.
So 2 things need to be done:
For example, if multiple ingredients want to be replaced by the same one and they have the same similarity (onion and garlic by shallot, for example), the ties should break based on amount, where of course only ingredients which we don't have too much of are considered.
We should add some more subclasses for the different pastas
create a class Tuple of ingredient and double (similarity)
If the bestrecipe decides that an ingredient can be removed, whilst still being able to create a decent recipe, add the ingredient to the shopping list. Maybe only if there already is a shopping list.
An ontological tree is a tree where all nodes are categories, and the leaves are ingredients. There is #2 on the implementation of ingredients.
This builds on #2. Ingredients should have lists of labels. These labels should perhaps just be strings, but maybe it would be nice to have a weight as well, to indicate how much this label says. ("flaky" is perhaps less important than "sour").
And Ingredient portion is some amount of some ingredient. It is at least an ingredient; a portion could perhaps be an extention of the ingredient class, or have some ingredient field (think about this). Perhaps we should have one superclass like this and several subclasses for the different ways of measuring
We should come up with a solution to make it possible to leave an ingredient out. This can be done by replacing an ingredient by "nothing". We have to add "nothing" to the ontology somehow.
EDIT: we decided to use the weights in the recipes instead of a nothing in the ontology
I click remove button (to remove the ingredient) and it crashes: java.lang.NumberFormatException: For input string: ""
Recipes are just lists of ingredients, because we don't really care about how a dish is made. Therefore you should probably just extend ArrayList
Look at distance to top instead, perhaps combine with how far it is to upper node.
For multiple people
Perhaps start with 5 basic flavors: sweet, sour, bitter, salty and umami (savory).
When you eat it
Copy them to a new one instead
Some of us think this is a good idea, some of us have their doubts. Besides #25 there should also be a weight that indicates how well a certain ingredient can function as a replacer in the recipe. So for example, when there is a recipe with the ingredients (among other things): garlic, onion and tomato. Let' say we don't have onion. Since onion has a high simularity with garlic, onion will probably be replaced by garlic. This is (in my opinion) not what we want, since there already is garlic in the recipe. It could even be the case that the recipe will be end up with 3 garlic and a tomato for example. A solution to this could be that there is another weight. A high weight means that the ingredient will, instead of being replaced by an ingredient that is already in the recipe, be replaced by an ingredient that has a lower simularity but is not in the recipe already. This creates more variation in the recipes.
Some code is commented out; this should be removed. The only comments should be documentation.
In the directory /ontologies there are 3 owl files. The one we use is PastaOntologyRDF.owl. PastaOntology.owl can be removed.
We added weights to the ingredients of every recipe, but this is of course very subjective. For example someone could value one ingredient in this recipe more then someone else.
We could add a simple form of learning: ask user if he wants to replace ingredient A with B, add/subtract the 0.05 from the weight of ingredient A in the recipe.
An ingredient is a certain edible substance. It should at least have a name.
Now, the ingredient objects are created using the ingredients from the avaible recipes. But we want all ingredients from the ontology. So, read them from the ontology and create the objects.
Each ingredient in a recipe should have a "ReplacableWeight" attribute which indicates how much you want to keep something. This should be added in the text files. A higher weight means that it will have a lower chance of being replaced. The format will be: ingredient weight. So for example: "Steak 3.0" means that the simularity will be: simularity^3.0.
For example the different kinds of pasta. Hopefully #36 will fix this.
We already knew this but this issue is here to document it so we don't forget.
Presentation: Please aim for a presentation of 20 minutes. Be specific in explaining what you have done. Specify clearly which agent architecture you have used, how you have designed its various components, why this was better than alternative architectures. Describe your ontology and its usage by the agent. Give demonstrations of a few scenarios that demonstrate how your agent uses the ontology for reasoning.
There should be some file that provides data for the ontological tree. There should also be code that reads this file and turns it into a tree in memory. The tree itself is implemented at #4
Basic: A small UI to see your fridge and possible recipe.
Advanced:
See title...
Now, all nodes are added as an ingredient. This should be removed
We could add amounts in the calculation for which ingredients we have.
Things to think about:
The general idea is simple: You don't have ingredients (in the fridge) anymore, you have amounts of ingredients. A recipe doesn't just require an ingredient, but a certain amount of ingredient. Ingredients should only be replaced with similar amounts.
We need a hardcoded method that reads in a fridge
Every ingredient has a weight. In the code, the following is happening:
If (similarityOfMostSimilarIngredient > certain treshold)
ingredientValue = similarity
else
ingredientValue = 1 - weight
The utility of a recipe is product of all values of ingredients. Pick the recipe with highest utility (or no recipe if it is too low). This way, if a certain ingredient is very important (has a high weight), its value will be very low, so the product of the utility will be very low as well.
Given a recipe with missing ingredients, compute a list of ingredients that is most like this but where ingredients are available. Implement this using the similarity measure of ingredients.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.