middleplan.cpp

来自「IRAN mesard_2d 2005源代码」· C++ 代码 · 共 96 行

CPP
96
字号
/* *  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 + =
减小字号Ctrl + -
显示快捷键?