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

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

?? brianteam.java

?? 一個多機器人的仿真平臺
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package Domains.SoccerBots.teams;/* * BrianTeam.java */import   EDU.gatech.cc.is.util.Vec2;import   EDU.gatech.cc.is.abstractrobot.*;import java.lang.Math;/** * Homogeneous team written by Brian McNamara *  * @author  Brian McNamara (lorgon@cc.gatech.edu) * @version $Revision: 1.1 $ *//*Here's a plausible strategy I'd like to implement:havetheball: am "behind" the ball and very near itclear: within kicking distance and no robots lie along pathopen: no opponent robot within x distancedefense/offense: which side has ball, if unclear, say defenseif( i have the ball ) then   if( clear shot ) then      shoot   else if( i am open ) then      dribble towards goal   else if( closest teammate is open && clear pass ) then      pass to him   else      ???   endifelse   if( i am closest to ball ) then      go to "behind" ball (avoid bumping it backwards)   else      if( i am closest to ourgoal ) then         go to point between ball and ourgoal nearest ourgoal      else if( on defense )         mark a man (go to nearest open opponent)      else         get open (move away from nearest opponent)      endif   endifendif*/public class BrianTeam extends ControlSystemSS{   double GOAL_WIDTH =  0.42; //?   double BALL_RADIUS = 0.01; //?   /**   Configure the control system.  This method is   called once at initialization time.  You can use it   to do whatever you like.   */   public void Configure()   {      // not used in this example.   }         public static final double ROBOT_RADIUS = 0.06; // should refer to                     // actual value, but is hardcoded for convenience   static String coor( Vec2 v )   // returns string like "(1.2, 2.0)"   {       String x = String.valueOf(v.x);      String y = String.valueOf(v.y);      return "("+x.substring(0,x.indexOf('.')+2)+","+                 y.substring(0,y.indexOf('.')+2)+")";    }   String my_name()   {      return names[(int)my_id()];   }   public long my_id()   {      return abstract_robot.getID();   }   // Used for debugging   boolean debug_reminders[] = new boolean[ Debugger.MAX ];   static long who_closest_to_ball=0;   static long who_closest_to_ourgoal=0;   static final String names[] = { "","","","","","",                                       "orange", "red   ",                                        "yellow", "purple", "white " };   static final boolean       DEBUG_CLOSEST_TO_OUR_GOAL = false,       DEBUG_CLOSEST_TO_BALL     = false,       DEBUG_STATE               = false,       DEBUG_AROUND              = false,       dummy                     = false;   static final int       SHOOT     = 0,      DRIBBLE   = 1,      RUN       = 2,      DEFEND    = 3,      OPEN_OPP  = 4,      OPEN_TEAM = 5,      OPEN_BALL = 6,      CLEAR     = 7,      foo       = -1;   static final String state_messages[] = {      " is going to shoot!",      " is dribbiling toward the goal.",      " is running toward the ball.",      " is defending the goal.",      " is trying to get open, away from opponent.",      " is trying to get open, away from teammate.",      " is trying to get open, toward the ball.",      " is trying to clear the ball.",      "" };   int current_state=0;   void set_state( int new_state )   {      if( DEBUG_STATE )      {         if( new_state != current_state )         {            current_state = new_state;            System.out.println( my_name() + state_messages[ new_state ]);         }      }   }   void debug()   {      long my_id = my_id();      if( DEBUG_CLOSEST_TO_OUR_GOAL )      {         if( i_am_closest_to( ourgoal ) )         {            if( who_closest_to_ourgoal != my_id )            {               who_closest_to_ourgoal = my_id;               System.out.println( "Robot " + names[(int)my_id] +                   " at " + coor( me ) +                  " is closest to our goal at " + coor( ourgoal ) );            }         }      }         if( DEBUG_CLOSEST_TO_BALL )      {         if( i_am_closest_to( ball ) )         {            if( who_closest_to_ball != my_id )            {               who_closest_to_ball = my_id;               System.out.println( "Robot " + names[(int)my_id] +                   " at " + coor( me ) +                  " is closest to ball at " + coor( ball ) );            }         }      }   //      new Debugger( this, Debugger.TOP_HALF_OF_FIELD );//      new Debugger( this, Debugger.CLOSEST_TO_BALL );//      new Debugger( this, Debugger.HAS_THE_BALL );//      new Debugger( this, Debugger.CLOSE_TO_THE_BALL );//      new Debugger( this, Debugger.BEHIND_THE_BALL );//      new Debugger( this, Debugger.HAS_CLEAR_SHOT );//      new Debugger( this, Debugger.IS_OPEN );//      new Debugger( this, Debugger.IN_GOALBOX, true );   }   // instance variables for convenience across modules   long curr_time;   Vec2 me, ball, ourgoal, theirgoal;   Vec2 ego_ball, ego_ourgoal, ego_theirgoal;   Vec2 ego_teammates[], ego_opponents[];   /**   Find the closest opponent, return ego vector to him   */   Vec2 closest_opponent()   {      Vec2 closestopponent = new Vec2( -99999, 0 );      for (int i=0; i< ego_opponents.length; i++)      {         if (ego_opponents[i].r < closestopponent.r)            closestopponent = ego_opponents[i];      }      return closestopponent;   }   /**   Find the closest teammate, return ego vector to him   */   Vec2 closest_teammate()   {      Vec2 closestteammate = new Vec2( -99999, 0 );      for (int i=0; i< ego_teammates.length; i++)      {         if (ego_teammates[i].r < closestteammate.r)            closestteammate = ego_teammates[i];      }      return closestteammate;   }   boolean i_am_closest_to_the_ball()   {      return i_am_closest_to( ball );   }   /**   Returns true if I am the closest of my ego_teammates to a given location   */   boolean i_am_closest_to( Vec2 something )   // should probably be rewritten to use common functions   {      double my_dist, their_dist;      Vec2 temp;      Vec2[] ego_teammates = abstract_robot.getTeammates(curr_time);      for (int i=0; i< ego_teammates.length; i++)      {         temp = new Vec2( ego_teammates[i].x, ego_teammates[i].y );         temp.add( me );         temp.sub( something );         their_dist = temp.r;         temp = abstract_robot.getPosition( curr_time );         temp = new Vec2( temp.x, temp.y );         temp.sub( something );         my_dist = temp.r;         if( their_dist < my_dist - 0.05 )   // fudge factor            return false;      }      return true;   }      /**   Return a Vec2 whose theta is directed from a to b and whose r is dist(a,b)   */   static Vec2 toward( Vec2 a, Vec2 b )   {      Vec2 temp = new Vec2( b.x, b.y );      temp.sub( a );      return temp;   }      void setInstanceVars()   {      // get the current time for timestamps      curr_time = abstract_robot.getTime();      // get a list of the positions of our ego_teammates      ego_teammates = abstract_robot.getTeammates(curr_time);      ego_opponents = abstract_robot.getOpponents(curr_time);//should create non-egos, too      me = abstract_robot.getPosition(curr_time);      ego_ball = abstract_robot.getBall(curr_time);      ball = new Vec2( ego_ball.x, ego_ball.y );      ball.add( me );      ego_ourgoal = abstract_robot.getOurGoal(curr_time);      ourgoal = new Vec2( ego_ourgoal.x, ego_ourgoal.y );      ourgoal.add( me );      ego_theirgoal = abstract_robot.getOpponentsGoal(curr_time);      theirgoal = new Vec2( ego_theirgoal.x, ego_theirgoal.y );      theirgoal.add( me );   }   /**   Called every timestep to allow the control system to   run.   */   public int TakeStep()   {      // the eventual movement command is placed here      Vec2   result;      Vec2 closestteammate = new Vec2();      setInstanceVars();      debug();      boolean kick_ball = false;      result = toward( me, ball );if( false ){   result = new Vec2( GOAL_X, -0.4 );   result = toward( me, result );}else{      if( i_have_the_ball() )      {         if( i_have_a_clear_shot() && toward(me,ego_theirgoal).r < 0.3 ) // reasonable shooting distance         {            kick_ball = true;            result = toward( me, ball );  // dribble toward goalset_state( SHOOT );         }         else if( i_am_in_my_goalbox() )         {            kick_ball = true;            result = toward( me, ball );  // dribble toward goalset_state( CLEAR );         }   // out since open() fails...//         else if( open( me, true ) ) // if i am open//         {//            result = toward( me, ball );  // dribble toward goal//         }//         else if( closest teammate is open && clear pass ) then//            pass to him         else // dunno a good strategy         {            result = toward( me, ball );  // dribble toward goalset_state( DRIBBLE );         }      }      else      {         if( i_am_closest_to( ball ) )         {            result = new Vec2( 1.0, 0 );            result.sett( toward_behind_ball() );set_state( RUN );         }         else if( i_am_closest_to( ourgoal ) &&                   ((me.x > 0)==i_am_on_west_team()) )         {            result = new Vec2( 0, 0 );                     result = toward( me, result );// play goalie//            result = new Vec2( 1.0, 0 );//            result.sett( defend_goal() );//set_state( DEFEND );         }//         else if( on defense )//            mark a man (go to nearest open opponent)         else         {            //get open (move away from nearest opponent)            result = closest_opponent();            if( result.r < 2*ROBOT_RADIUS )            {               result.sett( result.t + Math.PI );set_state( OPEN_OPP );            }            else            {               result = closest_teammate();               if( result.r < 4*ROBOT_RADIUS )               {                  result.sett( result.t + Math.PI );set_state( OPEN_TEAM );               }               else               {                  result = toward( me, ball );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美色综合网站| 精品视频1区2区| 免费成人在线网站| 日本中文字幕一区二区有限公司| 亚洲精品一卡二卡| 亚洲综合在线视频| 一区二区三区四区乱视频| 亚洲三级免费电影| 亚洲综合激情另类小说区| 亚洲电影在线播放| 日本aⅴ免费视频一区二区三区| 日韩成人伦理电影在线观看| 日本三级亚洲精品| 国产精品一级黄| 不卡的电影网站| 在线中文字幕不卡| 欧美一区二区三区啪啪| 久久奇米777| 亚洲人成亚洲人成在线观看图片| 亚洲柠檬福利资源导航| 日韩国产欧美视频| 国产精品2024| 色综合中文综合网| 91精品在线一区二区| 在线播放国产精品二区一二区四区| 欧美丰满嫩嫩电影| 国产亚洲一二三区| 一区二区三区欧美日| 青草国产精品久久久久久| 国模大尺度一区二区三区| 99久久国产综合精品色伊| 欧美日韩一卡二卡三卡| www国产亚洲精品久久麻豆| 中文字幕日韩av资源站| 日韩专区一卡二卡| av不卡免费在线观看| 51精品国自产在线| 亚洲桃色在线一区| 激情av综合网| 欧美日韩一级大片网址| 国产日产欧美一区| 天天操天天综合网| 欧美性色综合网| 欧美一区二区在线看| 亚洲天天做日日做天天谢日日欢| 香蕉影视欧美成人| 成人av综合一区| 日韩亚洲欧美一区二区三区| 成人免费在线播放视频| 蜜桃视频一区二区三区在线观看| 91在线看国产| 国产欧美一区二区三区鸳鸯浴| 亚洲成a人片在线不卡一二三区| 黄色小说综合网站| 91精品国产色综合久久不卡蜜臀| 亚洲乱码中文字幕综合| 不卡电影一区二区三区| 久久精品夜色噜噜亚洲a∨ | 欧美一级二级三级乱码| 亚洲线精品一区二区三区| 91美女片黄在线观看91美女| 国产午夜精品一区二区三区视频| 亚洲风情在线资源站| 色婷婷综合久久久久中文| 最新国产成人在线观看| a亚洲天堂av| 国产精品人人做人人爽人人添| 精品一区二区三区久久| 日韩视频一区二区| 久久精品国产亚洲5555| 6080午夜不卡| 捆绑紧缚一区二区三区视频| 欧美视频第二页| 亚洲精品国产无天堂网2021| 91亚洲国产成人精品一区二三| 久久九九99视频| 国产高清无密码一区二区三区| 久久综合国产精品| 国产精品一区二区不卡| 国产欧美一区二区精品性色| 国产一区二区三区精品视频| 国产精品国产自产拍高清av王其| 国产在线观看免费一区| 国产无人区一区二区三区| 国产精品一级黄| 亚洲同性gay激情无套| 欧美最新大片在线看 | 麻豆免费看一区二区三区| 69堂精品视频| 国内成+人亚洲+欧美+综合在线| 2欧美一区二区三区在线观看视频| 国内一区二区视频| 中文字幕国产一区二区| 91福利国产成人精品照片| 日韩激情视频网站| www国产精品av| 99久久免费国产| 日本特黄久久久高潮| 国产亚洲午夜高清国产拍精品| av在线播放一区二区三区| 亚洲女人小视频在线观看| 日韩欧美高清一区| 成人avav影音| 天天色综合天天| 欧美国产精品一区二区| 欧美在线综合视频| 国产一区美女在线| 综合激情成人伊人| 日韩三级电影网址| 成人av网站大全| 麻豆国产欧美一区二区三区| 国产精品灌醉下药二区| 精品国产乱码91久久久久久网站| 99久久精品99国产精品 | 国产精品久久久久永久免费观看 | 欧美成人午夜电影| 91九色最新地址| 国产精品1区2区3区在线观看| 亚洲少妇屁股交4| 欧美xxxx老人做受| 91黄视频在线| 成人黄页在线观看| 精品午夜一区二区三区在线观看| 亚洲男人电影天堂| 国产三区在线成人av| 欧美一卡2卡三卡4卡5免费| 99精品视频在线免费观看| 激情伊人五月天久久综合| 一区二区三区不卡在线观看| 精品国产免费人成电影在线观看四季| 91小视频免费观看| 成人综合婷婷国产精品久久蜜臀 | 国产精品主播直播| 奇米在线7777在线精品| 一区二区三区在线免费| 中文字幕巨乱亚洲| 精品久久久久久无| 宅男噜噜噜66一区二区66| 在线精品观看国产| 在线免费观看日韩欧美| av一二三不卡影片| 成人综合在线视频| 成人听书哪个软件好| 国产一区在线视频| 激情综合色综合久久综合| 青草国产精品久久久久久| 日本午夜一本久久久综合| 日韩成人午夜电影| 男人操女人的视频在线观看欧美| 亚洲大片精品永久免费| 亚洲国产人成综合网站| 亚洲男人的天堂一区二区| 亚洲私人黄色宅男| 亚洲欧美日韩人成在线播放| 亚洲精品自拍动漫在线| 亚洲一区二区在线播放相泽| 亚洲精品免费在线观看| 一区二区日韩电影| 午夜精品一区在线观看| 青青青爽久久午夜综合久久午夜| 午夜亚洲国产au精品一区二区| 亚洲午夜久久久久久久久电影网| 亚洲综合色婷婷| 日韩av一级片| 国产一区在线观看视频| 国产不卡视频在线播放| av一区二区久久| 欧美日韩五月天| 精品精品国产高清a毛片牛牛| 国产日本欧美一区二区| 亚洲欧美一区二区视频| 一区二区三区日韩| 美洲天堂一区二卡三卡四卡视频| 精品亚洲国产成人av制服丝袜 | 制服.丝袜.亚洲.另类.中文| 精品国产一区二区三区不卡 | 亚洲一区二区欧美激情| 老司机午夜精品| 成人免费观看视频| 欧美亚洲一区二区在线观看| 日韩欧美黄色影院| 欧美激情一区二区| 亚洲午夜电影在线观看| 精品伊人久久久久7777人| 成人一道本在线| 欧美日韩第一区日日骚| 国产日韩欧美综合在线| 亚洲成a人在线观看| 福利一区二区在线观看| 欧美疯狂性受xxxxx喷水图片| 国产精品视频一二| 日韩福利视频导航| 91在线国内视频| 26uuu国产电影一区二区| 一区二区成人在线| 国产传媒欧美日韩成人| 日韩欧美你懂的| 亚洲电影一区二区| 波波电影院一区二区三区| 精品国产免费久久|