⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 middleplan.cpp

📁 2006年世界杯足球赛2D仿真组第16名的源代码。在此代码上随便改改
💻 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 + -