当前位置:网站首页>Ind FHL first week
Ind FHL first week
2022-07-03 10:31:00 【IFI_ rccsim】
onball.cc summary
onball.cc It includes several functions with different functions , be used for onball Which way of playing football should be used when facing various situations .
1.how_to_kick Function , according to onball The coordinates and opp1( The other goalkeeper ) Coordinates of kick The way .
me.getX() obtain onball Of x coordinate , If <0, namely onball In our half ( Our goal coordinate is -15), Just put x The assignment is me.getX()+10( Try to kick forward ), And use opp1.getY() Get the other goalkeeper y coordinate , If it is regular, it will y The assignment is -0.6, Otherwise, it is assigned as +0.6, That is, try to kick towards the other half of the goalkeeper's goal .
abs_x and abs_y It is based on the midpoint of the opponent's goal , take x The axis is reversed , Under the established coordinate system onball coordinate . The next few if else It is determined according to this coordinate kick The type of . use t Pass it as a parameter to each kick function ,t That is, the coordinates of the position you want to kick ,t Medium x and y If there is no assignment, use the default parameter 15 and 0.
2.findCloestOppDistance Function gets the opposite distance onball The distance of the nearest player .
3.findOppDistance Function gets the opposite distance onball The latest player .
NUM_AGENTS by 11.
hinder if The sentence uses a way similar to the challenge arena to find the nearest .
4.findCloestOpptoBall Function to find the nearest opponent player .
( In this function, I made some modifications according to the function , For example, what we need to find is not Li onball The distance between the opposing players , But to find the distance ball The number of opposing players close k,distanceToMe It should also be changed to distanceToball.)
k That is, the number of opposing players . Call this function later , according to k To judge whether there are many players on the other side , If you don't have much, take the ball , Pass more .
5.cmp The function returns a bool type , Which USES c++ Of pair
6.findOppo Function to judge whether it can be opened
distance2oppo It's the distance between the ball and the opposing player ,if In various situations, judge whether it can open up dajiao_kick_straight_ok by 0 Do not place , by 1 Then you can .
7.avoid Function, as its name implies, is to avoid obstacles ( Obstacles are enemy players )
The shortest tangent path algorithm is used .
In the future, we need to add the judgment of boundary when we don't reach the tangent point , Prevent the ball from going out of bounds .
8.follow Function is the function that the player breaks the ball against the opponent .
The shortest tangent path algorithm is still used . Specially , When the obstacle is not onball And the ball , Call avoid function .
9. final onball Function is the specific way to play football in different situations .
Such as our special serve , When the opponent serves special , also onball In front 、 The back 、 Which of the above functions should be called in various actual situations, such as the number of people in the restricted area and around .
边栏推荐
- 权重衰退(PyTorch)
- What useful materials have I learned from when installing QT
- Model evaluation and selection
- Hands on deep learning pytorch version exercise solution - 3.1 linear regression
- Leetcode刷题---1
- A complete mall system
- Out of the box high color background system
- 【C 题集】of Ⅵ
- Hands on deep learning pytorch version exercise solution-3.3 simple implementation of linear regression
- 六、MySQL之数据定义语言(一)
猜你喜欢

Ut2014 learning notes

2018 y7000 upgrade hard disk + migrate and upgrade black apple

Mise en œuvre d'OpenCV + dlib pour changer le visage de Mona Lisa

重写波士顿房价预测任务(使用飞桨paddlepaddle)

GAOFAN Weibo app

Configure opencv in QT Creator

Implementation of "quick start electronic" window dragging

Leetcode-106:根据中后序遍历序列构造二叉树

Pytorch ADDA code learning notes

Leetcode - 706 design hash mapping (Design)*
随机推荐
20220601数学:阶乘后的零
Leetcode-100: same tree
Hands on deep learning pytorch version exercise solution - 2.3 linear algebra
Ut2012 learning notes
LeetCode - 715. Range module (TreeSet)*****
Tensorflow—Image segmentation
What useful materials have I learned from when installing QT
Out of the box high color background system
Implementation of "quick start electronic" window dragging
20220605数学:两数相除
Anaconda installation package reported an error packagesnotfounderror: the following packages are not available from current channels:
GAOFAN Weibo app
Inverse code of string (Jilin University postgraduate entrance examination question)
Leetcode刷题---75
Leetcode-112:路径总和
20220607 others: sum of two integers
Notes - regular expressions
High imitation Netease cloud music
Opencv+dlib to change the face of Mona Lisa
2018 y7000 upgrade hard disk + migrate and upgrade black apple