Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Entity.h

Go to the documentation of this file.
00001 /*
00002 Teem - an open source evolutionary software framework
00003 http://lis.epfl.ch/resources/Teem
00004 Stephane Magnenat <stephane.magnenat@epfl.ch>,
00005 Antoine Beyeler <antoine.beyeler@epfl.ch>,
00006 and other contributors. See AUTHORS for details
00007 Laboratory of Intelligent Systems, EPFL, Lausanne
00008 
00009 This program is free software; you can redistribute it and/or modify
00010 it under the terms of the GNU General Public License as published by
00011 the Free Software Foundation; either version 2 of the License, or
00012 (at your option) any later version.
00013 
00014 This program is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 GNU General Public License for more details.
00018 
00019 You should have received a copy of the GNU General Public License
00020 along with this program; if not, write to the Free Software
00021 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00022 */
00023 
00024 #ifndef __TEEM_ENTITY_H
00025 #define __TEEM_ENTITY_H
00026 
00027 #include "EntityInterfaces.h"
00028 #include <an/Types.h>
00029 
00034 namespace Teem
00035 {
00038     class Khepera :
00039         public Entity,
00040         virtual public Positionable,
00041         public DifferentialWheeled,
00042         public IRSensorEquipped,
00043         public Camera1DEquipped
00044     {
00045     protected:
00046         friend class KheperaCreator;
00048         Khepera() { }
00049 
00050     public:
00051         virtual ~Khepera() { }
00052         
00053         // TODO: should be in differentialWheeled, but not implemented in other robots yet
00055         virtual void getEncoders(double &left, double &right) = 0;
00056     };
00057     
00060     class Blimp :
00061         public Entity,
00062         public Camera1DEquipped
00063     {
00064     protected:
00065         friend class BlimpCreator;
00067         Blimp() { }
00068     
00069     public:
00070         virtual ~Blimp() { }
00071         
00073         virtual void setSpeed(double forward, double dir) = 0;
00074         
00076         virtual double getGyro() = 0;
00078         virtual double getAnemo() = 0;
00080         virtual bool getBumper(unsigned index) = 0;
00082         virtual const An::Point &getPosition() = 0;
00083     };
00084     
00087     class Alice :
00088         public Entity,
00089         virtual public Positionable,
00090         public DifferentialWheeled,
00091         public IRSensorEquipped,
00092         public Camera1DEquipped
00093     {
00094     protected:
00095         friend class AliceCreator;
00097         Alice() { }
00098 
00099     public:
00100         virtual ~Alice() { }
00101         
00103         virtual void setTransmitValue(unsigned val) = 0;
00105         virtual void setTransmit(bool enabled) = 0;
00107         virtual bool wasCommunication(void) = 0;
00109         virtual unsigned getSensorId(void) = 0;
00111         virtual unsigned getSensorValue(void) = 0;
00112         
00114         virtual void getSpeed(double &left, double &right) = 0;
00115     };
00116     
00119     class AliceSmallDisk :
00120         public Entity,
00121         virtual public Positionable
00122     {
00123     protected:
00124         friend class AliceSmallDiskCreator;
00126         AliceSmallDisk() { }
00127     };
00128     
00131     class AliceLargeDisk :
00132         public Entity,
00133         virtual public Positionable
00134     {
00135     protected:
00136         friend class AliceLargeDiskCreator;
00138         AliceLargeDisk() { }
00139     };
00140 
00143     class Sbot :
00144         public Entity,
00145         virtual public Positionable,
00146         public DifferentialWheeled
00147     {
00148     protected:
00149         friend class SbotCreator;
00151         Sbot() { }
00152     
00153     public:
00154         virtual ~Sbot() { }
00156         virtual void getCameraAverage(An::Color meanPixels[8]) = 0;
00158         virtual void getCamera(An::Color meanPixels[128]) = 0;
00160         virtual void setRingColor(const An::Color &color) = 0;
00161         
00163         virtual void clearEnergy(void) = 0;
00165         virtual void setEnergy(double energy) = 0;
00167         virtual double getEnergy(void) = 0;
00169         virtual double getDEnergy(void) = 0;
00170         
00172         virtual void setFrequencies(unsigned frequencies) = 0;
00174         virtual unsigned getFrequencies(void) = 0;
00175     };
00176 
00179     class SbotActiveObject :
00180         public Entity,
00181         virtual public Positionable
00182     {
00183     protected:
00184         friend class SbotCreator;
00186         SbotActiveObject() { }
00187 
00188     public:
00189         virtual ~SbotActiveObject() { }
00190         
00192         virtual void setEnergyProperties(double activeDuration, double inactiveDuration, bool consumeEnergy) = 0;
00194         virtual void setEnergyTime(double time) = 0;
00196         virtual void setEnergyFlow(double activeFlow, double inactiveFlow) = 0;
00198         virtual void setEnergy(double energy) = 0;
00200         virtual double getEnergy(void) = 0;
00201         
00203         virtual void setColor(const An::Color &activeColor, const An::Color &inactiveColor) = 0;
00204         
00206         virtual double getInteractionRange(void) = 0;
00207     };
00208     
00211     class RectangularBlock :
00212         public Entity,
00213         virtual public Positionable
00214     {
00215     protected:
00216         friend class RectangularBlockCreator;
00218         RectangularBlock() { }
00219     
00220     public:
00221         virtual ~RectangularBlock() { }
00223         virtual void set(double width, double height, double x, double y, double orientation) = 0;
00224     };
00225 }
00226 
00227 #endif

Generated on Mon Oct 24 17:38:25 2005 for Teem by  doxygen 1.4.2