Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

Decider.h

Go to the documentation of this file.
00001 /***************************************************************** lm-cpr beg
00002  *
00003  * AI Loom - A cross platform artificial intelligence framework
00004  * AI Loom is (c) Copyright 2003 Josh Brown
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public
00017  * License along with this library; if not, write to the
00018  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019  * Boston, MA 02111-1307, USA.
00020  *
00021  * -----------------------------------------------------------------
00022  * File:          $RCSfile: Decider.h,v $
00023  * Date modified: $Date: 2003/10/10 06:07:50 $
00024  * Version:       $Revision: 1.11 $
00025  * -----------------------------------------------------------------
00026  *
00027  ************************************************************** lm-cpr-end */
00028 #ifndef LM_DECIDER_H
00029 #define LM_DECIDER_H
00030 
00031 #include <boost/tuple/tuple.hpp>
00032 #include <list>
00033 
00034 #include "Defs.h"
00035 
00036 namespace lm
00037 {
00038    class Agent;
00039    class Effector;
00040    class Sensor;
00041    
00046    class Decider
00047    {
00048    public:
00049       Decider(Effector* defaultEffect);
00050       Decider();
00051    public:
00052       virtual ~Decider();
00053 
00054       void append(std::list<Effector*> effects);
00055 
00056       void append(std::list<Sensor*> senses);
00060       void add(std::list<Effector*> effects);
00061 
00065       void add(Effector& effect);
00066 
00070       void add(Sensor& sense);
00071 
00075       void add(std::list<Sensor*> senses);
00076 
00077       void setEffectors(std::list<Effector*> effects);
00078       void setSensors(std::list<Sensor*> senses);
00079 
00086       std::list<Effector*> getEffectors();
00087       std::list<Sensor*> getSensors();
00088       
00089       
00090    protected:
00094       std::list<Effector*> mEffectors;
00095 
00101       std::list<Sensor*> mSensors;
00102       
00113       std::list<boost::tuple<bool, Sensor*> > mSensorsResults;
00114 
00115       
00116 
00117    protected:
00122       std::list<boost::tuple<bool, Sensor*> > getSensorsResults();
00123    
00128       Agent* mAgent;
00129    public:
00133       void setAgent(Agent* newAgent);
00134       
00135    public:
00141       void applyDecision(Effector* e, int agentState );
00142 
00147       virtual Effector* makeDecision() = 0;
00148 
00152       Agent* getAgent()
00153       {
00154          return mAgent;
00155       }
00156       
00157    };
00158 }
00159 
00160 #endif
00161          

Generated on Wed Oct 22 21:33:21 2003 for AI Loom by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002