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

📄 robotforage.h

📁 多机器人合作中的动态角色分配仿真算法是多机器人合作领域的一个比较著名的仿真软件
💻 H
字号:
//////////////////////////////////////////////////////////////////////
// MuRoS - Multi Robot Simulator
//
// Luiz Chaimowicz
// GRASP Lab. University of Pennsylvania
// VERLab - DCC - UFMG - Brasil
//
// RobotForage.h: interface for the CRobotForage class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(ROBOTFORAGE_H)
#define ROBOTFORAGE_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "RobotHolonomic.h"

class CRobotForage : public CRobotHolonomic  
{
public:
	DECLARE_SERIAL(CRobotForage)
	
	CRobotForage();
	CRobotForage(double x, double y, double theta, short status, short id, CString name, short levelInfo);
	virtual ~CRobotForage();

	void Serialize(CArchive& archive );
	virtual void Draw(CDC* pDC);
	virtual void Update(CArray<CRobot*, CRobot*> *robots, double simTime, double dt, CBox* box,  CMapPath *mapPath);

	virtual CString GetInfo();
	static void SetItem(short i, CPoint p);
	static CPoint GetItem(short i);
	static void AddItem(CPoint p);
	static short GetNumItems();
	static void DeleteAllItems();

	static void SetArea(CSize a);
	static CSize GetArea();

	static void SerializeStatic(CArchive& ar);
	
	afx_msg LRESULT OnControlMsg(WPARAM wParam, LPARAM lParam);

private:
	void Forage(CArray<CRobot*, CRobot*> *robots, double dt, CMapPath *map, CBox* box, double simTime);
	void Track(CArray<CRobot*, CRobot*> *robots, double dt, CMapPath *map, CBox* box, double simTime);
	BOOL InsertPoint(CPoint p);
	BOOL FoundInList(CPoint p);
	BOOL CloseToPosition(CPoint p, int range);
	CPoint GetNextPoint();

	CArray<CPoint, CPoint> m_itemList;			// array with the items that have been detected
	short m_attached;							// number of the item that is attached to the robot
	short m_levelInfo;							// level of information being used (algorithm)
												// 1-random  2-list 3-comunication 4-divide and conquer(D&C)
	short m_rescuedItems;						// number of retrived items 
	CPoint m_trackPoint;						// current robot destination in the D&C algorithm

	static CSize m_area;						// search area
	static short m_totalRescuedItems;			// total number of retrived items
	static CArray<CPoint, CPoint> m_allItems;	// list with all the items in the environment
};
#endif

⌨️ 快捷键说明

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