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

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

?? player.c

?? uva trilearn的robocup源程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*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 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'/*!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;  // 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. */void Player::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( 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  printf("Shutting down player %d\n", WM->getPlayerNumber() );  printf("   Number of holes: %d (%f)\n", WM->iNrHoles,                         ((double)WM->iNrHoles/WM->getCurrentCycle())*100 );  printf("   Teammates seen: %d (%f)\n", WM->iNrTeammatesSeen,                         ((double)WM->iNrTeammatesSeen/WM->getCurrentCycle()) );  printf("   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();}    /*! This is the main decision loop for a defender. */void Player::defenderMainLoop( ){  deMeer5() ;}/*! This is the main decision loop for a midfielder. */void Player::midfielderMainLoop( ){  deMeer5() ;}/*! This is the main decision loop for an agent. */void Player::attackerMainLoop( ){  deMeer5();}/*!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 );  if( WM->isBeforeKickOff( ) )  {    if( formations->getFormation() != FT_INITIAL || // not in kick_off formation        posAgent.getDistanceTo( WM->getStrategicPosition() ) > 2.0 )      {      formations->setFormation( FT_INITIAL );       // go to kick_off formation      ACT->putCommandInQueue( teleportToPos( WM->getStrategicPosition() ) );    }    else                                            // else turn to center    {      ACT->putCommandInQueue( turnBodyToPoint( VecPosition( 0, 0 ), 0 ) );      ACT->putCommandInQueue( alignNeckWithBody( ) );    }    return;  }  if( WM->getConfidence( OBJECT_BALL ) < PS->getBallConfThr() )  {                                                // confidence ball too  low    ACT->putCommandInQueue( searchBall() );        // search ball    ACT->putCommandInQueue( alignNeckWithBody( ) );  }  else if( WM->getPlayMode() == PM_PLAY_ON || WM->isFreeKickThem() ||           WM->isCornerKickThem() )                 {    if( WM->isBallCatchable() )    {      ACT->putCommandInQueue( soc = catchBall() );      ACT->putCommandInQueue( turnNeckToObject( OBJECT_BALL, soc ) );    }     else if( WM->isBallKickable() )    {       soc = kickTo( VecPosition(0,posAgent.getY()*2.0), 2.0 );           ACT->putCommandInQueue( soc );       ACT->putCommandInQueue( turnNeckToObject( OBJECT_BALL, soc ) );    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲乱码国产乱码精品精的特点| 欧美国产乱子伦| 高清beeg欧美| 日日夜夜免费精品| 国产精品久久久久久亚洲毛片| 欧美日韩国产大片| 成人av电影在线网| 国产综合成人久久大片91| 亚洲一区二区av在线| 中文字幕在线观看不卡| 精品精品国产高清一毛片一天堂| 欧美亚一区二区| www.视频一区| 国产精品一区二区视频| 99在线精品观看| 天堂成人国产精品一区| 一区二区不卡在线播放| 国产精品美女久久福利网站| 精品毛片乱码1区2区3区| 欧美人与禽zozo性伦| 色婷婷精品大在线视频| av午夜一区麻豆| 国产成人在线免费观看| 激情深爱一区二区| 久久精品999| 日韩电影一区二区三区| 亚洲成av人片一区二区三区| 亚洲精品成人少妇| 亚洲黄色录像片| 亚洲免费观看高清完整版在线 | 精品少妇一区二区| 欧美一级生活片| 在线成人av网站| 欧美日韩国产成人在线91| 欧美日韩在线观看一区二区| 在线亚洲精品福利网址导航| 色综合欧美在线| 91色porny| 色偷偷久久人人79超碰人人澡| 99久久久国产精品免费蜜臀| 99久久国产免费看| 色呦呦国产精品| 色狠狠桃花综合| 欧美日韩在线播| 337p亚洲精品色噜噜| 欧美大胆一级视频| 久久尤物电影视频在线观看| 久久久高清一区二区三区| 国产欧美日韩不卡| 成人欧美一区二区三区黑人麻豆| 亚洲品质自拍视频| 亚洲亚洲人成综合网络| 偷拍亚洲欧洲综合| 美女网站视频久久| 国产激情一区二区三区四区 | 久久综合精品国产一区二区三区| 日韩一级二级三级精品视频| 日韩欧美高清一区| 国产三级欧美三级日产三级99| 欧美国产一区视频在线观看| 中文字幕在线观看不卡视频| 一区二区日韩av| 爽好久久久欧美精品| 极品少妇一区二区| 成人精品视频.| 在线看国产一区| 欧美一级二级三级乱码| 国产清纯白嫩初高生在线观看91| 国产精品理伦片| 亚洲电影激情视频网站| 国产在线看一区| 91欧美激情一区二区三区成人| 欧美手机在线视频| 精品电影一区二区三区| 自拍偷拍欧美激情| 婷婷久久综合九色国产成人 | 国产免费久久精品| 一区二区三区日韩在线观看| 青青青伊人色综合久久| 粉嫩aⅴ一区二区三区四区| 欧美视频中文字幕| 久久久精品一品道一区| 亚洲一二三四久久| 国产精品1024久久| 欧美久久久久久久久久 | 视频一区二区不卡| 成人免费电影视频| 欧美一区二区三区小说| 中文字幕不卡的av| 日av在线不卡| 99re66热这里只有精品3直播| 欧美日韩国产一区| 国产精品私房写真福利视频| 日韩中文字幕区一区有砖一区| 风间由美一区二区av101| 自拍偷拍欧美精品| 久久福利资源站| 欧美性感一类影片在线播放| 国产欧美一区二区精品仙草咪| 丝袜亚洲精品中文字幕一区| 成人高清伦理免费影院在线观看| 91精品久久久久久蜜臀| 亚洲裸体xxx| 国产成人综合亚洲网站| 欧美一区二区视频在线观看| 亚洲日本va午夜在线影院| 国产精品中文字幕一区二区三区| 欧美日韩免费视频| 亚洲欧美偷拍三级| 大胆欧美人体老妇| 久久久亚洲欧洲日产国码αv| 亚洲成人免费电影| 在线中文字幕一区二区| 国产精品欧美经典| 高清国产一区二区三区| 久久综合精品国产一区二区三区| 日本不卡一二三| 欧美日韩一区二区不卡| 亚洲欧美综合色| 国产精品18久久久久久久久| 2023国产精品| 久久99精品久久久| 日韩欧美一级精品久久| 亚洲成av人在线观看| 欧美性生活大片视频| 亚洲色图在线播放| 色综合网站在线| 亚洲免费av网站| 色一情一伦一子一伦一区| 亚洲品质自拍视频| 一本色道亚洲精品aⅴ| 亚洲欧美日韩国产中文在线| www.色综合.com| 最新国产成人在线观看| 91蜜桃免费观看视频| 亚洲欧美乱综合| 在线这里只有精品| 亚洲一卡二卡三卡四卡五卡| 欧美日韩午夜影院| 欧美aⅴ一区二区三区视频| 久久久久久一级片| 69久久夜色精品国产69蝌蚪网| 亚洲成国产人片在线观看| 在线成人免费视频| 麻豆精品蜜桃视频网站| 久久亚洲私人国产精品va媚药| 国产一区欧美一区| 国产精品丝袜一区| 色香色香欲天天天影视综合网| 亚洲综合激情另类小说区| 欧美日免费三级在线| 日韩不卡手机在线v区| 精品伦理精品一区| 成人一级片网址| 一区二区视频免费在线观看| 欧美男人的天堂一二区| 蜜臀av一区二区三区| 国产亚洲精品7777| 91蝌蚪porny| 香蕉久久一区二区不卡无毒影院 | 日韩国产一区二| 国产精品免费丝袜| 日韩午夜激情av| 欧美一区永久视频免费观看| 国产成人av一区二区三区在线观看| 日本中文字幕不卡| 午夜精品久久一牛影视| 日本欧美在线看| 久久精品国产99国产| 久久97超碰色| 一区二区三区自拍| 综合分类小说区另类春色亚洲小说欧美 | 亚洲成人资源在线| 亚洲国产乱码最新视频| 久久超碰97中文字幕| 久久精品国内一区二区三区| 99精品在线观看视频| www.色精品| 粉嫩av一区二区三区| 国产美女娇喘av呻吟久久| 毛片不卡一区二区| 国产精品1024久久| 91免费版pro下载短视频| 99re亚洲国产精品| 亚洲福中文字幕伊人影院| 亚洲日本电影在线| 午夜精品久久久久| 亚洲精品国产无套在线观| 久久蜜桃香蕉精品一区二区三区| 99国产精品一区| 91日韩一区二区三区| 成人v精品蜜桃久久一区| 91蜜桃视频在线| 91精品国产综合久久蜜臀| 国产欧美一区二区在线观看| 亚洲国产经典视频| 亚洲国产综合91精品麻豆| 久久成人精品无人区| 色综合视频在线观看| 日韩一区二区三区av|