0% found this document useful (0 votes)
6 views3 pages

Pseudo Code For Go Daddy Go and Point Eval

Uploaded by

Muwahid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Pseudo Code For Go Daddy Go and Point Eval

Uploaded by

Muwahid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

function Get_Points(curr_position, Radi):

Pos ← curr_position
R ← Radi
return [
Pos,
[(Pos[0] - R) * 0.66, (Pos[1] - R) * 0.33],
[(Pos[0] + R) * 0.66, (Pos[1] + R) * 0.33],
[(Pos[0] + R) * 0.66, (Pos[1] - R) * 0.33],
[(Pos[0] - R) * 0.66, (Pos[1] + R) * 0.33],
[(Pos[0] - R) * 0.33, (Pos[1] - R) * 0.66],
[(Pos[0] + R) * 0.33, (Pos[1] + R) * 0.66],
[(Pos[0] + R) * 0.33, (Pos[1] - R) * 0.66],
[(Pos[0] - R) * 0.33, (Pos[1] + R) * 0.66]
]
end function

function Assign_Weight_to_edge(Point1, Point2, state, Radi = 10):


Opponents_pos ← []
Density ← 0
Total_dis ← 0
Opponents_dict ← state.world_model.their_players_dict

for each opponent in Opponents_dict do


Opponents_pos.append((opponent.position.x, opponent.position.y))
Dis ← distance between opponent.position and Point2
if Dis ≤ Radi then
Density ← Density + 1
Total_dis ← Total_dis + Dis
end if
end for

StaminaWeight ← 0
key ← Get_key_pos(state, Point2 as pb2.RpcVector2D)
Count ← Pass_count for player's uniform number in Pass_count array
Update Pass_count for player and teammate uniform numbers
Stamina_ ← Stamina for teammate's uniform number

if Stamina_ < 2000 then


StaminaWeight ← 30
else if Stamina_ < 4000 then
StaminaWeight ← 10
end if

Opponents_pos ← array

try
Total_dis_to_oppo ← (Total_dis * 12) / (Density * Radi)
catch ZeroDivisionError
Total_dis_to_oppo ← 0
end try

Total ← 0
for each player in state.world_model.our_players_dict do
if player.uniform_number = 11 and player.position.x ≥ 11 then
Total ← Total + 20
end if
end for
Density ← Density * 2
Dis_to_goal ← average distance from Point1 and Point2 to goal
Interception_prob ← interception probability between Point1 and Point2 with
Opponents_pos
Point_dis ← distance between Point1 and Point2

return 1 * (Total_dis_to_oppo + Density + Interception_prob + Point_dis +


Dis_to_goal + Total)
end function

function G_D_G(state):
Teammates ← state.world_model.our_players_dict
Small_radai ← 4
Large_radai ← 20
Pos_ ← position of self in world model

uni ← array of uniform numbers of teammates within Large_radai


Candinates ← array of positions of teammates within Large_radai
Points ← Get_Points(Pos_, Small_radai)

Edges ← {}
Points_cand ← array of Get_Points for each position in Candinates

for each Point in Points do


for each (Point2, uniform) in zip(Points_cand, uni) do
for each Point3 in Point2 do
Edges[(Point, Point3)] ← Assign_Weight_to_edge(Point, Point3,
state)
end for
end for
end for

Min_edge ← None
Min_edge_weight ← infinity

for each Edge in Edges do


if Edges[Edge] ≤ Min_edge_weight then
Min_edge ← Edge
Min_edge_weight ← Edges[Edge]
end if
end for

if Min_edge = None then


Min_weight ← infinity
Min_edge ← None
for each Point in Points do
if Point ≠ Pos_ then
weight ← Assign_Weight_to_edge(Point, Pos_, state)
if weight < Min_weight then
Min_weight ← weight
Min_edge ← Point
end if
end if
end for
return ("Dribble", pb2.RpcVector2D(Min_edge))
end if

X, Y, X1, Y1 ← Min_edge
if X = Pos_[0] and Y = Pos_[1] then
return ("Pass", pb2.RpcVector2D(X1, Y1))
else
return ("Dribble", pb2.RpcVector2D(X, Y))
end if
end function

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy