亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? player.c

?? 機器足球2D比賽程序 對trlen_base_2002的改進
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*   Copyright (c) 2000-2002, Jelle Kok, University of Amsterdam   All rights reserved.   Redistribution and use in source and binary forms, with or without    modification, are permitted provided that the following conditions are met:   1. Redistributions of source code must retain the above copyright notice, this    list of conditions and the following disclaimer.    2. Redistributions in binary form must reproduce the above copyright notice,    this list of conditions and the following disclaimer in the documentation    and/or other materials provided with the distribution.    3. Neither the name of the University of Amsterdam nor the names of its    contributors may be used to endorse or promote products derived from this    software without specific prior written permission.    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   *//*! \file Player.C  <pre>  <b>File:</b>          Player.C  <b>Project:</b>       Robocup Soccer Simulation Team: UvA Trilearn  <b>Authors:</b>       Jelle Kok  <b>Created:</b>       03/03/2001  <b>Last Revision:</b> $ID$  <b>Contents:</b>      This file contains the definitions for the Player class,  which is a superclass from BasicPlayer and contains the  decision procedure to select the skills from the  BasicPlayer.   <hr size=2>  <h2><b>Changes</b></h2>  <b>Date</b>             <b>Author</b>          <b>Comment</b>  03/03/2001       Jelle Kok       Initial version created  </pre>  */#include "Player.h"#include "Parse.h"#include <sys/poll.h>		// needed for 'poll'static bool isPlayOn = true;/*!This is the constructor the Player class and calls the constructor of the  superclass BasicPlayer.  \param act ActHandler to which the actions can be sent  \param wm WorldModel which information is used to determine action  \param ss ServerSettings that contain parameters used by the server  \param ps PlayerSettings that contain parameters important for the client  \param strTeamName team name of this player  \param dVersion version this basicplayer corresponds to  \param iReconnect integer that defines player number (-1 when new player) */Player::Player(ActHandler * act, WorldModel * wm, ServerSettings * ss,		PlayerSettings * ps,		Formations * fs, char *strTeamName, double dVersion,		int iReconnect){	char str[MAX_MSG];	ACT = act;	WM = wm;	SS = ss;	PS = ps;	formations = fs;	bContLoop = true;	WM->setTeamName(strTeamName);	m_timeLastSay = -5;	m_iPenaltyNr = 0;	// wait longer as role number increases, to make sure players appear at the	// field in the correct order	poll(0, 0, formations->getPlayerInFormation() * 100);	// create initialisation string	if (iReconnect != -1)		sprintf(str, "(reconnect %s %d)", strTeamName, iReconnect);	else if (formations->getPlayerType() == PT_GOALKEEPER)		sprintf(str, "(init %s (version %f) (goalie))", strTeamName,				dVersion);	else		sprintf(str, "(init %s (version %f))", strTeamName, dVersion);	ACT->sendMessage(str);}/*! This is the main loop of the agent. This method calls the update methods  of the world model after it is indicated that new information has arrived.  After this, the correct main loop of the player type is called, which  puts the best soccer command in the queue of the ActHandler. */	voidPlayer::mainLoop(){	while (bContLoop)		// as long as server alive	{		Log.logWithTime(3, "  start update_all");		Log.setHeader(WM->getCurrentCycle(), WM->getPlayerNumber());		if (WM->updateAll() == true) {			if ((WM->isPenaltyUs() || WM->isPenaltyThem()))				performPenalty();			else if (WM->getPlayMode() == PM_FROZEN)				ACT->putCommandInQueue(turnBodyToObject(OBJECT_BALL));			else {				//formationDecision ();    //確定比賽陣型。				if (shallISaySomething() == true)	// shall I communicate				{					m_timeLastSay = WM->getCurrentTime();					ACT->sendCommandDirect(sayBallStatus());				}				switch (formations->getPlayerType())	// determine right loop				{					case PT_GOALKEEPER:						goalieMainLoop();						break;					case PT_DEFENDER_SWEEPER:					case PT_DEFENDER_WING:						defenderMainLoop();						break;					case PT_MIDFIELDER_CENTER:					case PT_MIDFIELDER_WING:						midfielderMainLoop();						break;					case PT_ATTACKER:					case PT_ATTACKER_WING:						attackerMainLoop();						break;					case PT_ILLEGAL:					default:						break;				}			}			Log.logWithTime(3,					"  determined action; waiting for new info");			// directly after see message, will nog get better info, so send commands			if (WM->getTimeLastSeeMessage() == WM->getCurrentTime())				ACT->sendCommands();		} else			Log.logWithTime(3,					"  HOLE no action determined; waiting for new info");		// wait for new information from the server		// cannot say bContLoop=WM->wait... since bContLoop can be changed elsewhere		if (WM->waitForNewInformation() == false)			bContLoop = false;	}	// shutdow, print hole and number of players seen statistics	Log.logWithTime(777, "Shutting down player %d\n",			WM->getPlayerNumber());	Log.logWithTime(777, "   Number of holes: %d (%f)\n", WM->iNrHoles,			((double) WM->iNrHoles / WM->getCurrentCycle()) * 100);	Log.logWithTime(777, "   Teammates seen: %d (%f)\n",			WM->iNrTeammatesSeen,			((double) WM->iNrTeammatesSeen /			 WM->getCurrentCycle()));	Log.logWithTime(777, "   Opponents seen: %d (%f)\n",			WM->iNrOpponentsSeen,			((double) WM->iNrOpponentsSeen /			 WM->getCurrentCycle()));}/*! This is the main decision loop for the goalkeeper. */void Player::goalieMainLoop(){	//deMeer5_goalie();	goalieStrategy();}/*! This is the main decision loop for a defender.  *              后衛決策 * *      此時已經確定好陣型和自己的角色, *      現在需要根據場上的狀態決定自己下一步的行動。 */void Player::defenderMainLoop(){	//deMeer5() ;	SoccerCommand soc(CMD_ILLEGAL);	SoccerCommand socVisual(CMD_ILLEGAL);	VecPosition posAgent = WM->getAgentGlobalPosition();	VecPosition posStrat = WM->getStrategicPosition();	VecPosition posBall = WM->getBallPos();	//行為決策部分。	if (WM->isKickOffThem());	// do nothing	else if (WM->isBeforeKickOff()) {		if (formations->getFormation() != FT_INITIAL)			formations->setFormation(FT_INITIAL);	// go to kick_off formation       		if (WM->isKickOffThem()				&& posStrat.getDistanceTo(VecPosition(0, 0)) < 9.0)			posStrat.setX(-10.0);		if (posAgent.getDistanceTo(posStrat) > 2.0)			soc = teleportToPos(posStrat);		else			// else turn to center		{			soc = turnBodyToPoint(VecPosition(0, 0), 0);			//ACT->putCommandInQueue( alignNeckWithBody( ) );		}	} else if (WM->isCornerKickUs() || WM->isFreeKickUs()) {		isPlayOn = false;		soc = midfielderStrategy();	} else {		isPlayOn = true;		soc = defenderStrategy();	}	ACT->putCommandInQueue(soc);	//視覺決策部分。	socVisual = visualDecision(soc);	ACT->putCommandInQueue(socVisual);	//}	}/*! This is the main decision loop for a midfielder.  *                中場決策 * *      此時已經確定好陣型和自己的角色, *      現在需要根據場上的狀態決定自己下一步的行動。 */void Player::midfielderMainLoop(){	//deMeer5() ;	//首先要確定球的位置。	if (WM->getConfidence(OBJECT_BALL) < PS->getBallConfThr()) {		ACT->putCommandInQueue(searchBall());	// if ball pos unknown		ACT->putCommandInQueue(alignNeckWithBody());	// search for it		return;	}	else {		SoccerCommand soc(CMD_ILLEGAL);		SoccerCommand socVisual(CMD_ILLEGAL);		VecPosition posAgent = WM->getAgentGlobalPosition();		VecPosition posStrat = WM->getStrategicPosition();		VecPosition posBall = WM->getBallPos();		//行為決策部分。		if (WM->isKickOffThem());	// do nothing		else if (WM->isBeforeKickOff()) {			if (formations->getFormation() != FT_INITIAL)				formations->setFormation(FT_INITIAL);	// go to kick_off formation       			if (WM->isKickOffThem()					&& posStrat.getDistanceTo(VecPosition(0, 0)) < 9.0)				posStrat.setX(-10.0);			if (posAgent.getDistanceTo(posStrat) > 2.0)				soc = teleportToPos(posStrat);			else		// else turn to center			{				soc = turnBodyToPoint(VecPosition(0, 0), 0);				//ACT->putCommandInQueue( alignNeckWithBody( ) );			}		} else if (WM->isCornerKickUs() || WM->isFreeKickUs()) {			isPlayOn = false;			soc = midfielderStrategy();		} else {			isPlayOn = true;			soc = midfielderStrategy();		}		ACT->putCommandInQueue(soc);		//視覺決策部分。		socVisual = visualDecision(soc);		ACT->putCommandInQueue(socVisual);	}}/*! This is the main decision loop for an agent.  *                  前鋒決策 * *      此時已經確定好陣型和自己的角色, *      現在需要根據場上的狀態決定自己下一步的行動。 */void Player::attackerMainLoop(){	//deMeer5() ;	//首先要確定球的位置。	if (WM->getConfidence(OBJECT_BALL) < PS->getBallConfThr()) {		ACT->putCommandInQueue(searchBall());	// if ball pos unknown		ACT->putCommandInQueue(alignNeckWithBody());	// search for it		return;	}	else {		SoccerCommand soc(CMD_ILLEGAL);		SoccerCommand socVisual(CMD_ILLEGAL);		VecPosition posAgent = WM->getAgentGlobalPosition();		VecPosition posStrat = WM->getStrategicPosition();		VecPosition posBall = WM->getBallPos();		//行為決策部分。		if (WM->isKickOffThem());	// do nothing		else if (WM->isBeforeKickOff()) {			if (formations->getFormation() != FT_INITIAL)				formations->setFormation(FT_INITIAL);	// go to kick_off formation       			if (WM->isKickOffThem()					&& posStrat.getDistanceTo(VecPosition(0, 0)) < 9.0)				posStrat.setX(-10.0);			if (posAgent.getDistanceTo(posStrat) > 2.0)				soc = teleportToPos(posStrat);			else		// else turn to center			{				soc = turnBodyToPoint(VecPosition(0, 0), 0);				//ACT->putCommandInQueue( alignNeckWithBody( ) );			}		} else if (WM->isCornerKickUs() || WM->isFreeKickUs()) {			isPlayOn = false;			soc = attackerStrategy();		} else {			isPlayOn = true;			soc = attackerStrategy();		}		ACT->putCommandInQueue(soc);		//視覺決策部分。		socVisual = visualDecision(soc);		ACT->putCommandInQueue(socVisual);	}}/*!This method is the first complete simple team and defines the actions taken  by all the players on the field (excluding the goalie). It is based on the  high-level actions taken by the simple team FC Portugal that it released in  2000. The players do the following:  - if ball is kickable  kick ball to goal (random corner of goal)  - else if i am fastest player to ball and no opponent can intercept ball  intercept the ball  - else  move to strategic position based on your home position and pos ball */void Player::deMeer5(){	SoccerCommand soc(CMD_ILLEGAL);	VecPosition posAgent = WM->getAgentGlobalPosition();	VecPosition posBall = WM->getBallPos();	int iTmp;	if (WM->isKickOffThem());	// do nothing	else if (WM->isBeforeKickOff()) {		if (formations->getFormation() != FT_INITIAL)			formations->setFormation(FT_INITIAL);	// go to kick_off formation		VecPosition posStrat = WM->getStrategicPosition();		if (WM->isKickOffThem()				&& posStrat.getDistanceTo(VecPosition(0, 0)) < 9.0)			posStrat.setX(-10.0);		if (posAgent.getDistanceTo(posStrat) > 2.0)			ACT->putCommandInQueue(teleportToPos(posStrat));		else			// else turn to center		{			ACT->putCommandInQueue(turnBodyToPoint(VecPosition(0, 0), 0));			ACT->putCommandInQueue(alignNeckWithBody());		}	} else {		formations->setFormation(FT_433_OFFENSIVE);		soc.commandType = CMD_ILLEGAL;		if (WM->getConfidence(OBJECT_BALL) < PS->getBallConfThr()) {			ACT->putCommandInQueue(searchBall());	// if ball pos unknown			ACT->putCommandInQueue(alignNeckWithBody());	// search for it		} else if (WM->isBallKickable())	// if kickable		{			VecPosition posGoal(PITCH_LENGTH / 2.0,					(-1 +					 2 * (WM->getCurrentCycle() % 2)) * 0.4 *					SS->getGoalWidth());			soc = kickTo(posGoal, SS->getBallSpeedMax());	// kick maximal			ACT->putCommandInQueue(soc);			ACT->putCommandInQueue(turnNeckToObject(OBJECT_BALL, soc));			Log.log(100, "kick ball");		} else if (WM->				getFastestInSetTo(OBJECT_SET_TEAMMATES, OBJECT_BALL,					&iTmp) == WM->getAgentObjectType()				&& !WM->isDeadBallThem()) {	// if fastest to ball			Log.log(100,					"I am fastest to ball; can get there in %d cycles",					iTmp);			soc = intercept(false);	// intercept the ball			if (soc.commandType == CMD_DASH &&	// if stamina low					WM->getAgentStamina().getStamina() <					SS->getRecoverDecThr() * SS->getStaminaMax() + 200) {				soc.dPower = 30.0 * WM->getAgentStamina().getRecovery();	// dash slow				ACT->putCommandInQueue(soc);				ACT->putCommandInQueue(turnNeckToObject(OBJECT_BALL, soc));			} else		// if stamina high			{				ACT->putCommandInQueue(soc);	// dash as intended				ACT->putCommandInQueue(turnNeckToObject(OBJECT_BALL, soc));			}		} else if (posAgent.getDistanceTo(WM->getStrategicPosition()) >				1.5 + fabs(posAgent.getX() - posBall.getX()) / 10.0)			// if not near strategic pos		{			if (WM->getAgentStamina().getStamina() >	// if stamina high					SS->getRecoverDecThr() * SS->getStaminaMax() + 200) {				soc =					moveToPos(WM->getStrategicPosition(),							PS->getPlayerWhenToTurnAngle());				ACT->putCommandInQueue(soc);	// move to strategic pos				ACT->putCommandInQueue(turnNeckToObject(OBJECT_BALL, soc));			} else		// else watch ball			{				ACT->putCommandInQueue(soc =						turnBodyToObject(OBJECT_BALL));				ACT->putCommandInQueue(turnNeckToObject(OBJECT_BALL, soc));			}		} else if (fabs(WM->getRelativeAngle(OBJECT_BALL)) > 1.0)	// watch ball		{			ACT->putCommandInQueue(soc = turnBodyToObject(OBJECT_BALL));			ACT->putCommandInQueue(turnNeckToObject(OBJECT_BALL, soc));		} else			// nothing to do			ACT->putCommandInQueue(SoccerCommand(CMD_TURNNECK, 0.0));	}}/*!This method is a simple goalie based on the goalie of the simple Team of  FC Portugal. It defines a rectangle in its penalty area and moves to the  position on this rectangle where the ball intersects if you make a line  between the ball position and the center of the goal. If the ball can  be intercepted in the own penalty area the ball is intercepted and catched.  */void Player::deMeer5_goalie(){	int i;	SoccerCommand soc;	VecPosition posAgent = WM->getAgentGlobalPosition();	AngDeg angBody = WM->getAgentGlobalBodyAngle();	// define the top and bottom position of a rectangle in which keeper moves	static const VecPosition posLeftTop(-PITCH_LENGTH / 2.0 +			0.7 * PENALTY_AREA_LENGTH,			-PENALTY_AREA_WIDTH / 4.0);	static const VecPosition posRightTop(-PITCH_LENGTH / 2.0 +			0.7 * PENALTY_AREA_LENGTH,			+PENALTY_AREA_WIDTH / 4.0);	// define the borders of this rectangle using the two points.	static Line lineFront =		Line::makeLineFromTwoPoints(posLeftTop, posRightTop);	static Line lineLeft =		Line::makeLineFromTwoPoints(VecPosition(-50.0, posLeftTop.getY()),				posLeftTop);	static Line lineRight =		Line::makeLineFromTwoPoints(VecPosition(-50.0, posRightTop.getY()),				posRightTop);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品欧美一区二区久久| 欧洲亚洲精品在线| 久久亚洲一区二区三区四区| 极品美女销魂一区二区三区 | 欧美日韩你懂的| 亚洲国产成人av好男人在线观看| 欧美日韩国产精选| 男女视频一区二区| 久久精品亚洲精品国产欧美kt∨| 国产91清纯白嫩初高中在线观看| 国产精品传媒视频| 欧美久久免费观看| 国精产品一区一区三区mba桃花| 国产女主播视频一区二区| 99精品偷自拍| 日本欧洲一区二区| 欧美激情一区在线| 欧美色男人天堂| 国产九色精品成人porny| 亚洲欧洲国产专区| 日韩一级片在线观看| 国产精品99久久久久久有的能看| 亚洲欧美另类综合偷拍| 日韩一级大片在线观看| 国产宾馆实践打屁股91| 亚洲成年人网站在线观看| 久久精品一区蜜桃臀影院| 日本久久精品电影| 韩国理伦片一区二区三区在线播放| 国产精品国产三级国产普通话99 | 亚洲人成电影网站色mp4| 欧美日韩卡一卡二| 国产成a人无v码亚洲福利| 亚洲在线观看免费| 久久久久久综合| 欧美亚洲国产一区二区三区va| 久久电影网站中文字幕| 亚洲免费视频中文字幕| 久久精品亚洲麻豆av一区二区| 欧美日韩中文另类| 成人黄动漫网站免费app| 日本最新不卡在线| 亚洲免费在线观看| 国产丝袜美腿一区二区三区| 666欧美在线视频| 色婷婷亚洲婷婷| 国产精品资源网| 石原莉奈一区二区三区在线观看| 国产精品久久久久久福利一牛影视| 日韩欧美高清dvd碟片| 色噜噜狠狠色综合中国 | 高清不卡在线观看| 麻豆视频一区二区| 石原莉奈在线亚洲三区| 亚洲在线观看免费| 亚洲欧美aⅴ...| 欧美国产日韩精品免费观看| 精品乱码亚洲一区二区不卡| 欧美性感一区二区三区| 91在线视频网址| 高清av一区二区| 国产成人免费视频一区| 久久97超碰色| 激情成人综合网| 六月丁香婷婷色狠狠久久| 亚洲18女电影在线观看| 一区二区三区蜜桃网| 18成人在线视频| **性色生活片久久毛片| 中文成人综合网| 国产精品水嫩水嫩| 久久五月婷婷丁香社区| 久久综合九色综合欧美就去吻| 日韩精品资源二区在线| 制服丝袜亚洲色图| 欧美二区三区91| 7777精品伊人久久久大香线蕉的| 欧美日韩国产在线观看| 欧美日韩精品一区二区| 欧美图片一区二区三区| 欧美日韩日日摸| 欧美精品自拍偷拍动漫精品| 欧美肥妇毛茸茸| 欧美一级久久久| 日韩美女视频一区二区在线观看| 欧美变态口味重另类| 日韩女同互慰一区二区| 精品成人在线观看| 久久天天做天天爱综合色| 国产欧美日韩视频在线观看| 最新国产成人在线观看| 亚洲私人影院在线观看| 亚洲欧美一区二区视频| 亚洲一级二级三级在线免费观看| 亚洲一区二区视频在线观看| 亚洲成人av福利| 日本美女一区二区| 紧缚捆绑精品一区二区| 成人小视频在线| 在线精品国精品国产尤物884a| 精品婷婷伊人一区三区三| 日韩一区二区免费电影| 久久久天堂av| 17c精品麻豆一区二区免费| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲免费观看高清| 免费国产亚洲视频| 床上的激情91.| 欧美三级视频在线| 欧美v日韩v国产v| 国产精品沙发午睡系列990531| 亚洲一区二区综合| 久久精品国产一区二区三| 成人污视频在线观看| 91黄视频在线| 精品国产亚洲一区二区三区在线观看| 国产精品青草久久| 天天色综合天天| 国产乱码精品一品二品| 色噜噜狠狠色综合欧洲selulu| 日韩三级中文字幕| 国产精品美女久久久久aⅴ| 午夜精品久久久久久不卡8050| 精品一区二区三区视频| 91丨porny丨国产| 日韩亚洲欧美中文三级| 亚洲天堂成人在线观看| 精品一区二区三区视频| 91久久精品午夜一区二区| 精品久久久久av影院| 亚洲黄一区二区三区| 国产一区高清在线| 欧美日韩一级视频| 国产精品色噜噜| 久久国产精品无码网站| 91在线国内视频| 久久久99精品免费观看| 亚洲成人你懂的| 91蝌蚪porny| 国产色产综合产在线视频| 亚洲成人资源网| 91免费国产在线| 中文字幕av在线一区二区三区| 日韩精品乱码av一区二区| 91麻豆国产福利精品| 久久久无码精品亚洲日韩按摩| 日韩不卡免费视频| 欧洲av在线精品| 日韩一区中文字幕| 国产高清视频一区| 精品国产不卡一区二区三区| 日韩激情视频在线观看| 色婷婷激情久久| 欧美日韩一区二区三区免费看| 中文字幕一区免费在线观看| 激情深爱一区二区| 欧美大白屁股肥臀xxxxxx| 亚洲国产一区二区视频| 91免费看视频| 亚洲欧洲精品一区二区三区不卡| 国产福利一区二区三区视频| 精品国产乱码久久久久久牛牛| 日韩专区中文字幕一区二区| 欧美三级中文字幕在线观看| 樱花影视一区二区| 91在线云播放| 亚洲黄色av一区| 91免费小视频| 亚洲一区二区视频在线观看| 在线观看日韩高清av| 亚洲综合激情另类小说区| 一本一本久久a久久精品综合麻豆| 国产精品久久久久一区二区三区| 国产成人av福利| 中国av一区二区三区| 不卡欧美aaaaa| 中文字幕一区二区三区蜜月| 91日韩在线专区| 亚洲一二三四在线| 欧美日韩久久久一区| 蜜臀av亚洲一区中文字幕| 欧美成人精品3d动漫h| 韩国午夜理伦三级不卡影院| 久久噜噜亚洲综合| 成人免费不卡视频| 一区二区三区四区不卡在线| 欧美三级视频在线| 麻豆成人91精品二区三区| 久久这里都是精品| 99视频精品全部免费在线| 亚洲在线中文字幕| 欧美一区二区三区免费大片| 国产一区二区不卡| 亚洲欧洲日韩av| 欧美在线视频全部完| 美国三级日本三级久久99 | 日韩理论片在线| 欧美区视频在线观看| 国内一区二区在线| 欧美激情在线观看视频免费|