Question
Write a java program for a washing machine using fuzzy logic. The below logic should be applied in the program:- First it always takes a
Write a java program for a washing machine using fuzzy logic. The below logic should be applied in the program:-
First it always takes a base of 10 minutes. It does this so that people are happy with its work even if they put completly clean laundry in to wash. It then calculates to what degree it is dirty. If it is 100% dirty it adds two minutes per piece of laundry. Of course a real washing machine would just do these calculations in the end, but our model does it for each individual piece so you can keep track of what is going on easier.
So if you now add a piece which is only 50% dirty, it will add 50% of 2 minutes; it adds 1 minute instead of 2 minutes to the base of 10 minutes.
Our washer, however, doesn't only check for dirt but also for grease. Laundry which is greasy has to be washed longer too. Since the laundry can be greasy and dirty at the same time, we have to put them on the same graph. When we do this, we get a graph like the one below:
On the graph to the right, you can see once more the base of ten minutes. The point 0,0 is where the laundry is completely clean; non-dirty and non-greasy. The point 0,1 is where the laundry is non-greasy, but dirty. The point 1,0 is where it is greasy but not dirty and 1,1 is greasy and dirty. The washing machine adds 2 minutes per piece for 100% dirty or 100% greasy and 4 minutes for 100% dirty and greasy.
So now if you have a piece of laundry which is 100% dirty and 50% greasy, you first go to the point 0,1 (100% dirty) and then go halfway towards point 1,1. If the cube would contain more information, you could now see that the washer has to wash it for 3 minutes more than the base of 10 minutes.
It should be able to calculate the total time taken. The output should be as:-
Enter the dirtiness in %-
Enter the weight in lbs:-
The output is the total time taken
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started