Fix some issues with the logic of the script

Signed-off-by: 's avatarHenrique Varella Ehrenfried <hve13@inf.ufpr.br>
parent 8a0441d6
......@@ -11,14 +11,14 @@ File.readlines(file_analyze).each do |line|
all_lines << line
end
# Index 0 = 100%
# Index 1~100 = 10%
# Index 101~200 = 20%
# Index 201~300 = 50%
# Index 301 = Diferent operator
# Index 302 = Each choice
# Index 303 = First to Last
# Index 304 = Random mix
# Index 0~9 = 100%
# Index 10~109 = 10%
# Index 110~209 = 20%
# Index 210~309 = 50%
# Index 310 = Diferent operator
# Index 311 = Each choice
# Index 312 = First to Last
# Index 313 = Random mix
matrix = CSV.read(source_matrix,{:col_sep => ";"}).to_a
matrix_no_header = matrix
......@@ -71,14 +71,14 @@ end
# Generate the average for each strategy
result = Array.new
result[0] = score_of_not_killed[0]
result[1] = number_of_not_killed[1..100].reduce(&:+).fdiv(100).fdiv(matrix_size)
result[2] = number_of_not_killed[101..200].reduce(&:+).fdiv(100).fdiv(matrix_size)
result[3] = number_of_not_killed[201..300].reduce(&:+).fdiv(100).fdiv(matrix_size)
result[4] = score_of_not_killed[301]
result[5] = score_of_not_killed[302]
result[6] = score_of_not_killed[303]
result[7] = score_of_not_killed[304]
result[0] = number_of_not_killed[0..9].reduce(&:+).fdiv(10).fdiv(matrix_size)
result[1] = number_of_not_killed[10..109].reduce(&:+).fdiv(100).fdiv(matrix_size)
result[2] = number_of_not_killed[110..209].reduce(&:+).fdiv(100).fdiv(matrix_size)
result[3] = number_of_not_killed[210..309].reduce(&:+).fdiv(100).fdiv(matrix_size)
result[4] = score_of_not_killed[310]
result[5] = score_of_not_killed[311]
result[6] = score_of_not_killed[312]
result[7] = score_of_not_killed[313]
......
BISECT
The avarege
Random 100%: 0.3712574850299401
Random 10%: 0.322814371257485
Random 20%: 0.33952095808383237
Random 50%: 0.34508982035928143
Diferent operator: 0.25149700598802394
Each choice: 0.25149700598802394
First to Last: 0.3712574850299401
Random mix: 0.3592814371257485
Random 100%: 0.3664670658682635
Random 10%: 0.3205988023952096
Random 20%: 0.34161676646706585
Random 50%: 0.3395808383233533
Diferent operator: 0.0658682634730539
Each choice: 0.0658682634730539
First to Last: 0.0658682634730539
Random mix: 0.0658682634730539
---
BUB
The avarege
Random 100%: 0.9016393442622951
Random 10%: 0.7334426229508197
Random 20%: 0.7485245901639344
Random 50%: 0.9116393442622951
Random 100%: 0.9049180327868853
Random 10%: 0.6560655737704919
Random 20%: 0.8262295081967213
Random 50%: 0.9119672131147541
Diferent operator: 0.9098360655737705
Each choice: 0.9262295081967213
First to Last: 0.9098360655737705
Random mix: 0.9098360655737705
Each choice: 0.9098360655737705
First to Last: 0.9016393442622951
Random mix: 0.9016393442622951
---
FIND
The avarege
Random 100%: 0.3962962962962963
Random 10%: 0.3582592592592593
Random 20%: 0.35374074074074074
Random 50%: 0.3792592592592593
Diferent operator: 0.3814814814814815
Each choice: 0.37037037037037035
First to Last: 0.4074074074074074
Random mix: 0.37037037037037035
Random 100%: 0.3792592592592593
Random 10%: 0.3526666666666667
Random 20%: 0.3592222222222222
Random 50%: 0.37974074074074077
Diferent operator: 0.35555555555555557
Each choice: 0.3851851851851852
First to Last: 0.35555555555555557
Random mix: 0.34814814814814815
---
FOURBALLS
The avarege
Random 100%: 0.9259259259259259
Random 10%: 0.9223456790123457
Random 20%: 0.9212757201646091
Random 50%: 0.9224691358024691
Diferent operator: 0.9176954732510288
Each choice: 0.9259259259259259
Random 100%: 0.9209876543209877
Random 10%: 0.9224279835390947
Random 20%: 0.9209876543209877
Random 50%: 0.9226748971193416
Diferent operator: 0.9135802469135802
Each choice: 0.9218106995884774
First to Last: 0.9176954732510288
Random mix: 0.9218106995884774
Random mix: 0.9259259259259259
---
MID
The avarege
Random 100%: 0.9739130434782609
Random 10%: 0.9651304347826086
Random 20%: 0.9705217391304348
Random 50%: 0.9732608695652174
Diferent operator: 0.9826086956521739
Each choice: 0.9739130434782609
First to Last: 0.9826086956521739
Random mix: 0.9608695652173913
Random 100%: 0.9752173913043479
Random 10%: 0.9647826086956522
Random 20%: 0.9703043478260869
Random 50%: 0.9737826086956521
Diferent operator: 0.9739130434782609
Each choice: 0.9695652173913043
First to Last: 0.9739130434782609
Random mix: 0.9739130434782609
---
TRIANGULO
The avarege
Random 100%: 0.9978354978354979
Random 10%: 0.9928354978354978
Random 20%: 0.9956493506493507
Random 10%: 0.9923809523809525
Random 20%: 0.996103896103896
Random 50%: 0.9978354978354979
Diferent operator: 0.9978354978354979
Each choice: 0.9978354978354979
First to Last: 0.9978354978354979
Random mix: 0.9978354978354979
Diferent operator: 0.9458874458874459
Each choice: 0.9458874458874459
First to Last: 0.9458874458874459
Random mix: 0.9458874458874459
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment