├── .gitignore ├── Data ├── google-Nov18-0.mat ├── google-Nov18.mat └── wikipedia_non-adaptive_overProvisioning_6G.csv ├── FQL4KE ├── fuzzy_action_calculator.p ├── initq.m ├── error_signal_calculator.m ├── init_knowledge_base.m ├── update_knowledge_base.m ├── fuzzy_action_selector.m ├── globalfql.m ├── update_fis.m ├── reward_calculator.m ├── approximate_q_function.m ├── value_function_calculator.m └── fqlearn.m ├── Compiled └── Learning │ ├── src │ ├── Learning.dll │ ├── LearningNative.dll │ ├── Learning_overview.html │ └── readme.txt │ └── distrib │ ├── Learning.dll │ ├── LearningNative.dll │ ├── Learning_overview.html │ └── readme.txt ├── Controllers ├── RobusT2Scale │ ├── Compiled │ │ ├── RobusT2Scale_pkg.exe │ │ ├── RobusT2Scale │ │ │ ├── src │ │ │ │ ├── RobusT2Scale.dll │ │ │ │ ├── RobusT2ScaleNative.dll │ │ │ │ ├── RobusT2Scale_overview.html │ │ │ │ ├── readme.txt │ │ │ │ ├── RobusT2Scale.xml │ │ │ │ ├── RobusT2ScaleNative.xml │ │ │ │ ├── RobusT2Scale.cs │ │ │ │ └── RobusT2ScaleNative.cs │ │ │ └── distrib │ │ │ │ ├── RobusT2Scale.dll │ │ │ │ ├── RobusT2ScaleNative.dll │ │ │ │ ├── RobusT2Scale_overview.html │ │ │ │ ├── _install.bat │ │ │ │ └── readme.txt │ │ └── RobusT2ScaleExternalFIS │ │ │ ├── src │ │ │ ├── RobusT2ScaleExternalFIS.dll │ │ │ ├── RobusT2ScaleExternalFISNative.dll │ │ │ ├── RobusT2ScaleExternalFIS_overview.html │ │ │ ├── readme.txt │ │ │ ├── RobusT2ScaleExternalFIS.xml │ │ │ ├── RobusT2ScaleExternalFISNative.xml │ │ │ ├── Robust2Scale2.cs │ │ │ └── Robust2Scale2Native.cs │ │ │ └── distrib │ │ │ ├── RobusT2ScaleExternalFIS.dll │ │ │ ├── RobusT2ScaleExternalFISNative.dll │ │ │ ├── RobusT2ScaleExternalFIS_overview.html │ │ │ └── readme.txt │ ├── scaledata.m │ ├── robust2scalesg.fis │ ├── RobusT2Scalesg.m │ └── horizontal_controller_main.m ├── tippersg.fis ├── T1FIS2.fis └── robust2scalesg.fis ├── Demo ├── dataprep.m ├── fuzzy_state_finder.m ├── value_finder.m ├── installQL.m ├── error_signal_calculator.m ├── init_vector.m ├── analysis.m ├── global2.m ├── global1.m ├── global3.m ├── scaledata.m ├── action_selector.m ├── reward_calculator.m ├── qlearn.m ├── fuzzy_action_selector.m ├── state_finder.m ├── update_fis.m ├── pol_finder.m ├── nqlearn.m ├── approximate_q_function.m ├── fuzzy_jump_learn.m ├── value_function_calculator.m ├── jump_learn.m ├── update_net.m ├── fuzzy_action_calculator.m ├── main.m ├── demo.m ├── fqlearn.m ├── global11.m └── global4.m ├── README.md ├── LICENSE.md └── setup.m /.gitignore: -------------------------------------------------------------------------------- 1 | BO4CO 2 | *.m~ 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /Data/google-Nov18-0.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Data/google-Nov18-0.mat -------------------------------------------------------------------------------- /Data/google-Nov18.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Data/google-Nov18.mat -------------------------------------------------------------------------------- /FQL4KE/fuzzy_action_calculator.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/FQL4KE/fuzzy_action_calculator.p -------------------------------------------------------------------------------- /Compiled/Learning/src/Learning.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Compiled/Learning/src/Learning.dll -------------------------------------------------------------------------------- /Compiled/Learning/distrib/Learning.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Compiled/Learning/distrib/Learning.dll -------------------------------------------------------------------------------- /Compiled/Learning/src/LearningNative.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Compiled/Learning/src/LearningNative.dll -------------------------------------------------------------------------------- /Compiled/Learning/distrib/LearningNative.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Compiled/Learning/distrib/LearningNative.dll -------------------------------------------------------------------------------- /Compiled/Learning/src/Learning_overview.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Compiled/Learning/src/Learning_overview.html -------------------------------------------------------------------------------- /Compiled/Learning/distrib/Learning_overview.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Compiled/Learning/distrib/Learning_overview.html -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2Scale_pkg.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Controllers/RobusT2Scale/Compiled/RobusT2Scale_pkg.exe -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2Scale/src/RobusT2Scale.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Controllers/RobusT2Scale/Compiled/RobusT2Scale/src/RobusT2Scale.dll -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2Scale/distrib/RobusT2Scale.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Controllers/RobusT2Scale/Compiled/RobusT2Scale/distrib/RobusT2Scale.dll -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2Scale/src/RobusT2ScaleNative.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Controllers/RobusT2Scale/Compiled/RobusT2Scale/src/RobusT2ScaleNative.dll -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2Scale/distrib/RobusT2ScaleNative.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Controllers/RobusT2Scale/Compiled/RobusT2Scale/distrib/RobusT2ScaleNative.dll -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2Scale/src/RobusT2Scale_overview.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Controllers/RobusT2Scale/Compiled/RobusT2Scale/src/RobusT2Scale_overview.html -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2Scale/distrib/RobusT2Scale_overview.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Controllers/RobusT2Scale/Compiled/RobusT2Scale/distrib/RobusT2Scale_overview.html -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/src/RobusT2ScaleExternalFIS.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/src/RobusT2ScaleExternalFIS.dll -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/distrib/RobusT2ScaleExternalFIS.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/distrib/RobusT2ScaleExternalFIS.dll -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/src/RobusT2ScaleExternalFISNative.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/src/RobusT2ScaleExternalFISNative.dll -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/distrib/RobusT2ScaleExternalFISNative.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/distrib/RobusT2ScaleExternalFISNative.dll -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/src/RobusT2ScaleExternalFIS_overview.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/src/RobusT2ScaleExternalFIS_overview.html -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/distrib/RobusT2ScaleExternalFIS_overview.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pooyanjamshidi/Fuzzy-Q-Learning/HEAD/Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/distrib/RobusT2ScaleExternalFIS_overview.html -------------------------------------------------------------------------------- /FQL4KE/initq.m: -------------------------------------------------------------------------------- 1 | function Q=initq() 2 | %% This function initialize the q-values in the look up table 3 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 4 | 5 | global NS NA 6 | globalfql % global parameters initialized 7 | 8 | Q=zeros(NS,NA); 9 | 10 | end -------------------------------------------------------------------------------- /FQL4KE/error_signal_calculator.m: -------------------------------------------------------------------------------- 1 | function delta_q=error_signal_calculator(Q,current_state,next_state,ais) 2 | %% This function computes the error signal 3 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 4 | 5 | global LAMBDA 6 | 7 | delta_q=reward_calculator(current_state,next_state)+LAMBDA*value_function_calculator(Q,next_state)-approximate_q_function(Q,current_state,ais); 8 | 9 | end -------------------------------------------------------------------------------- /Demo/dataprep.m: -------------------------------------------------------------------------------- 1 | global ITERMAX 2 | % ------------------------------------------------------------------------ 3 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 4 | % The code is released under the FreeBSD License. 5 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 6 | % The scripts implement Fuzzy Q-learning algorithm 7 | % ------------------------------------------------------------------------ 8 | 9 | 10 | DATA=csvread('Data/wikipedia_self-adaptive.csv',1,1,[1 1 ITERMAX 2]); -------------------------------------------------------------------------------- /Demo/fuzzy_state_finder.m: -------------------------------------------------------------------------------- 1 | function current_state=fuzzy_state_finder(iter) 2 | % ------------------------------------------------------------------------ 3 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 4 | % The code is released under the FreeBSD License. 5 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 6 | % The scripts implement Fuzzy Q-learning algorithm 7 | % ------------------------------------------------------------------------ 8 | 9 | 10 | global NORMONDATA 11 | 12 | current_state=NORMONDATA(iter,:); 13 | 14 | end -------------------------------------------------------------------------------- /Demo/value_finder.m: -------------------------------------------------------------------------------- 1 | function qvalue=value_finder(state,action,vector) 2 | %% compute o_p=sum{w(j)*x_p(j)} 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | qvalue=vector(action,1)+(vector(action,2)*state); -------------------------------------------------------------------------------- /FQL4KE/init_knowledge_base.m: -------------------------------------------------------------------------------- 1 | function init_knowledge_base() 2 | %% initializing the rule base and creating a folder for archiving them 3 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 4 | 5 | global FISFILENAME ARCHIVEFOLDER FIS 6 | globalfql % global parameters initialized 7 | 8 | % create archive folder 9 | if exist(ARCHIVEFOLDER,'dir')~=7 10 | mkdir(ARCHIVEFOLDER); 11 | fileattrib(ARCHIVEFOLDER,'+w'); 12 | end 13 | 14 | % create the current rule base useing for reasoning 15 | writefis(FIS,FISFILENAME); 16 | fileattrib(FISFILENAME,'+w'); 17 | 18 | end -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2Scale/distrib/_install.bat: -------------------------------------------------------------------------------- 1 | ECHO OFF 2 | 3 | :START 4 | ECHO Deploying project RobusT2Scale 5 | 6 | SET NEEDUPDATEPATH= 7 | IF EXIST MCRInstaller.exe ( 8 | ECHO Running MCRInstaller 9 | MCRInstaller.exe 10 | SET NEEDUPDATEPATH=1 11 | ) ELSE IF EXIST MCRInstaller.cmd ( 12 | ECHO Running remote MCRInstaller 13 | MCRInstaller.cmd 14 | SET NEEDUPDATEPATH=1 15 | ) 16 | 17 | 18 | 19 | :COMPLETE 20 | ECHO Installation complete. 21 | ECHO Please refer to the documentation for any additional setup steps. -------------------------------------------------------------------------------- /Demo/installQL.m: -------------------------------------------------------------------------------- 1 | function installQL() 2 | %% This function installs the paths 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | dirNames={'./Controllers','./Data'}; 12 | 13 | for i=1:length(dirNames) 14 | addpath(dirNames{i}); 15 | end 16 | 17 | end -------------------------------------------------------------------------------- /Demo/error_signal_calculator.m: -------------------------------------------------------------------------------- 1 | function delta_q=error_signal_calculator(stat) 2 | %% This function computes the error signal 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | global LAMBDA 12 | 13 | delta_q=stat.rimm+LAMBDA*value_function_calculator(stat)-approximate_q_function(stat); 14 | 15 | end -------------------------------------------------------------------------------- /FQL4KE/update_knowledge_base.m: -------------------------------------------------------------------------------- 1 | function fis=update_knowledge_base(Q) 2 | %% updating the rule base 3 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 4 | 5 | global FISFILENAME ARCHIVEFOLDER 6 | globalfql % global parameters initialized 7 | 8 | % update the rule base 9 | fis=update_fis(Q); 10 | 11 | % archive the old rule base of FLC in place 12 | c=clock; 13 | newName=sprintf(strcat(FISFILENAME,'-%s.fis'),strcat(num2str(c(1,1)),'-',num2str(c(1,2)),'-',num2str(c(1,3)),'-',num2str(c(1,4)),'-',num2str(c(1,5)),'-',num2str(c(1,6)))); 14 | copyfile(FISFILENAME,strcat(ARCHIVEFOLDER,'/',newName),'f'); 15 | 16 | % replace the rule base with the updated version 17 | writefis(fis,FISFILENAME); 18 | 19 | end -------------------------------------------------------------------------------- /Demo/init_vector.m: -------------------------------------------------------------------------------- 1 | function stat=init_vector(stat) 2 | %% initialize vector to small numbers 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | global NA 12 | 13 | 14 | for a=1:NA 15 | for i=1:2 16 | stat.vector(a,i)=rand(1); 17 | end 18 | end 19 | 20 | % set random number generator to a fixed seed 21 | 22 | rand('seed',1); 23 | 24 | 25 | end -------------------------------------------------------------------------------- /Demo/analysis.m: -------------------------------------------------------------------------------- 1 | % This script analyze the data and prepare the simulation diagrams 2 | % ------------------------------------------------------------------------ 3 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 4 | % The code is released under the FreeBSD License. 5 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 6 | % The scripts implement Fuzzy Q-learning algorithm 7 | % ------------------------------------------------------------------------ 8 | 9 | 10 | global NO_REPLICATIONS ITERMAX NA NS TPM TRM LAMBDA 11 | 12 | x=1:1:ITERMAX; 13 | figure; 14 | plot(x,squeeze(stat_h(1,1,:))',x,squeeze(stat_h(1,2,:))'); 15 | 16 | figure; 17 | plot(x,squeeze(stat_h(2,1,:))',x,squeeze(stat_h(2,2,:))'); 18 | 19 | figure; 20 | plot(x,squeeze(stat_h(3,1,:))',x,squeeze(stat_h(2,2,:))'); 21 | -------------------------------------------------------------------------------- /Controllers/tippersg.fis: -------------------------------------------------------------------------------- 1 | [System] 2 | Name='tippersg' 3 | Type='sugeno' 4 | Version=2.0 5 | NumInputs=2 6 | NumOutputs=1 7 | NumRules=3 8 | AndMethod='min' 9 | OrMethod='max' 10 | ImpMethod='prod' 11 | AggMethod='sum' 12 | DefuzzMethod='wtaver' 13 | 14 | [Input1] 15 | Name='service' 16 | Range=[0 10] 17 | NumMFs=3 18 | MF1='poor':'gaussmf',[1.5 0] 19 | MF2='average':'gaussmf',[1.5 5] 20 | MF3='good':'gaussmf',[1.5 10] 21 | 22 | [Input2] 23 | Name='food' 24 | Range=[0 10] 25 | NumMFs=2 26 | MF1='rancid':'trapmf',[-5 0 1 3] 27 | MF2='delicious':'trapmf',[7 9 10 15] 28 | 29 | [Output1] 30 | Name='tip' 31 | Range=[-30 30] 32 | NumMFs=3 33 | MF1='cheap':'linear',[0 0 5] 34 | MF2='average':'linear',[0 0 15] 35 | MF3='generous':'linear',[0 0 25] 36 | 37 | [Rules] 38 | 1 1, 1 (1) : 2 39 | 2 0, 2 (1) : 1 40 | 3 2, 3 (1) : 2 41 | -------------------------------------------------------------------------------- /Demo/global2.m: -------------------------------------------------------------------------------- 1 | global NO_REPLICATIONS ITERMAX NA NS TPM TRM LAMBDA 2 | 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | NO_REPLICATIONS=30; % No of replications of simulation 11 | ITERMAX=10000; % No of iterations of learning 12 | NA=2; % Number of actions in each state 13 | NS=2; % Number of states 14 | 15 | LAMBDA=0.8; % discount factor 16 | 17 | TPM(:,:,1)=[0.7,0.3;0.4,0.6]; 18 | 19 | TPM(:,:,2)=[0.9,0.1;0.2,0.8]; 20 | 21 | TRM(:,:,1)=[6,5;7,12]; 22 | 23 | TRM(:,:,2)=[10,17;14,13]; 24 | 25 | -------------------------------------------------------------------------------- /Demo/global1.m: -------------------------------------------------------------------------------- 1 | global NO_REPLICATIONS ITERMAX NA NS TPM TRM LAMBDA 2 | 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | NO_REPLICATIONS=30; % No of replications of simulation 12 | ITERMAX=10000; % No of iterations of learning 13 | NA=2; % Number of actions in each state 14 | NS=2; % Number of states 15 | 16 | LAMBDA=0.8; % discount factor 17 | 18 | TPM(:,:,1)=[0.7,0.3;0.4,0.6]; 19 | 20 | TPM(:,:,2)=[0.9,0.1;0.2,0.8]; 21 | 22 | TRM(:,:,1)=[6,-5;7,12]; 23 | 24 | TRM(:,:,2)=[10,17;-14,13]; 25 | 26 | -------------------------------------------------------------------------------- /Demo/global3.m: -------------------------------------------------------------------------------- 1 | global NO_REPLICATIONS ITERMAX NA NS TPM TRM LAMBDA 2 | 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | NO_REPLICATIONS=30; % No of replications of simulation 12 | ITERMAX=10000; % No of iterations of learning 13 | NA=2; % Number of actions in each state 14 | NS=2; % Number of states 15 | 16 | LAMBDA=0.8; % discount factor 17 | 18 | TPM(:,:,1)=[0.7,0.3;0.4,0.6]; 19 | 20 | TPM(:,:,2)=[0.9,0.1;0.2,0.8]; 21 | 22 | TRM(:,:,1)=[6,-5;7,12]; 23 | 24 | TRM(:,:,2)=[12,17;-14,13]; 25 | 26 | -------------------------------------------------------------------------------- /FQL4KE/fuzzy_action_selector.m: -------------------------------------------------------------------------------- 1 | function action=fuzzy_action_selector(Q,rule_number,epsilon) 2 | %% This function returns the next selected actions using epsilon-greedy policy 3 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 4 | 5 | global NA 6 | globalfql % global parameters initialized 7 | 8 | ran=rand(1); 9 | 10 | % action index is from 1 to J=maximum number of actions which is the same 11 | % as number of columns in Q 12 | 13 | 14 | % setting the exploration probability 15 | exploitation_probability=1-epsilon; 16 | 17 | % Selecting an action via epsilon-greedy policy 18 | 19 | if ran0) % violated but has been improved due to the action 20 | reward=0; % not either penalize nor give positive reward 21 | else %violated and has been dropped from last time 22 | reward=exp((SLA(1)-current_state(2))/SLA(1))-1; % a negative reward between [-1 0) 23 | end 24 | end 25 | 26 | end -------------------------------------------------------------------------------- /FQL4KE/reward_calculator.m: -------------------------------------------------------------------------------- 1 | function reward=reward_calculator(current_state,next_state) 2 | %% This function calculates the reinforcement signal 3 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 4 | 5 | % Here we can amend the reward function based on the problem formulation, 6 | % e.g., VScaler paper 7 | % state=[workload, rt, throughput, #VM], DESIRED_RT=Response time SLO 8 | global DESIRED_RT W MAX_THROUGHPUT MAX_VM 9 | 10 | if next_state(2)2*DESIRED_RT 14 | slaFactor=1; 15 | else 16 | slaFactor=(next_state(2)-DESIRED_RT)/DESIRED_RT; 17 | end 18 | end 19 | 20 | Ut_1=W(1)*next_state(3)/MAX_THROUGHPUT+W(2)*(1-next_state(4)/MAX_VM)+W(3)*(1-slaFactor); 21 | 22 | %-------------------------------------------------------------------------- 23 | if current_state(2)2*DESIRED_RT 27 | slaFactor=1; 28 | else 29 | slaFactor=(current_state(2)-DESIRED_RT)/DESIRED_RT; 30 | end 31 | end 32 | 33 | Ut=W(1)*current_state(3)/MAX_THROUGHPUT+W(2)*(1-current_state(4)/MAX_VM)+W(3)*(1-slaFactor); 34 | 35 | 36 | reward=Ut_1-Ut; 37 | 38 | end -------------------------------------------------------------------------------- /Demo/qlearn.m: -------------------------------------------------------------------------------- 1 | function stat=qlearn(stat) 2 | % ------------------------------------------------------------------------ 3 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 4 | % The code is released under the FreeBSD License. 5 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 6 | % The scripts implement Fuzzy Q-learning algorithm 7 | % ------------------------------------------------------------------------ 8 | 9 | 10 | global LAMBDA 11 | 12 | % Q-Learning 13 | 14 | % Finding the Max factor in the current state 15 | 16 | q_next=max(stat.Q(stat.current_state,:)); 17 | 18 | % incrementing the learning iteration 19 | stat.iter=stat.iter+1; 20 | 21 | %% Setting the step-size to determine how fast learning takes place: learning rate 22 | 23 | % 1/k 24 | %learn_rate=1/(stat.iter); 25 | 26 | % log(k)/k 27 | %learn_rate=log(stat.iter+1)/(stat.iter+1); 28 | 29 | % a/(b+k) 30 | %learn_rate=0.5*300/(300+stat.iter); 31 | 32 | % constant learning rate 33 | learn_rate=0.1; 34 | 35 | %% Value iteration update rule 36 | % Q_old 37 | q=stat.Q(stat.old_state,stat.old_action); 38 | 39 | % Q_new 40 | q=q*(1-learn_rate)+(learn_rate*(stat.rimm+(LAMBDA*q_next))); 41 | 42 | stat.Q(stat.old_state,stat.old_action)=q; 43 | -------------------------------------------------------------------------------- /FQL4KE/approximate_q_function.m: -------------------------------------------------------------------------------- 1 | function q=approximate_q_function(Q,current_state,ais) 2 | %% This function approximate the Q function from the current q-values and the degree of truth of the rules 3 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 4 | 5 | global NS FIS 6 | 7 | % determine the number of antecedents of the rules in the knowledge base of 8 | % the fuzzy logic controller 9 | number_of_input=size(FIS.input,2); 10 | 11 | % initialize the activation function or degree of truth of the rules in the 12 | % knowledge base, again number of rules is equal to number of states in MDP 13 | alpha=ones(NS,1); 14 | 15 | % initialize q-value 16 | q=0; 17 | 18 | for i=1:NS % number of rules 19 | 20 | for j=1:number_of_input % number of antecedents 21 | 22 | % if the antecedent MF exists in the associated rule 23 | if FIS.rule(i).antecedent(j)>0 24 | %calculate the activation function 25 | alpha(i)=alpha(i)*evalmf(current_state(j),FIS.input(j).mf(FIS.rule(i).antecedent(j)).params,FIS.input(j).mf(FIS.rule(i).antecedent(j)).type); 26 | end 27 | 28 | end 29 | 30 | % calculate the q-value 31 | q=q+alpha(i)*Q(i,ais(i)); 32 | 33 | end -------------------------------------------------------------------------------- /Demo/fuzzy_action_selector.m: -------------------------------------------------------------------------------- 1 | function action=fuzzy_action_selector(stat,rule_number) 2 | %% This function returns the next selected actions using epsilon-greedy policy 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | global NA EPSILON 12 | 13 | ran=rand(1); 14 | 15 | %set the initial candidate action to 0 meaning that action is not selected 16 | % action index is from 1 to J=maximum number of actions which is the same 17 | % as number of columns in Q 18 | action=0; 19 | 20 | % setting the exploration probability 21 | exploitation_probability=1-EPSILON; 22 | 23 | % Selecting an action via epsilon-greedy policy 24 | 25 | if ran0 24 | % calculate the activation function 25 | alpha(i)=alpha(i)*evalmf(next_state(j),FIS.input(j).mf(FIS.rule(i).antecedent(j)).params,FIS.input(j).mf(FIS.rule(i).antecedent(j)).type); 26 | end 27 | 28 | end 29 | 30 | maxQfactor=max(Q(i,:)); % note that max/min should be in accordance with reward/cost as reinfrocement signal 31 | 32 | % calculate the value of the new state 33 | v=v+alpha(i)*maxQfactor; 34 | 35 | end -------------------------------------------------------------------------------- /Controllers/T1FIS2.fis: -------------------------------------------------------------------------------- 1 | [System] 2 | Name='T1FIS2' 3 | Type='mamdani' 4 | Version=2.0 5 | NumInputs=2 6 | NumOutputs=1 7 | NumRules=21 8 | AndMethod='prod' 9 | OrMethod='max' 10 | ImpMethod='prod' 11 | AggMethod='max' 12 | DefuzzMethod='centroid' 13 | 14 | [Input1] 15 | Name='input1' 16 | Range=[0 5] 17 | NumMFs=3 18 | MF1='mf1':'trapmf',[0 0 1.87 2.38] 19 | MF2='mf2':'trimf',[0.94 2.675 4.26] 20 | MF3='mf3':'trapmf',[3.52 3.93 5 5] 21 | 22 | [Input2] 23 | Name='input2' 24 | Range=[0 5] 25 | NumMFs=3 26 | MF1='mf1':'trapmf',[0 0 1.87 2.38] 27 | MF2='mf2':'trimf',[0.94 2.675 4.26] 28 | MF3='mf3':'trapmf',[3.52 3.93 5 5] 29 | 30 | [Output1] 31 | Name='output1' 32 | Range=[0 5] 33 | NumMFs=4 34 | MF1='cmf2':'trimf',[0.93 2.135 3.86] 35 | MF2='cmf3':'trimf',[1.65 3.12 4.75] 36 | MF3='cmf1':'trapmf',[0 0 1.64 2.26] 37 | MF4='cmf4':'trapmf',[3.42 3.64 5 5] 38 | 39 | [Rules] 40 | 1 1, 1 (0.7) : 1 41 | 1 2, 1 (0.8) : 1 42 | 1 3, 3 (0.9) : 1 43 | 2 1, 2 (0.7) : 1 44 | 2 2, 2 (0.6) : 1 45 | 2 3, 2 (0.5) : 1 46 | 3 1, 4 (0.8) : 1 47 | 3 2, 4 (0.6) : 1 48 | 3 3, 2 (0.5) : 1 49 | 1 1, 2 (0.2) : 1 50 | 1 1, 3 (0.1) : 1 51 | 1 2, 3 (0.2) : 1 52 | 1 3, 1 (0.1) : 1 53 | 2 1, 1 (0.2) : 1 54 | 2 1, 4 (0.1) : 1 55 | 2 2, 1 (0.4) : 1 56 | 2 3, 1 (0.5) : 1 57 | 3 1, 2 (0.2) : 1 58 | 3 2, 2 (0.4) : 1 59 | 3 3, 4 (0.4) : 1 60 | 3 3, 1 (0.1) : 1 61 | -------------------------------------------------------------------------------- /Demo/state_finder.m: -------------------------------------------------------------------------------- 1 | function candidate=state_finder(stat) 2 | %% This function returns the next selected state 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | global TPM 12 | 13 | ran=rand(1); 14 | 15 | old_action=stat.old_action; 16 | old_state=stat.old_state; 17 | 18 | %set the initial candidate state to 1 19 | candidate=1; 20 | 21 | sum=0; 22 | 23 | sum=sum+TPM(old_state,candidate,old_action); 24 | 25 | % 0 stands when the selection process is not complete yet and 1 means that 26 | % the next state has been selected randomly. 27 | complete=0; 28 | 29 | while 0==complete 30 | 31 | if ran0 15 | % show vector 16 | stat.vector 17 | % update Q values 18 | for state=1:NS 19 | 20 | for action=1:NA 21 | 22 | Q(state,action)=value_finder(state,action,stat.vector) 23 | 24 | end 25 | 26 | end 27 | stat.Q=Q; 28 | end 29 | 30 | 31 | 32 | for state=1:NS 33 | % choose thre value and index of the optimum Q 34 | [maxQfactor,index]=max(stat.Q(state,:)); 35 | 36 | policy(state)=index; 37 | 38 | value_function(state)=maxQfactor; 39 | 40 | end 41 | 42 | %show optimal policy: pi:S->A 43 | policy 44 | 45 | %show value function 46 | value_function 47 | 48 | for state=1:NS 49 | 50 | for action=1:NA 51 | state 52 | action 53 | stat.Q(state,action) 54 | end 55 | 56 | end 57 | -------------------------------------------------------------------------------- /Demo/nqlearn.m: -------------------------------------------------------------------------------- 1 | function stat=nqlearn(stat) 2 | %% a neuron coupled with q-learning 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | global LAMBDA 12 | 13 | % Finding the Max factor in the current state but here through vector not Q 14 | % values as in traditional q-learning procedure 15 | 16 | q_next=max(value_finder(stat.current_state,1,stat.vector),value_finder(stat.current_state,2,stat.vector)); 17 | 18 | % incrementing the learning iteration 19 | stat.iter=stat.iter+1; 20 | %% Setting the step-size to determine how fast learning takes place: learning rate 21 | 22 | %learn_rate=1/(stat.iter); 23 | 24 | %learn_rate=log(stat.iter+1)/(stat.iter+1); 25 | 26 | learn_rate=0.5*300/(300+stat.iter); 27 | 28 | 29 | %% Value iteration update rule 30 | % Q_old 31 | q=value_finder(stat.old_state,stat.old_action,stat.vector); 32 | 33 | % Q_new 34 | q=q*(1-learn_rate)+(learn_rate*(stat.rimm+(LAMBDA*q_next))); 35 | 36 | % update the vector through neural network update 37 | stat.vector=update_net(q,stat.old_action,stat.old_state,stat.vector); 38 | 39 | % update Q 40 | stat.Q(stat.old_state,stat.old_action)=q; 41 | -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/RobusT2Scalesg.m: -------------------------------------------------------------------------------- 1 | function scalingaction=RobusT2Scalesg(x1,x2) 2 | 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The scripts implements the sugeno fuzzy controller and 6 | % produce the output which is the scaling action for horizontal elasticity. 7 | % x1: workload (should be normalized in [0 100]) 8 | % x2: response time (should be normalized in [0 100]) 9 | % scalingaction: [-2 +2], this determines the change in the number of resources 10 | % ------------------------------------------------------------------------ 11 | 12 | % Example: 13 | % output = RobusT2Scalesg(10,10) 14 | % This generates the response for example 15 | % output = -2 16 | 17 | 18 | % reads the designed fuzzy controller which is based on sugeno fuzzy type 19 | myfis=readfis('robust2scalesg.fis'); 20 | 21 | % Check the fis for empty values 22 | checkfis(myfis); 23 | 24 | % Issue warning if inputs out of range 25 | inRange = getfis(myfis,'inRange'); 26 | InputMin = min([x1 x2]); 27 | InputMax = max([x1 x2]); 28 | 29 | if any(InputMin(:)inRange(:,2)) 30 | warning('Some input values are outside of the normalized range.') 31 | end 32 | 33 | % this determines the precision of reasoning calculation 34 | numofpoints=101; 35 | 36 | % this evaluates the output based on the defined MFs and the rule engine 37 | % inside the fuzzy controller. 38 | scalingaction = evalfismex([x1 x2],myfis,numofpoints); 39 | 40 | end -------------------------------------------------------------------------------- /Demo/approximate_q_function.m: -------------------------------------------------------------------------------- 1 | function q=approximate_q_function(stat) 2 | %% This function approximate the Q function from the current q-values and the degree of truth of the rules 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | global NS FIS 12 | 13 | % determine the number of antecedents of the rules in the knowledge base of 14 | % the fuzzy logic controller 15 | number_of_input=size(FIS.input,2); 16 | 17 | % initialize the activation function or degree of truth of the rules in the 18 | % knowledge base, again number of rules is equal to number of states in MDP 19 | alpha=ones(NS,1); 20 | 21 | % initialize q-value 22 | q=0; 23 | 24 | for i=1:NS % number of rules 25 | 26 | for j=1:number_of_input % number of antecedents 27 | 28 | % if the antecedent MF exists in the associated rule 29 | if FIS.rule(i).antecedent(j)>0 30 | %calculate the activation function 31 | alpha(i)=alpha(i)*evalmf(stat.old_state(j),FIS.input(j).mf(FIS.rule(i).antecedent(j)).params,FIS.input(j).mf(FIS.rule(i).antecedent(j)).type); 32 | end 33 | 34 | end 35 | 36 | % calculate the q-value 37 | q=q+alpha(i)*stat.Q(i,fuzzy_action_selector(stat,i)); 38 | 39 | end -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The FreeBSD License 2 | 3 | Copyright (c) 2016, Pooyan Jamshidi, Imperial College London. 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 11 | 12 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | -------------------------------------------------------------------------------- /setup.m: -------------------------------------------------------------------------------- 1 | function setup 2 | % Setup script 3 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 4 | % The code is released under the FreeBSD License. 5 | % Copyright (C) 2018 Pooyan Jamshidi 6 | 7 | disp('setting path...'); 8 | pathCell = regexp(path, pathsep, 'split'); 9 | 10 | myDir = fileparts(mfilename('fullpath')); 11 | paths = genpath(myDir); 12 | paths = strread(paths, '%s', 'delimiter', ':'); 13 | pathsToAdd = []; 14 | 15 | if ispc 16 | del = '\'; 17 | else 18 | del = '/'; 19 | end 20 | 21 | for i=1:length(paths) 22 | thisPath = paths{i}; 23 | thisPathSplit = strread(thisPath, '%s', 'delimiter', del); 24 | addThisPath = 1; 25 | 26 | % Do not add any directories or files starting with a . or a ~ or if it 27 | % currently on the path 28 | for j=1:length(thisPathSplit) 29 | thisStr = thisPathSplit{j}; 30 | if (~isempty(thisStr)) && ((thisStr(1) == '.') || (thisStr(1) == '~')) || any(strcmpi(thisPath, pathCell)) 31 | addThisPath = 0; 32 | end 33 | 34 | end 35 | if addThisPath ==1 36 | if ~isempty(pathsToAdd) 37 | thisPath = [':' thisPath]; 38 | end 39 | pathsToAdd = [pathsToAdd thisPath]; 40 | end 41 | end 42 | 43 | if ~isempty(pathsToAdd) 44 | addpath(pathsToAdd); 45 | end 46 | 47 | if ispc 48 | rmpath('Controllers\RobusT2Scale') 49 | else 50 | rmpath('Controllers/RobusT2Scale') 51 | end 52 | rmpath('FQL4KE') 53 | end 54 | 55 | % if you want to not run this when you exit matlab uncomment this, use 56 | % this: which pathdef.m -all 57 | %savepath; 58 | -------------------------------------------------------------------------------- /Demo/fuzzy_jump_learn.m: -------------------------------------------------------------------------------- 1 | function [stat,done]=fuzzy_jump_learn(stat,new_input) 2 | %% This function simulates a jump and also updates the learning stats 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | global ITERMAX 12 | 13 | old_state=stat.old_state; 14 | 15 | old_action=stat.old_action; 16 | 17 | % Record current state 18 | 19 | stat.current_state=new_input; 20 | 21 | % Record the immediate reward earned in going from "old_state" to "current_state" 22 | % under old_action 23 | 24 | stat.rimm=reward_calculator(old_state,new_input,old_action); 25 | 26 | % at this point stat structure contains information that is needed for 27 | % updating the Q values, so we apply the qlearning procedure here. 28 | % TODO: code should be resuable in a way that different qlearning variations can 29 | % replace the current logic 30 | 31 | % call fuzzy Q-learning procedure 32 | 33 | stat=fqlearn(stat); 34 | 35 | % Select next action 36 | 37 | next_action=fuzzy_action_calculator(stat,new_input); 38 | 39 | % Get ready to get out of this function 40 | 41 | stat.old_state=new_input; 42 | 43 | stat.old_action=next_action; 44 | 45 | if stat.iter>=ITERMAX 46 | % simulation should end 47 | 48 | done=1; 49 | else 50 | % simulation should continue 51 | 52 | done=0; 53 | end -------------------------------------------------------------------------------- /Demo/value_function_calculator.m: -------------------------------------------------------------------------------- 1 | function v=value_function_calculator(stat) 2 | %% This function computes the value of the new state 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | global NS FIS 12 | 13 | % determine the number of antecedents of the rules in the knowledge base of 14 | % the fuzzy logic controller 15 | number_of_input=size(FIS.input,2); 16 | 17 | % initialize the activation function or degree of truth of the rules in the 18 | % knowledge base, again number of rules is equal to number of states in MDP 19 | alpha=ones(NS,1); 20 | 21 | % initialize q-value 22 | v=0; 23 | 24 | for i=1:NS % number of rules 25 | 26 | for j=1:number_of_input % number of antecedents 27 | 28 | % if the antecedent MF exists in the associated rule 29 | if FIS.rule(i).antecedent(j)>0 30 | %calculate the activation function 31 | alpha(i)=alpha(i)*evalmf(stat.current_state(j),FIS.input(j).mf(FIS.rule(i).antecedent(j)).params,FIS.input(j).mf(FIS.rule(i).antecedent(j)).type); 32 | end 33 | 34 | end 35 | 36 | maxQfactor=max(stat.Q(i,:)); % note that max/min should be in accordance with reward/cost as reinfrocement signal 37 | 38 | % calculate the value of the new state 39 | v=v+alpha(i)*maxQfactor; 40 | 41 | end -------------------------------------------------------------------------------- /Demo/jump_learn.m: -------------------------------------------------------------------------------- 1 | function [stat,done]=jump_learn(stat) 2 | %% This function simulates a jump and also updates the learning stats 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | global ITERMAX TRM 12 | 13 | old_state=stat.old_state; 14 | 15 | old_action=stat.old_action; 16 | 17 | % Determine current state 18 | 19 | current_state=state_finder(stat); 20 | 21 | % Record current state 22 | 23 | stat.current_state=current_state; 24 | 25 | % Record the immediate reward earned in going from "old_state" to "current_state" 26 | % under old_action 27 | 28 | stat.rimm=TRM(old_state,current_state,old_action); 29 | 30 | % at this point stat structure contains information that is needed for 31 | % updating the Q values, so we apply the qlearning procedure here. 32 | % TODO: code should be resuable in a way that different qlearning variations can 33 | % replace the current logic 34 | 35 | % Q-learning procedure 36 | 37 | stat=nqlearn(stat); 38 | 39 | % Select next action 40 | 41 | next_action=action_selector(stat); 42 | 43 | % Get ready to get out of this function 44 | 45 | stat.old_state=current_state; 46 | 47 | stat.old_action=next_action; 48 | 49 | if stat.iter>=ITERMAX 50 | % simulation should end 51 | 52 | done=1; 53 | else 54 | % simulation should continue 55 | 56 | done=0; 57 | end -------------------------------------------------------------------------------- /Demo/update_net.m: -------------------------------------------------------------------------------- 1 | function vector=update_net(q,action,state,vector) 2 | %% update the neural netwrok, a simple neuron (linear neural network of two input nodes and one output nofr) as a function approximator 3 | % approximated function is a plane with a constant 1 and one independent variable "state", weights are vector(action,1) and vector(action,2) 4 | % we implemented Incremental Widrow-Hoft algorithm: http://homepages.gold.ac.uk/nikolaev/311Delta.htm 5 | 6 | % This implementation is mostly inspired by the book: http://books.google.ie/books?id=XqKyW9U3PWAC&pg=PA72&lpg=PA72&dq=Incremental+Widrow-Hoff+algorithm&source=bl&ots=mWiuufoila&sig=danaX99O5RNVRrEkbw8ua6Vj7Ng&hl=en&sa=X&ei=lQpgVJ-0KbCO7Aaw_4HIDg&ved=0CCsQ6AEwAQ#v=onepage&q=Incremental%20Widrow-Hoff%20algorithm&f=false 7 | % ------------------------------------------------------------------------ 8 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 9 | % The code is released under the FreeBSD License. 10 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 11 | % The scripts implement Fuzzy Q-learning algorithm 12 | % ------------------------------------------------------------------------ 13 | 14 | 15 | 16 | global NET_ITERMAX 17 | 18 | % target value, Q_new, see nqlearn 19 | target=q; 20 | 21 | % neuron's internal learning iterations 22 | for iter=1:NET_ITERMAX 23 | 24 | % one iteration of training 25 | 26 | % old value 27 | output=value_finder(state,action,vector); 28 | 29 | % learning rate 30 | mu=log(iter+1)/(iter+1); 31 | 32 | % updateing the vector 33 | vector(action,1)=vector(action,1)+(mu*(target-output)*1); 34 | 35 | vector(action,2)=vector(action,2)+(mu*(target-output)*state); 36 | 37 | end 38 | 39 | -------------------------------------------------------------------------------- /Demo/fuzzy_action_calculator.m: -------------------------------------------------------------------------------- 1 | function action=fuzzy_action_calculator(stat,input) 2 | %% This function returns the next selected actions, this is fuzzy equivalent of action_selector 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | global NS FIS 12 | 13 | % determine the number of antecedents of the rules in the knowledge base of 14 | % the fuzzy logic controller 15 | number_of_input=size(FIS.input,2); 16 | 17 | % initialize the activation function or degree of truth of the rules in the 18 | % knowledge base, again number of rules is equal to number of states in MDP 19 | alpha=ones(NS,1); 20 | 21 | % initialize vector that stores ai (action selected for each activated rul) 22 | ais=zeros(NS,1); 23 | 24 | % initialize output action to execute 25 | action=0; 26 | 27 | for i=1:NS % number of rules 28 | 29 | for j=1:number_of_input % number of antecedents 30 | 31 | % if the antecedent MF exists in the associated rule 32 | if FIS.rule(i).antecedent(j)>0 33 | %calculate the activation function 34 | alpha(i)=alpha(i)*evalmf(input(j),FIS.input(j).mf(FIS.rule(i).antecedent(j)).params,FIS.input(j).mf(FIS.rule(i).antecedent(j)).type); 35 | end 36 | 37 | end 38 | 39 | % select ai 40 | ais(i)=fuzzy_action_selector(stat,i); 41 | % calculate the action 42 | action=action+alpha(i)*FIS.output.mf(ais(i)).params; 43 | 44 | end 45 | 46 | 47 | -------------------------------------------------------------------------------- /Demo/main.m: -------------------------------------------------------------------------------- 1 | % ------------------------------------------------------------------------ 2 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 3 | % The code is released under the FreeBSD License. 4 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 5 | % The scripts implement Fuzzy Q-learning algorithm 6 | % ------------------------------------------------------------------------ 7 | 8 | 9 | %% 10 | clearvars -global; 11 | % global variables declared 12 | global ITERMAX NA NS 13 | 14 | global4 % global parameters initialized 15 | 16 | % variable to set whether we need vector or not, for example in neural 17 | % network version of q_learning we require to set this to 1 otherwise it 18 | % should be set to 0 19 | vector_is_needed=1; 20 | 21 | % main data structure including the lookup table and other statistics for storing and tracking 22 | % Q-value. Q:S*A->R, note that we can initialize the Q with any arbitrary 23 | % value 24 | stat=struct('Q',zeros(NS,NA),'iter',0,'old_action',1,'old_state',1,'current_state',1,'rimm',0,'total_reward',0,'vector',zeros(NA,2)); 25 | 26 | if vector_is_needed==1 27 | stat=init_vector(stat); % it only usable when we use and update vector, e.g., for neural approximation of Q values otherwise it can be safely commented. 28 | end 29 | 30 | %historical values 31 | stat_h=zeros(NS,NA,ITERMAX); 32 | 33 | done=0; % 1 stands for stopping the simulation 0 stands for continue 34 | 35 | % index for historical Q 36 | i=0; 37 | 38 | while 0==done 39 | i=i+1; 40 | % simulate a jump in the MDP and learn 41 | [stat,done]=jump_learn(stat); 42 | 43 | % record temporal Q values for simulation diagrams 44 | stat_h(:,:,i)=stat.Q; 45 | 46 | end 47 | 48 | % finding the learned policy 49 | policy=pol_finder(stat); 50 | 51 | 52 | -------------------------------------------------------------------------------- /Demo/demo.m: -------------------------------------------------------------------------------- 1 | % ------------------------------------------------------------------------ 2 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 3 | % The code is released under the FreeBSD License. 4 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 5 | % The scripts implement Fuzzy Q-learning algorithm 6 | % ------------------------------------------------------------------------ 7 | 8 | %% 9 | installQL; 10 | 11 | clearvars -global; 12 | % global variables declared 13 | global ITERMAX NA NS FIS 14 | 15 | global4 % global parameters initialized 16 | 17 | % main data structure including the lookup table and other statistics for storing and tracking 18 | % Q-value. Q:S*A->R, note that we can initialize the Q with any arbitrary 19 | % value, all states are specified with [w,rt] 20 | % vector, w=workload, rt=response time but in general this vector can have 21 | % different structure and semantic 22 | stat=struct('Q',zeros(NS,NA),'iter',0,'old_action',1,'old_state',[0,0],'current_state',[0,0],'rimm',0,'total_reward',0,'vector',zeros(NA,2)); 23 | 24 | %historical values 25 | stat_h=zeros(NS,NA,ITERMAX); 26 | 27 | done=0; % 1 stands for stopping the simulation 0 stands for continue 28 | 29 | % index for historical Q 30 | i=0; 31 | 32 | while 0==done 33 | i=i+1; 34 | % observe a new state (input) 35 | % this function should be replaced with the input data that comes from 36 | % monitoring 37 | new_input=fuzzy_state_finder(i); 38 | 39 | [stat,done]=fuzzy_jump_learn(stat,new_input); 40 | 41 | % record temporal Q values for simulation diagrams 42 | stat_h(:,:,i)=stat.Q; 43 | 44 | end 45 | 46 | % updating the FLC 47 | fis=update_fis(stat); 48 | 49 | % show control surf (initial FIS) 50 | gensurf(FIS); 51 | 52 | % show control surf (updated FIS) 53 | figure; 54 | gensurf(fis); 55 | -------------------------------------------------------------------------------- /Demo/fqlearn.m: -------------------------------------------------------------------------------- 1 | function stat=fqlearn(stat) 2 | %% fuzzy q-learning 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | global NS FIS 12 | 13 | % determine the number of antecedents of the rules in the knowledge base of 14 | % the fuzzy logic controller 15 | number_of_input=size(FIS.input,2); 16 | 17 | % initialize the activation function or degree of truth of the rules in the 18 | % knowledge base, again number of rules is equal to number of states in MDP 19 | alpha=ones(NS,1); 20 | 21 | % incrementing the learning iteration 22 | stat.iter=stat.iter+1; 23 | 24 | %% Setting the step-size to determine how fast learning takes place: learning rate 25 | 26 | % 1/k 27 | %learn_rate=1/(stat.iter); 28 | 29 | % log(k)/k 30 | %learn_rate=log(stat.iter+1)/(stat.iter+1); 31 | 32 | % a/(b+k) 33 | %learn_rate=0.5*300/(300+stat.iter); 34 | 35 | % constant learning rate 36 | learn_rate=0.1; 37 | 38 | %% Value iteration update rule 39 | 40 | for i=1:NS 41 | 42 | for j=1:number_of_input % number of antecedents 43 | 44 | % if the antecedent MF exists in the associated rule 45 | if FIS.rule(i).antecedent(j)>0 46 | %calculate the activation function 47 | alpha(i)=alpha(i)*evalmf(stat.current_state(j),FIS.input(j).mf(FIS.rule(i).antecedent(j)).params,FIS.input(j).mf(FIS.rule(i).antecedent(j)).type); 48 | end 49 | 50 | end 51 | 52 | ai=fuzzy_action_selector(stat,i); 53 | stat.Q(i,ai)=stat.Q(i,ai)+learn_rate*error_signal_calculator(stat)*alpha(i); 54 | 55 | end 56 | -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/horizontal_controller_main.m: -------------------------------------------------------------------------------- 1 | function scaling_action=horizontal_controller_main(workload,reponse_time,current_vm_no,min_vm,max_vm,max_workload,slo_rt) 2 | 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The scripts implements the horizontal controller. 6 | 7 | % Inputs: 8 | % workload,reponse_time: the monitoring data regarding workload and response time 9 | 10 | % current_vm_no,min_vm,max_vm: the number of vm currently running and the 11 | % min and max number of allowable VMs which are determined at desing-time 12 | 13 | % max_workload,slo_rt: we scale the monitoring data with respect to the 14 | % maximum workload and the desirable response time. These two values are 15 | % supposed to be available at design-time. Note that monitoring data above 16 | % these two thresholds are set to 100 (max value of the scaling interval) 17 | 18 | % output: 19 | % scalingaction: {-2, -1, 0, +1, +2}, this determines the change in the number of resources 20 | % ------------------------------------------------------------------------ 21 | 22 | % normalizing inputs 23 | normalized_workload = scaledata(workload,0,100,max_workload); 24 | normalized_response_time = scaledata(reponse_time,0,100,slo_rt); 25 | 26 | % computing scaling action according to the fuzzy controller 27 | scaling_action=RobusT2Scalesg(normalized_workload,normalized_response_time); 28 | 29 | % round to the nearest decimal or integer 30 | scaling_action=round(scaling_action); 31 | 32 | % evaluating scaling constraint 33 | current_vm_no=current_vm_no+scaling_action; 34 | if (current_vm_no>=min_vm && current_vm_no<=max_vm) 35 | return 36 | else 37 | scaling_action=0; % action is igonored 38 | warning('Controller:InputOutOfRange','The current number of VM cannot be changed due to the violation of scaling constraint'); 39 | end 40 | 41 | end -------------------------------------------------------------------------------- /Demo/global11.m: -------------------------------------------------------------------------------- 1 | global NO_REPLICATIONS ITERMAX NET_ITERMAX NA NS TPM TRM EPSILON LAMBDA FIS ACTION_2_VALUE SLA MONDATA NORMONDATA 2 | % ------------------------------------------------------------------------ 3 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 4 | % The code is released under the FreeBSD License. 5 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 6 | % The scripts implement Fuzzy Q-learning algorithm 7 | % ------------------------------------------------------------------------ 8 | 9 | 10 | NO_REPLICATIONS=30; % No of replications of simulation 11 | ITERMAX=1000; % No of iterations of learning 12 | NET_ITERMAX=1; % No of iterations of neural network training, only used when we use neural netwrok coupled with q learning 13 | % NA=2; % Number of actions in each state 14 | % NS=3; % Number of states 15 | 16 | EPSILON=0.1; % exploration probability 17 | LAMBDA=0.8; % discount factor 18 | 19 | %% MDP: note that the probabilities for each state should sum to one 20 | 21 | TPM(:,:,1)=[0.5,0.2,0.3;0.4,0.2,0.4;0.8,0.1,0.1]; % probabilities of going from an state to another state under action 1 22 | 23 | TPM(:,:,2)=[0.4,0.1,0.5;0.2,0.5,0.3;0.1,0.1,0.8]; % probabilities of going from an state to another state under action 2 24 | 25 | TRM(:,:,1)=[16,-5,12;7,12,-2;7,12,-2]; % rewards earned in going from an state to another state under actions 1 26 | 27 | TRM(:,:,2)=[0,17,14;-14,13,-4;0,17,14]; % rewards earned in going from an state to another state under actions 2 28 | 29 | %% Fuzzy QL 30 | FIS=readfis('robust2scalesg.fis'); 31 | 32 | NS=size(FIS.rule,2); 33 | 34 | NA=size(FIS.output.mf,2); 35 | 36 | ACTION_2_VALUE=[-1,0,+1]; 37 | 38 | SLA=600; % response time SLO in milli second, SLA(index), index is the index for specific SLO such as rt 39 | 40 | MONDATA=csvread('Data/wikipedia_self-adaptive.csv',1,1,[1 1 ITERMAX 2]); 41 | 42 | NORMONDATA=scaledata(MONDATA,0,100); 43 | -------------------------------------------------------------------------------- /Demo/global4.m: -------------------------------------------------------------------------------- 1 | global NO_REPLICATIONS ITERMAX NET_ITERMAX NA NS TPM TRM EPSILON LAMBDA FIS ACTION_2_VALUE SLA MONDATA NORMONDATA 2 | 3 | % ------------------------------------------------------------------------ 4 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 5 | % The code is released under the FreeBSD License. 6 | % Copyright (C) 2016 Pooyan Jamshidi, Imperial College London 7 | % The scripts implement Fuzzy Q-learning algorithm 8 | % ------------------------------------------------------------------------ 9 | 10 | 11 | NO_REPLICATIONS=30; % No of replications of simulation 12 | ITERMAX=3000; % No of iterations of q learning 13 | NET_ITERMAX=1; % No of iterations of neural network training , only used when we use neural netwrok coupled with q learning 14 | % NA=2; % Number of actions in each state 15 | % NS=2; % Number of states 16 | 17 | EPSILON=0.1; % exploration probability 18 | LAMBDA=0.8; % discount factor 19 | 20 | TPM(:,:,1)=[0.7,0.3;0.4,0.6]; % probabilities of going from an state to another state under action 1 21 | 22 | TPM(:,:,2)=[0.9,0.1;0.2,0.8]; % probabilities of going from an state to another state under action 2 23 | 24 | TRM(:,:,1)=[16,-5;7,12]; % rewards earned in going from an state to another state under actions 1 25 | 26 | TRM(:,:,2)=[0,17;-14,13]; % rewards earned in going from an state to another state under actions 2 27 | 28 | 29 | %% Fuzzy QL 30 | FIS=readfis('robust2scalesg.fis'); 31 | 32 | NS=size(FIS.rule,2); 33 | 34 | NA=size(FIS.output.mf,2); 35 | 36 | ACTION_2_VALUE=[-1,0,+1]; 37 | 38 | SLA=600; % response time SLO in milli second, SLA(index), index is the index for specific SLO such as rt 39 | 40 | MONDATA=csvread('google.csv',1,1,[1 1 ITERMAX 2]); 41 | 42 | % MONDATA=csvread('Data/wikipedia_self-adaptive.csv',1,1,[1 1 ITERMAX 2]); 43 | 44 | % MONDATA=csvread('Data/wikipedia_non-adaptive_overProvisioning_6G.csv',1,1,[1 1 ITERMAX 2]); 45 | 46 | NORMONDATA=scaledata(MONDATA,0,100); -------------------------------------------------------------------------------- /FQL4KE/fqlearn.m: -------------------------------------------------------------------------------- 1 | function [Q,LEARN]=fqlearn(Q,current_state,next_state,ais) 2 | %% This function implements Fuzzy Q-Learning 3 | % Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 4 | 5 | %% initializations 6 | globalfql % global parameters initialized 7 | 8 | global NS NA FIS 9 | 10 | % determine the number of antecedents of the rules in the knowledge base of 11 | % the fuzzy logic controller 12 | number_of_input=size(FIS.input,2); 13 | 14 | % initialize the activation function or degree of truth of the rules in the 15 | % knowledge base, again number of rules is equal to number of states in MDP 16 | alpha=ones(NS,1); 17 | 18 | % initialize the matrix that maintain the number of updates for each 19 | % q-value corresponding to Q lookup table 20 | LEARN=zeros(NS,NA); 21 | %% Setting the step-size to determine how fast learning takes place: learning rate 22 | 23 | % 1/k 24 | %learn_rate=1/(stat.iter); 25 | 26 | % log(k)/k 27 | %learn_rate=log(stat.iter+1)/(stat.iter+1); 28 | 29 | % a/(b+k) 30 | %learn_rate=0.5*300/(300+stat.iter); 31 | 32 | % constant learning rate 33 | learn_rate=0.1; 34 | 35 | %% Value iteration update rule (learning process) 36 | 37 | for i=1:NS 38 | 39 | for j=1:number_of_input % number of antecedents 40 | 41 | % if the antecedent MF exists in the associated rule 42 | if FIS.rule(i).antecedent(j)>0 43 | %calculate the activation function 44 | alpha(i)=alpha(i)*evalmf(current_state(j),FIS.input(j).mf(FIS.rule(i).antecedent(j)).params,FIS.input(j).mf(FIS.rule(i).antecedent(j)).type); 45 | end 46 | 47 | end 48 | 49 | ai=ais(i); % select an action (for each activated rule!) 50 | if alpha(i)~=0 51 | % update Q table 52 | Q(i,ai)=Q(i,ai)+learn_rate*error_signal_calculator(Q,current_state,next_state,ais)*alpha(i); % update q-values by an ordinary gradient descent method 53 | % update the stats for maintaining the number of updates of the 54 | % q-values 55 | LEARN(i,ai)=LEARN(i,ai)+1; 56 | end 57 | end 58 | end 59 | -------------------------------------------------------------------------------- /Controllers/robust2scalesg.fis: -------------------------------------------------------------------------------- 1 | [System] 2 | Name='controller with sugeo' 3 | Type='sugeno' 4 | Version=2.0 5 | NumInputs=2 6 | NumOutputs=1 7 | NumRules=25 8 | AndMethod='prod' 9 | OrMethod='probor' 10 | ImpMethod='prod' 11 | AggMethod='sum' 12 | DefuzzMethod='wtaver' 13 | 14 | [Input1] 15 | Name='WorkLoad' 16 | Range=[0 100] 17 | NumMFs=5 18 | MF1='Low':'trimf',[14.85 31.75 48.59] 19 | MF2='Medium':'trimf',[30.7 50.25 67.94] 20 | MF3='High':'trimf',[56.41 71.75 89.27] 21 | MF4='VeryLow':'trapmf',[0 0 27 35.3] 22 | MF5='VeryHigh':'trapmf',[71.68 78 100 100] 23 | 24 | [Input2] 25 | Name='ResponseTime' 26 | Range=[0 100] 27 | NumMFs=5 28 | MF1='Fast':'trimf',[2.03 13.05 25.27] 29 | MF2='Medium':'trimf',[12.61 29.85 50.01] 30 | MF3='Slow':'trimf',[31.41 51 72.94] 31 | MF4='Instantaneus':'trapmf',[0 0 7.2 12.4] 32 | MF5='VerySlow':'trapmf',[52.18 60 100 100] 33 | 34 | [Output1] 35 | Name='output1' 36 | Range=[0 1] 37 | NumMFs=25 38 | MF1='mf1':'constant',[-1.6] 39 | MF2='mf2':'constant',[-1.4] 40 | MF3='mf3':'constant',[0] 41 | MF4='mf4':'constant',[0.06] 42 | MF5='mf5':'constant',[1.4] 43 | MF6='mf6':'constant',[-1.3] 44 | MF7='mf7':'constant',[-1.1] 45 | MF8='mf8':'constant',[0.4] 46 | MF9='mf9':'constant',[1] 47 | MF10='mf10':'constant',[1.6] 48 | MF11='mf11':'constant',[-1.6] 49 | MF12='mf12':'constant',[-0.9] 50 | MF13='mf13':'constant',[0.6] 51 | MF14='mf14':'constant',[1.1] 52 | MF15='mf15':'constant',[1.5] 53 | MF16='mf16':'constant',[-1.8] 54 | MF17='mf17':'constant',[-1.4] 55 | MF18='mf18':'constant',[0.4] 56 | MF19='mf19':'constant',[1.1] 57 | MF20='mf20':'constant',[1.4] 58 | MF21='mf21':'constant',[-1.9] 59 | MF22='mf22':'constant',[-1.2] 60 | MF23='mf23':'constant',[0.5] 61 | MF24='mf24':'constant',[1] 62 | MF25='mf25':'constant',[1.6] 63 | 64 | [Rules] 65 | 4 4, 1 (1) : 1 66 | 4 1, 2 (1) : 1 67 | 4 2, 3 (1) : 1 68 | 4 3, 4 (1) : 1 69 | 4 5, 5 (1) : 1 70 | 1 4, 6 (1) : 1 71 | 1 1, 7 (1) : 1 72 | 1 2, 8 (1) : 1 73 | 1 3, 9 (1) : 1 74 | 1 5, 10 (1) : 1 75 | 2 4, 11 (1) : 1 76 | 2 1, 12 (1) : 1 77 | 2 2, 13 (1) : 1 78 | 2 3, 14 (1) : 1 79 | 2 5, 15 (1) : 1 80 | 3 4, 16 (1) : 1 81 | 3 1, 17 (1) : 1 82 | 3 2, 18 (1) : 1 83 | 3 3, 19 (1) : 1 84 | 3 5, 20 (1) : 1 85 | 5 4, 21 (1) : 1 86 | 5 1, 22 (1) : 1 87 | 5 2, 23 (1) : 1 88 | 5 3, 24 (1) : 1 89 | 5 5, 25 (1) : 1 90 | -------------------------------------------------------------------------------- /Compiled/Learning/src/readme.txt: -------------------------------------------------------------------------------- 1 | MATLAB Builder NE (.NET Component) 2 | 3 | 4 | 1. Prerequisites for Deployment 5 | 6 | . Verify the MATLAB Compiler Runtime (MCR) is installed and ensure you 7 | have installed version 8.1 (R2013a). 8 | 9 | . If the MCR is not installed, do the following: 10 | (1) enter 11 | 12 | >>mcrinstaller 13 | 14 | at MATLAB prompt. The MCRINSTALLER command displays the 15 | location of the MCR Installer. 16 | 17 | (2) run the MCR Installer. 18 | 19 | Or download the Windows 64-bit version of the MCR for R2013a 20 | from the MathWorks Web site by navigating to 21 | 22 | http://www.mathworks.com/products/compiler/mcr/index.html 23 | 24 | 25 | For more information about the MCR and the MCR Installer, see 26 | Distribution to End Users in the MATLAB Compiler documentation 27 | in the MathWorks Documentation Center. 28 | 29 | NOTE: You will need administrator rights to run MCRInstaller. 30 | 31 | 2. Files to Deploy and Package 32 | 33 | -Learning.dll 34 | -contains the generated component using MWArray API. 35 | -LearningNative.dll 36 | -contains the generated component using native API. 37 | -This readme file 38 | 39 | . If the target machine does not have the version 8.1 of the MCR installed, and the end 40 | users are unable to download the MCR using the above link, include MCRInstaller.exe. 41 | 42 | 43 | 44 | Auto-generated Documentation Templates: 45 | 46 | MWArray.xml - This file contains the code comments for the MWArray data conversion 47 | classes and their methods. This file can be found in either the component 48 | distrib directory or in 49 | *\toolbox\dotnetbuilder\bin\win64\v2.0 50 | 51 | Learning_overview.html - HTML overview documentation file for the generated component. It 52 | contains the requirements for accessing the component and for 53 | generating arguments using the MWArray class hierarchy. 54 | 55 | Learning.xml - This file contains the code comments for the Learning component classes 56 | and methods. Using a third party documentation tool, this file 57 | can be combined with either or both of the previous files to 58 | generate online documentation for the Learning component. 59 | 60 | 61 | 62 | 63 | 3. Resources 64 | 65 | To learn more about: See: 66 | =================================================================== 67 | MWArray classes *\help\toolbox\ 68 | dotnetbuilder\MWArrayAPI\ 69 | MWArrayAPI.chm 70 | Examples of .NET Web Applications Web Deployment in the MATLAB 71 | Builder NE documentation in the 72 | MathWorks Documentation Center 73 | 74 | 75 | 4. Definitions 76 | 77 | For information on deployment terminology, go to 78 | http://www.mathworks.com/help. Select MATLAB Compiler > 79 | Getting Started > About Application Deployment > 80 | Application Deployment Terms in the MathWorks Documentation 81 | Center. 82 | 83 | 84 | 85 | * NOTE: is the directory where MCR is installed on the target machine. 86 | is the directory where MATLAB is installed on the target machine. 87 | 88 | -------------------------------------------------------------------------------- /Compiled/Learning/distrib/readme.txt: -------------------------------------------------------------------------------- 1 | MATLAB Builder NE (.NET Component) 2 | 3 | 4 | 1. Prerequisites for Deployment 5 | 6 | . Verify the MATLAB Compiler Runtime (MCR) is installed and ensure you 7 | have installed version 8.1 (R2013a). 8 | 9 | . If the MCR is not installed, do the following: 10 | (1) enter 11 | 12 | >>mcrinstaller 13 | 14 | at MATLAB prompt. The MCRINSTALLER command displays the 15 | location of the MCR Installer. 16 | 17 | (2) run the MCR Installer. 18 | 19 | Or download the Windows 64-bit version of the MCR for R2013a 20 | from the MathWorks Web site by navigating to 21 | 22 | http://www.mathworks.com/products/compiler/mcr/index.html 23 | 24 | 25 | For more information about the MCR and the MCR Installer, see 26 | Distribution to End Users in the MATLAB Compiler documentation 27 | in the MathWorks Documentation Center. 28 | 29 | NOTE: You will need administrator rights to run MCRInstaller. 30 | 31 | 2. Files to Deploy and Package 32 | 33 | -Learning.dll 34 | -contains the generated component using MWArray API. 35 | -LearningNative.dll 36 | -contains the generated component using native API. 37 | -This readme file 38 | 39 | . If the target machine does not have the version 8.1 of the MCR installed, and the end 40 | users are unable to download the MCR using the above link, include MCRInstaller.exe. 41 | 42 | 43 | 44 | Auto-generated Documentation Templates: 45 | 46 | MWArray.xml - This file contains the code comments for the MWArray data conversion 47 | classes and their methods. This file can be found in either the component 48 | distrib directory or in 49 | *\toolbox\dotnetbuilder\bin\win64\v2.0 50 | 51 | Learning_overview.html - HTML overview documentation file for the generated component. It 52 | contains the requirements for accessing the component and for 53 | generating arguments using the MWArray class hierarchy. 54 | 55 | Learning.xml - This file contains the code comments for the Learning component classes 56 | and methods. Using a third party documentation tool, this file 57 | can be combined with either or both of the previous files to 58 | generate online documentation for the Learning component. 59 | 60 | 61 | 62 | 63 | 3. Resources 64 | 65 | To learn more about: See: 66 | =================================================================== 67 | MWArray classes *\help\toolbox\ 68 | dotnetbuilder\MWArrayAPI\ 69 | MWArrayAPI.chm 70 | Examples of .NET Web Applications Web Deployment in the MATLAB 71 | Builder NE documentation in the 72 | MathWorks Documentation Center 73 | 74 | 75 | 4. Definitions 76 | 77 | For information on deployment terminology, go to 78 | http://www.mathworks.com/help. Select MATLAB Compiler > 79 | Getting Started > About Application Deployment > 80 | Application Deployment Terms in the MathWorks Documentation 81 | Center. 82 | 83 | 84 | 85 | * NOTE: is the directory where MCR is installed on the target machine. 86 | is the directory where MATLAB is installed on the target machine. 87 | 88 | -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2Scale/src/readme.txt: -------------------------------------------------------------------------------- 1 | MATLAB Builder NE (.NET Component) 2 | 3 | 4 | 1. Prerequisites for Deployment 5 | 6 | . Verify the MATLAB Compiler Runtime (MCR) is installed and ensure you 7 | have installed version 8.1 (R2013a). 8 | 9 | . If the MCR is not installed, do the following: 10 | (1) enter 11 | 12 | >>mcrinstaller 13 | 14 | at MATLAB prompt. The MCRINSTALLER command displays the 15 | location of the MCR Installer. 16 | 17 | (2) run the MCR Installer. 18 | 19 | Or download the Windows 64-bit version of the MCR for R2013a 20 | from the MathWorks Web site by navigating to 21 | 22 | http://www.mathworks.com/products/compiler/mcr/index.html 23 | 24 | 25 | For more information about the MCR and the MCR Installer, see 26 | Distribution to End Users in the MATLAB Compiler documentation 27 | in the MathWorks Documentation Center. 28 | 29 | NOTE: You will need administrator rights to run MCRInstaller. 30 | 31 | 2. Files to Deploy and Package 32 | 33 | -RobusT2Scale.dll 34 | -contains the generated component using MWArray API. 35 | -RobusT2ScaleNative.dll 36 | -contains the generated component using native API. 37 | -This readme file 38 | 39 | . If the target machine does not have the version 8.1 of the MCR installed, and the end 40 | users are unable to download the MCR using the above link, include MCRInstaller.exe. 41 | 42 | 43 | 44 | Auto-generated Documentation Templates: 45 | 46 | MWArray.xml - This file contains the code comments for the MWArray data conversion 47 | classes and their methods. This file can be found in either the component 48 | distrib directory or in 49 | *\toolbox\dotnetbuilder\bin\win64\v2.0 50 | 51 | RobusT2Scale_overview.html - HTML overview documentation file for the generated 52 | component. It contains the requirements for accessing the 53 | component and for generating arguments using the MWArray 54 | class hierarchy. 55 | 56 | RobusT2Scale.xml - This file contains the code comments for the RobusT2Scale component 57 | classes and methods. Using a third party documentation tool, 58 | this file can be combined with either or both of the 59 | previous files to generate online documentation for the 60 | RobusT2Scale component. 61 | 62 | 63 | 64 | 65 | 3. Resources 66 | 67 | To learn more about: See: 68 | =================================================================== 69 | MWArray classes *\help\toolbox\ 70 | dotnetbuilder\MWArrayAPI\ 71 | MWArrayAPI.chm 72 | Examples of .NET Web Applications Web Deployment in the MATLAB 73 | Builder NE documentation in the 74 | MathWorks Documentation Center 75 | 76 | 77 | 4. Definitions 78 | 79 | For information on deployment terminology, go to 80 | http://www.mathworks.com/help. Select MATLAB Compiler > 81 | Getting Started > About Application Deployment > 82 | Application Deployment Terms in the MathWorks Documentation 83 | Center. 84 | 85 | 86 | 87 | * NOTE: is the directory where MCR is installed on the target machine. 88 | is the directory where MATLAB is installed on the target machine. 89 | 90 | -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2Scale/distrib/readme.txt: -------------------------------------------------------------------------------- 1 | MATLAB Builder NE (.NET Component) 2 | 3 | 4 | 1. Prerequisites for Deployment 5 | 6 | . Verify the MATLAB Compiler Runtime (MCR) is installed and ensure you 7 | have installed version 8.1 (R2013a). 8 | 9 | . If the MCR is not installed, do the following: 10 | (1) enter 11 | 12 | >>mcrinstaller 13 | 14 | at MATLAB prompt. The MCRINSTALLER command displays the 15 | location of the MCR Installer. 16 | 17 | (2) run the MCR Installer. 18 | 19 | Or download the Windows 64-bit version of the MCR for R2013a 20 | from the MathWorks Web site by navigating to 21 | 22 | http://www.mathworks.com/products/compiler/mcr/index.html 23 | 24 | 25 | For more information about the MCR and the MCR Installer, see 26 | Distribution to End Users in the MATLAB Compiler documentation 27 | in the MathWorks Documentation Center. 28 | 29 | NOTE: You will need administrator rights to run MCRInstaller. 30 | 31 | 2. Files to Deploy and Package 32 | 33 | -RobusT2Scale.dll 34 | -contains the generated component using MWArray API. 35 | -RobusT2ScaleNative.dll 36 | -contains the generated component using native API. 37 | -This readme file 38 | 39 | . If the target machine does not have the version 8.1 of the MCR installed, and the end 40 | users are unable to download the MCR using the above link, include MCRInstaller.exe. 41 | 42 | 43 | 44 | Auto-generated Documentation Templates: 45 | 46 | MWArray.xml - This file contains the code comments for the MWArray data conversion 47 | classes and their methods. This file can be found in either the component 48 | distrib directory or in 49 | *\toolbox\dotnetbuilder\bin\win64\v2.0 50 | 51 | RobusT2Scale_overview.html - HTML overview documentation file for the generated 52 | component. It contains the requirements for accessing the 53 | component and for generating arguments using the MWArray 54 | class hierarchy. 55 | 56 | RobusT2Scale.xml - This file contains the code comments for the RobusT2Scale component 57 | classes and methods. Using a third party documentation tool, 58 | this file can be combined with either or both of the 59 | previous files to generate online documentation for the 60 | RobusT2Scale component. 61 | 62 | 63 | 64 | 65 | 3. Resources 66 | 67 | To learn more about: See: 68 | =================================================================== 69 | MWArray classes *\help\toolbox\ 70 | dotnetbuilder\MWArrayAPI\ 71 | MWArrayAPI.chm 72 | Examples of .NET Web Applications Web Deployment in the MATLAB 73 | Builder NE documentation in the 74 | MathWorks Documentation Center 75 | 76 | 77 | 4. Definitions 78 | 79 | For information on deployment terminology, go to 80 | http://www.mathworks.com/help. Select MATLAB Compiler > 81 | Getting Started > About Application Deployment > 82 | Application Deployment Terms in the MathWorks Documentation 83 | Center. 84 | 85 | 86 | 87 | * NOTE: is the directory where MCR is installed on the target machine. 88 | is the directory where MATLAB is installed on the target machine. 89 | 90 | -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/distrib/readme.txt: -------------------------------------------------------------------------------- 1 | MATLAB Builder NE (.NET Component) 2 | 3 | 4 | 1. Prerequisites for Deployment 5 | 6 | . Verify the MATLAB Compiler Runtime (MCR) is installed and ensure you 7 | have installed version 8.1 (R2013a). 8 | 9 | . If the MCR is not installed, do the following: 10 | (1) enter 11 | 12 | >>mcrinstaller 13 | 14 | at MATLAB prompt. The MCRINSTALLER command displays the 15 | location of the MCR Installer. 16 | 17 | (2) run the MCR Installer. 18 | 19 | Or download the Windows 64-bit version of the MCR for R2013a 20 | from the MathWorks Web site by navigating to 21 | 22 | http://www.mathworks.com/products/compiler/mcr/index.html 23 | 24 | 25 | For more information about the MCR and the MCR Installer, see 26 | Distribution to End Users in the MATLAB Compiler documentation 27 | in the MathWorks Documentation Center. 28 | 29 | NOTE: You will need administrator rights to run MCRInstaller. 30 | 31 | 2. Files to Deploy and Package 32 | 33 | -RobusT2ScaleExternalFIS.dll 34 | -contains the generated component using MWArray API. 35 | -RobusT2ScaleExternalFISNative.dll 36 | -contains the generated component using native API. 37 | -This readme file 38 | 39 | . If the target machine does not have the version 8.1 of the MCR installed, and the end 40 | users are unable to download the MCR using the above link, include MCRInstaller.exe. 41 | 42 | 43 | 44 | Auto-generated Documentation Templates: 45 | 46 | MWArray.xml - This file contains the code comments for the MWArray data conversion 47 | classes and their methods. This file can be found in either the component 48 | distrib directory or in 49 | *\toolbox\dotnetbuilder\bin\win64\v2.0 50 | 51 | RobusT2ScaleExternalFIS_overview.html - HTML overview documentation file for the 52 | generated component. It contains the requirements 53 | for accessing the component and for generating 54 | arguments using the MWArray class hierarchy. 55 | 56 | RobusT2ScaleExternalFIS.xml - This file contains the code comments for the 57 | RobusT2ScaleExternalFIS component classes and 58 | methods. Using a third party documentation tool, 59 | this file can be combined with either or both of 60 | the previous files to generate online 61 | documentation for the RobusT2ScaleExternalFIS 62 | component. 63 | 64 | 65 | 66 | 67 | 3. Resources 68 | 69 | To learn more about: See: 70 | =================================================================== 71 | MWArray classes *\help\toolbox\ 72 | dotnetbuilder\MWArrayAPI\ 73 | MWArrayAPI.chm 74 | Examples of .NET Web Applications Web Deployment in the MATLAB 75 | Builder NE documentation in the 76 | MathWorks Documentation Center 77 | 78 | 79 | 4. Definitions 80 | 81 | For information on deployment terminology, go to 82 | http://www.mathworks.com/help. Select MATLAB Compiler > 83 | Getting Started > About Application Deployment > 84 | Application Deployment Terms in the MathWorks Documentation 85 | Center. 86 | 87 | 88 | 89 | * NOTE: is the directory where MCR is installed on the target machine. 90 | is the directory where MATLAB is installed on the target machine. 91 | 92 | -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/src/readme.txt: -------------------------------------------------------------------------------- 1 | MATLAB Builder NE (.NET Component) 2 | 3 | 4 | 1. Prerequisites for Deployment 5 | 6 | . Verify the MATLAB Compiler Runtime (MCR) is installed and ensure you 7 | have installed version 8.1 (R2013a). 8 | 9 | . If the MCR is not installed, do the following: 10 | (1) enter 11 | 12 | >>mcrinstaller 13 | 14 | at MATLAB prompt. The MCRINSTALLER command displays the 15 | location of the MCR Installer. 16 | 17 | (2) run the MCR Installer. 18 | 19 | Or download the Windows 64-bit version of the MCR for R2013a 20 | from the MathWorks Web site by navigating to 21 | 22 | http://www.mathworks.com/products/compiler/mcr/index.html 23 | 24 | 25 | For more information about the MCR and the MCR Installer, see 26 | Distribution to End Users in the MATLAB Compiler documentation 27 | in the MathWorks Documentation Center. 28 | 29 | NOTE: You will need administrator rights to run MCRInstaller. 30 | 31 | 2. Files to Deploy and Package 32 | 33 | -RobusT2ScaleExternalFIS.dll 34 | -contains the generated component using MWArray API. 35 | -RobusT2ScaleExternalFISNative.dll 36 | -contains the generated component using native API. 37 | -This readme file 38 | 39 | . If the target machine does not have the version 8.1 of the MCR installed, and the end 40 | users are unable to download the MCR using the above link, include MCRInstaller.exe. 41 | 42 | 43 | 44 | Auto-generated Documentation Templates: 45 | 46 | MWArray.xml - This file contains the code comments for the MWArray data conversion 47 | classes and their methods. This file can be found in either the component 48 | distrib directory or in 49 | *\toolbox\dotnetbuilder\bin\win64\v2.0 50 | 51 | RobusT2ScaleExternalFIS_overview.html - HTML overview documentation file for the 52 | generated component. It contains the requirements 53 | for accessing the component and for generating 54 | arguments using the MWArray class hierarchy. 55 | 56 | RobusT2ScaleExternalFIS.xml - This file contains the code comments for the 57 | RobusT2ScaleExternalFIS component classes and 58 | methods. Using a third party documentation tool, 59 | this file can be combined with either or both of 60 | the previous files to generate online 61 | documentation for the RobusT2ScaleExternalFIS 62 | component. 63 | 64 | 65 | 66 | 67 | 3. Resources 68 | 69 | To learn more about: See: 70 | =================================================================== 71 | MWArray classes *\help\toolbox\ 72 | dotnetbuilder\MWArrayAPI\ 73 | MWArrayAPI.chm 74 | Examples of .NET Web Applications Web Deployment in the MATLAB 75 | Builder NE documentation in the 76 | MathWorks Documentation Center 77 | 78 | 79 | 4. Definitions 80 | 81 | For information on deployment terminology, go to 82 | http://www.mathworks.com/help. Select MATLAB Compiler > 83 | Getting Started > About Application Deployment > 84 | Application Deployment Terms in the MathWorks Documentation 85 | Center. 86 | 87 | 88 | 89 | * NOTE: is the directory where MCR is installed on the target machine. 90 | is the directory where MATLAB is installed on the target machine. 91 | 92 | -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2Scale/src/RobusT2Scale.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RobusT2Scale 5 | 6 | 7 | 8 | 9 | The RobusT2Scale class provides a CLS compliant, MWArray interface to the MATLAB 10 | functions contained in the files: 11 | 12 | C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\RobusT2Sca 13 | lesg.m 14 | 15 | deployprint.m 16 | 17 | printdlg.m 18 | 19 | 20 | @Version 0.0 21 | 22 | 23 | 24 | 25 | The static constructor instantiates and initializes the MATLAB Compiler Runtime 26 | instance. 27 | 28 | 29 | 30 | 31 | Constructs a new instance of the RobusT2Scale class. 32 | 33 | 34 | 35 | 36 | Class destructor called by the CLR garbage collector. 37 | 38 | 39 | 40 | 41 | Frees the native resources associated with this object 42 | 43 | 44 | 45 | 46 | Internal dispose function 47 | 48 | 49 | 50 | 51 | Provides a single output, 0-input MWArrayinterface to the RobusT2Scalesg MATLAB 52 | function. 53 | 54 | 55 | M-Documentation: 56 | ------------------------------------------------------------------------ 57 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 58 | The scripts implements the sugeno fuzzy controller and 59 | produce the output which is the scaling action for horizontal elasticity. 60 | x1: workload (should be normalized in [0 100]) 61 | x2: response time (should be normalized in [0 100]) 62 | scalingaction: [-2 +2], this determines the change in the number of resources 63 | ------------------------------------------------------------------------ 64 | 65 | An MWArray containing the first output argument. 66 | 67 | 68 | 69 | 70 | Provides a single output, 1-input MWArrayinterface to the RobusT2Scalesg MATLAB 71 | function. 72 | 73 | 74 | M-Documentation: 75 | ------------------------------------------------------------------------ 76 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 77 | The scripts implements the sugeno fuzzy controller and 78 | produce the output which is the scaling action for horizontal elasticity. 79 | x1: workload (should be normalized in [0 100]) 80 | x2: response time (should be normalized in [0 100]) 81 | scalingaction: [-2 +2], this determines the change in the number of resources 82 | ------------------------------------------------------------------------ 83 | 84 | Input argument #1 85 | An MWArray containing the first output argument. 86 | 87 | 88 | 89 | 90 | Provides a single output, 2-input MWArrayinterface to the RobusT2Scalesg MATLAB 91 | function. 92 | 93 | 94 | M-Documentation: 95 | ------------------------------------------------------------------------ 96 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 97 | The scripts implements the sugeno fuzzy controller and 98 | produce the output which is the scaling action for horizontal elasticity. 99 | x1: workload (should be normalized in [0 100]) 100 | x2: response time (should be normalized in [0 100]) 101 | scalingaction: [-2 +2], this determines the change in the number of resources 102 | ------------------------------------------------------------------------ 103 | 104 | Input argument #1 105 | Input argument #2 106 | An MWArray containing the first output argument. 107 | 108 | 109 | 110 | 111 | Provides the standard 0-input MWArray interface to the RobusT2Scalesg MATLAB 112 | function. 113 | 114 | 115 | M-Documentation: 116 | ------------------------------------------------------------------------ 117 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 118 | The scripts implements the sugeno fuzzy controller and 119 | produce the output which is the scaling action for horizontal elasticity. 120 | x1: workload (should be normalized in [0 100]) 121 | x2: response time (should be normalized in [0 100]) 122 | scalingaction: [-2 +2], this determines the change in the number of resources 123 | ------------------------------------------------------------------------ 124 | 125 | The number of output arguments to return. 126 | An Array of length "numArgsOut" containing the output 127 | arguments. 128 | 129 | 130 | 131 | 132 | Provides the standard 1-input MWArray interface to the RobusT2Scalesg MATLAB 133 | function. 134 | 135 | 136 | M-Documentation: 137 | ------------------------------------------------------------------------ 138 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 139 | The scripts implements the sugeno fuzzy controller and 140 | produce the output which is the scaling action for horizontal elasticity. 141 | x1: workload (should be normalized in [0 100]) 142 | x2: response time (should be normalized in [0 100]) 143 | scalingaction: [-2 +2], this determines the change in the number of resources 144 | ------------------------------------------------------------------------ 145 | 146 | The number of output arguments to return. 147 | Input argument #1 148 | An Array of length "numArgsOut" containing the output 149 | arguments. 150 | 151 | 152 | 153 | 154 | Provides the standard 2-input MWArray interface to the RobusT2Scalesg MATLAB 155 | function. 156 | 157 | 158 | M-Documentation: 159 | ------------------------------------------------------------------------ 160 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 161 | The scripts implements the sugeno fuzzy controller and 162 | produce the output which is the scaling action for horizontal elasticity. 163 | x1: workload (should be normalized in [0 100]) 164 | x2: response time (should be normalized in [0 100]) 165 | scalingaction: [-2 +2], this determines the change in the number of resources 166 | ------------------------------------------------------------------------ 167 | 168 | The number of output arguments to return. 169 | Input argument #1 170 | Input argument #2 171 | An Array of length "numArgsOut" containing the output 172 | arguments. 173 | 174 | 175 | 176 | 177 | Provides an interface for the RobusT2Scalesg function in which the input and 178 | output 179 | arguments are specified as an array of MWArrays. 180 | 181 | 182 | This method will allocate and return by reference the output argument 183 | array. 184 | M-Documentation: 185 | ------------------------------------------------------------------------ 186 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 187 | The scripts implements the sugeno fuzzy controller and 188 | produce the output which is the scaling action for horizontal elasticity. 189 | x1: workload (should be normalized in [0 100]) 190 | x2: response time (should be normalized in [0 100]) 191 | scalingaction: [-2 +2], this determines the change in the number of resources 192 | ------------------------------------------------------------------------ 193 | 194 | The number of output arguments to return 195 | Array of MWArray output arguments 196 | Array of MWArray input arguments 197 | 198 | 199 | 200 | 201 | This method will cause a MATLAB figure window to behave as a modal dialog box. 202 | The method will not return until all the figure windows associated with this 203 | component have been closed. 204 | 205 | 206 | An application should only call this method when required to keep the 207 | MATLAB figure window from disappearing. Other techniques, such as calling 208 | Console.ReadLine() from the application should be considered where 209 | possible. 210 | 211 | 212 | 213 | 214 | -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2Scale/src/RobusT2ScaleNative.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RobusT2ScaleNative 5 | 6 | 7 | 8 | 9 | The RobusT2Scale class provides a CLS compliant, Object (native) interface to the 10 | MATLAB functions contained in the files: 11 | 12 | C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\RobusT2Sca 13 | lesg.m 14 | 15 | deployprint.m 16 | 17 | printdlg.m 18 | 19 | 20 | @Version 0.0 21 | 22 | 23 | 24 | 25 | The static constructor instantiates and initializes the MATLAB Compiler Runtime 26 | instance. 27 | 28 | 29 | 30 | 31 | Constructs a new instance of the RobusT2Scale class. 32 | 33 | 34 | 35 | 36 | Class destructor called by the CLR garbage collector. 37 | 38 | 39 | 40 | 41 | Frees the native resources associated with this object 42 | 43 | 44 | 45 | 46 | Internal dispose function 47 | 48 | 49 | 50 | 51 | Provides a single output, 0-input Objectinterface to the RobusT2Scalesg MATLAB 52 | function. 53 | 54 | 55 | M-Documentation: 56 | ------------------------------------------------------------------------ 57 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 58 | The scripts implements the sugeno fuzzy controller and 59 | produce the output which is the scaling action for horizontal elasticity. 60 | x1: workload (should be normalized in [0 100]) 61 | x2: response time (should be normalized in [0 100]) 62 | scalingaction: [-2 +2], this determines the change in the number of resources 63 | ------------------------------------------------------------------------ 64 | 65 | An Object containing the first output argument. 66 | 67 | 68 | 69 | 70 | Provides a single output, 1-input Objectinterface to the RobusT2Scalesg MATLAB 71 | function. 72 | 73 | 74 | M-Documentation: 75 | ------------------------------------------------------------------------ 76 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 77 | The scripts implements the sugeno fuzzy controller and 78 | produce the output which is the scaling action for horizontal elasticity. 79 | x1: workload (should be normalized in [0 100]) 80 | x2: response time (should be normalized in [0 100]) 81 | scalingaction: [-2 +2], this determines the change in the number of resources 82 | ------------------------------------------------------------------------ 83 | 84 | Input argument #1 85 | An Object containing the first output argument. 86 | 87 | 88 | 89 | 90 | Provides a single output, 2-input Objectinterface to the RobusT2Scalesg MATLAB 91 | function. 92 | 93 | 94 | M-Documentation: 95 | ------------------------------------------------------------------------ 96 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 97 | The scripts implements the sugeno fuzzy controller and 98 | produce the output which is the scaling action for horizontal elasticity. 99 | x1: workload (should be normalized in [0 100]) 100 | x2: response time (should be normalized in [0 100]) 101 | scalingaction: [-2 +2], this determines the change in the number of resources 102 | ------------------------------------------------------------------------ 103 | 104 | Input argument #1 105 | Input argument #2 106 | An Object containing the first output argument. 107 | 108 | 109 | 110 | 111 | Provides the standard 0-input Object interface to the RobusT2Scalesg MATLAB 112 | function. 113 | 114 | 115 | M-Documentation: 116 | ------------------------------------------------------------------------ 117 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 118 | The scripts implements the sugeno fuzzy controller and 119 | produce the output which is the scaling action for horizontal elasticity. 120 | x1: workload (should be normalized in [0 100]) 121 | x2: response time (should be normalized in [0 100]) 122 | scalingaction: [-2 +2], this determines the change in the number of resources 123 | ------------------------------------------------------------------------ 124 | 125 | The number of output arguments to return. 126 | An Array of length "numArgsOut" containing the output 127 | arguments. 128 | 129 | 130 | 131 | 132 | Provides the standard 1-input Object interface to the RobusT2Scalesg MATLAB 133 | function. 134 | 135 | 136 | M-Documentation: 137 | ------------------------------------------------------------------------ 138 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 139 | The scripts implements the sugeno fuzzy controller and 140 | produce the output which is the scaling action for horizontal elasticity. 141 | x1: workload (should be normalized in [0 100]) 142 | x2: response time (should be normalized in [0 100]) 143 | scalingaction: [-2 +2], this determines the change in the number of resources 144 | ------------------------------------------------------------------------ 145 | 146 | The number of output arguments to return. 147 | Input argument #1 148 | An Array of length "numArgsOut" containing the output 149 | arguments. 150 | 151 | 152 | 153 | 154 | Provides the standard 2-input Object interface to the RobusT2Scalesg MATLAB 155 | function. 156 | 157 | 158 | M-Documentation: 159 | ------------------------------------------------------------------------ 160 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 161 | The scripts implements the sugeno fuzzy controller and 162 | produce the output which is the scaling action for horizontal elasticity. 163 | x1: workload (should be normalized in [0 100]) 164 | x2: response time (should be normalized in [0 100]) 165 | scalingaction: [-2 +2], this determines the change in the number of resources 166 | ------------------------------------------------------------------------ 167 | 168 | The number of output arguments to return. 169 | Input argument #1 170 | Input argument #2 171 | An Array of length "numArgsOut" containing the output 172 | arguments. 173 | 174 | 175 | 176 | 177 | Provides an interface for the RobusT2Scalesg function in which the input and 178 | output 179 | arguments are specified as an array of Objects. 180 | 181 | 182 | This method will allocate and return by reference the output argument 183 | array. 184 | M-Documentation: 185 | ------------------------------------------------------------------------ 186 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 187 | The scripts implements the sugeno fuzzy controller and 188 | produce the output which is the scaling action for horizontal elasticity. 189 | x1: workload (should be normalized in [0 100]) 190 | x2: response time (should be normalized in [0 100]) 191 | scalingaction: [-2 +2], this determines the change in the number of resources 192 | ------------------------------------------------------------------------ 193 | 194 | The number of output arguments to return 195 | Array of Object output arguments 196 | Array of Object input arguments 197 | Array of Object representing variable input 198 | arguments 199 | 200 | 201 | 202 | 203 | This method will cause a MATLAB figure window to behave as a modal dialog box. 204 | The method will not return until all the figure windows associated with this 205 | component have been closed. 206 | 207 | 208 | An application should only call this method when required to keep the 209 | MATLAB figure window from disappearing. Other techniques, such as calling 210 | Console.ReadLine() from the application should be considered where 211 | possible. 212 | 213 | 214 | 215 | 216 | -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/src/RobusT2ScaleExternalFIS.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RobusT2ScaleExternalFIS 5 | 6 | 7 | 8 | 9 | The Robust2Scale2 class provides a CLS compliant, MWArray interface to the MATLAB 10 | functions contained in the files: 11 | 12 | C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\RobusT2Sca 13 | lesg.m 14 | 15 | deployprint.m 16 | 17 | printdlg.m 18 | 19 | 20 | @Version 0.0 21 | 22 | 23 | 24 | 25 | The static constructor instantiates and initializes the MATLAB Compiler Runtime 26 | instance. 27 | 28 | 29 | 30 | 31 | Constructs a new instance of the Robust2Scale2 class. 32 | 33 | 34 | 35 | 36 | Class destructor called by the CLR garbage collector. 37 | 38 | 39 | 40 | 41 | Frees the native resources associated with this object 42 | 43 | 44 | 45 | 46 | Internal dispose function 47 | 48 | 49 | 50 | 51 | Provides a single output, 0-input MWArrayinterface to the RobusT2Scalesg MATLAB 52 | function. 53 | 54 | 55 | M-Documentation: 56 | ------------------------------------------------------------------------ 57 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 58 | The scripts implements the sugeno fuzzy controller and 59 | produce the output which is the scaling action for horizontal elasticity. 60 | x1: workload (should be normalized in [0 100]) 61 | x2: response time (should be normalized in [0 100]) 62 | scalingaction: [-2 +2], this determines the change in the number of resources 63 | ------------------------------------------------------------------------ 64 | 65 | An MWArray containing the first output argument. 66 | 67 | 68 | 69 | 70 | Provides a single output, 1-input MWArrayinterface to the RobusT2Scalesg MATLAB 71 | function. 72 | 73 | 74 | M-Documentation: 75 | ------------------------------------------------------------------------ 76 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 77 | The scripts implements the sugeno fuzzy controller and 78 | produce the output which is the scaling action for horizontal elasticity. 79 | x1: workload (should be normalized in [0 100]) 80 | x2: response time (should be normalized in [0 100]) 81 | scalingaction: [-2 +2], this determines the change in the number of resources 82 | ------------------------------------------------------------------------ 83 | 84 | Input argument #1 85 | An MWArray containing the first output argument. 86 | 87 | 88 | 89 | 90 | Provides a single output, 2-input MWArrayinterface to the RobusT2Scalesg MATLAB 91 | function. 92 | 93 | 94 | M-Documentation: 95 | ------------------------------------------------------------------------ 96 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 97 | The scripts implements the sugeno fuzzy controller and 98 | produce the output which is the scaling action for horizontal elasticity. 99 | x1: workload (should be normalized in [0 100]) 100 | x2: response time (should be normalized in [0 100]) 101 | scalingaction: [-2 +2], this determines the change in the number of resources 102 | ------------------------------------------------------------------------ 103 | 104 | Input argument #1 105 | Input argument #2 106 | An MWArray containing the first output argument. 107 | 108 | 109 | 110 | 111 | Provides the standard 0-input MWArray interface to the RobusT2Scalesg MATLAB 112 | function. 113 | 114 | 115 | M-Documentation: 116 | ------------------------------------------------------------------------ 117 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 118 | The scripts implements the sugeno fuzzy controller and 119 | produce the output which is the scaling action for horizontal elasticity. 120 | x1: workload (should be normalized in [0 100]) 121 | x2: response time (should be normalized in [0 100]) 122 | scalingaction: [-2 +2], this determines the change in the number of resources 123 | ------------------------------------------------------------------------ 124 | 125 | The number of output arguments to return. 126 | An Array of length "numArgsOut" containing the output 127 | arguments. 128 | 129 | 130 | 131 | 132 | Provides the standard 1-input MWArray interface to the RobusT2Scalesg MATLAB 133 | function. 134 | 135 | 136 | M-Documentation: 137 | ------------------------------------------------------------------------ 138 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 139 | The scripts implements the sugeno fuzzy controller and 140 | produce the output which is the scaling action for horizontal elasticity. 141 | x1: workload (should be normalized in [0 100]) 142 | x2: response time (should be normalized in [0 100]) 143 | scalingaction: [-2 +2], this determines the change in the number of resources 144 | ------------------------------------------------------------------------ 145 | 146 | The number of output arguments to return. 147 | Input argument #1 148 | An Array of length "numArgsOut" containing the output 149 | arguments. 150 | 151 | 152 | 153 | 154 | Provides the standard 2-input MWArray interface to the RobusT2Scalesg MATLAB 155 | function. 156 | 157 | 158 | M-Documentation: 159 | ------------------------------------------------------------------------ 160 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 161 | The scripts implements the sugeno fuzzy controller and 162 | produce the output which is the scaling action for horizontal elasticity. 163 | x1: workload (should be normalized in [0 100]) 164 | x2: response time (should be normalized in [0 100]) 165 | scalingaction: [-2 +2], this determines the change in the number of resources 166 | ------------------------------------------------------------------------ 167 | 168 | The number of output arguments to return. 169 | Input argument #1 170 | Input argument #2 171 | An Array of length "numArgsOut" containing the output 172 | arguments. 173 | 174 | 175 | 176 | 177 | Provides an interface for the RobusT2Scalesg function in which the input and 178 | output 179 | arguments are specified as an array of MWArrays. 180 | 181 | 182 | This method will allocate and return by reference the output argument 183 | array. 184 | M-Documentation: 185 | ------------------------------------------------------------------------ 186 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 187 | The scripts implements the sugeno fuzzy controller and 188 | produce the output which is the scaling action for horizontal elasticity. 189 | x1: workload (should be normalized in [0 100]) 190 | x2: response time (should be normalized in [0 100]) 191 | scalingaction: [-2 +2], this determines the change in the number of resources 192 | ------------------------------------------------------------------------ 193 | 194 | The number of output arguments to return 195 | Array of MWArray output arguments 196 | Array of MWArray input arguments 197 | 198 | 199 | 200 | 201 | This method will cause a MATLAB figure window to behave as a modal dialog box. 202 | The method will not return until all the figure windows associated with this 203 | component have been closed. 204 | 205 | 206 | An application should only call this method when required to keep the 207 | MATLAB figure window from disappearing. Other techniques, such as calling 208 | Console.ReadLine() from the application should be considered where 209 | possible. 210 | 211 | 212 | 213 | 214 | -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/src/RobusT2ScaleExternalFISNative.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RobusT2ScaleExternalFISNative 5 | 6 | 7 | 8 | 9 | The Robust2Scale2 class provides a CLS compliant, Object (native) interface to the 10 | MATLAB functions contained in the files: 11 | 12 | C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\RobusT2Sca 13 | lesg.m 14 | 15 | deployprint.m 16 | 17 | printdlg.m 18 | 19 | 20 | @Version 0.0 21 | 22 | 23 | 24 | 25 | The static constructor instantiates and initializes the MATLAB Compiler Runtime 26 | instance. 27 | 28 | 29 | 30 | 31 | Constructs a new instance of the Robust2Scale2 class. 32 | 33 | 34 | 35 | 36 | Class destructor called by the CLR garbage collector. 37 | 38 | 39 | 40 | 41 | Frees the native resources associated with this object 42 | 43 | 44 | 45 | 46 | Internal dispose function 47 | 48 | 49 | 50 | 51 | Provides a single output, 0-input Objectinterface to the RobusT2Scalesg MATLAB 52 | function. 53 | 54 | 55 | M-Documentation: 56 | ------------------------------------------------------------------------ 57 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 58 | The scripts implements the sugeno fuzzy controller and 59 | produce the output which is the scaling action for horizontal elasticity. 60 | x1: workload (should be normalized in [0 100]) 61 | x2: response time (should be normalized in [0 100]) 62 | scalingaction: [-2 +2], this determines the change in the number of resources 63 | ------------------------------------------------------------------------ 64 | 65 | An Object containing the first output argument. 66 | 67 | 68 | 69 | 70 | Provides a single output, 1-input Objectinterface to the RobusT2Scalesg MATLAB 71 | function. 72 | 73 | 74 | M-Documentation: 75 | ------------------------------------------------------------------------ 76 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 77 | The scripts implements the sugeno fuzzy controller and 78 | produce the output which is the scaling action for horizontal elasticity. 79 | x1: workload (should be normalized in [0 100]) 80 | x2: response time (should be normalized in [0 100]) 81 | scalingaction: [-2 +2], this determines the change in the number of resources 82 | ------------------------------------------------------------------------ 83 | 84 | Input argument #1 85 | An Object containing the first output argument. 86 | 87 | 88 | 89 | 90 | Provides a single output, 2-input Objectinterface to the RobusT2Scalesg MATLAB 91 | function. 92 | 93 | 94 | M-Documentation: 95 | ------------------------------------------------------------------------ 96 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 97 | The scripts implements the sugeno fuzzy controller and 98 | produce the output which is the scaling action for horizontal elasticity. 99 | x1: workload (should be normalized in [0 100]) 100 | x2: response time (should be normalized in [0 100]) 101 | scalingaction: [-2 +2], this determines the change in the number of resources 102 | ------------------------------------------------------------------------ 103 | 104 | Input argument #1 105 | Input argument #2 106 | An Object containing the first output argument. 107 | 108 | 109 | 110 | 111 | Provides the standard 0-input Object interface to the RobusT2Scalesg MATLAB 112 | function. 113 | 114 | 115 | M-Documentation: 116 | ------------------------------------------------------------------------ 117 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 118 | The scripts implements the sugeno fuzzy controller and 119 | produce the output which is the scaling action for horizontal elasticity. 120 | x1: workload (should be normalized in [0 100]) 121 | x2: response time (should be normalized in [0 100]) 122 | scalingaction: [-2 +2], this determines the change in the number of resources 123 | ------------------------------------------------------------------------ 124 | 125 | The number of output arguments to return. 126 | An Array of length "numArgsOut" containing the output 127 | arguments. 128 | 129 | 130 | 131 | 132 | Provides the standard 1-input Object interface to the RobusT2Scalesg MATLAB 133 | function. 134 | 135 | 136 | M-Documentation: 137 | ------------------------------------------------------------------------ 138 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 139 | The scripts implements the sugeno fuzzy controller and 140 | produce the output which is the scaling action for horizontal elasticity. 141 | x1: workload (should be normalized in [0 100]) 142 | x2: response time (should be normalized in [0 100]) 143 | scalingaction: [-2 +2], this determines the change in the number of resources 144 | ------------------------------------------------------------------------ 145 | 146 | The number of output arguments to return. 147 | Input argument #1 148 | An Array of length "numArgsOut" containing the output 149 | arguments. 150 | 151 | 152 | 153 | 154 | Provides the standard 2-input Object interface to the RobusT2Scalesg MATLAB 155 | function. 156 | 157 | 158 | M-Documentation: 159 | ------------------------------------------------------------------------ 160 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 161 | The scripts implements the sugeno fuzzy controller and 162 | produce the output which is the scaling action for horizontal elasticity. 163 | x1: workload (should be normalized in [0 100]) 164 | x2: response time (should be normalized in [0 100]) 165 | scalingaction: [-2 +2], this determines the change in the number of resources 166 | ------------------------------------------------------------------------ 167 | 168 | The number of output arguments to return. 169 | Input argument #1 170 | Input argument #2 171 | An Array of length "numArgsOut" containing the output 172 | arguments. 173 | 174 | 175 | 176 | 177 | Provides an interface for the RobusT2Scalesg function in which the input and 178 | output 179 | arguments are specified as an array of Objects. 180 | 181 | 182 | This method will allocate and return by reference the output argument 183 | array. 184 | M-Documentation: 185 | ------------------------------------------------------------------------ 186 | Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 187 | The scripts implements the sugeno fuzzy controller and 188 | produce the output which is the scaling action for horizontal elasticity. 189 | x1: workload (should be normalized in [0 100]) 190 | x2: response time (should be normalized in [0 100]) 191 | scalingaction: [-2 +2], this determines the change in the number of resources 192 | ------------------------------------------------------------------------ 193 | 194 | The number of output arguments to return 195 | Array of Object output arguments 196 | Array of Object input arguments 197 | Array of Object representing variable input 198 | arguments 199 | 200 | 201 | 202 | 203 | This method will cause a MATLAB figure window to behave as a modal dialog box. 204 | The method will not return until all the figure windows associated with this 205 | component have been closed. 206 | 207 | 208 | An application should only call this method when required to keep the 209 | MATLAB figure window from disappearing. Other techniques, such as calling 210 | Console.ReadLine() from the application should be considered where 211 | possible. 212 | 213 | 214 | 215 | 216 | -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/src/Robust2Scale2.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * MATLAB Compiler: 4.18.1 (R2013a) 3 | * Date: Fri Jan 02 01:33:54 2015 4 | * Arguments: "-B" "macro_default" "-W" 5 | * "dotnet:RobusT2ScaleExternalFIS,Robust2Scale2,0.0,private" "-T" "link:lib" "-d" 6 | * "C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2ScaleExternalFIS\sr 7 | * c" "-w" "enable:specified_file_mismatch" "-w" "enable:repeated_file" "-w" 8 | * "enable:switch_ignored" "-w" "enable:missing_lib_sentinel" "-w" "enable:demo_license" 9 | * "-v" 10 | * "class{Robust2Scale2:C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT 11 | * 2Scale\RobusT2Scalesg.m}" "-a" 12 | * "C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\scaledata.m" 13 | */ 14 | using System; 15 | using System.Reflection; 16 | using System.IO; 17 | using MathWorks.MATLAB.NET.Arrays; 18 | using MathWorks.MATLAB.NET.Utility; 19 | 20 | #if SHARED 21 | [assembly: System.Reflection.AssemblyKeyFile(@"")] 22 | #endif 23 | 24 | namespace RobusT2ScaleExternalFIS 25 | { 26 | 27 | /// 28 | /// The Robust2Scale2 class provides a CLS compliant, MWArray interface to the MATLAB 29 | /// functions contained in the files: 30 | /// 31 | /// C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\RobusT2Sca 32 | /// lesg.m 33 | /// 34 | /// deployprint.m 35 | /// 36 | /// printdlg.m 37 | /// 38 | /// 39 | /// @Version 0.0 40 | /// 41 | public class Robust2Scale2 : IDisposable 42 | { 43 | #region Constructors 44 | 45 | /// 46 | /// The static constructor instantiates and initializes the MATLAB Compiler Runtime 47 | /// instance. 48 | /// 49 | static Robust2Scale2() 50 | { 51 | if (MWMCR.MCRAppInitialized) 52 | { 53 | try 54 | { 55 | Assembly assembly= Assembly.GetExecutingAssembly(); 56 | 57 | string ctfFilePath= assembly.Location; 58 | 59 | int lastDelimiter= ctfFilePath.LastIndexOf(@"\"); 60 | 61 | ctfFilePath= ctfFilePath.Remove(lastDelimiter, (ctfFilePath.Length - lastDelimiter)); 62 | 63 | string ctfFileName = "RobusT2ScaleExternalFIS.ctf"; 64 | 65 | Stream embeddedCtfStream = null; 66 | 67 | String[] resourceStrings = assembly.GetManifestResourceNames(); 68 | 69 | foreach (String name in resourceStrings) 70 | { 71 | if (name.Contains(ctfFileName)) 72 | { 73 | embeddedCtfStream = assembly.GetManifestResourceStream(name); 74 | break; 75 | } 76 | } 77 | mcr= new MWMCR("", 78 | ctfFilePath, embeddedCtfStream, true); 79 | } 80 | catch(Exception ex) 81 | { 82 | ex_ = new Exception("MWArray assembly failed to be initialized", ex); 83 | } 84 | } 85 | else 86 | { 87 | ex_ = new ApplicationException("MWArray assembly could not be initialized"); 88 | } 89 | } 90 | 91 | 92 | /// 93 | /// Constructs a new instance of the Robust2Scale2 class. 94 | /// 95 | public Robust2Scale2() 96 | { 97 | if(ex_ != null) 98 | { 99 | throw ex_; 100 | } 101 | } 102 | 103 | 104 | #endregion Constructors 105 | 106 | #region Finalize 107 | 108 | /// 109 | /// Class destructor called by the CLR garbage collector. 110 | /// 111 | ~Robust2Scale2() 112 | { 113 | Dispose(false); 114 | } 115 | 116 | 117 | /// 118 | /// Frees the native resources associated with this object 119 | /// 120 | public void Dispose() 121 | { 122 | Dispose(true); 123 | 124 | GC.SuppressFinalize(this); 125 | } 126 | 127 | 128 | /// 129 | /// Internal dispose function 130 | /// 131 | protected virtual void Dispose(bool disposing) 132 | { 133 | if (!disposed) 134 | { 135 | disposed= true; 136 | 137 | if (disposing) 138 | { 139 | // Free managed resources; 140 | } 141 | 142 | // Free native resources 143 | } 144 | } 145 | 146 | 147 | #endregion Finalize 148 | 149 | #region Methods 150 | 151 | /// 152 | /// Provides a single output, 0-input MWArrayinterface to the RobusT2Scalesg MATLAB 153 | /// function. 154 | /// 155 | /// 156 | /// M-Documentation: 157 | /// ------------------------------------------------------------------------ 158 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 159 | /// The scripts implements the sugeno fuzzy controller and 160 | /// produce the output which is the scaling action for horizontal elasticity. 161 | /// x1: workload (should be normalized in [0 100]) 162 | /// x2: response time (should be normalized in [0 100]) 163 | /// scalingaction: [-2 +2], this determines the change in the number of resources 164 | /// ------------------------------------------------------------------------ 165 | /// 166 | /// An MWArray containing the first output argument. 167 | /// 168 | public MWArray RobusT2Scalesg() 169 | { 170 | return mcr.EvaluateFunction("RobusT2Scalesg", new MWArray[]{}); 171 | } 172 | 173 | 174 | /// 175 | /// Provides a single output, 1-input MWArrayinterface to the RobusT2Scalesg MATLAB 176 | /// function. 177 | /// 178 | /// 179 | /// M-Documentation: 180 | /// ------------------------------------------------------------------------ 181 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 182 | /// The scripts implements the sugeno fuzzy controller and 183 | /// produce the output which is the scaling action for horizontal elasticity. 184 | /// x1: workload (should be normalized in [0 100]) 185 | /// x2: response time (should be normalized in [0 100]) 186 | /// scalingaction: [-2 +2], this determines the change in the number of resources 187 | /// ------------------------------------------------------------------------ 188 | /// 189 | /// Input argument #1 190 | /// An MWArray containing the first output argument. 191 | /// 192 | public MWArray RobusT2Scalesg(MWArray x1) 193 | { 194 | return mcr.EvaluateFunction("RobusT2Scalesg", x1); 195 | } 196 | 197 | 198 | /// 199 | /// Provides a single output, 2-input MWArrayinterface to the RobusT2Scalesg MATLAB 200 | /// function. 201 | /// 202 | /// 203 | /// M-Documentation: 204 | /// ------------------------------------------------------------------------ 205 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 206 | /// The scripts implements the sugeno fuzzy controller and 207 | /// produce the output which is the scaling action for horizontal elasticity. 208 | /// x1: workload (should be normalized in [0 100]) 209 | /// x2: response time (should be normalized in [0 100]) 210 | /// scalingaction: [-2 +2], this determines the change in the number of resources 211 | /// ------------------------------------------------------------------------ 212 | /// 213 | /// Input argument #1 214 | /// Input argument #2 215 | /// An MWArray containing the first output argument. 216 | /// 217 | public MWArray RobusT2Scalesg(MWArray x1, MWArray x2) 218 | { 219 | return mcr.EvaluateFunction("RobusT2Scalesg", x1, x2); 220 | } 221 | 222 | 223 | /// 224 | /// Provides the standard 0-input MWArray interface to the RobusT2Scalesg MATLAB 225 | /// function. 226 | /// 227 | /// 228 | /// M-Documentation: 229 | /// ------------------------------------------------------------------------ 230 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 231 | /// The scripts implements the sugeno fuzzy controller and 232 | /// produce the output which is the scaling action for horizontal elasticity. 233 | /// x1: workload (should be normalized in [0 100]) 234 | /// x2: response time (should be normalized in [0 100]) 235 | /// scalingaction: [-2 +2], this determines the change in the number of resources 236 | /// ------------------------------------------------------------------------ 237 | /// 238 | /// The number of output arguments to return. 239 | /// An Array of length "numArgsOut" containing the output 240 | /// arguments. 241 | /// 242 | public MWArray[] RobusT2Scalesg(int numArgsOut) 243 | { 244 | return mcr.EvaluateFunction(numArgsOut, "RobusT2Scalesg", new MWArray[]{}); 245 | } 246 | 247 | 248 | /// 249 | /// Provides the standard 1-input MWArray interface to the RobusT2Scalesg MATLAB 250 | /// function. 251 | /// 252 | /// 253 | /// M-Documentation: 254 | /// ------------------------------------------------------------------------ 255 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 256 | /// The scripts implements the sugeno fuzzy controller and 257 | /// produce the output which is the scaling action for horizontal elasticity. 258 | /// x1: workload (should be normalized in [0 100]) 259 | /// x2: response time (should be normalized in [0 100]) 260 | /// scalingaction: [-2 +2], this determines the change in the number of resources 261 | /// ------------------------------------------------------------------------ 262 | /// 263 | /// The number of output arguments to return. 264 | /// Input argument #1 265 | /// An Array of length "numArgsOut" containing the output 266 | /// arguments. 267 | /// 268 | public MWArray[] RobusT2Scalesg(int numArgsOut, MWArray x1) 269 | { 270 | return mcr.EvaluateFunction(numArgsOut, "RobusT2Scalesg", x1); 271 | } 272 | 273 | 274 | /// 275 | /// Provides the standard 2-input MWArray interface to the RobusT2Scalesg MATLAB 276 | /// function. 277 | /// 278 | /// 279 | /// M-Documentation: 280 | /// ------------------------------------------------------------------------ 281 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 282 | /// The scripts implements the sugeno fuzzy controller and 283 | /// produce the output which is the scaling action for horizontal elasticity. 284 | /// x1: workload (should be normalized in [0 100]) 285 | /// x2: response time (should be normalized in [0 100]) 286 | /// scalingaction: [-2 +2], this determines the change in the number of resources 287 | /// ------------------------------------------------------------------------ 288 | /// 289 | /// The number of output arguments to return. 290 | /// Input argument #1 291 | /// Input argument #2 292 | /// An Array of length "numArgsOut" containing the output 293 | /// arguments. 294 | /// 295 | public MWArray[] RobusT2Scalesg(int numArgsOut, MWArray x1, MWArray x2) 296 | { 297 | return mcr.EvaluateFunction(numArgsOut, "RobusT2Scalesg", x1, x2); 298 | } 299 | 300 | 301 | /// 302 | /// Provides an interface for the RobusT2Scalesg function in which the input and 303 | /// output 304 | /// arguments are specified as an array of MWArrays. 305 | /// 306 | /// 307 | /// This method will allocate and return by reference the output argument 308 | /// array. 309 | /// M-Documentation: 310 | /// ------------------------------------------------------------------------ 311 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 312 | /// The scripts implements the sugeno fuzzy controller and 313 | /// produce the output which is the scaling action for horizontal elasticity. 314 | /// x1: workload (should be normalized in [0 100]) 315 | /// x2: response time (should be normalized in [0 100]) 316 | /// scalingaction: [-2 +2], this determines the change in the number of resources 317 | /// ------------------------------------------------------------------------ 318 | /// 319 | /// The number of output arguments to return 320 | /// Array of MWArray output arguments 321 | /// Array of MWArray input arguments 322 | /// 323 | public void RobusT2Scalesg(int numArgsOut, ref MWArray[] argsOut, MWArray[] argsIn) 324 | { 325 | mcr.EvaluateFunction("RobusT2Scalesg", numArgsOut, ref argsOut, argsIn); 326 | } 327 | 328 | 329 | 330 | /// 331 | /// This method will cause a MATLAB figure window to behave as a modal dialog box. 332 | /// The method will not return until all the figure windows associated with this 333 | /// component have been closed. 334 | /// 335 | /// 336 | /// An application should only call this method when required to keep the 337 | /// MATLAB figure window from disappearing. Other techniques, such as calling 338 | /// Console.ReadLine() from the application should be considered where 339 | /// possible. 340 | /// 341 | public void WaitForFiguresToDie() 342 | { 343 | mcr.WaitForFiguresToDie(); 344 | } 345 | 346 | 347 | 348 | #endregion Methods 349 | 350 | #region Class Members 351 | 352 | private static MWMCR mcr= null; 353 | 354 | private static Exception ex_= null; 355 | 356 | private bool disposed= false; 357 | 358 | #endregion Class Members 359 | } 360 | } 361 | -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2Scale/src/RobusT2Scale.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * MATLAB Compiler: 4.18.1 (R2013a) 3 | * Date: Tue Dec 23 22:31:25 2014 4 | * Arguments: "-B" "macro_default" "-W" "dotnet:RobusT2Scale,RobusT2Scale,0.0,private" 5 | * "-T" "link:lib" "-d" 6 | * "C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\RobusT2Scale\ 7 | * src" "-w" "enable:specified_file_mismatch" "-w" "enable:repeated_file" "-w" 8 | * "enable:switch_ignored" "-w" "enable:missing_lib_sentinel" "-w" "enable:demo_license" 9 | * "-v" 10 | * "class{RobusT2Scale:C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2 11 | * Scale\RobusT2Scalesg.m}" "-a" 12 | * "C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\robust2scales 13 | * g.fis" "-a" 14 | * "C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\scaledata.m" 15 | */ 16 | using System; 17 | using System.Reflection; 18 | using System.IO; 19 | using MathWorks.MATLAB.NET.Arrays; 20 | using MathWorks.MATLAB.NET.Utility; 21 | 22 | #if SHARED 23 | [assembly: System.Reflection.AssemblyKeyFile(@"")] 24 | #endif 25 | 26 | namespace RobusT2Scale 27 | { 28 | 29 | /// 30 | /// The RobusT2Scale class provides a CLS compliant, MWArray interface to the MATLAB 31 | /// functions contained in the files: 32 | /// 33 | /// C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\RobusT2Sca 34 | /// lesg.m 35 | /// 36 | /// deployprint.m 37 | /// 38 | /// printdlg.m 39 | /// 40 | /// 41 | /// @Version 0.0 42 | /// 43 | public class RobusT2Scale : IDisposable 44 | { 45 | #region Constructors 46 | 47 | /// 48 | /// The static constructor instantiates and initializes the MATLAB Compiler Runtime 49 | /// instance. 50 | /// 51 | static RobusT2Scale() 52 | { 53 | if (MWMCR.MCRAppInitialized) 54 | { 55 | try 56 | { 57 | Assembly assembly= Assembly.GetExecutingAssembly(); 58 | 59 | string ctfFilePath= assembly.Location; 60 | 61 | int lastDelimiter= ctfFilePath.LastIndexOf(@"\"); 62 | 63 | ctfFilePath= ctfFilePath.Remove(lastDelimiter, (ctfFilePath.Length - lastDelimiter)); 64 | 65 | string ctfFileName = "RobusT2Scale.ctf"; 66 | 67 | Stream embeddedCtfStream = null; 68 | 69 | String[] resourceStrings = assembly.GetManifestResourceNames(); 70 | 71 | foreach (String name in resourceStrings) 72 | { 73 | if (name.Contains(ctfFileName)) 74 | { 75 | embeddedCtfStream = assembly.GetManifestResourceStream(name); 76 | break; 77 | } 78 | } 79 | mcr= new MWMCR("", 80 | ctfFilePath, embeddedCtfStream, true); 81 | } 82 | catch(Exception ex) 83 | { 84 | ex_ = new Exception("MWArray assembly failed to be initialized", ex); 85 | } 86 | } 87 | else 88 | { 89 | ex_ = new ApplicationException("MWArray assembly could not be initialized"); 90 | } 91 | } 92 | 93 | 94 | /// 95 | /// Constructs a new instance of the RobusT2Scale class. 96 | /// 97 | public RobusT2Scale() 98 | { 99 | if(ex_ != null) 100 | { 101 | throw ex_; 102 | } 103 | } 104 | 105 | 106 | #endregion Constructors 107 | 108 | #region Finalize 109 | 110 | /// 111 | /// Class destructor called by the CLR garbage collector. 112 | /// 113 | ~RobusT2Scale() 114 | { 115 | Dispose(false); 116 | } 117 | 118 | 119 | /// 120 | /// Frees the native resources associated with this object 121 | /// 122 | public void Dispose() 123 | { 124 | Dispose(true); 125 | 126 | GC.SuppressFinalize(this); 127 | } 128 | 129 | 130 | /// 131 | /// Internal dispose function 132 | /// 133 | protected virtual void Dispose(bool disposing) 134 | { 135 | if (!disposed) 136 | { 137 | disposed= true; 138 | 139 | if (disposing) 140 | { 141 | // Free managed resources; 142 | } 143 | 144 | // Free native resources 145 | } 146 | } 147 | 148 | 149 | #endregion Finalize 150 | 151 | #region Methods 152 | 153 | /// 154 | /// Provides a single output, 0-input MWArrayinterface to the RobusT2Scalesg MATLAB 155 | /// function. 156 | /// 157 | /// 158 | /// M-Documentation: 159 | /// ------------------------------------------------------------------------ 160 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 161 | /// The scripts implements the sugeno fuzzy controller and 162 | /// produce the output which is the scaling action for horizontal elasticity. 163 | /// x1: workload (should be normalized in [0 100]) 164 | /// x2: response time (should be normalized in [0 100]) 165 | /// scalingaction: [-2 +2], this determines the change in the number of resources 166 | /// ------------------------------------------------------------------------ 167 | /// 168 | /// An MWArray containing the first output argument. 169 | /// 170 | public MWArray RobusT2Scalesg() 171 | { 172 | return mcr.EvaluateFunction("RobusT2Scalesg", new MWArray[]{}); 173 | } 174 | 175 | 176 | /// 177 | /// Provides a single output, 1-input MWArrayinterface to the RobusT2Scalesg MATLAB 178 | /// function. 179 | /// 180 | /// 181 | /// M-Documentation: 182 | /// ------------------------------------------------------------------------ 183 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 184 | /// The scripts implements the sugeno fuzzy controller and 185 | /// produce the output which is the scaling action for horizontal elasticity. 186 | /// x1: workload (should be normalized in [0 100]) 187 | /// x2: response time (should be normalized in [0 100]) 188 | /// scalingaction: [-2 +2], this determines the change in the number of resources 189 | /// ------------------------------------------------------------------------ 190 | /// 191 | /// Input argument #1 192 | /// An MWArray containing the first output argument. 193 | /// 194 | public MWArray RobusT2Scalesg(MWArray x1) 195 | { 196 | return mcr.EvaluateFunction("RobusT2Scalesg", x1); 197 | } 198 | 199 | 200 | /// 201 | /// Provides a single output, 2-input MWArrayinterface to the RobusT2Scalesg MATLAB 202 | /// function. 203 | /// 204 | /// 205 | /// M-Documentation: 206 | /// ------------------------------------------------------------------------ 207 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 208 | /// The scripts implements the sugeno fuzzy controller and 209 | /// produce the output which is the scaling action for horizontal elasticity. 210 | /// x1: workload (should be normalized in [0 100]) 211 | /// x2: response time (should be normalized in [0 100]) 212 | /// scalingaction: [-2 +2], this determines the change in the number of resources 213 | /// ------------------------------------------------------------------------ 214 | /// 215 | /// Input argument #1 216 | /// Input argument #2 217 | /// An MWArray containing the first output argument. 218 | /// 219 | public MWArray RobusT2Scalesg(MWArray x1, MWArray x2) 220 | { 221 | return mcr.EvaluateFunction("RobusT2Scalesg", x1, x2); 222 | } 223 | 224 | 225 | /// 226 | /// Provides the standard 0-input MWArray interface to the RobusT2Scalesg MATLAB 227 | /// function. 228 | /// 229 | /// 230 | /// M-Documentation: 231 | /// ------------------------------------------------------------------------ 232 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 233 | /// The scripts implements the sugeno fuzzy controller and 234 | /// produce the output which is the scaling action for horizontal elasticity. 235 | /// x1: workload (should be normalized in [0 100]) 236 | /// x2: response time (should be normalized in [0 100]) 237 | /// scalingaction: [-2 +2], this determines the change in the number of resources 238 | /// ------------------------------------------------------------------------ 239 | /// 240 | /// The number of output arguments to return. 241 | /// An Array of length "numArgsOut" containing the output 242 | /// arguments. 243 | /// 244 | public MWArray[] RobusT2Scalesg(int numArgsOut) 245 | { 246 | return mcr.EvaluateFunction(numArgsOut, "RobusT2Scalesg", new MWArray[]{}); 247 | } 248 | 249 | 250 | /// 251 | /// Provides the standard 1-input MWArray interface to the RobusT2Scalesg MATLAB 252 | /// function. 253 | /// 254 | /// 255 | /// M-Documentation: 256 | /// ------------------------------------------------------------------------ 257 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 258 | /// The scripts implements the sugeno fuzzy controller and 259 | /// produce the output which is the scaling action for horizontal elasticity. 260 | /// x1: workload (should be normalized in [0 100]) 261 | /// x2: response time (should be normalized in [0 100]) 262 | /// scalingaction: [-2 +2], this determines the change in the number of resources 263 | /// ------------------------------------------------------------------------ 264 | /// 265 | /// The number of output arguments to return. 266 | /// Input argument #1 267 | /// An Array of length "numArgsOut" containing the output 268 | /// arguments. 269 | /// 270 | public MWArray[] RobusT2Scalesg(int numArgsOut, MWArray x1) 271 | { 272 | return mcr.EvaluateFunction(numArgsOut, "RobusT2Scalesg", x1); 273 | } 274 | 275 | 276 | /// 277 | /// Provides the standard 2-input MWArray interface to the RobusT2Scalesg MATLAB 278 | /// function. 279 | /// 280 | /// 281 | /// M-Documentation: 282 | /// ------------------------------------------------------------------------ 283 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 284 | /// The scripts implements the sugeno fuzzy controller and 285 | /// produce the output which is the scaling action for horizontal elasticity. 286 | /// x1: workload (should be normalized in [0 100]) 287 | /// x2: response time (should be normalized in [0 100]) 288 | /// scalingaction: [-2 +2], this determines the change in the number of resources 289 | /// ------------------------------------------------------------------------ 290 | /// 291 | /// The number of output arguments to return. 292 | /// Input argument #1 293 | /// Input argument #2 294 | /// An Array of length "numArgsOut" containing the output 295 | /// arguments. 296 | /// 297 | public MWArray[] RobusT2Scalesg(int numArgsOut, MWArray x1, MWArray x2) 298 | { 299 | return mcr.EvaluateFunction(numArgsOut, "RobusT2Scalesg", x1, x2); 300 | } 301 | 302 | 303 | /// 304 | /// Provides an interface for the RobusT2Scalesg function in which the input and 305 | /// output 306 | /// arguments are specified as an array of MWArrays. 307 | /// 308 | /// 309 | /// This method will allocate and return by reference the output argument 310 | /// array. 311 | /// M-Documentation: 312 | /// ------------------------------------------------------------------------ 313 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 314 | /// The scripts implements the sugeno fuzzy controller and 315 | /// produce the output which is the scaling action for horizontal elasticity. 316 | /// x1: workload (should be normalized in [0 100]) 317 | /// x2: response time (should be normalized in [0 100]) 318 | /// scalingaction: [-2 +2], this determines the change in the number of resources 319 | /// ------------------------------------------------------------------------ 320 | /// 321 | /// The number of output arguments to return 322 | /// Array of MWArray output arguments 323 | /// Array of MWArray input arguments 324 | /// 325 | public void RobusT2Scalesg(int numArgsOut, ref MWArray[] argsOut, MWArray[] argsIn) 326 | { 327 | mcr.EvaluateFunction("RobusT2Scalesg", numArgsOut, ref argsOut, argsIn); 328 | } 329 | 330 | 331 | 332 | /// 333 | /// This method will cause a MATLAB figure window to behave as a modal dialog box. 334 | /// The method will not return until all the figure windows associated with this 335 | /// component have been closed. 336 | /// 337 | /// 338 | /// An application should only call this method when required to keep the 339 | /// MATLAB figure window from disappearing. Other techniques, such as calling 340 | /// Console.ReadLine() from the application should be considered where 341 | /// possible. 342 | /// 343 | public void WaitForFiguresToDie() 344 | { 345 | mcr.WaitForFiguresToDie(); 346 | } 347 | 348 | 349 | 350 | #endregion Methods 351 | 352 | #region Class Members 353 | 354 | private static MWMCR mcr= null; 355 | 356 | private static Exception ex_= null; 357 | 358 | private bool disposed= false; 359 | 360 | #endregion Class Members 361 | } 362 | } 363 | -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2ScaleExternalFIS/src/Robust2Scale2Native.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * MATLAB Compiler: 4.18.1 (R2013a) 3 | * Date: Fri Jan 02 01:33:54 2015 4 | * Arguments: "-B" "macro_default" "-W" 5 | * "dotnet:RobusT2ScaleExternalFIS,Robust2Scale2,0.0,private" "-T" "link:lib" "-d" 6 | * "C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2ScaleExternalFIS\sr 7 | * c" "-w" "enable:specified_file_mismatch" "-w" "enable:repeated_file" "-w" 8 | * "enable:switch_ignored" "-w" "enable:missing_lib_sentinel" "-w" "enable:demo_license" 9 | * "-v" 10 | * "class{Robust2Scale2:C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT 11 | * 2Scale\RobusT2Scalesg.m}" "-a" 12 | * "C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\scaledata.m" 13 | */ 14 | using System; 15 | using System.Reflection; 16 | using System.IO; 17 | using MathWorks.MATLAB.NET.Arrays; 18 | using MathWorks.MATLAB.NET.Utility; 19 | 20 | #if SHARED 21 | [assembly: System.Reflection.AssemblyKeyFile(@"")] 22 | #endif 23 | 24 | namespace RobusT2ScaleExternalFISNative 25 | { 26 | 27 | /// 28 | /// The Robust2Scale2 class provides a CLS compliant, Object (native) interface to the 29 | /// MATLAB functions contained in the files: 30 | /// 31 | /// C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\RobusT2Sca 32 | /// lesg.m 33 | /// 34 | /// deployprint.m 35 | /// 36 | /// printdlg.m 37 | /// 38 | /// 39 | /// @Version 0.0 40 | /// 41 | public class Robust2Scale2 : IDisposable 42 | { 43 | #region Constructors 44 | 45 | /// 46 | /// The static constructor instantiates and initializes the MATLAB Compiler Runtime 47 | /// instance. 48 | /// 49 | static Robust2Scale2() 50 | { 51 | if (MWMCR.MCRAppInitialized) 52 | { 53 | try 54 | { 55 | Assembly assembly= Assembly.GetExecutingAssembly(); 56 | 57 | string ctfFilePath= assembly.Location; 58 | 59 | int lastDelimiter= ctfFilePath.LastIndexOf(@"\"); 60 | 61 | ctfFilePath= ctfFilePath.Remove(lastDelimiter, (ctfFilePath.Length - lastDelimiter)); 62 | 63 | string ctfFileName = "RobusT2ScaleExternalFIS.ctf"; 64 | 65 | Stream embeddedCtfStream = null; 66 | 67 | String[] resourceStrings = assembly.GetManifestResourceNames(); 68 | 69 | foreach (String name in resourceStrings) 70 | { 71 | if (name.Contains(ctfFileName)) 72 | { 73 | embeddedCtfStream = assembly.GetManifestResourceStream(name); 74 | break; 75 | } 76 | } 77 | mcr= new MWMCR("", 78 | ctfFilePath, embeddedCtfStream, true); 79 | } 80 | catch(Exception ex) 81 | { 82 | ex_ = new Exception("MWArray assembly failed to be initialized", ex); 83 | } 84 | } 85 | else 86 | { 87 | ex_ = new ApplicationException("MWArray assembly could not be initialized"); 88 | } 89 | } 90 | 91 | 92 | /// 93 | /// Constructs a new instance of the Robust2Scale2 class. 94 | /// 95 | public Robust2Scale2() 96 | { 97 | if(ex_ != null) 98 | { 99 | throw ex_; 100 | } 101 | } 102 | 103 | 104 | #endregion Constructors 105 | 106 | #region Finalize 107 | 108 | /// 109 | /// Class destructor called by the CLR garbage collector. 110 | /// 111 | ~Robust2Scale2() 112 | { 113 | Dispose(false); 114 | } 115 | 116 | 117 | /// 118 | /// Frees the native resources associated with this object 119 | /// 120 | public void Dispose() 121 | { 122 | Dispose(true); 123 | 124 | GC.SuppressFinalize(this); 125 | } 126 | 127 | 128 | /// 129 | /// Internal dispose function 130 | /// 131 | protected virtual void Dispose(bool disposing) 132 | { 133 | if (!disposed) 134 | { 135 | disposed= true; 136 | 137 | if (disposing) 138 | { 139 | // Free managed resources; 140 | } 141 | 142 | // Free native resources 143 | } 144 | } 145 | 146 | 147 | #endregion Finalize 148 | 149 | #region Methods 150 | 151 | /// 152 | /// Provides a single output, 0-input Objectinterface to the RobusT2Scalesg MATLAB 153 | /// function. 154 | /// 155 | /// 156 | /// M-Documentation: 157 | /// ------------------------------------------------------------------------ 158 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 159 | /// The scripts implements the sugeno fuzzy controller and 160 | /// produce the output which is the scaling action for horizontal elasticity. 161 | /// x1: workload (should be normalized in [0 100]) 162 | /// x2: response time (should be normalized in [0 100]) 163 | /// scalingaction: [-2 +2], this determines the change in the number of resources 164 | /// ------------------------------------------------------------------------ 165 | /// 166 | /// An Object containing the first output argument. 167 | /// 168 | public Object RobusT2Scalesg() 169 | { 170 | return mcr.EvaluateFunction("RobusT2Scalesg", new Object[]{}); 171 | } 172 | 173 | 174 | /// 175 | /// Provides a single output, 1-input Objectinterface to the RobusT2Scalesg MATLAB 176 | /// function. 177 | /// 178 | /// 179 | /// M-Documentation: 180 | /// ------------------------------------------------------------------------ 181 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 182 | /// The scripts implements the sugeno fuzzy controller and 183 | /// produce the output which is the scaling action for horizontal elasticity. 184 | /// x1: workload (should be normalized in [0 100]) 185 | /// x2: response time (should be normalized in [0 100]) 186 | /// scalingaction: [-2 +2], this determines the change in the number of resources 187 | /// ------------------------------------------------------------------------ 188 | /// 189 | /// Input argument #1 190 | /// An Object containing the first output argument. 191 | /// 192 | public Object RobusT2Scalesg(Object x1) 193 | { 194 | return mcr.EvaluateFunction("RobusT2Scalesg", x1); 195 | } 196 | 197 | 198 | /// 199 | /// Provides a single output, 2-input Objectinterface to the RobusT2Scalesg MATLAB 200 | /// function. 201 | /// 202 | /// 203 | /// M-Documentation: 204 | /// ------------------------------------------------------------------------ 205 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 206 | /// The scripts implements the sugeno fuzzy controller and 207 | /// produce the output which is the scaling action for horizontal elasticity. 208 | /// x1: workload (should be normalized in [0 100]) 209 | /// x2: response time (should be normalized in [0 100]) 210 | /// scalingaction: [-2 +2], this determines the change in the number of resources 211 | /// ------------------------------------------------------------------------ 212 | /// 213 | /// Input argument #1 214 | /// Input argument #2 215 | /// An Object containing the first output argument. 216 | /// 217 | public Object RobusT2Scalesg(Object x1, Object x2) 218 | { 219 | return mcr.EvaluateFunction("RobusT2Scalesg", x1, x2); 220 | } 221 | 222 | 223 | /// 224 | /// Provides the standard 0-input Object interface to the RobusT2Scalesg MATLAB 225 | /// function. 226 | /// 227 | /// 228 | /// M-Documentation: 229 | /// ------------------------------------------------------------------------ 230 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 231 | /// The scripts implements the sugeno fuzzy controller and 232 | /// produce the output which is the scaling action for horizontal elasticity. 233 | /// x1: workload (should be normalized in [0 100]) 234 | /// x2: response time (should be normalized in [0 100]) 235 | /// scalingaction: [-2 +2], this determines the change in the number of resources 236 | /// ------------------------------------------------------------------------ 237 | /// 238 | /// The number of output arguments to return. 239 | /// An Array of length "numArgsOut" containing the output 240 | /// arguments. 241 | /// 242 | public Object[] RobusT2Scalesg(int numArgsOut) 243 | { 244 | return mcr.EvaluateFunction(numArgsOut, "RobusT2Scalesg", new Object[]{}); 245 | } 246 | 247 | 248 | /// 249 | /// Provides the standard 1-input Object interface to the RobusT2Scalesg MATLAB 250 | /// function. 251 | /// 252 | /// 253 | /// M-Documentation: 254 | /// ------------------------------------------------------------------------ 255 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 256 | /// The scripts implements the sugeno fuzzy controller and 257 | /// produce the output which is the scaling action for horizontal elasticity. 258 | /// x1: workload (should be normalized in [0 100]) 259 | /// x2: response time (should be normalized in [0 100]) 260 | /// scalingaction: [-2 +2], this determines the change in the number of resources 261 | /// ------------------------------------------------------------------------ 262 | /// 263 | /// The number of output arguments to return. 264 | /// Input argument #1 265 | /// An Array of length "numArgsOut" containing the output 266 | /// arguments. 267 | /// 268 | public Object[] RobusT2Scalesg(int numArgsOut, Object x1) 269 | { 270 | return mcr.EvaluateFunction(numArgsOut, "RobusT2Scalesg", x1); 271 | } 272 | 273 | 274 | /// 275 | /// Provides the standard 2-input Object interface to the RobusT2Scalesg MATLAB 276 | /// function. 277 | /// 278 | /// 279 | /// M-Documentation: 280 | /// ------------------------------------------------------------------------ 281 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 282 | /// The scripts implements the sugeno fuzzy controller and 283 | /// produce the output which is the scaling action for horizontal elasticity. 284 | /// x1: workload (should be normalized in [0 100]) 285 | /// x2: response time (should be normalized in [0 100]) 286 | /// scalingaction: [-2 +2], this determines the change in the number of resources 287 | /// ------------------------------------------------------------------------ 288 | /// 289 | /// The number of output arguments to return. 290 | /// Input argument #1 291 | /// Input argument #2 292 | /// An Array of length "numArgsOut" containing the output 293 | /// arguments. 294 | /// 295 | public Object[] RobusT2Scalesg(int numArgsOut, Object x1, Object x2) 296 | { 297 | return mcr.EvaluateFunction(numArgsOut, "RobusT2Scalesg", x1, x2); 298 | } 299 | 300 | 301 | /// 302 | /// Provides an interface for the RobusT2Scalesg function in which the input and 303 | /// output 304 | /// arguments are specified as an array of Objects. 305 | /// 306 | /// 307 | /// This method will allocate and return by reference the output argument 308 | /// array. 309 | /// M-Documentation: 310 | /// ------------------------------------------------------------------------ 311 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 312 | /// The scripts implements the sugeno fuzzy controller and 313 | /// produce the output which is the scaling action for horizontal elasticity. 314 | /// x1: workload (should be normalized in [0 100]) 315 | /// x2: response time (should be normalized in [0 100]) 316 | /// scalingaction: [-2 +2], this determines the change in the number of resources 317 | /// ------------------------------------------------------------------------ 318 | /// 319 | /// The number of output arguments to return 320 | /// Array of Object output arguments 321 | /// Array of Object input arguments 322 | /// Array of Object representing variable input 323 | /// arguments 324 | /// 325 | [MATLABSignature("RobusT2Scalesg", 2, 1, 0)] 326 | protected void RobusT2Scalesg(int numArgsOut, ref Object[] argsOut, Object[] argsIn, params Object[] varArgsIn) 327 | { 328 | mcr.EvaluateFunctionForTypeSafeCall("RobusT2Scalesg", numArgsOut, ref argsOut, argsIn, varArgsIn); 329 | } 330 | 331 | /// 332 | /// This method will cause a MATLAB figure window to behave as a modal dialog box. 333 | /// The method will not return until all the figure windows associated with this 334 | /// component have been closed. 335 | /// 336 | /// 337 | /// An application should only call this method when required to keep the 338 | /// MATLAB figure window from disappearing. Other techniques, such as calling 339 | /// Console.ReadLine() from the application should be considered where 340 | /// possible. 341 | /// 342 | public void WaitForFiguresToDie() 343 | { 344 | mcr.WaitForFiguresToDie(); 345 | } 346 | 347 | 348 | 349 | #endregion Methods 350 | 351 | #region Class Members 352 | 353 | private static MWMCR mcr= null; 354 | 355 | private static Exception ex_= null; 356 | 357 | private bool disposed= false; 358 | 359 | #endregion Class Members 360 | } 361 | } 362 | -------------------------------------------------------------------------------- /Controllers/RobusT2Scale/Compiled/RobusT2Scale/src/RobusT2ScaleNative.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * MATLAB Compiler: 4.18.1 (R2013a) 3 | * Date: Tue Dec 23 22:31:25 2014 4 | * Arguments: "-B" "macro_default" "-W" "dotnet:RobusT2Scale,RobusT2Scale,0.0,private" 5 | * "-T" "link:lib" "-d" 6 | * "C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\RobusT2Scale\ 7 | * src" "-w" "enable:specified_file_mismatch" "-w" "enable:repeated_file" "-w" 8 | * "enable:switch_ignored" "-w" "enable:missing_lib_sentinel" "-w" "enable:demo_license" 9 | * "-v" 10 | * "class{RobusT2Scale:C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2 11 | * Scale\RobusT2Scalesg.m}" "-a" 12 | * "C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\robust2scales 13 | * g.fis" "-a" 14 | * "C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\scaledata.m" 15 | */ 16 | using System; 17 | using System.Reflection; 18 | using System.IO; 19 | using MathWorks.MATLAB.NET.Arrays; 20 | using MathWorks.MATLAB.NET.Utility; 21 | 22 | #if SHARED 23 | [assembly: System.Reflection.AssemblyKeyFile(@"")] 24 | #endif 25 | 26 | namespace RobusT2ScaleNative 27 | { 28 | 29 | /// 30 | /// The RobusT2Scale class provides a CLS compliant, Object (native) interface to the 31 | /// MATLAB functions contained in the files: 32 | /// 33 | /// C:\Users\pooyanjam\Source\Repos\pooyan-amir\RL-Q\Controllers\RobusT2Scale\RobusT2Sca 34 | /// lesg.m 35 | /// 36 | /// deployprint.m 37 | /// 38 | /// printdlg.m 39 | /// 40 | /// 41 | /// @Version 0.0 42 | /// 43 | public class RobusT2Scale : IDisposable 44 | { 45 | #region Constructors 46 | 47 | /// 48 | /// The static constructor instantiates and initializes the MATLAB Compiler Runtime 49 | /// instance. 50 | /// 51 | static RobusT2Scale() 52 | { 53 | if (MWMCR.MCRAppInitialized) 54 | { 55 | try 56 | { 57 | Assembly assembly= Assembly.GetExecutingAssembly(); 58 | 59 | string ctfFilePath= assembly.Location; 60 | 61 | int lastDelimiter= ctfFilePath.LastIndexOf(@"\"); 62 | 63 | ctfFilePath= ctfFilePath.Remove(lastDelimiter, (ctfFilePath.Length - lastDelimiter)); 64 | 65 | string ctfFileName = "RobusT2Scale.ctf"; 66 | 67 | Stream embeddedCtfStream = null; 68 | 69 | String[] resourceStrings = assembly.GetManifestResourceNames(); 70 | 71 | foreach (String name in resourceStrings) 72 | { 73 | if (name.Contains(ctfFileName)) 74 | { 75 | embeddedCtfStream = assembly.GetManifestResourceStream(name); 76 | break; 77 | } 78 | } 79 | mcr= new MWMCR("", 80 | ctfFilePath, embeddedCtfStream, true); 81 | } 82 | catch(Exception ex) 83 | { 84 | ex_ = new Exception("MWArray assembly failed to be initialized", ex); 85 | } 86 | } 87 | else 88 | { 89 | ex_ = new ApplicationException("MWArray assembly could not be initialized"); 90 | } 91 | } 92 | 93 | 94 | /// 95 | /// Constructs a new instance of the RobusT2Scale class. 96 | /// 97 | public RobusT2Scale() 98 | { 99 | if(ex_ != null) 100 | { 101 | throw ex_; 102 | } 103 | } 104 | 105 | 106 | #endregion Constructors 107 | 108 | #region Finalize 109 | 110 | /// 111 | /// Class destructor called by the CLR garbage collector. 112 | /// 113 | ~RobusT2Scale() 114 | { 115 | Dispose(false); 116 | } 117 | 118 | 119 | /// 120 | /// Frees the native resources associated with this object 121 | /// 122 | public void Dispose() 123 | { 124 | Dispose(true); 125 | 126 | GC.SuppressFinalize(this); 127 | } 128 | 129 | 130 | /// 131 | /// Internal dispose function 132 | /// 133 | protected virtual void Dispose(bool disposing) 134 | { 135 | if (!disposed) 136 | { 137 | disposed= true; 138 | 139 | if (disposing) 140 | { 141 | // Free managed resources; 142 | } 143 | 144 | // Free native resources 145 | } 146 | } 147 | 148 | 149 | #endregion Finalize 150 | 151 | #region Methods 152 | 153 | /// 154 | /// Provides a single output, 0-input Objectinterface to the RobusT2Scalesg MATLAB 155 | /// function. 156 | /// 157 | /// 158 | /// M-Documentation: 159 | /// ------------------------------------------------------------------------ 160 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 161 | /// The scripts implements the sugeno fuzzy controller and 162 | /// produce the output which is the scaling action for horizontal elasticity. 163 | /// x1: workload (should be normalized in [0 100]) 164 | /// x2: response time (should be normalized in [0 100]) 165 | /// scalingaction: [-2 +2], this determines the change in the number of resources 166 | /// ------------------------------------------------------------------------ 167 | /// 168 | /// An Object containing the first output argument. 169 | /// 170 | public Object RobusT2Scalesg() 171 | { 172 | return mcr.EvaluateFunction("RobusT2Scalesg", new Object[]{}); 173 | } 174 | 175 | 176 | /// 177 | /// Provides a single output, 1-input Objectinterface to the RobusT2Scalesg MATLAB 178 | /// function. 179 | /// 180 | /// 181 | /// M-Documentation: 182 | /// ------------------------------------------------------------------------ 183 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 184 | /// The scripts implements the sugeno fuzzy controller and 185 | /// produce the output which is the scaling action for horizontal elasticity. 186 | /// x1: workload (should be normalized in [0 100]) 187 | /// x2: response time (should be normalized in [0 100]) 188 | /// scalingaction: [-2 +2], this determines the change in the number of resources 189 | /// ------------------------------------------------------------------------ 190 | /// 191 | /// Input argument #1 192 | /// An Object containing the first output argument. 193 | /// 194 | public Object RobusT2Scalesg(Object x1) 195 | { 196 | return mcr.EvaluateFunction("RobusT2Scalesg", x1); 197 | } 198 | 199 | 200 | /// 201 | /// Provides a single output, 2-input Objectinterface to the RobusT2Scalesg MATLAB 202 | /// function. 203 | /// 204 | /// 205 | /// M-Documentation: 206 | /// ------------------------------------------------------------------------ 207 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 208 | /// The scripts implements the sugeno fuzzy controller and 209 | /// produce the output which is the scaling action for horizontal elasticity. 210 | /// x1: workload (should be normalized in [0 100]) 211 | /// x2: response time (should be normalized in [0 100]) 212 | /// scalingaction: [-2 +2], this determines the change in the number of resources 213 | /// ------------------------------------------------------------------------ 214 | /// 215 | /// Input argument #1 216 | /// Input argument #2 217 | /// An Object containing the first output argument. 218 | /// 219 | public Object RobusT2Scalesg(Object x1, Object x2) 220 | { 221 | return mcr.EvaluateFunction("RobusT2Scalesg", x1, x2); 222 | } 223 | 224 | 225 | /// 226 | /// Provides the standard 0-input Object interface to the RobusT2Scalesg MATLAB 227 | /// function. 228 | /// 229 | /// 230 | /// M-Documentation: 231 | /// ------------------------------------------------------------------------ 232 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 233 | /// The scripts implements the sugeno fuzzy controller and 234 | /// produce the output which is the scaling action for horizontal elasticity. 235 | /// x1: workload (should be normalized in [0 100]) 236 | /// x2: response time (should be normalized in [0 100]) 237 | /// scalingaction: [-2 +2], this determines the change in the number of resources 238 | /// ------------------------------------------------------------------------ 239 | /// 240 | /// The number of output arguments to return. 241 | /// An Array of length "numArgsOut" containing the output 242 | /// arguments. 243 | /// 244 | public Object[] RobusT2Scalesg(int numArgsOut) 245 | { 246 | return mcr.EvaluateFunction(numArgsOut, "RobusT2Scalesg", new Object[]{}); 247 | } 248 | 249 | 250 | /// 251 | /// Provides the standard 1-input Object interface to the RobusT2Scalesg MATLAB 252 | /// function. 253 | /// 254 | /// 255 | /// M-Documentation: 256 | /// ------------------------------------------------------------------------ 257 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 258 | /// The scripts implements the sugeno fuzzy controller and 259 | /// produce the output which is the scaling action for horizontal elasticity. 260 | /// x1: workload (should be normalized in [0 100]) 261 | /// x2: response time (should be normalized in [0 100]) 262 | /// scalingaction: [-2 +2], this determines the change in the number of resources 263 | /// ------------------------------------------------------------------------ 264 | /// 265 | /// The number of output arguments to return. 266 | /// Input argument #1 267 | /// An Array of length "numArgsOut" containing the output 268 | /// arguments. 269 | /// 270 | public Object[] RobusT2Scalesg(int numArgsOut, Object x1) 271 | { 272 | return mcr.EvaluateFunction(numArgsOut, "RobusT2Scalesg", x1); 273 | } 274 | 275 | 276 | /// 277 | /// Provides the standard 2-input Object interface to the RobusT2Scalesg MATLAB 278 | /// function. 279 | /// 280 | /// 281 | /// M-Documentation: 282 | /// ------------------------------------------------------------------------ 283 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 284 | /// The scripts implements the sugeno fuzzy controller and 285 | /// produce the output which is the scaling action for horizontal elasticity. 286 | /// x1: workload (should be normalized in [0 100]) 287 | /// x2: response time (should be normalized in [0 100]) 288 | /// scalingaction: [-2 +2], this determines the change in the number of resources 289 | /// ------------------------------------------------------------------------ 290 | /// 291 | /// The number of output arguments to return. 292 | /// Input argument #1 293 | /// Input argument #2 294 | /// An Array of length "numArgsOut" containing the output 295 | /// arguments. 296 | /// 297 | public Object[] RobusT2Scalesg(int numArgsOut, Object x1, Object x2) 298 | { 299 | return mcr.EvaluateFunction(numArgsOut, "RobusT2Scalesg", x1, x2); 300 | } 301 | 302 | 303 | /// 304 | /// Provides an interface for the RobusT2Scalesg function in which the input and 305 | /// output 306 | /// arguments are specified as an array of Objects. 307 | /// 308 | /// 309 | /// This method will allocate and return by reference the output argument 310 | /// array. 311 | /// M-Documentation: 312 | /// ------------------------------------------------------------------------ 313 | /// Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com) 314 | /// The scripts implements the sugeno fuzzy controller and 315 | /// produce the output which is the scaling action for horizontal elasticity. 316 | /// x1: workload (should be normalized in [0 100]) 317 | /// x2: response time (should be normalized in [0 100]) 318 | /// scalingaction: [-2 +2], this determines the change in the number of resources 319 | /// ------------------------------------------------------------------------ 320 | /// 321 | /// The number of output arguments to return 322 | /// Array of Object output arguments 323 | /// Array of Object input arguments 324 | /// Array of Object representing variable input 325 | /// arguments 326 | /// 327 | [MATLABSignature("RobusT2Scalesg", 2, 1, 0)] 328 | protected void RobusT2Scalesg(int numArgsOut, ref Object[] argsOut, Object[] argsIn, params Object[] varArgsIn) 329 | { 330 | mcr.EvaluateFunctionForTypeSafeCall("RobusT2Scalesg", numArgsOut, ref argsOut, argsIn, varArgsIn); 331 | } 332 | 333 | /// 334 | /// This method will cause a MATLAB figure window to behave as a modal dialog box. 335 | /// The method will not return until all the figure windows associated with this 336 | /// component have been closed. 337 | /// 338 | /// 339 | /// An application should only call this method when required to keep the 340 | /// MATLAB figure window from disappearing. Other techniques, such as calling 341 | /// Console.ReadLine() from the application should be considered where 342 | /// possible. 343 | /// 344 | public void WaitForFiguresToDie() 345 | { 346 | mcr.WaitForFiguresToDie(); 347 | } 348 | 349 | 350 | 351 | #endregion Methods 352 | 353 | #region Class Members 354 | 355 | private static MWMCR mcr= null; 356 | 357 | private static Exception ex_= null; 358 | 359 | private bool disposed= false; 360 | 361 | #endregion Class Members 362 | } 363 | } 364 | -------------------------------------------------------------------------------- /Data/wikipedia_non-adaptive_overProvisioning_6G.csv: -------------------------------------------------------------------------------- 1 | iteration,workload,measured-rt(average) 2 | 1,209,5 3 | 2,109,30 4 | 3,94,16 5 | 4,86,12 6 | 5,104,11 7 | 6,108,10 8 | 7,112,11 9 | 8,113,11 10 | 9,112,11 11 | 10,107,10 12 | 11,137,13 13 | 12,126,11 14 | 13,109,10 15 | 14,108,10 16 | 15,107,11 17 | 16,98,10 18 | 17,102,10 19 | 18,93,11 20 | 19,100,10 21 | 20,108,11 22 | 21,117,11 23 | 22,106,10 24 | 23,104,11 25 | 24,82,10 26 | 25,85,10 27 | 26,78,11 28 | 27,95,10 29 | 28,86,11 30 | 29,92,10 31 | 30,94,11 32 | 31,78,10 33 | 32,102,11 34 | 33,92,10 35 | 34,85,11 36 | 35,87,10 37 | 36,74,10 38 | 37,77,10 39 | 38,107,11 40 | 39,102,11 41 | 40,103,10 42 | 41,94,10 43 | 42,77,10 44 | 43,68,10 45 | 44,82,11 46 | 45,73,10 47 | 46,78,10 48 | 47,94,12 49 | 48,92,10 50 | 49,68,10 51 | 50,79,11 52 | 51,50,10 53 | 52,65,12 54 | 53,64,11 55 | 54,65,10 56 | 55,62,11 57 | 56,71,11 58 | 57,62,10 59 | 58,83,11 60 | 59,69,11 61 | 60,83,13 62 | 61,88,11 63 | 62,78,10 64 | 63,66,11 65 | 64,79,11 66 | 65,46,11 67 | 66,57,10 68 | 67,86,12 69 | 68,63,10 70 | 69,61,11 71 | 70,79,11 72 | 71,77,11 73 | 72,75,11 74 | 73,59,10 75 | 74,67,10 76 | 75,66,10 77 | 76,69,10 78 | 77,70,11 79 | 78,57,10 80 | 79,39,12 81 | 80,69,11 82 | 81,58,11 83 | 82,71,11 84 | 83,74,11 85 | 84,44,10 86 | 85,52,11 87 | 86,61,10 88 | 87,71,10 89 | 88,70,10 90 | 89,55,10 91 | 90,76,13 92 | 91,90,11 93 | 92,81,10 94 | 93,100,11 95 | 94,87,10 96 | 95,77,10 97 | 96,77,10 98 | 97,69,10 99 | 98,77,10 100 | 99,59,10 101 | 100,53,10 102 | 101,48,10 103 | 102,65,11 104 | 103,67,12 105 | 104,58,10 106 | 105,57,11 107 | 106,63,11 108 | 107,54,10 109 | 108,62,10 110 | 109,74,10 111 | 110,75,11 112 | 111,75,12 113 | 112,67,10 114 | 113,64,10 115 | 114,57,10 116 | 115,44,11 117 | 116,71,11 118 | 117,67,10 119 | 118,59,10 120 | 119,47,10 121 | 120,44,10 122 | 121,48,10 123 | 122,57,11 124 | 123,67,10 125 | 124,68,10 126 | 125,54,10 127 | 126,64,11 128 | 127,68,10 129 | 128,69,11 130 | 129,69,10 131 | 130,63,10 132 | 131,63,10 133 | 132,61,10 134 | 133,67,11 135 | 134,46,10 136 | 135,74,11 137 | 136,73,10 138 | 137,70,10 139 | 138,73,10 140 | 139,75,10 141 | 140,62,10 142 | 141,43,11 143 | 142,61,10 144 | 143,60,10 145 | 144,60,10 146 | 145,63,10 147 | 146,69,10 148 | 147,65,10 149 | 148,54,10 150 | 149,58,11 151 | 150,46,10 152 | 151,57,10 153 | 152,66,10 154 | 153,59,11 155 | 154,59,10 156 | 155,53,10 157 | 156,41,10 158 | 157,57,11 159 | 158,54,10 160 | 159,62,10 161 | 160,56,10 162 | 161,57,11 163 | 162,61,10 164 | 163,55,10 165 | 164,57,10 166 | 165,53,10 167 | 166,58,10 168 | 167,67,10 169 | 168,78,11 170 | 169,65,10 171 | 170,53,10 172 | 171,63,10 173 | 172,62,10 174 | 173,60,11 175 | 174,80,11 176 | 175,70,10 177 | 176,93,10 178 | 177,65,10 179 | 178,73,10 180 | 179,57,11 181 | 180,45,10 182 | 181,60,10 183 | 182,40,11 184 | 183,47,10 185 | 184,59,10 186 | 185,47,10 187 | 186,61,10 188 | 187,64,11 189 | 188,64,10 190 | 189,61,11 191 | 190,50,10 192 | 191,61,10 193 | 192,75,10 194 | 193,64,10 195 | 194,65,10 196 | 195,56,10 197 | 196,57,10 198 | 197,47,10 199 | 198,66,11 200 | 199,70,10 201 | 200,67,10 202 | 201,52,10 203 | 202,59,10 204 | 203,55,10 205 | 204,59,10 206 | 205,53,10 207 | 206,44,11 208 | 207,55,10 209 | 208,50,11 210 | 209,64,10 211 | 210,59,10 212 | 211,57,10 213 | 212,52,10 214 | 213,62,10 215 | 214,61,10 216 | 215,67,10 217 | 216,74,10 218 | 217,53,10 219 | 218,66,11 220 | 219,76,10 221 | 220,53,10 222 | 221,75,10 223 | 222,76,10 224 | 223,61,10 225 | 224,64,10 226 | 225,65,10 227 | 226,63,10 228 | 227,65,10 229 | 228,94,10 230 | 229,71,10 231 | 230,98,10 232 | 231,58,10 233 | 232,83,10 234 | 233,81,10 235 | 234,81,10 236 | 235,107,10 237 | 236,83,10 238 | 237,90,10 239 | 238,95,10 240 | 239,86,10 241 | 240,92,11 242 | 241,87,10 243 | 242,83,10 244 | 243,96,10 245 | 244,110,10 246 | 245,85,10 247 | 246,88,11 248 | 247,115,10 249 | 248,91,10 250 | 249,97,10 251 | 250,97,10 252 | 251,105,10 253 | 252,116,10 254 | 253,106,10 255 | 254,109,10 256 | 255,100,10 257 | 256,134,10 258 | 257,128,10 259 | 258,119,10 260 | 259,135,10 261 | 260,126,10 262 | 261,115,10 263 | 262,139,10 264 | 263,135,11 265 | 264,134,10 266 | 265,122,10 267 | 266,135,10 268 | 267,166,10 269 | 268,142,10 270 | 269,138,10 271 | 270,132,10 272 | 271,146,10 273 | 272,145,10 274 | 273,162,10 275 | 274,165,10 276 | 275,171,11 277 | 276,177,10 278 | 277,172,10 279 | 278,155,10 280 | 279,190,10 281 | 280,176,10 282 | 281,201,11 283 | 282,188,10 284 | 283,156,10 285 | 284,178,10 286 | 285,195,11 287 | 286,194,10 288 | 287,198,11 289 | 288,182,10 290 | 289,191,10 291 | 290,213,10 292 | 291,185,10 293 | 292,184,10 294 | 293,240,11 295 | 294,232,11 296 | 295,207,10 297 | 296,227,11 298 | 297,243,10 299 | 298,229,10 300 | 299,232,11 301 | 300,248,10 302 | 301,249,10 303 | 302,230,11 304 | 303,240,10 305 | 304,275,10 306 | 305,226,10 307 | 306,272,11 308 | 307,263,10 309 | 308,242,10 310 | 309,281,11 311 | 310,249,10 312 | 311,298,11 313 | 312,275,11 314 | 313,299,11 315 | 314,325,12 316 | 315,325,11 317 | 316,312,11 318 | 317,334,11 319 | 318,299,10 320 | 319,348,11 321 | 320,313,11 322 | 321,357,11 323 | 322,364,11 324 | 323,355,11 325 | 324,394,12 326 | 325,407,11 327 | 326,410,12 328 | 327,402,12 329 | 328,422,11 330 | 329,394,11 331 | 330,467,12 332 | 331,412,12 333 | 332,383,11 334 | 333,430,12 335 | 334,455,21 336 | 335,464,13 337 | 336,400,11 338 | 337,471,12 339 | 338,478,21 340 | 339,460,42 341 | 340,449,14 342 | 341,480,15 343 | 342,456,11 344 | 343,455,12 345 | 344,501,12 346 | 345,474,12 347 | 346,474,12 348 | 347,447,24 349 | 348,454,19 350 | 349,473,23 351 | 350,463,11 352 | 351,499,15 353 | 352,517,24 354 | 353,503,59 355 | 354,546,64 356 | 355,508,40 357 | 356,518,13 358 | 357,506,12 359 | 358,543,12 360 | 359,590,13 361 | 360,577,14 362 | 361,521,35 363 | 362,518,42 364 | 363,563,32 365 | 364,554,13 366 | 365,524,12 367 | 366,534,12 368 | 367,566,12 369 | 368,558,14 370 | 369,564,36 371 | 370,590,85 372 | 371,575,35 373 | 372,572,29 374 | 373,601,13 375 | 374,600,14 376 | 375,596,13 377 | 376,568,12 378 | 377,560,13 379 | 378,561,13 380 | 379,532,12 381 | 380,556,12 382 | 381,582,14 383 | 382,604,15 384 | 383,557,17 385 | 384,626,15 386 | 385,652,17 387 | 386,588,13 388 | 387,609,13 389 | 388,600,12 390 | 389,589,13 391 | 390,612,13 392 | 391,578,13 393 | 392,585,12 394 | 393,597,15 395 | 394,575,13 396 | 395,579,13 397 | 396,608,14 398 | 397,646,13 399 | 398,543,12 400 | 399,583,13 401 | 400,613,14 402 | 401,610,13 403 | 402,568,13 404 | 403,618,13 405 | 404,608,13 406 | 405,614,14 407 | 406,683,15 408 | 407,587,16 409 | 408,615,18 410 | 409,627,15 411 | 410,635,16 412 | 411,649,14 413 | 412,627,13 414 | 413,680,24 415 | 414,641,22 416 | 415,661,14 417 | 416,678,14 418 | 417,673,14 419 | 418,658,13 420 | 419,673,14 421 | 420,677,17 422 | 421,666,27 423 | 422,690,21 424 | 423,695,17 425 | 424,690,14 426 | 425,678,15 427 | 426,690,24 428 | 427,701,30 429 | 428,731,35 430 | 429,729,18 431 | 430,721,17 432 | 431,707,15 433 | 432,739,16 434 | 433,752,15 435 | 434,722,14 436 | 435,724,15 437 | 436,718,16 438 | 437,715,15 439 | 438,736,17 440 | 439,730,16 441 | 440,765,23 442 | 441,726,25 443 | 442,735,20 444 | 443,771,18 445 | 444,744,15 446 | 445,762,17 447 | 446,723,15 448 | 447,704,15 449 | 448,735,15 450 | 449,778,17 451 | 450,761,17 452 | 451,718,14 453 | 452,772,18 454 | 453,775,15 455 | 454,788,21 456 | 455,785,22 457 | 456,770,25 458 | 457,733,18 459 | 458,853,17 460 | 459,802,16 461 | 460,772,16 462 | 461,786,15 463 | 462,723,15 464 | 463,812,16 465 | 464,800,16 466 | 465,849,17 467 | 466,763,15 468 | 467,750,15 469 | 468,801,15 470 | 469,784,16 471 | 470,781,14 472 | 471,791,17 473 | 472,800,15 474 | 473,759,17 475 | 474,833,18 476 | 475,811,14 477 | 476,770,20 478 | 477,839,21 479 | 478,809,43 480 | 479,836,17 481 | 480,846,18 482 | 481,752,15 483 | 482,847,16 484 | 483,833,16 485 | 484,766,16 486 | 485,763,15 487 | 486,810,16 488 | 487,809,16 489 | 488,807,15 490 | 489,806,15 491 | 490,743,16 492 | 491,793,16 493 | 492,800,16 494 | 493,807,16 495 | 494,772,15 496 | 495,755,16 497 | 496,795,17 498 | 497,812,16 499 | 498,741,15 500 | 499,777,15 501 | 500,784,16 502 | 501,795,15 503 | 502,800,19 504 | 503,815,17 505 | 504,790,16 506 | 505,804,17 507 | 506,804,19 508 | 507,808,18 509 | 508,822,17 510 | 509,827,17 511 | 510,818,17 512 | 511,827,17 513 | 512,795,16 514 | 513,821,16 515 | 514,810,18 516 | 515,840,18 517 | 516,836,18 518 | 517,728,16 519 | 518,812,15 520 | 519,772,19 521 | 520,757,16 522 | 521,773,17 523 | 522,749,14 524 | 523,788,17 525 | 524,751,15 526 | 525,844,17 527 | 526,848,18 528 | 527,750,15 529 | 528,844,20 530 | 529,709,15 531 | 530,724,15 532 | 531,790,15 533 | 532,807,16 534 | 533,767,15 535 | 534,804,16 536 | 535,793,18 537 | 536,780,16 538 | 537,750,16 539 | 538,783,24 540 | 539,787,16 541 | 540,793,16 542 | 541,780,18 543 | 542,768,16 544 | 543,810,16 545 | 544,790,16 546 | 545,830,16 547 | 546,750,16 548 | 547,813,17 549 | 548,755,17 550 | 549,816,18 551 | 550,832,17 552 | 551,764,17 553 | 552,776,16 554 | 553,787,16 555 | 554,804,17 556 | 555,841,19 557 | 556,778,20 558 | 557,861,25 559 | 558,897,18 560 | 559,790,16 561 | 560,811,17 562 | 561,829,17 563 | 562,682,17 564 | 563,732,17 565 | 564,830,18 566 | 565,814,17 567 | 566,780,16 568 | 567,810,18 569 | 568,758,16 570 | 569,860,18 571 | 570,813,17 572 | 571,829,16 573 | 572,825,18 574 | 573,805,18 575 | 574,775,21 576 | 575,785,18 577 | 576,811,16 578 | 577,798,18 579 | 578,864,17 580 | 579,772,17 581 | 580,854,17 582 | 581,753,15 583 | 582,802,16 584 | 583,797,16 585 | 584,841,17 586 | 585,872,18 587 | 586,872,18 588 | 587,895,22 589 | 588,840,19 590 | 589,902,18 591 | 590,897,19 592 | 591,849,18 593 | 592,847,18 594 | 593,841,17 595 | 594,859,17 596 | 595,877,17 597 | 596,885,17 598 | 597,834,19 599 | 598,850,27 600 | 599,834,19 601 | 600,853,20 602 | 601,892,24 603 | 602,866,21 604 | 603,937,21 605 | 604,800,18 606 | 605,900,17 607 | 606,906,21 608 | 607,923,21 609 | 608,875,18 610 | 609,914,23 611 | 610,920,31 612 | 611,952,32 613 | 612,906,17 614 | 613,978,22 615 | 614,940,22 616 | 615,893,18 617 | 616,985,30 618 | 617,958,23 619 | 618,945,18 620 | 619,920,22 621 | 620,958,24 622 | 621,972,22 623 | 622,964,20 624 | 623,977,28 625 | 624,949,35 626 | 625,940,18 627 | 626,998,19 628 | 627,998,20 629 | 628,986,29 630 | 629,971,21 631 | 630,1024,23 632 | 631,1000,21 633 | 632,1050,24 634 | 633,1071,21 635 | 634,961,21 636 | 635,1068,23 637 | 636,1048,20 638 | 637,980,20 639 | 638,1008,22 640 | 639,1041,21 641 | 640,1101,21 642 | 641,1079,29 643 | 642,1088,21 644 | 643,1050,29 645 | 644,1001,30 646 | 645,1090,30 647 | 646,1033,20 648 | 647,1069,21 649 | 648,1038,21 650 | 649,1045,18 651 | 650,1056,22 652 | 651,1048,19 653 | 652,996,19 654 | 653,992,19 655 | 654,1063,21 656 | 655,1103,20 657 | 656,1087,19 658 | 657,1013,18 659 | 658,1048,19 660 | 659,1028,20 661 | 660,1100,26 662 | 661,1125,29 663 | 662,1030,18 664 | 663,1064,20 665 | 664,1063,20 666 | 665,1105,24 667 | 666,1053,19 668 | 667,1041,20 669 | 668,1140,22 670 | 669,1098,18 671 | 670,1091,21 672 | 671,1073,22 673 | 672,1002,21 674 | 673,1011,18 675 | 674,1079,20 676 | 675,1045,20 677 | 676,1049,20 678 | 677,1117,19 679 | 678,1079,21 680 | 679,1123,23 681 | 680,1119,30 682 | 681,1064,22 683 | 682,1097,31 684 | 683,1045,19 685 | 684,1070,21 686 | 685,1089,20 687 | 686,1111,21 688 | 687,1081,24 689 | 688,1049,18 690 | 689,1062,22 691 | 690,1094,21 692 | 691,1132,22 693 | 692,1031,18 694 | 693,1082,21 695 | 694,1072,19 696 | 695,1099,20 697 | 696,1073,21 698 | 697,1091,20 699 | 698,1119,24 700 | 699,1002,22 701 | 700,1058,26 702 | 701,1071,24 703 | 702,1049,24 704 | 703,1080,19 705 | 704,1102,23 706 | 705,1098,31 707 | 706,1038,21 708 | 707,1067,23 709 | 708,1103,23 710 | 709,1025,19 711 | 710,1074,21 712 | 711,1036,20 713 | 712,1133,30 714 | 713,1079,20 715 | 714,1097,23 716 | 715,1044,23 717 | 716,1104,25 718 | 717,1043,23 719 | 718,1025,26 720 | 719,1087,20 721 | 720,1113,20 722 | 721,1100,21 723 | 722,1035,18 724 | 723,1092,22 725 | 724,1063,20 726 | 725,1006,19 727 | 726,1033,18 728 | 727,1044,20 729 | 728,1087,19 730 | 729,1125,21 731 | 730,1061,19 732 | 731,1100,22 733 | 732,1044,23 734 | 733,1072,22 735 | 734,1032,20 736 | 735,1034,22 737 | 736,1120,20 738 | 737,1142,25 739 | 738,1058,21 740 | 739,1053,20 741 | 740,1070,19 742 | 741,1078,22 743 | 742,1038,20 744 | 743,1163,24 745 | 744,1128,25 746 | 745,1049,23 747 | 746,1056,21 748 | 747,1081,24 749 | 748,991,21 750 | 749,1045,19 751 | 750,1064,20 752 | 751,1036,20 753 | 752,1059,20 754 | 753,1074,23 755 | 754,974,22 756 | 755,995,22 757 | 756,1063,22 758 | 757,1022,18 759 | 758,1005,17 760 | 759,1053,21 761 | 760,1065,20 762 | 761,965,18 763 | 762,985,16 764 | 763,1022,20 765 | 764,975,16 766 | 765,961,20 767 | 766,996,17 768 | 767,1031,21 769 | 768,986,18 770 | 769,996,19 771 | 770,1010,19 772 | 771,1026,20 773 | 772,975,17 774 | 773,1103,18 775 | 774,1033,17 776 | 775,990,18 777 | 776,1051,19 778 | 777,1041,19 779 | 778,975,19 780 | 779,996,18 781 | 780,1000,18 782 | 781,975,18 783 | 782,947,15 784 | 783,1000,15 785 | 784,1018,16 786 | 785,947,16 787 | 786,950,19 788 | 787,958,18 789 | 788,960,17 790 | 789,1044,19 791 | 790,1037,22 792 | 791,1071,20 793 | 792,957,18 794 | 793,1010,17 795 | 794,1018,19 796 | 795,982,19 797 | 796,1023,20 798 | 797,1006,17 799 | 798,963,17 800 | 799,1019,19 801 | 800,957,17 802 | 801,941,17 803 | 802,917,17 804 | 803,947,18 805 | 804,945,17 806 | 805,976,17 807 | 806,938,19 808 | 807,947,18 809 | 808,901,16 810 | 809,883,18 811 | 810,946,18 812 | 811,928,19 813 | 812,915,18 814 | 813,894,17 815 | 814,927,16 816 | 815,914,17 817 | 816,950,18 818 | 817,1023,17 819 | 818,901,16 820 | 819,960,16 821 | 820,920,18 822 | 821,916,17 823 | 822,923,17 824 | 823,919,16 825 | 824,948,16 826 | 825,909,18 827 | 826,867,17 828 | 827,940,18 829 | 828,852,16 830 | 829,857,16 831 | 830,905,15 832 | 831,886,17 833 | 832,886,15 834 | 833,919,16 835 | 834,928,17 836 | 835,956,17 837 | 836,957,15 838 | 837,931,16 839 | 838,982,18 840 | 839,911,16 841 | 840,943,18 842 | 841,881,15 843 | 842,964,20 844 | 843,932,17 845 | 844,953,18 846 | 845,897,16 847 | 846,921,18 848 | 847,988,17 849 | 848,903,17 850 | 849,913,16 851 | 850,903,18 852 | 851,918,15 853 | 852,861,16 854 | 853,915,16 855 | 854,916,16 856 | 855,921,16 857 | 856,934,16 858 | 857,875,15 859 | 858,870,15 860 | 859,950,16 861 | 860,984,19 862 | 861,953,17 863 | 862,990,18 864 | 863,924,18 865 | 864,889,15 866 | 865,971,17 867 | 866,955,17 868 | 867,973,17 869 | 868,963,18 870 | 869,946,18 871 | 870,910,17 872 | 871,983,19 873 | 872,928,17 874 | 873,940,18 875 | 874,930,14 876 | 875,910,16 877 | 876,943,16 878 | 877,891,16 879 | 878,1004,17 880 | 879,985,21 881 | 880,994,18 882 | 881,1014,17 883 | 882,940,19 884 | 883,976,17 885 | 884,950,17 886 | 885,1010,18 887 | 886,1022,19 888 | 887,968,15 889 | 888,939,15 890 | 889,945,18 891 | 890,1029,19 892 | 891,1021,21 893 | 892,1037,17 894 | 893,985,18 895 | 894,992,17 896 | 895,921,16 897 | 896,943,16 898 | 897,925,16 899 | 898,921,16 900 | 899,929,17 901 | 900,916,15 902 | 901,912,13 903 | 902,949,16 904 | 903,948,17 905 | 904,982,17 906 | 905,973,16 907 | 906,967,16 908 | 907,890,15 909 | 908,1018,17 910 | 909,974,16 911 | 910,985,25 912 | 911,956,14 913 | 912,907,15 914 | 913,966,17 915 | 914,943,16 916 | 915,970,16 917 | 916,933,16 918 | 917,978,16 919 | 918,929,16 920 | 919,948,16 921 | 920,894,16 922 | 921,927,18 923 | 922,973,18 924 | 923,985,18 925 | 924,948,16 926 | 925,942,19 927 | 926,927,17 928 | 927,904,18 929 | 928,927,17 930 | 929,957,17 931 | 930,912,16 932 | 931,964,19 933 | 932,929,18 934 | 933,928,16 935 | 934,694,14 936 | 935,664,13 937 | 936,624,13 938 | 937,665,14 939 | 938,632,13 940 | 939,636,13 941 | 940,620,13 942 | 941,645,12 943 | 942,633,14 944 | 943,625,13 945 | 944,638,12 946 | 945,601,12 947 | 946,620,13 948 | 947,647,12 949 | 948,599,13 950 | 949,595,13 951 | 950,639,12 952 | 951,670,13 953 | 952,608,12 954 | 953,598,14 955 | 954,658,14 956 | 955,628,13 957 | 956,620,13 958 | 957,633,12 959 | 958,619,13 960 | 959,611,13 961 | 960,605,12 962 | 961,649,14 963 | 962,617,13 964 | 963,631,13 965 | 964,664,13 966 | 965,653,13 967 | 966,633,12 968 | 967,692,13 969 | 968,626,12 970 | 969,570,12 971 | 970,609,13 972 | 971,638,14 973 | 972,631,13 974 | 973,607,13 975 | 974,614,12 976 | 975,655,12 977 | 976,675,13 978 | 977,641,12 979 | 978,652,14 980 | 979,635,13 981 | 980,654,12 982 | 981,679,12 983 | 982,598,12 984 | 983,646,13 985 | 984,634,14 986 | 985,646,12 987 | 986,645,12 988 | 987,668,12 989 | 988,640,12 990 | 989,590,13 991 | 990,590,12 992 | 991,657,12 993 | 992,685,14 994 | 993,624,12 995 | 994,646,12 996 | 995,622,12 997 | 996,661,12 998 | 997,620,13 999 | 998,572,12 1000 | 999,606,12 1001 | 1000,605,12 1002 | ,,15.52 1003 | --------------------------------------------------------------------------------