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

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

?? junteamheterog.java

?? 一個多機器人的仿真平臺
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package Domains.SoccerBots.teams;import EDU.gatech.cc.is.util.Vec2;import EDU.gatech.cc.is.abstractrobot.*;public class JunTeamHeteroG extends ControlSystemSS {    //////////////////////////////////////////////////    // Constants                                    //    //////////////////////////////////////////////////    public static final int MEMORY = 10;    public static final int PLAYERS = 5;    public static final int TEAMMATES = 4;    public static final int UNDEFINED = -1;    public static final int GOALKEEPER = 0;    public static final int CENTER = 1;    public static final int TACKLER = 2;    public static final int DRIBBLER = 3;    public static final int STOPPER = 4;    public static final int DEFENDER = 5;    public static final double INFINITY = 99999;    public static final double EPSILON = 0.01;    public static final double ZERO = 0.0;    public static final double GOALMAX = 0.25;    public static final double DZYMAX = 0.5;    public static final double DZYMIN = -0.5;    public static final double DZXMAX = 1.145;    public static final double DZXMIN = -1.145;    public static final double XMAX = 1.3096740;    public static final double YMAX = 0.6980531;    public static final double XMIN = -1.3096740;    public static final double YMIN = -0.6980531;    public static final int WESTSIDE = -1;    public static final int EASTSIDE = 1;    public static final double MAXSPEED = 1.0;    public static final double HALFSPEED = 0.50;    public static final double STOP = 0.0;    //////////////////////////////////////////////////    // Memory Variables                             //    //////////////////////////////////////////////////    private static int goalkeeper;    private static int center;    private static int tackler;    private static int dribbler;    private static int stopper;    private static int defender;    private static Vec2[][] gplayerlocations;    private static int[][] gplayerpositions;    private static Vec2 gplayerlastlocation;    private static int gplayerlastposition;    private static Vec2[] gballlocations;    private static Vec2 gballlastlocation;    private static int side;    private static String cstrategy;    //////////////////////////////////////////////////    // Sensor Data                                  //    //////////////////////////////////////////////////        private long ctime;    private int mynumber;    private Vec2 gball, eball;    private Vec2 gplayer, eplayer;    private Vec2 gourgoal, eourgoal;     private Vec2 goppgoal, eoppgoal;        private Vec2[] gourteam, eourteam;    private Vec2[] goppteam, eoppteam;    private Vec2 eopponent, gopponent;    private Vec2 eteammate, gteammate;    //////////////////////////////////////////////////    // Actuator Data                                //    //////////////////////////////////////////////////            private boolean attemptkick;    private Vec2 nextmove;    private int nextposition;    /**         Configure the control system. This method is        called once at initialization time. You can         use it to do whatever you like.    */    public void configure() {                ctime = abstract_robot.getTime();        cstrategy = "begin";        goalkeeper = 0;        center = 0;        tackler = 0;        dribbler = 0;        stopper = 0;        defender = 0;        gballlocations = new Vec2[MEMORY];        for (int i = 0; i < MEMORY; i++) {            gballlocations[i] = new Vec2(0, 0);        }                gplayerlocations = new Vec2[PLAYERS][MEMORY];        gplayerpositions = new int[PLAYERS][MEMORY];        for (int i = 0; i < PLAYERS; i++) {            for (int j = 0; j < MEMORY; j++) {                gplayerlocations[i][j] = new Vec2(0, 0);                gplayerpositions[i][j] = UNDEFINED;            }        }                if (abstract_robot.getOurGoal(ctime).x < 0)             side = -1;        else            side = 1;        nextmove = new Vec2(0, 0);    }    /**       Called every timestep to allow the control system to run.    */    public int takeStep() {        updateSensors();        selectStrategy();        updateActuators();               return CSSTAT_OK;    }    /**       Updates sensors.    */    private void updateSensors() {        //////////////////////////////////////////////////        // Sensor Data                                  //        //////////////////////////////////////////////////            ctime = abstract_robot.getTime();        mynumber = abstract_robot.getPlayerNumber(ctime);        eplayer = new Vec2(0,0);        gplayer = abstract_robot.getPosition(ctime);        eball = abstract_robot.getBall(ctime);        gball = new Vec2(0,0);        gball.sett(eball.t);        gball.setr(eball.r);        gball.add(gplayer);        eourgoal = abstract_robot.getOurGoal(ctime);        gourgoal = new Vec2(0,0);        gourgoal.sett(eourgoal.t);        gourgoal.setr(eourgoal.r);        gourgoal.add(gplayer);        eoppgoal = abstract_robot.getOpponentsGoal(ctime);        goppgoal = new Vec2(0,0);        goppgoal.sett(eoppgoal.t);        goppgoal.setr(eoppgoal.r);        goppgoal.add(gplayer);                eourteam = abstract_robot.getTeammates(ctime);        eoppteam = abstract_robot.getOpponents(ctime);                eteammate = closestTeammate();        eopponent = closestOpponent();    }    /**       Selects a strategy to execute. Ideally, would select strategy       based on opponent's history and formation. Didn't have time       to finish.    */   private void selectStrategy() {       // homogeneous();       // heterogeneous();       // kechze();       // schema();       // basicteam();       dteam();       // Wall();       // Horde();   }    /**       Homogeneous strategy.     */    private void homogeneous() {                cstrategy = "homogeneous";        if (closestToOppGoal(gplayer))            playStopper();        else if (neargoalzone(gball) && closestToGoal(gplayer))            playGoalkeeper(false);        else if (neargoalzone(gball) && (goalkeeper > 0) && (defender == 0))            playDefender();        else if (nearcenterzone(gball) && closestToGoal(gplayer))            playGoalkeeper(false);        else if (nearcenterzone(gball) && (goalkeeper > 0) && (defender == 0))            playDefender();        else if (closestToGoal(gplayer))            playGoalkeeper(false);        else if (closestToBall(gplayer))            playDribbler();        else if (closestToCenter(gplayer) && !closestToBall(gplayer) && (goalkeeper > 0))            playCenter();        else            playTackler();    }    private void dteam() {                cstrategy = "dteam";        if (mynumber == 0)            playStopper();        else if (mynumber == 1)            playCenter();        else if (mynumber == 2)            playCenter();        else if (closestToCenter(gplayer) && !closestToBall(gplayer))            playCenter();        else             playDribbler();    }    private void kechze() {        cstrategy = "kechze";        if ((lastPosition() == DRIBBLER) && (!closestToBall(gplayer)) && (dribbler >= 2) && (closestToCenter(gplayer))) {            playCenter();        } else if (lastPosition() == GOALKEEPER) {            playGoalkeeper(false);        } else if (lastPosition() == STOPPER) {            playStopper();        } else if (lastPosition() == DRIBBLER) {            playDribbler();        } else if (lastPosition() == TACKLER) {            playTackler();        } else if ((goalkeeper < 2) && (defzone(gplayer))) {            playGoalkeeper(false);        } else if (stopper == 0) {            playStopper();        } else if (tackler == 0) {            playTackler();        } else {             playCenter();        }    }        //////////////////////////////////////////////////    // Player functions                             //    //////////////////////////////////////////////////    /**       Has player play goalkeeper. Defends our goal.    */    private void playGoalkeeper(boolean dontmove) {             abstract_robot.setDisplayString("Goalkeeper");        nextposition = GOALKEEPER;        if (!closestToGoal(gplayer)) {            playDribbler();        } else if (!defzone(gplayer)) {            nextmove.sett(eourgoal.t);            nextmove.setr(HALFSPEED);        } else if ((defzone(gplayer)) && (!goalzone(gplayer)))  {            nextmove.sett(eourgoal.t);            nextmove.setr(HALFSPEED);        } else if (goalzone(gplayer) && !dontmove) {            nextmove.sety( (eball.y / Math.abs(eball.y)) * 10 );            nextmove.setr(MAXSPEED);        } else if (dontmove) {            nextmove.setr(STOP);        } else {            // Should never end up in this state            System.out.println("ERROR: goalkeeper");        }    }    /**       Has player play defender. Defends our goal.    */    private void playDefender() {               abstract_robot.setDisplayString("Defender");        nextposition = DEFENDER;        if (!neargoalzone(gplayer)) {            nextmove.setx(side * DZXMAX);            nextmove.sety(ZERO);        } else if (((side == WESTSIDE) && (eball.x > 0)) || ((side == EASTSIDE) && (eball.x < 0))) {            nextmove.sett(eball.t);            nextmove.setr(MAXSPEED);            kickBall();        } else if (neargoalzone(gplayer)) {            Vec2 odribbler = closestTo(eoppteam, eball);            Vec2 ogoal = new Vec2(eourgoal.x, eourgoal.y);            ogoal.sub(odribbler);            ogoal.setr(abstract_robot.RADIUS);            ogoal.add(odribbler);                        nextmove.sett(ogoal.t);            nextmove.setr(MAXSPEED);                        if (odribbler != eopponent)                avoidCollision();        } else {            // Should never end up in this state            System.out.println("ERROR: defender");        }    }        /**       Has player play center. Looks for ball in       the center of the field.    */    private void playCenter() {        abstract_robot.setDisplayString("Center");        nextposition = CENTER;        Vec2 centerfield = new Vec2(0, 0);        centerfield = abstract_robot.getPosition(ctime);        if (side == WESTSIDE)            centerfield.setx(centerfield.x + (4 * abstract_robot.RADIUS));        else // EASTSIDE            centerfield.setx(centerfield.x - (4 * abstract_robot.RADIUS));        centerfield.setr(-centerfield.r);                if (closestToBall(gplayer)) {            playDribbler();        } else {            moveBehind(centerfield, eoppgoal);            avoidCollision();        }    }    /**       Has player play tackler. Tries to get in between       opponent and our goal.    */    private void playTackler() {        abstract_robot.setDisplayString("Tackler");        nextposition = TACKLER;        Vec2 odribbler = closestTo(eoppteam, eball);        Vec2 ogoal = new Vec2(eourgoal.x, eourgoal.y);        ogoal.sub(odribbler);        ogoal.setr(abstract_robot.RADIUS);        ogoal.add(odribbler);        nextmove.sett(ogoal.t);        nextmove.setr(MAXSPEED);        if (odribbler != eopponent)            avoidCollision();    }    /**       Has player play dribbler. Tries to move the ball       towards the opponents goal.    */    private void playDribbler() {        abstract_robot.setDisplayString("Dribbler");        nextposition = DRIBBLER;        if (behindBall(eball, eoppgoal) && eball.t < abstract_robot.RADIUS * 4) {            nextmove.sett(eoppgoal.t);            nextmove.setr(MAXSPEED);                        if ((Math.abs(abstract_robot.getSteerHeading(ctime) - eoppgoal.t) < Math.PI / 8) &&                 (eoppgoal.r < abstract_robot.RADIUS * 15) && (!neargoalzone(gplayer) && !nearcenterzone(gplayer))) {                kickBall();            }        } else {            moveBehind(eball, eoppgoal);            avoidCollision();        }    }    /**       Has player play stopper. Tries to prevent opponent       goalkeeper from doing its job.     */    private void playStopper() {        abstract_robot.setDisplayString("Stopper");        nextposition = STOPPER;        // the other team's goalie is whoever is closest to the goal        Vec2 ogoalkeeper = closestTo(eoppteam, eoppgoal);                eoppgoal.sub(ogoalkeeper);        eoppgoal.setr(abstract_robot.RADIUS);        eoppgoal.add(ogoalkeeper);                nextmove.sett(eoppgoal.t);        nextmove.setr(MAXSPEED);                if (ogoalkeeper != eopponent)            avoidCollision();    }    //////////////////////////////////////////////////    // Movement functions                           //    //////////////////////////////////////////////////    /**       Has player move behind ball (or other point) with        respect to some target point.     */    private void moveBehind(Vec2 eball, Vec2 etarget) {        Vec2 behindpoint = new Vec2(0, 0);        double behind = 0;        double pointside = 0;                behindpoint.sett(etarget.t);        behindpoint.setr(etarget.r);                behindpoint.sub(eball);        behindpoint.setr(-abstract_robot.RADIUS * 1.8);                behind = Math.cos(Math.abs(eball.t - behindpoint.t));                pointside = Math.sin(Math.abs(eball.t - behindpoint.t));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品入口麻豆九色| 中文字幕在线不卡国产视频| 91福利视频在线| 成人福利视频网站| 99在线热播精品免费| 国产91对白在线观看九色| 高清在线观看日韩| 不卡av在线网| 欧美私模裸体表演在线观看| 在线一区二区观看| 欧洲另类一二三四区| 欧美日韩在线播放三区| 欧美一区在线视频| 久久麻豆一区二区| 国产精品大尺度| 一区二区成人在线观看| 婷婷丁香久久五月婷婷| 精品一区二区三区在线播放视频| 国产一区二区三区电影在线观看| 成人a区在线观看| 91在线播放网址| 91.成人天堂一区| 精品少妇一区二区三区视频免付费| 国产欧美一区二区三区沐欲| 中文字幕亚洲区| 欧美精品一区视频| 国产亚洲综合性久久久影院| 国产三级一区二区三区| 中文字幕日韩精品一区| 午夜日韩在线电影| 国产精品综合av一区二区国产馆| 色天使久久综合网天天| 欧美成人一区二区三区在线观看 | 久久综合视频网| 最新日韩在线视频| 日本视频免费一区| 色综合欧美在线| 精品国产网站在线观看| 亚洲欧美日韩国产手机在线 | 日韩精品专区在线影院重磅| 国产精品精品国产色婷婷| 日韩精品高清不卡| www.日韩av| 久久久久久亚洲综合影院红桃| 亚洲激情av在线| 狠狠色丁香久久婷婷综合_中| 一本久久a久久精品亚洲| 精品对白一区国产伦| 亚洲电影一级片| 91啪在线观看| 国产日韩欧美在线一区| 视频精品一区二区| 91久久国产综合久久| 国产网红主播福利一区二区| 久久成人免费电影| 欧美日韩和欧美的一区二区| 国产精品女上位| 国产成人精品亚洲日本在线桃色| 7777精品伊人久久久大香线蕉完整版 | 亚洲欧美一区二区不卡| 久久99久久99精品免视看婷婷| 91久久精品一区二区二区| 欧美激情资源网| 久久99深爱久久99精品| 欧美一区二区免费视频| 亚洲第一av色| 欧美视频在线观看一区二区| 亚洲激情六月丁香| 色综合欧美在线| 亚洲欧美区自拍先锋| 92国产精品观看| 国产精品久久久久久久蜜臀 | 亚洲午夜日本在线观看| 91久久久免费一区二区| 亚洲自拍偷拍av| 在线观看视频一区二区| 亚洲综合视频在线观看| 欧美在线一二三| 亚洲一区在线播放| 欧美精品777| 免费黄网站欧美| 精品捆绑美女sm三区| 久久99精品国产91久久来源| 精品美女在线播放| 国产成人精品一区二区三区网站观看| 国产性色一区二区| 97精品国产露脸对白| 最新国产成人在线观看| 欧美怡红院视频| 日本va欧美va瓶| 国产欧美日韩在线看| 91麻豆精品在线观看| 午夜精品影院在线观看| 精品粉嫩aⅴ一区二区三区四区| 国产精品一区二区在线观看网站| 国产精品色婷婷| 在线观看91精品国产入口| 日韩国产在线一| 久久影音资源网| 91久久精品一区二区三区| 免费高清成人在线| 成人免费在线播放视频| 欧美日本高清视频在线观看| 国产一区二区三区四| 亚洲精选免费视频| 日韩精品中文字幕一区| 色综合欧美在线视频区| 精品一区二区综合| 一区二区三区蜜桃| 久久久欧美精品sm网站| 在线欧美日韩国产| 国产又黄又大久久| 亚洲成人在线免费| 国产区在线观看成人精品| 欧美最猛黑人xxxxx猛交| 国产成人在线免费| 日韩不卡免费视频| 亚洲欧美色一区| 久久久久九九视频| 6080亚洲精品一区二区| 岛国精品在线播放| 老司机精品视频导航| 亚洲与欧洲av电影| 国产精品美女www爽爽爽| 91精品国产91久久久久久最新毛片| aaa国产一区| 国产在线精品免费| 美女视频黄 久久| 亚洲福利视频导航| 一区二区三区欧美视频| 国产亚洲精品aa| 日韩精品一区在线| 91精选在线观看| 欧美午夜视频网站| 99久久婷婷国产精品综合| 国产成人精品影院| 国产精一区二区三区| 日韩vs国产vs欧美| 天涯成人国产亚洲精品一区av| 亚洲精选视频免费看| 自拍偷自拍亚洲精品播放| 国产欧美日韩中文久久| 久久亚区不卡日本| 久久综合色综合88| 久久久三级国产网站| 久久综合久久综合久久综合| 精品成人私密视频| 精品国产人成亚洲区| 精品福利一区二区三区 | 成人一区二区三区视频| 国产自产视频一区二区三区| 久久66热偷产精品| 国产伦精品一区二区三区在线观看| 日本不卡在线视频| 日本成人在线网站| 久色婷婷小香蕉久久| 激情久久五月天| 国产裸体歌舞团一区二区| 国产精品一区二区免费不卡| 国产一区二区剧情av在线| 国产精品538一区二区在线| 国产成人综合自拍| 波多野结衣中文字幕一区| 成人av电影免费在线播放| 91色视频在线| 激情综合五月婷婷| 婷婷一区二区三区| 日本中文字幕一区二区视频 | 美女视频网站黄色亚洲| 蜜臀久久久99精品久久久久久| 精品制服美女久久| 国产99久久久精品| 91美女在线视频| 欧美一卡在线观看| 国产视频视频一区| 亚洲精品视频一区| 免费成人在线观看视频| 高清不卡一二三区| 欧美自拍偷拍午夜视频| 欧美不卡在线视频| 亚洲人成网站色在线观看| 日一区二区三区| 国产成人精品免费看| 欧美无砖砖区免费| 精品国产青草久久久久福利| 中文字幕字幕中文在线中不卡视频| 亚州成人在线电影| 国产成a人无v码亚洲福利| 欧美日韩在线电影| 国产婷婷色一区二区三区在线| 亚洲激情中文1区| 九一九一国产精品| 欧美性大战久久久| 国产日韩精品一区二区三区在线| 亚洲成人一区二区| 99精品1区2区| 欧美精品一区二区三区蜜桃视频| 亚洲精品国产成人久久av盗摄| 国模一区二区三区白浆| 欧美在线看片a免费观看|