Main Page   Compound List   File List   Compound Members   File Members  

FireYear.c File Reference

#include "FireYear.h"

Go to the source code of this file.

Functions

FireYearInitFireYearFuels (int year, GridData * fuels, ChHashTable * fmtble)
 Allocate memory for a FireYear structure with an underlying fire id array of size matching fuels GridData supplied as argument. More...

int FireYearGetCellIDRowCol (FireYear * fy, int i, int j, int * id)
 Retrieves the id of the fire ignited inside of a cell at index i,j, if any. More...

int FireYearGetCellIDRealWorld (FireYear * fy, double rwx, double rwy, int * id)
 Retrieves the id of the fire ignited inside of a cell at real world coordinate x,y, if any. More...

int FireYearIsCellBurnedRowCol (FireYear * fy, int i, int j)
 Returns 1 if the cell at index i,j is ignited, 0 otherwise. More...

int FireYearIsCellBurnedRealWorld (FireYear * fy, double rwx, double rwy)
 Returns 1 if the cell at real world coordinate x,y is ignited, 0 otherwise. More...

void FireYearSetCellNewFireIDRowCol (FireYear * fy, int i, int j)
 Assigns a unique id to identify the start of a new fire at index i,j. More...

void FireYearSetCellNewFireIDRealWorld (FireYear * fy, double rwx, double rwy)
 Assigns a unique id to identify the start of a new fire at real world coordinate x,y. More...

void FreeFireYear (FireYear * fy)
 Frees memory associated with FireYear object. 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 FireYear.c.


Function Documentation

int FireYearGetCellIDRealWorld ( FireYear * fy,
double rwx,
double rwy,
int * id )
 

Retrieves the id of the fire ignited inside of a cell at real world coordinate x,y, if any.

See also:
FireYear
Parameters:
fy   FireYear of all active fires
rwx   real world x coordinate to retrieve id
rwy   real world y coordinate to retrieve id
id   id of fire returned as dereferenced value
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 99 of file FireYear.c.

Referenced by GetIgnitionLocRANDUFromProps().

int FireYearGetCellIDRowCol ( FireYear * fy,
int i,
int j,
int * id )
 

Retrieves the id of the fire ignited inside of a cell at index i,j, if any.

See also:
FireYear
Parameters:
fy   FireYear of all active fires
i   row index of cell to retrieve id
j   column index of cell to retrieve id
id   id of fire returned as dereferenced value
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 88 of file FireYear.c.

Referenced by IncrementStandAge().

int FireYearIsCellBurnedRealWorld ( FireYear * fy,
double rwx,
double rwy )
 

Returns 1 if the cell at real world coordinate x,y is ignited, 0 otherwise.

See also:
FireYear
Parameters:
fy   FireYear of all active fires
rwx   real world x coordinate to examine
rwy   real world y coordinate to examine
Return values:
int   1 if cell is ignited, 0 otherwise

Definition at line 137 of file FireYear.c.

int FireYearIsCellBurnedRowCol ( FireYear * fy,
int i,
int j )
 

Returns 1 if the cell at index i,j is ignited, 0 otherwise.

See also:
FireYear
Parameters:
fy   FireYear of all active fires
i   row index of cell to examine
j   column index of cell to examine
Return values:
int   1 if cell is ignited, 0 otherwise

Definition at line 119 of file FireYear.c.

void FireYearSetCellNewFireIDRealWorld ( FireYear * fy,
double rwx,
double rwy )
 

Assigns a unique id to identify the start of a new fire at real world coordinate x,y.

This function should only be called for a new ignition. The simulation handles assignment of ids as fire grows and propagates through adjacent cells.

See also:
FireYear
Parameters:
fy   FireYear of all active fires
rwx   real world x coordinate to assign new id
rwy   real world y coordinate to assign new id

Definition at line 179 of file FireYear.c.

void FireYearSetCellNewFireIDRowCol ( FireYear * fy,
int i,
int j )
 

Assigns a unique id to identify the start of a new fire at index i,j.

This function should only be called for a new ignition. The simulation handles assignment of ids as fire grows and propagates through adjacent cells.

See also:
FireYear
Parameters:
fy   FireYear of all active fires
i   row index of cell to assign new id
j   column index of cell to assign new id

Definition at line 163 of file FireYear.c.

void FreeFireYear ( FireYear * fy )
 

Frees memory associated with FireYear object.

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

See also:
FireYear
Parameters:
fy   ptr to FireYear

Definition at line 205 of file FireYear.c.

FireYear * InitFireYearFuels ( int year,
GridData * fuels,
ChHashTable * fmtble )
 

Allocate memory for a FireYear structure with an underlying fire id array of size matching fuels GridData supplied as argument.

Upon initialization all cells in underlying fire id array are set to FIRE_YEAR_ID_DEFAULT, indicating that no fire has occured in that cell for the given year. In the case of cells in the fuels GridData which represent unburnable fuel, the fire is reset to FIRE_YEAR_ID_UNBURNABLE to prevent the cell from being set as burned during the simulation.

See also:
FireYear , ChHashTable , GridData
Parameters:
year   year for which this FireYear structure describes the fire history
fuels   fuels spatial data
fmtble   ChHashTable of FuelModels used to determine if num from fuels is burnable
Return values:
FireYear   * Ptr to initialized FireYear structure

Definition at line 27 of file FireYear.c.


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