Enki  1.9
SbotObject.h
Go to the documentation of this file.
1 /*
2  Enki - a fast 2D robot simulator
3  Copyright (C) 1999-2016 Stephane Magnenat <stephane at magnenat dot net>
4  Copyright (C) 2004-2005 Markus Waibel <markus dot waibel at epfl dot ch>
5  Copyright (c) 2004-2005 Antoine Beyeler <abeyeler at ab-ware dot com>
6  Copyright (C) 2005-2006 Laboratory of Intelligent Systems, EPFL, Lausanne
7  Copyright (C) 2006-2008 Laboratory of Robotics Systems, EPFL, Lausanne
8  See AUTHORS for details
9 
10  This program is free software; the authors of any publication
11  arising from research using this software are asked to add the
12  following reference:
13  Enki - a fast 2D robot simulator
14  http://home.gna.org/enki
15  Stephane Magnenat <stephane at magnenat dot net>,
16  Markus Waibel <markus dot waibel at epfl dot ch>
17  Laboratory of Intelligent Systems, EPFL, Lausanne.
18 
19  You can redistribute this program and/or modify
20  it under the terms of the GNU General Public License as published by
21  the Free Software Foundation; either version 2 of the License, or
22  (at your option) any later version.
23 
24  This program is distributed in the hope that it will be useful,
25  but WITHOUT ANY WARRANTY; without even the implied warranty of
26  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  GNU General Public License for more details.
28 
29  You should have received a copy of the GNU General Public License
30  along with this program; if not, write to the Free Software
31  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 */
33 
34 #ifndef __ENKI_SBOTOBJECT_H
35 #define __ENKI_SBOTOBJECT_H
36 
37 #include <enki/Interaction.h>
38 #include <enki/PhysicalEngine.h>
40 
44 namespace Enki
45 {
47 
49  {
50  public:
52  double actualEnergy;
54  double actualTime;
66  double dEnergyActive;
69 
70  public :
72  SbotFeeding(double r, Robot *owner);
73  virtual void objectStep (double dt, PhysicalObject *po, World *w);
74  virtual void finalize(double dt);
75  };
76 
78 
79  class SbotActiveObject : public Robot
80  {
81  public:
84 
85  public:
87  SbotActiveObject(double objectRadius, double actionRange);
88  };
89 
91 
93  {
94  public:
96  SbotActiveSoundObject(double objectRadius, double actionRange);
98  void setSoundRange(double soundRange);
99  };
100 }
101 #endif
102 
SbotFeeding feeding
The interaction.
Definition: SbotObject.h:83
Header of sound emitter interaction.
Color activeColor
The color of the object when active: (actualTime % (activeDuration+inactiveDuration) < activeDuration...
Definition: SbotObject.h:60
bool consumeEnergy
If true, energy given to the Sbots is removed from actualEnergy.
Definition: SbotObject.h:64
double actualTime
The actual time.
Definition: SbotObject.h:54
A situated object in the world with mass, geometry properties, physical properties, ...
Definition: PhysicalEngine.h:131
double inactiveDuration
The duration of inactive period.
Definition: SbotObject.h:58
SbotFeeding(double r, Robot *owner)
Constructor, r is the radius of the interaction.
Definition: SbotObject.cpp:45
double activeDuration
The duration of active period.
Definition: SbotObject.h:56
Enki is the namespace of the Enki simulator. All Enki functions and classes excepted the math one are...
Definition: BluetoothBase.cpp:44
double r
Radius of the local interaction.
Definition: Interaction.h:57
Robot * owner
The physical object that owns the interaction.
Definition: Interaction.h:62
The interfaces for the interactions.
double dEnergyActive
The energy difference per second when active.
Definition: SbotObject.h:66
double dEnergyInactive
The energy difference per second when inactive.
Definition: SbotObject.h:68
Color inactiveColor
The color of the object when inactive: (actualTime % (activeDuration+inactiveDuration) >= activeDurat...
Definition: SbotObject.h:62
The world is the container of all objects and robots.
Definition: PhysicalEngine.h:411
SbotActiveSoundObject give or remove energy to nearby Sbots through an SbotFeeding interaction...
Definition: SbotObject.h:92
ActiveSoundObject can be inherited by any robot that want to emit sound.
Definition: ActiveSoundSource.h:86
A color in RGBA.
Definition: Types.h:55
Interacts with another object or wall only up to a certain distance.
Definition: Interaction.h:53
SbotActiveObject give or remove energy to nearby Sbots through an SbotFeeding interaction.
Definition: SbotObject.h:79
Feeding interaction gives or remove energy to nearby Sbots.
Definition: SbotObject.h:48
The core of Enki.
A robot is a PhysicalObject that has additional interactions and a controller.
Definition: PhysicalEngine.h:379
double actualEnergy
The energy in stock.
Definition: SbotObject.h:52