# Javalanche: An Avalanche Predictor

The model is to be applied when there has been snowfall during the last 24-hour period. There are three input variables:

Slope_Pitch, the average slope angle (degrees) in the region of the suspected avalanche danger

Water_Equiv, the snowfall's water content (centimeters of equivalent water)

Current_Temp, the current temperature (Celsius)

To introduce fuzzy sets, we'll start with the input variable, Slope_Pitch. Wild slopes do not, of course, have constant pitch and even a measurement of average pitch is approximate. Nor is it clear that the distinction between a number like 15.2 degrees and 17.3 degrees is all that useful. Fuzzy sets provide a way to incorporate that inherent fuzziness into a model. We somewhat arbitrarily classify the Slope_Pitch variable into four categories, based loosely on the corresponding skiing ability needed to competently negotiate the terrain. These categories are Novice, Intermediate, Advanced and Expert.

**Figure 1. Fuzzy
Set for Novice Slope_Pitch**

**Figure 2. The
Four Fuzzy Sets for Slope_Pitch**

There is no widely accepted ski industry standard for these terms, but there is an approximate agreement on what they imply. For example, most skiers would consider the pitch range of 0 to 10 degrees as Novice, but there would be less agreement on the angle at which the slope would be considered no longer Novice, but Intermediate. Fuzzy Logic would accommodate this uncertainty by defining a fuzzy set for novice slope pitch as shown in Figure 1, where the vertical axis is called the degree of membership (dom). In Figure 2, the fuzzy sets for Intermediate, Advanced and Expert are incorporated as well. Looking at Figure 2, an input Slope_Pitch of 17.5 degrees would have a degree of membership of 0.25 in the Novice category and of 0.75 in the Intermediate category, reflecting the fuzzy transition from Novice to Intermediate Slope_Pitch. Ascertaining the doms of the various input values is called the fuzzification process.

**Figure 3. The
Three Fuzzy Sets for Water_Equiv**

**Figure 4. The
Three Fuzzy Sets for Current_Temp**

Figures 3 and 4 show fuzzy set choices for the other two input variables, Water_Equiv and Current_Temp. The choices of fuzzy set ranges and shapes are somewhat arbitrary, but should be guided by the knowledge of the expert. From Figures 2, 3, and 4 we see that the model has the following sets:

Four fuzzy sets for Slope_Pitch

Three fuzzy sets for Water_Equiv

Three fuzzy sets for Current_Temp

There is only one output variable, Avalanche_Danger. It is scaled from 0 to 100. It is tempting to interpret this as the probability of avalanche, but at this current stage of development it is an arbitrary scale. If the model were significantly enhanced and then used both extensively and successfully, this parameter could be calibrated and perhaps be rather like a probability. Figure 5 depicts the four fuzzy set categories for Avalanche_Danger.

**Figure 5. The
Four Fuzzy Sets for Avalanche_Danger**

Note that the expert snow scientist must be consulted by the programmer to construct the fuzzy sets. It can be expected that these would be modified and additional inputs incorporated as experience with the model is gained.

Rules come in both conditional and unconditional varieties.
For Javalanche, only conditional rules are currently implemented. A
typical rule might be “If Water_Equiv is Small AND Slope_Pitch is
Novice AND Current_Temp is Below_Freezing, then Avalanche_Danger is
Low.” The **if** clause (antecedent)
of the rule contains input fuzzy sets, while the
**then** clause (consequent) contains
output fuzzy sets. Each of the rules here links three fuzzy sets in
the antecedent with the “AND” conjunction. Each consequent
involves a single output fuzzy set.

**Figure 6. Rules
for Current_Temp = Below_Freezing**

**Figure 7. Rules for Current_Temp = Near_Freezing**

**Figure 8. Rules for Current_Temp = Above_Freezing**

Recall that the multiplicity of fuzzy sets for the three input variables is 4, 3 and 3, so that the total number of rules is the product, 36. Rather than quote each of the 36 rules, we represent them with the three tables shown in Figures 6, 7 and 8. Extracting a rule from a table is straightforward. The table entries show Avalanche_Danger for two inputs, Water_Equiv (row) and Slope_Pitch (column) while the third input is contained in the figure label. For example, in Figure 6, the upper left corner entry is “Low” and the corresponding inputs are:

Water_Equiv = Small (row)

Slope_Pitch = Novice (column)

Current_Temp = Below_Freezing (Figure 6's label)

Hence the related rule is, “If Water_Equiv is Small AND Slope_Pitch is Novice AND Current_Temp is Below_Freezing, then Avalanche_Danger is Low”; the same rule quoted earlier.

Just as for the fuzzy sets, the expert snow scientist must be consulted by the programmer in order to compose adequate rules. As with the fuzzy sets, experience with applying the model in the real world will most likely result in adjustments to the rules.

## Trending Topics

## Webinar

### Fast/Flexible Linux OS Recovery

On Demand Now

In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.

Join *Linux Journal*'s Shawn Powers and David Huffman, President/CEO, Storix, Inc.

Free to *Linux Journal* readers.

Libarchive Security Flaw Discovered | Jun 28, 2016 |

Sony Settles in Linux Battle | Jun 27, 2016 |

Astronomy for KDE | Jun 23, 2016 |

Profiles and RC Files | Jun 22, 2016 |

Understanding Ceph and Its Place in the Market | Jun 21, 2016 |

SoftMaker FreeOffice | Jun 20, 2016 |

- Sony Settles in Linux Battle
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Libarchive Security Flaw Discovered
- Profiles and RC Files
- Maru OS Brings Debian to Your Phone
- Understanding Ceph and Its Place in the Market
- Snappy Moves to New Platforms
- The Giant Zero, Part 0.x
- Git 2.9 Released
- Astronomy for KDE

## Geek Guides

With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.

This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.

Get the Guide