>xabsl   The Extensible Agent Behavior Specification Language

XabslEngine Class Library Reference

 

XabslBehavior.h

Go to the documentation of this file.
00001 /**
00002 * @file XabslBehavior.h
00003 * 
00004 * Definition of class Behavior
00005 *
00006 * @author <a href="http://www.sim.informatik.tu-darmstadt.de/pers/card/risler.html">Max Risler</a>
00007 */
00008 
00009 #ifndef __XabslBehavior_h_
00010 #define __XabslBehavior_h_
00011 
00012 #include "XabslArray.h"
00013 #include "XabslSymbols.h"
00014 
00015 namespace xabsl 
00016 {
00017 
00018 /** 
00019 * @class Behavior
00020 *
00021 * Parent class for Option and BasicBehavior
00022 *
00023 * @author <a href="http://www.sim.informatik.tu-darmstadt.de/pers/card/risler.html">Max Risler</a>
00024 */
00025 class Behavior : public NamedItem
00026 {
00027 public:
00028   /** 
00029   * Constructor.
00030   * @param name The name of the behavior. For debugging purposes.
00031   */
00032   Behavior(const char* name) : 
00033       NamedItem(name), 
00034       isActive(false),
00035       wasActive(false),
00036       timeOfExecution(0),
00037       timeWhenActivated(0),
00038       parameters(0)
00039   {};
00040 
00041   /**
00042   * Destructor
00043   */
00044   virtual ~Behavior() {};
00045 
00046   /** the behavior is activated in the current path through the option graph */
00047   bool isActive;
00048   
00049   /** the behavior was activated in the last path trough the option graph */
00050   bool wasActive;
00051 
00052   /** 
00053   * executes the behavior
00054   */
00055   virtual void execute() = 0;
00056 
00057   /** the time how long the option is already active */
00058   unsigned timeOfExecution;
00059 
00060   /** The time, when the option was activated */
00061   unsigned timeWhenActivated;
00062 
00063   /** The parameters of the behavior */
00064   Parameters* parameters; 
00065 
00066   /** Notify the software environment about a parameter change */
00067   virtual void parametersChanged() {};
00068 };
00069 
00070 } // namespace
00071 
00072 #endif //__XabslBehavior_h_

Up | Main Page | Generated at Wed Aug 19 17:32:28 2009.