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

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

?? attention_to_bma.c

?? 這是bs球隊的仿真2D比賽程序
?? C
字號:
/*Brainstormers 2D (Soccer Simulation League 2D)PUBLIC SOURCE CODE RELEASE 2005Copyright (C) 1998-2005 Neuroinformatics Group,                        University of Osnabrueck, GermanyThis program is free software; you can redistribute it and/ormodify it under the terms of the GNU General Public Licenseas published by the Free Software Foundation; either version 2of 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 ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.*/#include "attention_to_bma.h"#include "intentiontype.h"#include "blackboard.h"#include "ws_info.h"#include "ws_memory.h"#include "../policy/positioning.h"#if 1#define MYLOG_POL(LLL,XXX) LOG_POL(LLL,XXX)//#define MYLOG_DRAW(LLL,XXX) LOG_POL(LLL,<<_2D<<XXX)#else#define MYLOG_POL(LLL,XXX) #define MYLOG_DRAW(LLL,XXX)#endifbool AttentionTo::initialized = false;AttentionTo::AttentionTo() {}bool AttentionTo::get_cmd(Cmd &cmd) {  construct_say_message(cmd);  set_attention_to(cmd);  return true;}void AttentionTo::set_attention_to(Cmd & cmd){  if (cmd.cmd_att.is_cmd_set()){    MYLOG_POL(0, << "ATTENTION TO:  CMD FORM ALREADY SET !!! ");    return;  }  Vector target;  Value speed;  int target_player_number;  // attention of PASS PLAYER  if(Blackboard::get_pass_info(WSinfo::ws->time, speed, target, target_player_number) == true){    if ( target_player_number > 0 ){      MYLOG_POL(0, << "ATTENTION TO: Set attention to pass_receiver "<<target_player_number);      cmd.cmd_att.set_attentionto(target_player_number);    }    return;  } // pass player  int  new_att= 0;  Vector ballholder_pos;  int ballholder;  if(teammate_controls_ball(ballholder, ballholder_pos)){// I do not control the ball myself and a teammate has the ball    if(ballholder >0 && ballholder != WSinfo::me->number)      new_att = ballholder;    MYLOG_POL(0, << "ATTENTION TO: Set attention to ball holder "<<ballholder);  }  // if someone plays a pass, keep attention to him!  PPlayer p= WSinfo::get_teammate_with_newest_pass_info();  if ( p ) {    new_att = p->number;    MYLOG_POL(0, << "ATTENTION TO: Set attention to pass giver "<<new_att);  }  MYLOG_POL(0,<<"ATTENTION TO: Current Attention to is set to player "<< WSinfo::ws->my_attentionto);  if(new_att == 0){// not set yet    PPlayer teammate;#if 1 // debug information only    for(int i=0; i<WSinfo::num_relevant_teammates;i++){      MYLOG_POL(0,<<"ATTENTION 2: list of relevant teammates "<<WSinfo::relevant_teammate[i]);    }#endif    for(int i=0; i<WSinfo::num_relevant_teammates;i++){      if(WSinfo::get_teammate(WSinfo::relevant_teammate[i],teammate)){	MYLOG_POL(0,<<"ATTENTION 2: Checking relevant teammate "		<<teammate->number<<" age "<<teammate->age);	if(new_att == 0 && teammate->age >1){ // not yet found and too old	  new_att = teammate->number;	}	if(teammate->age >3){ // much too old -> emergency set attention	  new_att = teammate->number;	  break;	}      }      else{ // strange: relevant teammate not found -> set attention to	MYLOG_POL(0,<<"ATTENTION 2: Teammate "<<WSinfo::relevant_teammate[i]<<" not found. Set attention");	new_att =WSinfo::relevant_teammate[i];	break; // quit loop      }    }  }  int old_att= WSinfo::ws->my_attentionto;  if (old_att <= 0)    old_att= 0;  if (new_att <= 0)    new_att= 0;  if ( old_att == new_att ) {    MYLOG_POL(0,<<"ATTENTION TO: old attention = new attention: "<<new_att);    return;  }  if ( new_att > 0 ) {#if 0 // ridi: do not check this -> we want to listen to players, that we don' t see currently    PPlayer p= WSinfo::get_teammate_by_number(new_att);    if ( p && p->alive ){ //otherwise attentionto causes (wrong command form) messages#endif      cmd.cmd_att.set_attentionto(new_att);      MYLOG_POL(0,<<"ATTENTION TO: Set Attention to player "<<new_att);      //    }  }  else{ // new_att <= 0;  this should not happen    cmd.cmd_att.set_attentionto_none();    MYLOG_POL(0,<<"ATTENTION TO: set NO attention -> CHECK!!!");  }}void AttentionTo::construct_say_message(Cmd & cmd){  Vector target;  Value speed,dir;  int target_player_number;  // Communication for GOALIE  if (ClientOptions::consider_goalie)   {    if ((WSinfo::ball->age <= 4) && (WSinfo::ws->play_mode == PM_PlayOn))     {      //ball information      cmd.cmd_say.set_ball(WSinfo::ball->pos, WSinfo::ball->vel, WSinfo::ball->age, 4);      return;    }   } // Goalie  // Communication for PASS PLAYER  if(Blackboard::get_pass_info(WSinfo::ws->time, speed, target, target_player_number) == true){    MYLOG_POL(0, << "COMMUNICATION: Blackboard intention is PASS: to "<<target_player_number<<" target pos "	    <<target<<" w. speed "<<speed<<" -> Communicate");    int cycles2go = 0; // communicate for one cycle only    if (Blackboard::pass_intention.immediatePass == false) cycles2go = 1;    Vector ballvel;    ballvel.init_polar(speed,(target - WSinfo::me->pos).arg());    cmd.cmd_say.set_pass(WSinfo::me->pos,ballvel,WSinfo::ws->time + cycles2go);    return;  } // pass info was set  else  {    MYLOG_POL(0,<<"COMMUNICATE: Blackboard contains no pass info. So I do not communicate a pass."<<std::flush);  }  // Communication for PASS PLAYER, WHEN BALL JUST LEFT  if(WSinfo::is_ball_kickable() == false && WSmemory::ball_was_kickable4me_at == WSinfo::ws->time -1){    // I had the ball last time, so communicate where the ball is now    MYLOG_POL(0, << "Communicate: I had the ball last cycle, now I say where it goes ["<<WSinfo::ball->pos+WSinfo::ball->vel<<","<<ServerOptions::ball_decay*WSinfo::ball->vel<<"]");    cmd.cmd_say.set_ball(WSinfo::ball->pos, WSinfo::ball->vel, WSinfo::ball->age, WSinfo::ball->age );  }    // Communication for BALL HOLDER  if(WSinfo::is_ball_pos_valid() && WSinfo::is_ball_kickable()){ // ball is kickable, but no pass info was set    MYLOG_POL(0, << "COMMUNICATE: I have the ball and my Position. Use set me as Ballholder"<<std::flush);    cmd.cmd_say.set_me_as_ball_holder(WSinfo::me->pos);    return;  }  // Communication for PLAYER WO BALL  generate_players4communication(cmd);}#define MAX_SAY_CAPACITY 4 // no more than 4 playersvoid AttentionTo::generate_players4communication(Cmd & cmd_form){  WSpset players4communication;  PPlayer ballholder = WSinfo::teammate_closest2ball();  if(!WSinfo::is_ball_kickable()) {// I do not control the ball myself    // compute my next position    Vector my_next_pos, my_next_vel;    Angle my_next_ang;    Tools::model_player_movement(WSinfo::me->pos,WSinfo::me->vel,WSinfo::me->ang.get_value(),				 cmd_form.cmd_main, my_next_pos, 				 my_next_vel, my_next_ang);    MYLOG_POL(0,<<"I am not holding the ball, so communicate my next position "	    << my_next_pos<<" (current pos "<<WSinfo::me->pos);          //    MYLOG_POL(0,<<_2D<<C2D(my_next_pos.x, my_next_pos.y, 1.1, "grey"));    // construct communication set :    WS::Player next_me = *WSinfo::me;    next_me.pos = my_next_pos;    players4communication.append(&next_me);          if(ballholder !=NULL){      WSpset pset= WSinfo::valid_opponents;      pset.keep_players_with_max_age(1);      float width1 =  1.0 * 2* ((ballholder->pos-WSinfo::me->pos).norm()/2.5);      float width2 = 4; // at ball be  a little smaller      Quadrangle2d check_area = Quadrangle2d(ballholder->pos, WSinfo::me->pos , width1, width2);      LOG_POL(0, <<_2D<<check_area );      pset.keep_players_in(check_area);      //pset.keep_players_in_quadrangle(WSinfo::me->pos, ballholder->pos, 10 ); // players between me and ballholder      pset.keep_and_sort_closest_players_to_point(2,ballholder->pos);          if(pset.num>0){	MYLOG_POL(0,<<"COMMUNICATE: Found Opponents in passway: "<<pset.num<<std::flush);	players4communication.append(pset);      }      pset= WSinfo::valid_opponents;      pset.keep_players_with_max_age(0);      pset.keep_players_in_circle(ballholder->pos,5.); // opponents close 2 me      pset.keep_and_sort_closest_players_to_point(2,ballholder->pos);      if(pset.num>0){	MYLOG_POL(0,<<"COMMUNICATE: Found Opponents close2e ballholder: "<<pset.num<<std::flush);	players4communication.join(pset);      }    }    if(players4communication.num < MAX_SAY_CAPACITY){      WSpset pset= WSinfo::valid_opponents;      pset.keep_players_with_max_age(0);      pset.keep_players_in_circle(my_next_pos,40.); // opponents close 2 me      pset.keep_and_sort_closest_players_to_point(10,my_next_pos);      if(pset.num>0){	MYLOG_POL(0,<<"COMMUNICATE: Found Opponents close2e my next pos: "<<pset.num<<std::flush);	players4communication.join(pset);      }    }    if(players4communication.num < MAX_SAY_CAPACITY){      WSpset pset= WSinfo::valid_teammates_without_me;      pset.keep_players_with_max_age(0);      pset.keep_players_in_circle(my_next_pos,40.); // opponents close 2 me      pset.keep_and_sort_closest_players_to_point(10,my_next_pos);      if(pset.num>0){	MYLOG_POL(0,<<"COMMUNICATE: Found Teammates close2e my next pos: "<<pset.num<<std::flush);	players4communication.join(pset);      }    }  } // ball is not kickable for me and teammate controls the ball  for(int i=0; i<players4communication.num;i++){    MYLOG_POL(0,<<"My communication set "<<i<<" number "	    <<players4communication[i]->number<<" pos "<<players4communication[i]->pos);        MYLOG_POL(0,<<_2D<<C2D(players4communication[i]->pos.x, players4communication[i]->pos.y, 1.3, "magenta"));  }  cmd_form.cmd_say.set_players( players4communication );}bool AttentionTo::teammate_controls_ball(int &number, Vector & pos){  number = 0; // default  if(WSinfo::is_ball_kickable() != false){// I control the ball myself!    return false;  }  int steps2go;  Vector ipos;      WSpset teammates = WSinfo::valid_teammates_without_me;  InterceptResult ires[1];  teammates.keep_and_sort_best_interceptors_with_intercept_behavior_to_WSinfoBallPos            ( 1, ires );  if (teammates.num > 0 && ires[0].time <= 2)  {    number = teammates[0]->number;    pos    = teammates[0]->pos;    MYLOG_POL(2,<<"AttentionTo: /EXPENSIVE INTERCEPT/ To my way of thinking, the fastest intercepting teammate, to whom I ought to pay attention, is #"<<number<<", standing at "<<pos);    return true;  }  PPlayer teammate=Tools::get_our_fastest_player2ball(ipos, steps2go);  if(steps2go <= 2 && teammate && teammate != WSinfo::me){ // check: steps2go <= 1 oder steps2go <= 2 besser?    number=teammate->number;    pos = teammate->pos;    MYLOG_POL(2,<<"AttentionTo: /CHEAP INTERCEPT/ To my way of thinking, the fastest intercepting teammate, to whom I ought to pay attention, is #"<<number<<", standing at "<<pos);    return true;  }  return false;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品美女久久久久av爽李琼| 樱花草国产18久久久久| 国产精品美女久久福利网站| 亚洲一区在线观看免费| 国产精品18久久久久久vr| 色94色欧美sute亚洲13| 国产清纯在线一区二区www| 五月综合激情日本mⅴ| 91蝌蚪国产九色| 亚洲乱码国产乱码精品精的特点 | 国产一区二区三区四区五区入口| 91天堂素人约啪| 国产日产欧美一区二区三区 | 亚洲激情男女视频| 国产经典欧美精品| 久久综合一区二区| 日本sm残虐另类| 555夜色666亚洲国产免| 亚洲精品老司机| 一本一道综合狠狠老| 欧美国产视频在线| 成人av在线影院| 中文字幕欧美日本乱码一线二线| 韩国一区二区三区| 欧美成人精品高清在线播放| 日韩一区精品字幕| 欧美精品久久99久久在免费线 | 久久久久久久网| 国产乱码精品一区二区三区忘忧草| 日韩一二在线观看| 青青草97国产精品免费观看| 91精品国产丝袜白色高跟鞋| 日本在线不卡一区| 91麻豆精品国产91久久久久| 日精品一区二区| 日韩欧美电影一二三| 美女视频黄频大全不卡视频在线播放| 91麻豆精品国产91久久久使用方法| 午夜a成v人精品| 精品奇米国产一区二区三区| 狠狠v欧美v日韩v亚洲ⅴ| 久久久久97国产精华液好用吗| 国产精品99久久久久久有的能看| 久久精子c满五个校花| 成人午夜电影久久影院| 亚洲欧洲国产专区| 欧美视频完全免费看| 午夜久久久久久久久| 日韩免费电影一区| 风流少妇一区二区| 亚洲最大色网站| 91精品国产综合久久精品| 蜜臀av一区二区| 久久久不卡影院| 91视频观看视频| 日日摸夜夜添夜夜添精品视频 | 99久久久免费精品国产一区二区 | 91免费在线视频观看| 亚洲精品乱码久久久久久久久| 欧美日韩国产小视频| 乱一区二区av| 亚洲日本青草视频在线怡红院| 欧美日韩中字一区| 国产精品一区在线观看乱码| 樱花草国产18久久久久| 日韩欧美视频一区| 色综合天天狠狠| 日本欧美韩国一区三区| 国产精品不卡一区| 91精品国产一区二区三区蜜臀| 国产成人一区在线| 日欧美一区二区| 国产精品久久久久久久久久免费看| 在线视频欧美精品| 国产精品一区一区| 婷婷六月综合网| 国产精品丝袜91| 91麻豆精品国产91久久久| 成人av手机在线观看| 久久99久久99| 香蕉久久夜色精品国产使用方法 | 性久久久久久久| 成人欧美一区二区三区视频网页 | 国产高清视频一区| 天天操天天色综合| 国产精品蜜臀av| 久久青草欧美一区二区三区| 在线不卡一区二区| 欧美亚洲一区二区三区四区| 国产91精品一区二区麻豆亚洲| 日本不卡免费在线视频| 一区二区久久久| 国产精品成人一区二区艾草 | 99国产精品视频免费观看| 久久99精品久久久久久动态图| 亚洲国产精品影院| 亚洲免费看黄网站| 自拍偷拍亚洲欧美日韩| 久久夜色精品国产噜噜av| 日韩一区二区三区在线视频| 在线观看一区不卡| 日本乱人伦一区| 91老师国产黑色丝袜在线| 不卡电影一区二区三区| 成人免费毛片嘿嘿连载视频| 国产寡妇亲子伦一区二区| 黄页网站大全一区二区| 国产一区二区免费看| 久久国产精品72免费观看| 久久99在线观看| 久久99精品久久久| 国产乱码字幕精品高清av| 国产剧情一区二区| 国产高清不卡一区| 成人激情小说乱人伦| 北岛玲一区二区三区四区| 懂色一区二区三区免费观看| 国产成人自拍网| av电影在线观看完整版一区二区| 91在线观看地址| 欧美偷拍一区二区| 欧美一区二区成人| 久久先锋影音av鲁色资源| 国产午夜精品在线观看| 国产精品久久久久永久免费观看| 亚洲国产激情av| 国产精品久久久久影视| 一区二区三区免费观看| 亚洲成人三级小说| 久久精品免费看| 成人午夜av影视| 欧美亚洲一区二区在线观看| 欧美一区二区三区的| 国产婷婷色一区二区三区四区| 综合久久一区二区三区| 亚洲r级在线视频| 国产乱一区二区| 色噜噜狠狠色综合中国| 欧美日韩精品电影| 精品国产精品一区二区夜夜嗨| 久久久精品人体av艺术| 亚洲女爱视频在线| 蜜臀av国产精品久久久久| 成人爽a毛片一区二区免费| 色婷婷精品久久二区二区蜜臀av| 欧美日本国产一区| 中文字幕二三区不卡| 亚洲午夜电影在线观看| 久久 天天综合| 色狠狠色狠狠综合| 日韩欧美激情在线| 亚洲男帅同性gay1069| 免费观看91视频大全| 91一区二区三区在线播放| 欧美一区二区三区在| 国产精品欧美久久久久无广告| 亚洲综合一区在线| 国产高清久久久| 欧美日本不卡视频| 中文字幕中文字幕一区二区| 日欧美一区二区| 99久久婷婷国产综合精品电影| 欧美一级高清片| 一区二区三区日本| 成人午夜av电影| 久久综合九色综合欧美亚洲| 亚洲一区影音先锋| 91丨porny丨国产| 国产日韩欧美精品综合| 免费看日韩精品| 在线观看一区二区精品视频| 中文天堂在线一区| 极品美女销魂一区二区三区| 欧美在线啊v一区| 亚洲欧洲三级电影| 国产精品99久久久久久有的能看 | 1024成人网| 国产精品资源在线观看| 日韩欧美一二三| 日韩电影在线免费看| 91麻豆国产精品久久| 中文在线资源观看网站视频免费不卡 | 欧美日韩一区不卡| 日韩理论电影院| 成人午夜av影视| 日本一二三不卡| 成人午夜在线免费| 国产欧美日韩精品一区| 国产一区 二区 三区一级| 日韩免费观看高清完整版在线观看| 亚洲成人av一区| 欧美精品久久99| 午夜欧美2019年伦理| 欧美日韩一级视频| 亚洲一二三区不卡| 欧美日本国产视频| 美女一区二区久久| 欧美tickle裸体挠脚心vk| 黄页网站大全一区二区| 久久久精品人体av艺术|