-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.lua
31 lines (23 loc) · 925 Bytes
/
config.lua
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
--apply configurations
config.plotHeight = 350
--temporal initialization of needed variables in main.lua
--in future main.lua should include this and the main code will be inside an update function
--for button "Print PRGA P(K_x = P) at experiment j"
x = 1
j = 3
--for button 'Print PRGA P(K_x = P) at firsts ' .. ZxAmount .. ' bytes in experiment' .. j
ZxAmount = 20
-- returns P(Z_x = E),P(Z_x = E| S_N[1]=0),P(Z_x = E| S_N[1]!=0) for experiment j
function PZxIsEven(j,x)
local p = 0
local pS1eq0 = 0
local pS1neq0 = 0
for i=1,256 do
if i%2 ~= 0 then
p = p + data[j].PRGAoutputsProbabilities[x]:getOccurrenceProbability(i-1)
pS1eq0 = pS1eq0 + data[j].PRGAoutputsProbabilitiesS1eq0[x]:getOccurrenceProbability(i-1)
pS1neq0 = pS1neq0 + data[j].PRGAoutputsProbabilitiesS1neq0[x]:getOccurrenceProbability(i-1)
end
end
return p,pS1eq0, pS1neq0
end