?? middleplan.cpp
字號:
/* * Copyright 2002-2005, Mersad Team, Allameh Helli High School (NODET). * * This program is free software, you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * * This file is created by: Sassan Haradji * * Released on Monday 1 August 2005, 10 Mordad 1384 by Mersad RoboCup Team. * For more information please read README file.*/#include <BasicDash.h>#include <AdvancedAgent.h>#include <MiddlePlan.h>#include <DribblePlan.h>#include <SRPDribblePlan.h>#include <InterceptPlan.h>#include <OffensePosPlan.h>#include <PassPlan.h>#include <Basics.h>#include <Logger.h>#include <cassert>using namespace std;using namespace Basics;MiddlePlan::MiddlePlan(const WorldModel *wm, Form &form, const Library &library): Plan("Middle", wm, form, library){}MiddlePlan::~MiddlePlan(){}void MiddlePlan::decide(){ LOG << "MiddlePlan::decide" << endl; Plan::decide(); if (wm->isBallKickable()) {/* startPlan(bestPlan(2, true, new DribblePlan(wm, form, library), new SRPDribblePlan(wm, form, library)), .3);*/ startPlan(new DribblePlan(wm, form, library), 0.3); // Ahmad2005 startPlan(new PassPlan(wm, form, library, BPM_ALL, BPN_ALL, -90, +90, -90, +90), .3);/* startPlan(bestPlan(2, true, new DribblePlan(wm, form, library), new SRPDribblePlan(wm, form, library)), .25);*/ startPlan(new DribblePlan(wm, form, library), 0.25); // Ahmad2005 LOG << "Middle Plan WARNING!!! : " << "All WithBall Plans Finished Without Return Any Command." << endl; LOG << "Middle Plan : " << "Now Run Dribble Plan Without Check SuccessRate or isFinished" << "(Urgent State)." << endl; DribblePlan dribblePlan(wm, form, library); dribblePlan.decide(); } else { if (library.gwSelection == WOBS_INTERCEPT) startPlan(new InterceptPlan(wm, form, library)); startPlan(new OffensePosPlan(wm, form, library)); } LOG << "MiddlePlan Now Kill Program" << endl; assert(0);}double MiddlePlan::successRate(){ return 1.0;}bool MiddlePlan::isFinished(){// if(isInPlayers(wm->getBody().getUniNum(), "234AB") &&// wm->getBall().getPos().getX() < wm->getOppDefenseMedium().x - 20)// return false; return true;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -