-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathfuzzy_centre_1.m
91 lines (62 loc) · 2.37 KB
/
fuzzy_centre_1.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
% Hit any key to load the fuzzy system.
pause
a=readfis('centre_1.fis');
% Hit any key to display the whole system as a block diagram.
pause
figure('name','Block diagram of the fuzzy system');
plotfis(a);
% Hit any key to display fuzzy sets for the linguistic variable "Mean delay".
pause
figure('name','Mean delay (normalised)');
plotmf(a,'input',1);
% Hit any key to display fuzzy sets for the linguistic variable "Number of servers".
pause
figure('name','Number of servers (normalised)');
plotmf(a,'input',2);
% Hit any key to display fuzzy sets for the linguistic variable "Repair utilisation
% factor".
pause
figure('name','Repair utilisation factor');
plotmf(a,'input',3);
% Hit any key to display fuzzy sets for the linguistic variable "Number of spares".
pause
figure('name','Number of spares (normalised)');
plotmf(a,'output',1);
% Hit any key to bring up the Rule Editor.
pause
ruleedit(a);
% Hit any key to generate three-dimensional plots for Rule Base.
pause
figure('name','Three-dimensional surface (a)');
gensurf(a,[2 1],1); view([140 37.5]);
% Hit any key to continue.
pause
figure('name','Three-dimensional surface (b)');
gensurf(a,[1 3],1);
% Hit any key to bring up the Rule Viewer.
pause
ruleview(a);
% Hit any key to continue.
pause
% CASE STUDY
% =====================================================================================
% Suppose, a service centre is required to supply its customers with spare parts within
% 24 hours. The service centre employs 8 servers and the repair utilisation factor is
% 60%. The inventory capacities of the centre are limited by 100 spares. The values for
% the mean delay, number of servers and repair utilisation factor are 0.6, 0.8 and 0.6,
% respectively.
% =====================================================================================
% Hit any key to obtain the required number of spares.
pause
n=round((evalfis([0.7 0.8 0.6],a))*100)
% Hit any key to continue.
pause
% ===================================================================================
% Suppose, now a manager of the service centre wants to reduce the customer's average
% waiting time to 12 hours.
% ===================================================================================
% Hit any key to see how this will effect the required number of spares.
pause
n=round((evalfis([0.35 0.8 0.6],a))*100)
echo off
disp('End of fuzzy_centre_1.m')