SPModel: libSPModel/src/ParameterTimeSeries.h Source File
VPAC - Computational Software Development
Main | SPModel | StGermain FrameWork |
Main Page | Alphabetical List | Class List | Directories | File List | Class Members | File Members

ParameterTimeSeries.h

Go to the documentation of this file.
00001 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00002 **
00003 ** Copyright (C), 2004, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
00004 **
00005 ** Authors:
00006 **  Ogar R. Widjaja, Computational Scientist, VPAC.
00007 **  Raquibul Hassan, Software Engineer, VPAC. (raq@vpac.org)
00008 **  Keith Hsuan, Computational Scientist, VPAC (keith@vpac.org)
00009 **  William F. Appelbe, Director, VPAC. (bill@vpac.org)
00010 **  Stevan M. Quenette, Senior Software Engineer, VPAC. (steve@vpac.org)
00011 **  Patrick D. Sunter, Software Engineer, VPAC. (patrick@vpac.org)
00012 **
00013 ** This file may be distributed under the terms of the VPAC Public License
00014 ** as defined by VPAC of Australia and appearing in the file
00015 ** LICENSE.VPL included in the packaging of this file.
00016 **
00017 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00018 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00019 **
00020 ** $Id: ParameterTimeSeries.h 177 2005-08-23 10:15:00Z RaquibulHassan $
00021 **
00022 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
00023 
00024 #ifndef __SPModel_ParameterTimeSeries_h__
00025 #define __SPModel_ParameterTimeSeries_h__
00026 
00027     #define __ParameterTimeSeries\
00028         struct{ __Stg_Component }; \
00029         double      *timeStepArray; \
00030         double      *parameterValueArray; \
00031         int         numEntries; \
00032         int         currIndex; \
00033         double      value; \
00034         double      defaultValue; \
00035         Dictionary  *dictionary;
00036     struct ParameterTimeSeries{ __ParameterTimeSeries };
00037 
00038 ParameterTimeSeries *ParameterTimeSeries_DefaultNew( Name name );
00039 
00040 ParameterTimeSeries *ParameterTimeSeries_New( Name name, double defaultValue, Dictionary *dictionary );
00041 
00042 ParameterTimeSeries *_ParameterTimeSeries_New( SizeT                            _sizeOfSelf,
00043                                     Type                            type,
00044                                     Stg_Class_DeleteFunction*               _delete,
00045                                     Stg_Class_PrintFunction*                _print,
00046                                     Stg_Class_CopyFunction*             _copy, 
00047                                     Stg_Component_DefaultConstructorFunction*   _defaultConstructor,
00048                                     Stg_Component_ConstructFunction*            _construct,
00049                                     Stg_Component_BuildFunction*        _build,
00050                                     Stg_Component_InitialiseFunction*       _initialise,
00051                                     Stg_Component_ExecuteFunction*      _execute,
00052                                     Stg_Component_DestroyFunction*      _destroy,
00053                                     Name                            name,
00054                                     double                          defaultValue,
00055                                     Bool                            initFlag,
00056                                     Dictionary                      *dictionary );
00057 
00058 void ParameterTimeSeries_Init( ParameterTimeSeries *self );
00059 
00060 void ParameterTimeSeries_Print( void *parameterTimeSeries, Stream *stream );
00061 
00062 void ParameterTimeSeries_Delete( void *parameterTimeSeries );
00063 
00064 void ParameterTimeSeries_Construct( void *parameterTimeSeries, Stg_ComponentFactory *cf );
00065 
00066 void ParameterTimeSeries_Build( void *parameterTimeSeries, void *data );
00067 
00068 void ParameterTimeSeries_Initialise( void *parameterTimeSeries, void *data );
00069 
00070 void ParameterTimeSeries_Execute( void *parameterTimeSeries, void *data );
00071 
00072 void ParameterTimeSeries_Destroy( void *parameterTimeSeries, void *data );
00073 
00074 void ParameterTimeSeries_InterpolateFunc( ParameterTimeSeries *parameterTimeSeries, void *data );
00075 
00076 #define ParameterTimeSeries_Interpolate( parameterTimeSeries, data ) \
00077     (parameterTimeSeries->numEntries ? \
00078     ParameterTimeSeries_InterpolateFunc( parameterTimeSeries, data) : \
00079     parameterTimeSeries->value)
00080 
00081 #endif
00082