-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHMI_FL_Optimization.m
48 lines (38 loc) · 1.28 KB
/
HMI_FL_Optimization.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
function [nb_points,nb_connections,nb_iterations,fis_file_name,folder,simulink,fis_simulation,costFunction,criterias] = HMI_FL_Optimization()
prompt = {'Number of points :','Number of connections :','Number of iterations','Pre-config FIS File :',...
'Folder for results','Simulink for simulation','Fis inside your simulink',...
'Enter the cost function that we have to maximize','Enter the number of criterias'};
def = {'','','','','','','','',''};
% HMI name
name = 'Settings';
size = 2;
answer = inputdlg(prompt,name,size,def);
if isempty(answer)
disp('action annulée');
return;
end
nb_points = str2num(answer{1});
nb_connections = str2num(answer{2});
nb_iterations = str2num(answer{3});
fis_file_name = answer{4};
folder = answer{5};
simulink = answer{6};
fis_simulation = answer{7};
costFunction = answer{8};
numberCriterias = str2num(answer{9});
criterias = HMI_Criterias(numberCriterias);
end
function criteria = HMI_Criterias(numberCriterias)
for i_criteria=1:numberCriterias
prompt = {'What criteria'};
def = {''};
name = 'Criteria';
size = 1;
answer = inputdlg(prompt,name,size,def);
if isempty(answer)
disp('action annulée');
return,
end
criteria{i_criteria} = answer{1};
end
end