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 "local_proto.h"
18
int p[18] = { 100, 100, 100, 90, 80, 70, 60, 50, 40, /*adapt the "average" */
19
40, 30, 30, 20, 20, 20, 10, 10, 10
20
}; /*10-50 shading, 80-89F */
22
int pick_ignite(int i)
24
return ((100.0 * rand() / INT_MAX) <= p[i]);