parent
ad0a9750ed
commit
32c947e6a7
6 changed files with 28 additions and 49 deletions
@ -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 |
@ -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 |
@ -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 |
@ -1,4 +0,0 @@ |
||||
function res = uniform_5case() |
||||
|
||||
|
||||
end |
@ -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 |
||||
| |
Loading…
Reference in new issue