当前位置:网站首页>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 .
边栏推荐
- Opencv+dlib to change the face of Mona Lisa
- CV learning notes convolutional neural network
- Several problems encountered in installing MySQL under MAC system
- 七、MySQL之数据定义语言(二)
- Tensorflow—Image segmentation
- Ut2013 learning notes
- Leetcode刷题---367
- Leetcode刷题---704
- . DLL and Differences between lib files
- Leetcode刷题---202
猜你喜欢
Ut2014 learning notes
『快速入门electron』之实现窗口拖拽
Deep Reinforcement learning with PyTorch
[C question set] of Ⅵ
Matplotlib drawing
Hands on deep learning pytorch version exercise solution - 2.5 automatic differentiation
Hands on deep learning pytorch version exercise answer - 2.2 preliminary knowledge / data preprocessing
Leetcode-513:找树的左下角值
Advantageous distinctive domain adaptation reading notes (detailed)
八、MySQL之事务控制语言
随机推荐
[C question set] of Ⅵ
Flutter 退出当前操作二次确认怎么做才更优雅?
Yolov5 creates and trains its own data set to realize mask wearing detection
20220606 Mathematics: fraction to decimal
20220608其他:逆波兰表达式求值
Leetcode-100: same tree
Inverse code of string (Jilin University postgraduate entrance examination question)
mysql5.7安装和配置教程(图文超详细版)
Leetcode - 705 design hash set (Design)
. DLL and Differences between lib files
GAOFAN Weibo app
Leetcode - 5 longest palindrome substring
Ut2011 learning notes
Hands on deep learning pytorch version exercise solution - 2.3 linear algebra
Are there any other high imitation projects
重写波士顿房价预测任务(使用飞桨paddlepaddle)
Leetcode刷题---1
一个30岁的测试员无比挣扎的故事,连躺平都是奢望
[LZY learning notes dive into deep learning] 3.4 3.6 3.7 softmax principle and Implementation
Anaconda installation package reported an error packagesnotfounderror: the following packages are not available from current channels: