2
/******************************************************************************
4
* pick_ignite.c pick an ignition based on probability
6
* Usage: pick_ignite (fuelmoisture)
8
* Notes: pick_ignite() pick an ignition idetermined by fine fuel moisture
9
* based on the probability simplified from Rothermel (1983): Predicting
11
* Author: Jianping Xu, Rutgers University
13
******************************************************************************/
16
#include <grass/gis.h>
17
#include "local_proto.h"
19
int p[18] = { 100, 100, 100, 90, 80, 70, 60, 50, 40, /*adapt the "average" */
20
40, 30, 30, 20, 20, 20, 10, 10, 10
21
}; /*10-50 shading, 80-89F */
23
int pick_ignite(int i)
25
return ((100.0 * G_drand48()) <= p[i]);