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

/home/pauldt/projects/IDEA/IDEA-ALL/IDEA-DEV/Core/ReactivePlanner/Includes/ReactivePlannerImpl.hh

Go to the documentation of this file.
00001 // -*- Mode: C++ -*-
00002 //      CVS: $Id: ReactivePlannerImpl.hh,v 1.22 2005/12/30 22:15:40 rijsman Exp $
00003 //      Tag: $name$
00004 //     Info: $CVSROOT/COPYRIGHT
00005 #ifndef REACTIVEPLANNER_IMPLEMENTATION_HEADER_
00006 #define REACTIVEPLANNER_IMPLEMENTATION_HEADER_
00007 
00008 #include "DefaultReactor.hh"
00009 #include "FreeStrategies.hh"
00010 #include "PslContainers.hh"
00011 #include "StatusTypes.hh"
00012 #include "Utilities.hh"
00013 
00014 
00015 namespace IDEA
00016 {
00017   class AgentTimingService;
00018   class Planner;
00019   class PlannerImpl;
00020   class PslDatabase;
00021   class PslTimeline;
00022   class PslToken;
00023 
00029   class ReactivePlannerImpl:
00030     public DefaultReactor
00031   {
00032     friend class ReactivePlanner;
00033   public:
00037     ReactivePlannerImpl( const std::string& name,
00038                          const PslDatabase* database,
00039                          const AgentTimingService* ats,
00040                          const std::string& heuristicFile, 
00041                          bool readHeuristicsFile,
00042                          const std::string& noBranchFile,
00043                          bool readNoBranchFile );
00047     virtual ~ReactivePlannerImpl();
00051     const FreeStrategy& getFreeStrategy() const;
00055     void addRevocableAuthority( int authority );
00059     bool isRevocable( int authority ) const;
00063     int getAuthority();
00067     void setFreeGoalTokens();
00071     void stopReacting();
00075     virtual StatusType startReacting( const Time& time );
00076   protected:
00080     const IntSet& getRevocableAuthorities() const;
00084     const Planner* getPlanner() const;
00089     bool freeGoalTokens() const;
00090   private:
00094     void determineDisablement( const PslToken* token, const PslTokenList& tokens );
00098     StatusType attemptRecovery( const Time& time  );
00102     int initialize();
00108     virtual void getFutureTokens( const PslTimeline* timeline, 
00109                                   PslTokenList& tokensExecuting,
00110                                   PslTokenList& tokensInTheFuture ) const;
00111 
00115     virtual StatusType free( const PslToken* pslTok );
00119     virtual StatusType relax( const PslToken* pslTok );
00123     StatusType preProcessPlanning();
00127     StatusType postProcessPlanning();
00132     StatusType preProcessExecutingTokens( PslTokenList& tokens );
00136     StatusType postProcessExecutingTokens( PslTokenList& tokens );
00140     StatusType preProcessControllableToken( const PslToken* token );
00144     StatusType preProcessUncontrollableToken( const PslToken* token, const PslTokenList& controllableTokens  );
00145   private:
00146     IntSet m_RevocableAuthorities;
00147     Planner* m_Planner;
00148 
00149     FreeStrategy m_FreeStrategy;
00150     bool m_FreeGoalTokens;
00151     PslTokenList m_ExecutingTokens;
00152     bool m_StopPlanner;
00153 
00154     std::string m_HeuristicFile;
00155     bool m_ReadHeuristicsFile;
00156     std::string m_NoBranchFile;
00157     bool m_ReadNoBranchFile;
00158 
00159   };
00160 }
00161 
00162 #endif // REACTIVEPLANNER_IMPLEMENTATION_HEADER_

Contact information
© IDEA
Generated on Fri Feb 3 17:09:41 2006 for IDEA.