Main Page   Compound List   File List   Compound Members   File Members  

FireTimer.c File Reference

#include "FireTimer.h"

Go to the source code of this file.

Functions

FireTimerInitFireTimer (int sim_start_yr, int sim_start_mo, int sim_start_dy, int sim_start_hr, int sim_end_yr, int sim_end_mo, int sim_end_dy, int sim_end_hr)
 Allocates memory associated with FireTimer structure and initializes members. More...

int FireTimerIncrementSeconds (FireTimer * ft, int secs)
 Increments the current time stored in the FireTimer by the number of seconds supplied as argument. More...

int FireTimerIsSimCurYearTimeExpired (FireTimer * ft)
 Returns 1 if the current simulation time has reached the end of the fire season for this year. More...

int FireTimerIsSimTimeExpired (FireTimer * ft)
 Returns 1 if the current simulation time has reached the simulation end time. More...

int FireTimerGetDaysInMonth (int mo)
 Returns the number of days in the month supplied as an argument. More...

int FireTimerGetDaysDifftime (int mo1, int dy1, int mo2, int dy2)
 Calculates the number of days between the first and second dates supplied as arguments. More...

void FreeFireTimer (FireTimer * fs)
 Frees memory associated with FireTimer structure. More...


Detailed Description

Author(s):
Marco Morais
Date:
2000-2001

HFire (Highly Optmized Tolerance Fire Spread Model) Library Copyright (C) 2001 Marco Morais

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Definition in file FireTimer.c.


Function Documentation

int FireTimerGetDaysDifftime ( int mo1,
int dy1,
int mo2,
int dy2 )
 

Calculates the number of days between the first and second dates supplied as arguments.

See also:
FireTimer , Check the config file documentation
Parameters:
mo1   1-based month
dy1   1-based day
mo2   1-based month
dy2   1-based day
Return values:
int   number of days difference

Definition at line 135 of file FireTimer.c.

Referenced by IsIgnitionNowRANDFromProps(), and IsSantaAnaNowFromProps().

int FireTimerGetDaysInMonth ( int mo )
 

Returns the number of days in the month supplied as an argument.

See also:
FireTimer , Check the config file documentation
Parameters:
mo   1-based month
Return values:
int   number of days in month

Definition at line 131 of file FireTimer.c.

Referenced by FireTimerGetDaysDifftime(), FireTimerIncrementSeconds(), and InitFireTimer().

int FireTimerIncrementSeconds ( FireTimer * ft,
int secs )
 

Increments the current time stored in the FireTimer by the number of seconds supplied as argument.

Propagates necessary changes into hr, dy, mo, and year fields if necessary.

See also:
FireTimer , Check the config file documentation
Parameters:
ft   ptr to FireTimer
secs   number of seconds to increment the simulation clock
Return values:
ERR_SUCCESS   (0) if operation successful, an error code otherwise
Note:
Best use of this facility is as follows:
            int error_status = SomeFunctionXXX();
            if ( error_status )
                // something bad happened

Definition at line 75 of file FireTimer.c.

int FireTimerIsSimCurYearTimeExpired ( FireTimer * ft )
 

Returns 1 if the current simulation time has reached the end of the fire season for this year.

For multiple-year simulations the simulation will begin at the start of the fire season during the next year.

See also:
FireTimer , Check the config file documentation
Return values:
int   1 if current simulation year expired, 0 otherwise

Definition at line 109 of file FireTimer.c.

Referenced by FireExportSpatialData().

int FireTimerIsSimTimeExpired ( FireTimer * ft )
 

Returns 1 if the current simulation time has reached the simulation end time.

See also:
FireTimer , Check the config file documentation
Return values:
int   1 if simulation time expired, 0 otherwise

Definition at line 119 of file FireTimer.c.

void FreeFireTimer ( FireTimer * fs )
 

Frees memory associated with FireTimer structure.

Subsequent calls to methods taking FireTimer as argument will not work.

See also:
FireTimer , Check the config file documentation
Parameters:
fs   ptr to FireTimer

Definition at line 153 of file FireTimer.c.

FireTimer * InitFireTimer ( int sim_start_yr,
int sim_start_mo,
int sim_start_dy,
int sim_start_hr,
int sim_end_yr,
int sim_end_mo,
int sim_end_dy,
int sim_end_hr )
 

Allocates memory associated with FireTimer structure and initializes members.

See also:
FireTimer , Check the config file documentation
Parameters:
sim_start_yr   year to start simulation (not offset from 1900)
sim_start_mo   month to start simulation (1-based month index)
sim_start_dy   day to start simulation (1-based day index)
sim_start_hr   hour to start simulation (1-based hour index)
sim_end_yr   year to end simulation (not offset from 1900)
sim_end_mo   month to end simulation (1-based month index)
sim_end_dy   day to end simulation (1-based day index)
sim_end_hr   hour to end simulation (1-based hour index)
Return values:
FireTimer   * Ptr to initialized FireTimer

Definition at line 30 of file FireTimer.c.

Referenced by InitFireTimerFromPropsFireConfig().


Generated at Fri Jun 22 00:46:52 2001 for HFire by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000