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

📄 syncedagent.h

📁 RoboCup 2D 仿真组老牌强队Mersad 2005的完整源代码
💻 H
字号:
/* *  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: Ahmad Boorghany * *  Released on Monday 1 August 2005, 10 Mordad 1384 by Mersad RoboCup Team. *  For more information please read README file.*/#ifndef __SYNCED_AGENT_H#define __SYNCED_AGENT_H#include <BasicAgent.h>#ifndef NULL#	define NULL 0#endif // NULL#define SERVER_TIME_OUT 9990 // ms#define BODY_CYCLE_COMMAND_LATE 7 // cycle#define HEAD_CYCLE_COMMAND_LATE 4 // cycle#define SEE_STEP \		(int)(worldModel->getServerParam()["send_step"].asFloat() * \			  worldModel->getServerParam()["slow_down_factor"].asFloat())#define SENSE_BODY_STEP \		(int)(worldModel->getServerParam()["sense_body_step"].asFloat() * \			  worldModel->getServerParam()["slow_down_factor"].asFloat())#define ZERO_QUICK_LEVEL_MS (0.6 * SENSE_BODY_STEP)class SyncedAgent: public BasicAgent{protected:	int seeReceiveMS;	bool seeReceivedFlag;	bool senseBodyReceivedFlag;	bool quickDecideFlag;	bool bodyCycleCommandSentFlag;	bool headCycleCommandSentFlag;	bool bodyCycleCommandLostFlag;	bool headCycleCommandLostFlag;	virtual void senseBody(const SExpression &exp);	virtual void see(const SExpression &exp);	virtual void hear(const SExpression &exp);	virtual void fullState(const SExpression &exp);	virtual void serverParam(const SExpression &exp);	virtual void playerParam(const SExpression &exp);	virtual void playerType(const SExpression &exp);	virtual void init(const SExpression &exp);	virtual void think(const SExpression &exp);	virtual void changePlayerType(const SExpression &exp);	virtual bool decide();	virtual bool synchronize();		virtual void sayDecide() = 0;	virtual void headDecide() = 0;	virtual void pointToDecide() = 0;	virtual bool bodyDecide(int QuickLevel) = 0;	int getLastSeeReceiveMS() const;	bool isLateForSending() const;	void setSeeReceiveMSAfterSee();	void setSeeReceiveMSAfterSenseBody();	void setSeeReceiveMSAfterChangeView(const Command *command);	void recoverSeeReceiveMSAfterChangeView(const Command *command);	int getQuickLevel();	virtual void logEndInf();	virtual void checkForLosts();	virtual bool isBodyCycleCommandLost() const;	virtual bool isHeadCycleCommandLost() const;	// Getting functions	int getSeeReceiveMS() const;	bool isSeeReceived() const;	bool isSenseBodyReceived() const;	bool isQuickDecide() const;	bool isBodyCycleCommandSent() const;	bool isHeadCycleCommandSent() const;	// Setting functions	void setSeeReceiveMS(int seeReceiveMSArg);	void setSeeReceived(bool seeReceivedFlagArg);	void setSenseBodyReceived(bool senseBodyReceivedFlagArg);	void setQuickDecide(bool quickDecideFlagArg);	void setBodyCycleCommandSent(bool bodyCycleCommandSentFlagArg);	void setHeadCycleCommandSent(bool headCycleCommandSentFlagArg);	void setBodyCycleCommandLost(bool bodyCycleCommandLostFlagArg);	void setHeadCycleCommandLost(bool headCycleCommandLostFlagArg);public:	SyncedAgent(int argc, char **argv);	virtual ~SyncedAgent();	ViewModeWidth getSyncedWide() const;	ViewModeWidth getSyncedNormal() const;	ViewModeWidth getSyncedNarrow() const;};#endif // __SYNCED_AGENT_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -