0% found this document useful (0 votes)
7 views6 pages

Soft Computing - Assignment 3 (Fall 2022)

The assignment requires students to build a simple Fuzzy Logic Toolbox that allows users to define fuzzy logic systems, including input and output variables, fuzzy sets, and rules, and to run simulations. Students must implement fuzzification, inference, and defuzzification processes, and can earn bonus points for creating a graphical user interface and file handling features. The project has specific submission guidelines and grading criteria, emphasizing teamwork and integrity.

Uploaded by

ttywat61
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views6 pages

Soft Computing - Assignment 3 (Fall 2022)

The assignment requires students to build a simple Fuzzy Logic Toolbox that allows users to define fuzzy logic systems, including input and output variables, fuzzy sets, and rules, and to run simulations. Students must implement fuzzification, inference, and defuzzification processes, and can earn bonus points for creating a graphical user interface and file handling features. The project has specific submission guidelines and grading criteria, emphasizing teamwork and integrity.

Uploaded by

ttywat61
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Cairo University

Faculty of Computers & Artificial Intelligence


Department of Computer Science
Soft Computing Course - 2022

Assignment 3 – Fuzzy Logic Toolbox

About the problem:


A “Fuzzy Logic Toolbox” provides functions and apps for designing and simulating
fuzzy logic systems. It lets the user specify and configure input variables, output variables,
membership functions, rules and defuzzification methods. (Example: MATLAB’s Fuzzy
Logic Toolbox™)

What you are required to do:


Build a simple fuzzy logic toolbox and test it on a well-known problem. In this fuzzy logic
toolbox, the user can:
1. Define a new fuzzy logic system.
2. Define the system’s variables.
3. Define each variable’s range and fuzzy sets.
4. Define the input variables’ crisp values.
5. Define the rules.
6. Get the predicted output.
Example:

Fuzzy Logic Toolbox


===================
1- Create a new fuzzy system
2- Quit

Enter the system’s name and a brief description:


------------------------------------------------
Project Risk Estimation
The problem is to estimate the risk level of a project based on the project
funding and the technical experience of the project’s team members.

Main Menu:
==========
1- Add variables.
2- Add fuzzy sets to an existing variable.
3- Add rules.
4- Run the simulation on crisp values.

Enter the variable’s name, type (IN/OUT) and range ([lower, upper]):
(Press x to finish)
--------------------------------------------------------------------
proj_funding IN [0, 100]
exp_level IN [0, 60]
risk OUT [0, 100]
x

Main Menu:
==========
1- Add variables.
2- Add fuzzy sets to an existing variable.
3- Add rules.
4- Run the simulation on crisp values.

CAN’T START THE SIMULATION! Please add the fuzzy sets and rules first.
Main Menu:
==========
1- Add variables.
2- Add fuzzy sets to an existing variable.
3- Add rules.
4- Run the simulation on crisp values.

Enter the variable’s name:


--------------------------
exp_level

Enter the fuzzy set name, type (TRI/TRAP) and values: (Press x to finish)
-----------------------------------------------------
beginner TRI 0 15 30
intermediate TRI 15 30 45
expert TRI 30 60 60
x

Main Menu:
==========
1- Add variables.
2- Add fuzzy sets to an existing variable.
3- Add rules.
4- Run the simulation on crisp values.

Enter the variable’s name:


--------------------------
proj_funding

Enter the fuzzy set name, type (TRI/TRAP) and values: (Press x to finish)
-----------------------------------------------------
very_low TRAP 0 0 10 30
low TRAP 10 30 40 60
medium TRAP 40 60 70 90
high TRAP 70 90 100 100
x

Main Menu:
==========
1- Add variables.
2- Add fuzzy sets to an existing variable.
3- Add rules.
4- Run the simulation on crisp values.
2

Enter the variable’s name:


--------------------------
risk

Enter the fuzzy set name, type (TRI/TRAP) and values: (Press x to finish)
-----------------------------------------------------
low TRI 0 25 50
normal TRI 25 50 75
high TRI 50 100 100
x

Main Menu:
==========
1- Add variables.
2- Add fuzzy sets to an existing variable.
3- Add rules.
4- Run the simulation on crisp values.

Enter the rules in this format: (Press x to finish)


IN_variable set operator IN_variable set => OUT_variable set
------------------------------------------------------------
proj_funding high or exp_level expert => risk low
proj_funding medium and exp_level intermediate => risk normal
proj_funding medium and exp_level beginner => risk normal
proj_funding low and exp_level beginner => risk high
proj_funding very_low and_not exp_level expert => risk high
x

Main Menu:
==========
1- Add variables.
2- Add fuzzy sets to an existing variable.
3- Add rules.
4- Run the simulation on crisp values.

Enter the crisp values:


-----------------------
proj_funding: 50
exp_level: 40
Running the simulation…
Fuzzification => done
Inference => done
Defuzzification => done

The predicted risk is normal (37.5)

Main Menu:
==========
1- Add variables.
2- Add fuzzy sets to an existing variable.
3- Add rules.
4- Run the simulation on crisp values.
Close

Fuzzy Logic Toolbox


===================
1- Create a new fuzzy system
2- Quit
2

Note: In this example, the user’s input is in gray.


Important remarks to help you solve the problem:
1. You will need to create the appropriate classes and data structures to store the
system’s data.
2. The system may contain multiple output variables.
3. The expected fuzzy set shapes are either triangular or trapezoidal.
4. In the “run simulation” step, you will need to perform fuzzification, inference
and defuzzification using the weighted average method.
5. Show error messages if there is missing input or if the user enters invalid input.
6. Test your program on the example in the lab.
7. If you build a graphical user interface for the fuzzy logic toolbox and implement
reading from and writing to a file, you will get bonus grades.

Assignment submission notes:


• The maximum number of students in a team is 4 and the minimum is 3.
• The deadline will be announced, and no late submission is allowed.
• Please submit one compressed folder. The folder name should follow this
structure: ID1_ID2_ID3_GROUP
• Cheating students will take negative grades and no excuses will be accepted. If
you have any problems during the submission, contact your TA but don’t, under
any circumstances, give your code to or take the code from your friends.

Grading Criteria: (5 marks)


Program & Code Structure 1
Fuzzification (Memberships) 1.5
Inference 1
Defuzzification (Output) 1.5

Good luck

You might also like