24.11.2014 Views

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2. Frames and Inheritance 24<br />

Depth-First versus Breadth-First Search ?<br />

The frames to be considered, when looking for a potential place to inherit<br />

from, are determined by the frame hierarchy and the attribute in question.<br />

Whenever there are alternative places to search, there are inevitably<br />

alternative ways of looking.<br />

In both of the following methods, the search is left-to-right over the ordering<br />

of parent-frames.<br />

A depth-first search of the frame hierarchy will investigate a complete<br />

ancestor branch before considering alternative ancestor branches.<br />

For example, a depth first search of the example hierarchy, starting at<br />

Sammy, will visit the following frames in order :<br />

4<br />

Animal<br />

3<br />

Mammal<br />

Carnivore<br />

5<br />

2<br />

Feline<br />

1<br />

Cat<br />

Sammy<br />

1 Cat being the parent-frame of Sammy<br />

2 Feline being a grandparent-frame<br />

3 Mammal being the first great-grandparent-frame<br />

4 Animal being a great-great-grandparent-frame<br />

5 Carnivore being the second great grandparent-frame<br />

A breadth-first search, however, will visit all frames at a particular ancestor<br />

level before considering any at a higher level. It will visit all parent-frames<br />

first, then all grandparent-frames, all great-grandparent-frames, and so on.<br />

<strong>flex</strong> toolkit

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!