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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? basicplayer.c

?? 機(jī)器足球2D比賽程序 對trlen_base_2002的改進(jìn)
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*Copyright (c) 2000-2002, Jelle Kok, University of AmsterdamAll 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 BasicPlayer.C<pre><b>File:</b>          BasicPlayer.C<b>Project:</b>       Robocup Soccer Simulation Team: UvA Trilearn<b>Authors:</b>       Jelle Kok<b>Created:</b>       10/12/2000<b>Last Revision:</b> $ID$<b>Contents:</b>      This file contains the class declaration for the               BasicPlayer. The BasicPlayer is the class where the               available skills for the agent are defined.<hr size=2><h2><b>Changes</b></h2><b>Date</b>             <b>Author</b>          <b>Comment</b>:10/12/2000       Jelle Kok       Initial version created</pre>*/#include "BasicPlayer.h"#include "Parse.h"        // parseFirstInt/********************** LOW-LEVEL SKILLS *************************************//*! This skill enables an agent to align his neck with his body. It returns a    turn neck command that takes the angle of the agent's body relative to his    neck as its only argument.   \return SoccerCommand turn_neck command that aligns neck with body */SoccerCommand BasicPlayer::alignNeckWithBody( ){  return SoccerCommand( CMD_TURNNECK, WM->getAgentBodyAngleRelToNeck( ) );}/*! This skill enables an agent to turn his body towards a given point. It    receives a global position 'pos' on the field and returns a turn command    that will turn the agent's body towards this point. To this end the agent's    global position in the next cycle is predicted based on his current    velocity. This is done to compensate for the fact that the remaining    velocity will move the agent to another position in the next cycle. The    global angle between the given position and the predicted position is then    determined after which the agent's global body direction is subtracted from    this angle in order to make it relative to the agent's body. Finally,    the resulting angle is normalized and adjusted to compensate for the    inertia moment and speed of the agent. If it is impossible to turn towards    the given position in a single cycle then the agent turns as far as    possible.    \param pos position to which body should be turned    \param iCycles denotes the number of cycles that are used to update the               the agent position. The resulting position is compared with               'pos' to determine the desired turning angle.    \return SoccerCommand turn command to turn body to the desired point */SoccerCommand BasicPlayer::turnBodyToPoint( VecPosition pos, int iCycles ){  VecPosition posGlobal = WM->predictAgentPos(iCycles, 0);  AngDeg angTurn        = (pos - posGlobal).getDirection();  angTurn              -= WM->getAgentGlobalBodyAngle();  angTurn               = VecPosition::normalizeAngle( angTurn );  angTurn               = WM->getAngleForTurn( angTurn, WM->getAgentSpeed() );  return SoccerCommand( CMD_TURN, angTurn );}/*! This skill enables an agent to turn his back towards a given point 'pos'.    The only difference between this skill and turnBodyToPoint is that the    angle between the given position and the predicted position of the agent    in the next cycle is now made relative to the back of the agent by    subtracting the agent's global back direction. This skill can for example    be used by the goalkeeper in case he wants to move back to his goal while    keeping sight of the rest of the field.    \param pos position to which the agent's back should be turned    \param iCycles denotes the number of cycles that are used to update the               the agent position. The resulting position is compared with               'pos' to determine the desired turning angle.    \return SoccerCommand command to turn agent's back to the desired point */SoccerCommand BasicPlayer::turnBackToPoint( VecPosition pos, int iCycles ){  VecPosition posGlobal = WM->predictAgentPos(iCycles, 0);  AngDeg angTurn        = (pos - posGlobal).getDirection();  angTurn              -= (WM->getAgentGlobalBodyAngle() + 180);  angTurn               = VecPosition::normalizeAngle( angTurn );  angTurn               = WM->getAngleForTurn( angTurn, WM->getAgentSpeed() );  return SoccerCommand( CMD_TURN, angTurn );}/*! This skill enables an agent to turn his neck towards a given point. It    receives a global position 'pos' on the field as well as a primary action    command 'soc' that will be executed by the agent at the end of the current    cycle and returns a turn neck command that will turn the agent's neck    towards 'pos'. To this end the agent's global position and neck direction    after executing the cmd command are predicted using methods from the world    model. The global angle between the given position and the predicted    position is then determined after which the predicted neck direction is    subtracted from this angle in order to make it relative to the agent's    neck. Finally, the resulting angle is normalized and directly passed as an    argument to the turn neck command since the actual angle with which a    player turns his neck is by definition equal to this argument.    If the resulting turn angle causes the absolute angle between    the agent's neck and body to exceed the maximum value, then the agent turns    his neck as far as possible. Note that it is necessary to supply the    selected primary command as an argument to this skill, since a turn neck    command can be executed in the same cycle as a kick, dash, turn , move    or catch command.   \param pos position to which neck should be turned   \param soc SoccerCommand that is executed in the same cycle   \return SoccerCommand turn command to turn neck to the desired point */SoccerCommand BasicPlayer::turnNeckToPoint(VecPosition pos, SoccerCommand soc){  VecPosition posMe,   velMe;  AngDeg      angBody, angNeck, angActual;  Stamina     sta;  // predict agent information after command 'soc' is performed  // calculate the desired global angle of the neck  // calculate the desired angle of the neck relative to the body  WM->predictAgentStateAfterCommand(soc,&posMe,&velMe,&angBody,&angNeck,&sta);  AngDeg angDesGlobNeck   = (pos - posMe).getDirection();  AngDeg angNeckRelToBody = VecPosition::normalizeAngle(angDesGlobNeck-angBody);  // calculate the current angle of the body relative to the neck  // check if the desired neck angle relative to the body is possible:  // if angle is smaller than the minimum or larger than the maximum neck angle  //  turn neck to the minimum or maximum neck angle + the current neck angle  // else calculate the desired angle relative to the body  AngDeg angBodyRelToNeck = VecPosition::normalizeAngle(angBody-angNeck);  if( angNeckRelToBody < SS->getMinNeckAng() )    angActual = SS->getMinNeckAng() + angBodyRelToNeck;  else if( angNeckRelToBody > SS->getMaxNeckAng() )    angActual = SS->getMaxNeckAng() + angBodyRelToNeck;  else    angActual = angNeckRelToBody + angBodyRelToNeck;  return SoccerCommand( CMD_TURNNECK, angActual );}/*! This skill enables an agent to search for the ball when he cannot see it.    It returns a turn command that causes the agent to turn his body by an    angle that equals the width of his current view cone (denoted by the    ViewAngle attribute in the AgentObject class). In this way the agent will    see an entirely different part of the field after the turn which maximizes    the chance that he will see the ball in the next cycle. Note that the    agent turns towards the direction in which the ball was last observed to    avoid turning back and forth without ever seeing the ball. Furthermore    the inertia moment of the agent is taken into account to compensate for    the current speed of the agent.    \return SoccerCommand that searches for the ball. */SoccerCommand BasicPlayer::searchBall(){  static Time timeLastSearch;  static int  iSign       = 1;  // calculate maximum turn angle  AngDeg ang = 2*SoccerTypes::getHalfViewAngleValue( WM->getAgentViewAngle() );  ang        = WM->getAngleForTurn( ang - ang/10.0, WM->getAgentSpeed() );  // calculate whether expected ball position is too the left or right of body  // do this by making angle in directon body and back of body and check  // whether estimated ball prediction lies between these two angles  // only change sign when not searched in previous cycles, otherwise could  // turn left, right, left, right and never find ball  AngDeg angBody = WM->getAgentGlobalBodyAngle();  AngDeg angMax  = VecPosition::normalizeAngle( angBody + 180 );  AngDeg angBall = (WM->getBallPos()-                                  WM->getAgentGlobalPosition()).getDirection();  if( WM->getCurrentTime() - timeLastSearch  > 3 )    iSign = isAngInInterval( angBall, angBody, angMax ) ? 1: -1;  timeLastSearch = WM->getCurrentTime();  if( WM->getCurrentTime() == WM->getTimeLastSeeMessage() )    return SoccerCommand( CMD_TURN, iSign * ang );  return SoccerCommand( CMD_TURN, 1 );}/*! This method can be called to create a SoccerCommand that dashes to a point.    This skill enables an agent to dash to a given point. It receives a global    position 'pos' as its only argument and returns a dash command that causes    the agent to come as close to this point as possible. Since the agent can    only move forwards or backwards, the closest point to the target position    that he can reach by dashing is the orthogonal projection of 'pos' onto the    line that extends into the direction of his body (forwards and backwards).    The power that must be supplied to the dash command is computed using the    'getPowerForDash' method which takes the position of 'pos' relative to the    agent as input.    \param pos global position to which the agent wants to dash    \return SoccerCommand dash command to move closer to 'pos' */SoccerCommand BasicPlayer::dashToPoint( VecPosition pos ){  double dDashPower = WM->getPowerForDash(                                 pos - WM->getAgentGlobalPosition(),                                 WM->getAgentGlobalBodyAngle(),                                 WM->getAgentGlobalVelocity(),                                 WM->getAgentEffort()                );  return SoccerCommand( CMD_DASH, dDashPower );}/*! This skill enables an agent to freeze a moving ball, i.e. it returns a kick    command that stops the ball dead at its current position. Since ball    movement in the soccer server is implemented as a vector addition, the ball    will stop in the next cycle when it is kicked in such a way that the    resulting acceleration vector has the same length and opposite direction to    the current ball velocity. The desired speed that should be given to the    ball on the kick thus equals the current ball speed. Furthermore, the    direction of the kick should equal the direction of the current ball    velocity plus 180 degrees. Note that this direction must be made relative    to the agent's global body angle before it can be passed as an argument to    the kick command.    \return SoccerCommand to freeze the ball. */SoccerCommand BasicPlayer::freezeBall( ){  // determine power needed to kick the ball to compensate for current speed  // get opposite direction (current direction + 180) relative to body  // and make the kick command.  double dPower = WM->getKickPowerForSpeed( WM->getBallSpeed() );  if( dPower > SS->getMaxPower() )  {    Log.log( 552, "%d: freeze ball has to much power", WM->getCurrentCycle() );    dPower = (double)SS->getMaxPower();  }  double dAngle = WM->getBallDirection() + 180 - WM->getAgentGlobalBodyAngle();

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
老司机精品视频一区二区三区| 亚洲美女在线一区| 日本大胆欧美人术艺术动态| 欧美高清视频一二三区| 日本不卡的三区四区五区| 日韩一区二区三区三四区视频在线观看| 午夜视频一区二区| 欧美sm美女调教| 国产suv一区二区三区88区| 中文字幕一区二区三区在线播放 | 免费高清在线一区| 26uuu另类欧美| 成人av中文字幕| 亚洲成人自拍一区| 久久尤物电影视频在线观看| 国产99久久久国产精品潘金| 亚洲女人****多毛耸耸8| 欧美午夜影院一区| 激情都市一区二区| 一区二区三区精品| 欧美成人精品3d动漫h| 国产成人免费在线视频| 亚洲综合色在线| 欧美电影免费观看高清完整版在线 | 亚洲国产精品尤物yw在线观看| 91精品国产品国语在线不卡| 国模少妇一区二区三区| 亚洲日本在线a| 欧美一级免费大片| 成人毛片老司机大片| 五月激情六月综合| 国产精品色在线| 欧美一区三区四区| 99视频在线精品| 韩国欧美国产一区| 亚洲综合免费观看高清完整版| 日韩欧美二区三区| 日本韩国欧美一区二区三区| 看电视剧不卡顿的网站| 亚洲另类在线制服丝袜| 精品福利在线导航| 欧美日韩免费不卡视频一区二区三区| 国产精品996| 美腿丝袜在线亚洲一区| 亚洲小说春色综合另类电影| 国产精品女同互慰在线看| 日韩一卡二卡三卡国产欧美| 色一情一乱一乱一91av| 国产精品亚洲成人| 裸体一区二区三区| 午夜激情久久久| 一区二区在线观看视频 | 色一情一乱一乱一91av| 国产高清视频一区| 毛片一区二区三区| 丝袜国产日韩另类美女| 一区二区免费视频| 亚洲人成网站色在线观看| 国产欧美一区在线| 久久嫩草精品久久久久| 欧美一区二区三区免费在线看 | 午夜不卡av在线| 亚洲影院免费观看| 一区二区三区欧美激情| 成人免费小视频| 国产精品美女久久久久久久久| 久久久久久久久久电影| www国产成人| 久久久久久久久久久久电影| 欧美成人在线直播| 欧美成人bangbros| 精品久久久久久久一区二区蜜臀| 欧美一区二区二区| 337p亚洲精品色噜噜| 欧美日韩另类一区| 欧美一区二区三区小说| 欧美大片拔萝卜| 欧美电影精品一区二区| 久久伊人蜜桃av一区二区| 精品国产污网站| 精品91自产拍在线观看一区| 欧美精品一区二区三区视频| 精品国产乱码久久久久久影片| 精品国产三级电影在线观看| 久久免费午夜影院| 中文字幕一区av| 亚洲另类一区二区| 丝袜亚洲另类丝袜在线| 美女看a上一区| 国产精品乡下勾搭老头1| 99国产精品久久久久| 一本色道久久加勒比精品| 欧洲一区在线观看| 91精品在线麻豆| 欧美精品一区二区不卡| 国产精品情趣视频| 亚洲小说欧美激情另类| 久久精品72免费观看| 国产成人啪午夜精品网站男同| 91丝袜美腿高跟国产极品老师 | 91国在线观看| 91精品在线免费| 亚洲国产精品av| 亚洲一区在线免费观看| 免费欧美高清视频| 粉嫩一区二区三区在线看 | 欧美日韩二区三区| 欧美www视频| 日韩美女精品在线| 蜜臀av国产精品久久久久 | 欧美三片在线视频观看 | 成人av电影在线播放| 欧美体内she精视频| 2014亚洲片线观看视频免费| 亚洲美女电影在线| 久久se精品一区精品二区| 99久久久国产精品| 欧美大片日本大片免费观看| 亚洲靠逼com| 国产资源在线一区| 欧美日韩在线精品一区二区三区激情| 欧美sm美女调教| 亚洲午夜在线视频| 国产精品亚洲午夜一区二区三区 | 精品欧美久久久| 亚洲欧美日本韩国| 国产精品996| 日韩一区二区中文字幕| 艳妇臀荡乳欲伦亚洲一区| 国产丶欧美丶日本不卡视频| 欧美精品一二三| 亚洲日本va在线观看| 国内精品写真在线观看| 欧美日韩在线综合| 亚洲欧洲日韩av| 国产美女视频一区| 欧美一级黄色录像| 亚洲电影中文字幕在线观看| 成人av在线网| 久久久久久毛片| 久久成人免费网| 欧美剧情片在线观看| 亚洲精品中文字幕乱码三区 | 天堂成人免费av电影一区| www.99精品| 久久久久久久久久久久久久久99 | 天堂蜜桃91精品| 91在线观看免费视频| 中文字幕不卡在线播放| 捆绑变态av一区二区三区| 欧美日韩国产综合一区二区| 亚洲欧美日韩国产一区二区三区 | 1区2区3区国产精品| 国产精品77777| 久久亚洲一级片| 蜜桃久久久久久| 日韩一区二区三区av| 午夜电影久久久| 欧美日韩免费高清一区色橹橹 | 99re热这里只有精品视频| 国产亚洲欧美一级| 黄色小说综合网站| 精品盗摄一区二区三区| 久久99蜜桃精品| 精品国产乱码久久久久久1区2区 | 99精品欧美一区二区三区综合在线| 欧美精品一区二区蜜臀亚洲| 蜜臀精品久久久久久蜜臀| 日韩一区二区三区四区五区六区| 欧美aaaaaa午夜精品| 精品国精品自拍自在线| 国产乱码精品一区二区三区忘忧草| 久久影院视频免费| 成人免费av网站| 国产精品国产精品国产专区不蜜| 成人毛片老司机大片| 亚洲视频免费观看| 精品视频在线免费看| 午夜电影网亚洲视频| 日韩精品一区二区三区四区 | 99久久精品久久久久久清纯| 亚洲视频在线一区| 在线视频一区二区三| 日韩在线一区二区| 26uuu国产一区二区三区| 成人黄色小视频在线观看| 最新国产成人在线观看| 精品污污网站免费看| 六月丁香婷婷色狠狠久久| 国产午夜精品久久| 在线视频国产一区| 青草国产精品久久久久久| 国产日韩欧美在线一区| 91老师国产黑色丝袜在线| 丝袜诱惑亚洲看片| 国产免费观看久久| 欧美少妇xxx| 国产精品主播直播| 亚洲精选一二三| 精品日韩99亚洲|