Reference no: EM133155830
COIT20277 Introduction to Artificial Intelligence - Central Queensland University
Assignment - Fuzzy Sets
Objective 1: Model and design solution to the given problem applying fuzzy system concepts
Objective 2: Develop source code and implement designed solution
Objective 3: Follow use of good programming practice/techniques
Objective 4: Test software implementations to ensure correctness of the model and algorithm
Objective 5: Provide suggestions to enhance the model using one or more computational intelligence techniques
Assessment Task
In this assignment, you are required to write a Java Application that implements a water distribution controlled by a fuzzy controller. You will be using the given input details and guidance on use of fuzzy membership functions to model, design and build your application for the fuzzy controller.
A. The Problem
Let us assume that we have an Internet of Things (IoT) based smart sprinkler system in a park, where the sprinklers will spray water in a given frequency while maintaining the pressure at an optimum level to avoid waste of water. Variable speed drives (VSD) are used for the sprinklers where the speed can be controlled by changing the frequency to adjust the water pressure. Inputs from pressure transducers and frequency of the motor have been used to control the speed of the sprinkler by changing the frequency. The fuzzy controller output is the change in frequency (δF). The inputs of pressure and frequency measurements are given in Table 1 below.
B. Modelling
1. You can use the following guidelines in your modelling.
2. There are two sets of inputs as shown Table 1 and you should use two fuzzy sets for these.
a) Frequency of actuation of the motor-pump set (FR) which is used to vary the speed and hence flow rate. This has 4 levels of Frequency ranges F1 - F4
b) Water pressure (PR) measured in the most unfavourable point of the system
3. The output is the change in frequency (δF)
4. You will develop the fuzzy controller that have two input variables with the following linguistic values and fuzzy membership specifications.
D. Programming
You are required to write a Java Application that implements a fuzzy controller which will perform fuzzification for the pressure and frequency measurements of each input set given in Table 1, fire the fuzzy rules, and then perform defuzzification to obtain a final value for the change in frequency, δF.
You can use the following class descriptions as a guideline for your design.
1. FuzzyMember class
This should store:
start point, endpoint, membership type.
This should have a fuzzy member method which takes an input and converts it to fuzzified (normalised) value. You need appropriate membership functions such as leftTriangle, rightTriangle and Triangle as required.
You should also modify the toString() method to display output properly.
2. FuzzyVariable class
This class stores the fuzzy sets corresponding to a particular type of input or output. For example, if you have three different fuzzy members F1, F2, and F3 related to frequency, then a FuzzyVariable frequency will store all the three members. You can use an ArrayList of FuzzyMembers.
3. FuzzyRule class
This class stores the variables required to construct a rule and these include: Linguistic variables for input and output
Fuzzified output and defuzzified outcome, if multiple rules are not fired at the same time.
4. Controller class
This class creates the objects of pressure, frequency, and change in frequency δF using the FuzzyVariable and FuzzyMember classes. This also creates the RuleSet, an ArrayList of FuzzyRule and stores the given rules.
5. ControllerTest class
This class is for testing your controller using the inputs given by fuzzifying the inputs, firing the rules, and then defuzzifying the outcome. The firing of rules involves applying the min operator for implementing ‘and'. The intersection method in the FuzzyMember class can be used.
The output generated by firing the rule gives the ‘y' axis value. The defuzzification is required to convert that to the x-axis value which is the required output. Please refer to Figure 1 which shows the representation of δF with a fuzzified out and actual output.
Note: As given in Figure 1 fuzzified output can be 0.72 Negative Medium and this can have two corresponding change in frequency values, x1 and x2. One way of defuzzifying is, in case of a triangle, take the right maximum, so the actual change in frequency should x2, -0.04.
E. Source Code
You will write and submit source code in java for the implementation of the application. As you can see many of the classes and methods can be coded following the generic pattern given in examples in Weeks 9 and 10.
You can build your application using the TextPad Editor, NetBeans, or any other suitable IDE for software development.
Example output of the fuzzy controller for some of the inputs given for testing is as given below. (the output formatting can be more user friendly).
FuzzyRule{pressure(7.000)=Low:0.444 frequency(2.300)=F2: 1.000
fuzzified outcome= 0.444, deltaF =positive medium, 0.156}
FuzzyRule{pressure(14.000)=optimum:1.000 frequency(3.500)=F3: 1.000
fuzzified outcome= 1.000, deltaF =zero, 0.000}
FuzzyRule{pressure(11.000) = Low: 0.667 frequency(5.400) = F4: 1.000 fuzzified outcome=0.667,deltaF =positive medium, 0.133},
FuzzyRule{pressure(21.000) = High: 0.875 frequency(4.400) = F4:
1.000 fuzzified outcome=0.875,deltaF=negative Medium,-0.088}
FuzzyRule{pressure(31.000)=very High: 0.900 frequency(5.700) = F4:
fuzzified outcome= 0.900,deltaF =negative Medium,-0.090},
FuzzyRule{pressure(45.000)=very High: 1.000 frequency(5.800) = F4:
1.00 fuzzified outcome= 1.000,deltaF=negative Medium, -0.100}
Report
As part of the assessment you should submit a report that contains the UML class diagrams for the classes and diagrams representing fuzzy membership functions for the variables (Pressure, and Frequency) based on the given specifications. Your report should also contain an explanation of the intersection (Min), Union (Max), and defuzzification operations of the fuzzy sets.
Attachment:- Fuzzy Sets.rar