[Gcblue-commits] gcb_wx/include/ai Blackboard.h,NONE,1.1 BlackboardItem.h,NONE,1.1 Brain.h,NONE,1.1
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-02-04 18:50:57
|
Update of /cvsroot/gcblue/gcb_wx/include/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24994/include/ai Added Files: Blackboard.h BlackboardItem.h Brain.h Task.h Log Message: Ground SAM related updates --- NEW FILE: Brain.h --- /** ** @file Brain.h */ /* Copyright (C) 2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB 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 General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _BRAIN_H_ #define _BRAIN_H_ #if _MSC_VER > 1000 #pragma once #endif #include <map> #include <string> #include <vector> #include "ai/Blackboard.h" namespace ai { class Blackboard; class Task { public: std::map<std::string, std::string> textMemory; std::map<int, double> numberMemory; }; /** * Holds */ class Brain { public: Blackboard board; ///< for inter-task communication Brain(); ~Brain(); }; } #endif --- NEW FILE: BlackboardItem.h --- /** ** @file BlackboardItem.h */ /* Copyright (C) 2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB 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 General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _BLACKBOARDITEM_H_ #define _BLACKBOARDITEM_H_ #if _MSC_VER > 1000 #pragma once #endif #include <string> namespace ai { /** * */ class BlackboardItem { public: long author; ///< -1 for invalid, 0 for anonymous double priority; std::string message; bool Valid() const; BlackboardItem& operator=(const BlackboardItem& rhs); BlackboardItem(const BlackboardItem& src); BlackboardItem(long author_, double priority_, const std::string& message_); BlackboardItem(); ~BlackboardItem(); }; } #endif --- NEW FILE: Blackboard.h --- /** ** @file Blackboard.h */ /* Copyright (C) 2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB 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 General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _BLACKBOARD_H_ #define _BLACKBOARD_H_ #if _MSC_VER > 1000 #pragma once #endif #include <map> #include <string> namespace ai { class BlackboardItem; class Blackboard { public: void EraseAll(); void Erase(const std::string& key, double priority); bool KeyExists(const std::string& key) const; BlackboardItem Read(const std::string& key); double ReadPriority(const std::string& key); void Write(const std::string& key, const BlackboardItem& item); void Write(const std::string& key, long author, double priority, const std::string& message); Blackboard(); ~Blackboard(); private: std::map<std::string, BlackboardItem> content; }; } #endif --- NEW FILE: Task.h --- /** ** @file Task.h */ /* Copyright (C) 2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB 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 General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _TASK_H_ #define _TASK_H_ #if _MSC_VER > 1000 #pragma once #endif #include <map> #include <string> #include <vector> namespace ai { class Blackboard; /** * */ class Task { public: std::map<std::string, std::string> textMemory; std::map<int, double> numberMemory; void SetBoard(Blackboard* bb); void SetId(long id_); void SetPriority(double priority_); Task(Blackboard* bb, long id_, double priority_); Task(); ~Task(); private: Blackboard* commBoard; double priority; long id; }; } #endif |