DiscreteEventStepper.hpp

Go to the documentation of this file.
00001 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
00002 //
00003 //        This file is part of E-Cell Simulation Environment package
00004 //
00005 //                Copyright (C) 1996-2004 Keio University
00006 //                Copyright (C) 2005 The Molecular Sciences Institute
00007 //
00008 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
00009 //
00010 //
00011 // E-Cell is free software; you can redistribute it and/or
00012 // modify it under the terms of the GNU General Public
00013 // License as published by the Free Software Foundation; either
00014 // version 2 of the License, or (at your option) any later version.
00015 // 
00016 // E-Cell is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00019 // See the GNU General Public License for more details.
00020 // 
00021 // You should have received a copy of the GNU General Public
00022 // License along with E-Cell -- see the file COPYING.
00023 // If not, write to the Free Software Foundation, Inc.,
00024 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00025 // 
00026 //END_HEADER
00027 //
00028 // written by Koichi Takahashi <shafi@e-cell.org>,
00029 // E-Cell Project.
00030 //
00031 
00032 #ifndef __DISCRETEEVENTSTEPPER_HPP
00033 #define __DISCRETEEVENTSTEPPER_HPP
00034 
00035 #include "libecs.hpp"
00036 #include "Stepper.hpp"
00037 #include "Process.hpp"
00038 
00039 #include "EventScheduler.hpp"
00040 #include "ProcessEvent.hpp"
00041 
00042 
00043 namespace libecs
00044 {
00045 
00046   /** @addtogroup stepper
00047    *@{
00048    */
00049 
00050   /** @file */
00051 
00052   /**
00053 
00054   */
00055 
00056   LIBECS_DM_CLASS( DiscreteEventStepper, Stepper )
00057   {
00058 
00059   protected:
00060 
00061     typedef EventScheduler<ProcessEvent> ProcessEventScheduler;
00062     typedef ProcessEventScheduler::EventIndex EventIndex;
00063 
00064 
00065 
00066   public:
00067 
00068     LIBECS_DM_OBJECT( DiscreteEventStepper, Stepper )
00069       {
00070         INHERIT_PROPERTIES( Stepper );
00071 
00072         PROPERTYSLOT_SET_GET( Real, Tolerance );
00073         PROPERTYSLOT_GET_NO_LOAD_SAVE( Real, TimeScale );
00074         PROPERTYSLOT_GET_NO_LOAD_SAVE( String, LastProcess );
00075       }
00076 
00077     DiscreteEventStepper();
00078     virtual ~DiscreteEventStepper() {}
00079 
00080     virtual void initialize();
00081     virtual void step();
00082     virtual void interrupt( TimeParam aTime );
00083     virtual void log();
00084 
00085 
00086     SET_METHOD( Real, Tolerance )
00087       {
00088         theTolerance = value;
00089       }
00090     
00091     GET_METHOD( Real, Tolerance )
00092       {
00093         return theTolerance;
00094       }
00095     
00096     virtual GET_METHOD( Real, TimeScale )
00097       {
00098         //      return theTimeScale;  temporarily disabled
00099         return 0.0;
00100       }
00101 
00102     GET_METHOD( String, LastProcess );
00103 
00104     ProcessVectorCref getProcessVector() const
00105       {
00106         return theProcessVector;
00107       }
00108 
00109   protected:
00110 
00111     ProcessEventScheduler  theScheduler;
00112 
00113     // temporarily disabled
00114     //    Real            theTimeScale;
00115     Real            theTolerance;
00116 
00117     EventIndex      theLastEventIndex;
00118 
00119 
00120 
00121   };
00122 
00123 } // namespace libecs
00124 
00125 #endif /* __STEPPER_HPP */
00126 
00127 
00128 
00129 /*
00130   Do not modify
00131   $Author: shafi $
00132   $Revision: 2529 $
00133   $Date: 2005-11-19 10:36:40 +0100 (Sat, 19 Nov 2005) $
00134   $Locker$
00135 */

Generated on Mon Dec 18 07:24:07 2006 for E-CELL C++ libraries (libecs and libemc) 3.1.105 by  doxygen 1.5.1