1function solver = chooseAvgSolverAI(self)
2% This function takes as input a QN model defined in LINE and returns
3% a Solver
object with the predicted method loaded
4this_model = self.model;
5sn = this_model.getStruct;
6dataVector = zeros(1, 15);
8% Station and scheduling information
9dataVector(1) = sum(sn.sched == SchedStrategy.FCFS); % Num FCFS queues
10dataVector(2) = sum(sn.sched == SchedStrategy.PS); % Num PS queues
11dataVector(3) = sum(sn.sched == SchedStrategy.INF); % Num delays
12dataVector(4) = sn.nnodes - sn.nstations; % Num CS
nodes
13dataVector(5) = sum(sn.nservers(~isinf(sn.nservers))); % Num queue servers
16dataVector(6) = sn.nchains; % Num chains
17dataVector(7) = sn.nclosedjobs; % Number of jobs in the system
19% Service process information
24for i = 1 : this_model.getNumberOfStations
25 for j = 1 : this_model.getNumberOfClasses
26 switch this_model.stations{i}.serviceProcess{j}.name
30 numhyperexp = numhyperexp + 1;
32 numerlang = numerlang + 1;
37dataVector(8:10) = [numexp numhyperexp numerlang]; % Num of each distribution type
38dataVector(11) = mean(sn.rates,
'all',
'omitnan'); % Avg service rate
39dataVector(12) = mean(sn.scv,
'all',
'omitnan'); % Avg SCV
40dataVector(13) = mean(sn.phases,
'all',
'omitnan'); % Avg phases
43dataVector(14) = sum(sn.nodetype == NodeType.Queue) == 1; % If only 1 Queue, special
for nc.mmint
44dataVector(15) = this_model.hasProductFormSolution; % Check
if model has product form solution
47dataVector = [dataVector dataVector(:, 1:3) ./ sum(dataVector(:, 1:3), 2)]; % Percent FCFS, PS, Delay
48dataVector = [dataVector logical(dataVector(:, 4))]; % Has CS or not
49dataVector = [dataVector dataVector(:, 5) ./ sum(dataVector(:, 1:2), 2)]; % Avg svrs per Queue
50dataVector = [dataVector dataVector(:, 7) ./ dataVector(:, 6)]; % Num jobs per chain
51dataVector = [dataVector dataVector(:, 8:10) ./ sum(dataVector(:, 8:10), 2)]; % Percent distributions
53load(
'classifier.mat',
'classifier',
'methodNames',
'selected');
54if isa(classifier,
'cell')
55 chosenMethod = predictEnsemble(classifier, dataVector(selected(1:length(dataVector))));
57 chosenMethod = predict(classifier, dataVector(selected(1:length(dataVector))));
60solver = LINE.load(methodNames(chosenMethod), this_model);