-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathenumerateModels.m
71 lines (56 loc) · 1.75 KB
/
enumerateModels.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
function allModels = enumerateModels(preset)
% Creates a cell array (vector) containing the names of all models. "Model
% names" are actually structures describing the properties of the models.
% INPUT
% preset: 'key' models only. Infernce type, and whether observer uses block type
% are the only things varied. Leave empty for all models.
allModels = cell(32, 1);
binarySpecArray = dec2bin(1:32);
binarySpecArray(:, 1) = [];
binarySpecArray = sortrows(binarySpecArray);
for iModel = 1 : size(binarySpecArray, 1)
Spec = struct();
if strcmp(binarySpecArray(iModel, 1), '1')
Spec.Inference = 'bayes';
if strcmp(binarySpecArray(iModel, 2), '1')
Spec.Prior = 'true';
else
Spec.Prior = 'biased';
end
else
Spec.Inference = 'min';
if strcmp(binarySpecArray(iModel, 2), '1')
Spec.SetSizeThresh = 'variable';
else
Spec.SetSizeThresh = 'fixed';
end
end
if strcmp(binarySpecArray(iModel, 3), '1')
Spec.SetSizePrec = 'variable';
else
Spec.SetSizePrec = 'fixed';
end
if strcmp(binarySpecArray(iModel, 4), '1')
Spec.Lapses = 'yes';
else
Spec.Lapses = 'no';
end
if strcmp(binarySpecArray(iModel, 5), '1')
Spec.BlockTypes = 'ignore';
else
Spec.BlockTypes = 'use';
end
allModels{iModel, 1} = Spec;
end
% Check output
for iModel = 1 : (length(allModels)-1)
for iCompareModel = (iModel+1) : length(allModels)
if isequal(allModels{iModel}, allModels{iCompareModel})
error('Bug')
end
end
end
% Pick requested models
if nargin > 0 && strcmp(preset, 'key')
allModels = allModels([23, 24, 15, 16]);
end