From 32c947e6a7e088b968165b5210d44dc37394a722 Mon Sep 17 00:00:00 2001 From: iotcat Date: Wed, 30 Oct 2019 22:42:01 +0000 Subject: [PATCH] report --- func/getDisProb.asv | 21 --------------------- func/getDivByPos.asv | 10 ---------- func/isGoalKept.asv | 13 ------------- func/uniform_5case.asv | 4 ---- t2.m | 3 ++- tree.js | 26 ++++++++++++++++++++++++++ 6 files changed, 28 insertions(+), 49 deletions(-) delete mode 100644 func/getDisProb.asv delete mode 100644 func/getDivByPos.asv delete mode 100644 func/isGoalKept.asv delete mode 100644 func/uniform_5case.asv create mode 100644 tree.js diff --git a/func/getDisProb.asv b/func/getDisProb.asv deleted file mode 100644 index 988d8ae..0000000 --- a/func/getDisProb.asv +++ /dev/null @@ -1,21 +0,0 @@ -% compute distributation -function [score, totalTimes, prs, d_rx, d_bo] = getDisProb(R, N, Radius, Length, Width, isPlot, disMethod, goalkeepMethod) -score = 0; -totalTimes = 0; -for m = 1 : R - for n = 1 : N - [x, y] = disMethod(Radius); - totalTimes = totalTimes + 1; - if isInRect(Length/2, Width/2, x, y) && (nargin<8 || isGoalKept()) - score = score + 1; - if isPlot - d_rx = plot(x, y, 'rx'); - end - else - if isPlot - d_bo = plot(x, y, 'bo'); - end - end - end - prs = score / totalTimes; -end diff --git a/func/getDivByPos.asv b/func/getDivByPos.asv deleted file mode 100644 index 155a302..0000000 --- a/func/getDivByPos.asv +++ /dev/null @@ -1,10 +0,0 @@ -function res = getDivByPos(Length, Width, x, y) - res = 0; - ux=Length/4; - uy=Width/2; - - x = x + Length/2; - y = y + Width/2; - - px = ceil(x/ux); -end \ No newline at end of file diff --git a/func/isGoalKept.asv b/func/isGoalKept.asv deleted file mode 100644 index fb8efa0..0000000 --- a/func/isGoalKept.asv +++ /dev/null @@ -1,13 +0,0 @@ -function res = isGoalKept(Length, Width, x, y, goalkeepMethod) - div = getDivByPos(Length, Width, x, y); - act = goalkeepMethod(); - - pattern = [2, 3, 6, 7; ]; - - res = false; - - % case 1 - if act == 1 && - - -end \ No newline at end of file diff --git a/func/uniform_5case.asv b/func/uniform_5case.asv deleted file mode 100644 index e89f8f4..0000000 --- a/func/uniform_5case.asv +++ /dev/null @@ -1,4 +0,0 @@ -function res = uniform_5case() - - -end \ No newline at end of file diff --git a/t2.m b/t2.m index b36cca1..23e7547 100644 --- a/t2.m +++ b/t2.m @@ -16,7 +16,8 @@ R = input("Repeating Times: "); drawBackGround(Radius, Width, Length); % calculate prs -[score, totalTimes, prs, d_rx, d_bo] = getDisProb(R, N, Radius, Length, Width, true, @unifrnd_circle); +[score, totalTimes, prs, d_rx, d_bo] = getDisProb(R, N, Radius, Length,... + Width, true, @unifrnd_circle); % add legend legend([d_rx, d_bo], {'scored shot', 'missed shot'}); diff --git a/tree.js b/tree.js new file mode 100644 index 0000000..8313e9a --- /dev/null +++ b/tree.js @@ -0,0 +1,26 @@ +src +| +|---main code +| |---t2.m +| |---t4.m +| |---t5.m +| |---t7_2.m +| |---t7_4.m +| |---t7_5.m +| |---t8.m +| |---t9.m +| |---t10_8.m +| |---t10_9.m +| +| +|---func +| |---drawBackGround.m +| |---getDisProb.m +| |---getDivByPos.m +| |---isGoalKept.m +| |---isInRect.m +| |---normrnd_circle.m +| |---uniform_5case.m +| |---uniform_5case_plus.m +| |---unifrnd_circle.m +| \ No newline at end of file