📄 strategy.h
字号:
/*************************************************************************** * Copyright (C) 2004 - 2006 by ZJUBase *
* National Lab of Industrial Control Tech. * * Zhejiang University, China * * * * Achievements of ZJUBase in RoboCup Soccer 3D Simulation League: *
* In RoboCup championship, *
* - June 2006 - 3rd place in RoboCup 2006, Bremen, Germany (lost * * the semi-final with a coin toss) *
* - July 2005 - 3rd place in RoboCup 2005, Osaka, Japan (share the * * 3rd place with team Caspian) *
* In RoboCup local events, *
* - April 2006 - 2nd place in RoboCup Iran Open 2006, Tehran, Iran * * (lost the final with a coin toss) *
* - December 2005 - 2nd place in AI Games 2005, Isfahan, Iran *
* - July 2005 - champion in China Robot Competition 2005, Changzhou, * * China *
* - October 2004 - champion in China Soccer Robot Competition 2004, * * Guangzhou, China *
* * * Team members: *
* Currently the team leader is, * * Hao JIANG (jianghao@iipc.zju.edu.cn; riveria@gmail.com) *
* In the next season, the leader will be * * Yifeng ZHANG (yfzhang@iipc.zju.edu.cn) *
* ZJUBase 3D agent is created by * * Dijun LUO (djluo@iipc.zju.edu.cn) *
* All the members who has ever contributed: * * Jun JIANG *
* Xinfeng DU (xfdu@iipc.zju.edu.cn) *
* Yang ZHOU (yzhou@iipc.zju.edu.cn) *
* Zhipeng YANG *
* Xiang FAN *
* *
* Team Manager: *
* Ms. Rong XIONG (rxiong@iipc.zju.edu.cn) *
* *
* If you met any problems or you have something to discuss about * * ZJUBase. Please feel free to contact us through EMails given below. * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/#ifndef STRATEGY_H#define STRATEGY_H
#include <vector>#include "soccertypes.h"#include "Utils.h"#include "ServerSettings.h"#include <fstream>using namespace std;
class Strategy{public: Strategy(void); ~Strategy(void);
void coefficientGhost(double length); void Init(ServerSettings* ss); Vector3 getFormationPosition(); double GetShootProb(Angle &ang); string m_DebugMessage; Vector3 SBSPPosition(int num);
/////////////////////OriginalFormation///////////////// double getGhostX(int num,double ballX); double getGhostY(int num,double ballX,double ballY); void getCoefficient(int num,double ballX,double ballY); double getX(int i, double ballX, double ballY); double getY(int i, double ballY, double ballX); void AddDebugMessage(const char *str, ...);
//////////////////////PositionSet///////////////////// void getConsiderPassPoint(vector<Vector3>& points,Vector3 p_Center,Dist distance,int t_ang); Vector3 getBestPassPoint(Vector3 pos); Vector3 getBestRunPoint(Vector3 pos); Vector3 getAreaPoint(Vector3 point); double EvaluateRunPoint(Vector3 point); double EvalHB(Vector3 point); double EvalOffense(Vector3 point); double Normal_School(double u,double a,double x); double Normal_School_2D(double u1,double u2,double a1,double a2,double x,double rou,double y); double EvalDist(Vector3 point,Vector3 goalpoint,double u,double a); Vector3 OffSide(Vector3 point,int num);
/////////////////////////PositionControl Vector3 tempCP[50]; Vector3 Y_CP[6]; double Y_weight[6]; Vector3 getPosition(int player,double x_Ball,double y_Ball); double getYShift(double y_Ball);};
extern Strategy strategy;
class ControlPoint{public: ControlPoint(){}; ~ControlPoint(){}; Vector3 CP[15][50]; int CpNum[15]; double weight[15][50]; void GetPositionCP();};
class CBpline {public: int Def_k; int num_points; float *T;
public: CBpline(); virtual ~CBpline(); Vector3 Qu(double u,int n,Vector3 *CP,double *weight); float N(double u,int i,int k);
private: void GetT(int n);};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -