|
| 1 | +# AAC Effort Metrics - User Guide |
| 2 | + |
| 3 | +This guide explains the basics of the AAC Effort Algorithm and how to use the TypeScript implementation provided in this repository. |
| 4 | + |
| 5 | +## 🧠 The AAC Effort Algorithm |
| 6 | + |
| 7 | +The AAC Effort Algorithm measures the physical and cognitive "cost" of activating buttons in an AAC (Augmentative and Alternative Communication) system. It combines multiple factors into a single "effort score" for each word or phrase. |
| 8 | + |
| 9 | +### Core Metrics |
| 10 | + |
| 11 | +1. **Button Size Effort**: Calculated from grid dimensions. Larger grids (smaller buttons) require more effort to discriminate and target. |
| 12 | +2. **Field Size Effort**: Based on the number of visible buttons. More choices increase visual clutter and cognitive load. |
| 13 | +3. **Visual Scan Effort**: The time/effort taken to scan through buttons in a grid (usually left-to-right, top-to-bottom) before reaching the target. |
| 14 | +4. **Distance Effort**: The physical distance between the previous button (or the "home" position) and the current target. |
| 15 | +5. **Prior Effort (Navigation Cost)**: Every time a board changes (folder selection), a "Processing Effort" penalty (default: 1.0) is added, representing the cognitive cost of orienting to a new screen. |
| 16 | + |
| 17 | +### Motor Planning Discounts |
| 18 | + |
| 19 | +The algorithm rewards systems that support motor planning. If a button appears in a predictable location or follows a recognizable pattern, its effort is discounted: |
| 20 | + |
| 21 | +- **Clones**: Exact copies of buttons in the same location across boards. |
| 22 | +- **Semantic Locations**: Patterns where types of words (e.g., verbs, colors) always appear in the same grid area. |
| 23 | +- **Upstream Matching**: If the button used to _enter_ a board matches the ID of a button _on_ that board, the effort is reduced. |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## 💻 How to Use the Code |
| 28 | + |
| 29 | +### 1. Basic Usage (Multi-Format Support) |
| 30 | + |
| 31 | +The `MetricsCalculator` is format-agnostic. You can use any processor to load a pageset into an `AACTree`, then pass that tree to the calculator. |
| 32 | + |
| 33 | +#### Loading an OBFSET |
| 34 | +```typescript |
| 35 | +import { ObfsetProcessor, Analytics } from '@willwade/aac-processors'; |
| 36 | + |
| 37 | +const processor = new ObfsetProcessor(); |
| 38 | +const tree = processor.loadIntoTree('set.obfset'); |
| 39 | +const result = new Analytics.MetricsCalculator().analyze(tree); |
| 40 | +``` |
| 41 | + |
| 42 | +#### Loading Grid 3 (.gridset) |
| 43 | +```typescript |
| 44 | +import { GridsetProcessor, Analytics } from '@willwade/aac-processors'; |
| 45 | + |
| 46 | +const processor = new GridsetProcessor(); |
| 47 | +const tree = processor.loadIntoTree('my_file.gridset'); |
| 48 | +const result = new Analytics.MetricsCalculator().analyze(tree); |
| 49 | +``` |
| 50 | + |
| 51 | +#### Loading Snap (.pageSet / .spb) |
| 52 | +```typescript |
| 53 | +import { SnapProcessor, Analytics } from '@willwade/aac-processors'; |
| 54 | + |
| 55 | +const processor = new SnapProcessor(); |
| 56 | +const tree = processor.loadIntoTree('SnapBackup.pageSet'); |
| 57 | +const result = new Analytics.MetricsCalculator().analyze(tree); |
| 58 | +``` |
| 59 | + |
| 60 | +#### Loading TouchChat (.zip) |
| 61 | +```typescript |
| 62 | +import { TouchChatProcessor, Analytics } from '@willwade/aac-processors'; |
| 63 | + |
| 64 | +const processor = new TouchChatProcessor(); |
| 65 | +const tree = processor.loadIntoTree('TouchChatBackup.zip'); |
| 66 | +const result = new Analytics.MetricsCalculator().analyze(tree); |
| 67 | +``` |
| 68 | + |
| 69 | +### 2. Result Structure |
| 70 | + |
| 71 | +The `analyze` function returns: |
| 72 | + |
| 73 | +- `total_words`: Number of unique vocalizations found. |
| 74 | +- `total_buttons`: Total number of button activations analyzed. |
| 75 | +- `buttons`: An array of `ButtonMetrics` for each word (taking the minimum effort path found). |
| 76 | +- `levels`: An object grouping buttons by their depth (e.g., Level 0 = home screen). |
| 77 | + |
| 78 | +### 3. Requirements |
| 79 | + |
| 80 | +- **Supported Formats**: Any format with a corresponding processor (`.obf`, `.obz`, `.obfset`, `.gridset`, `.pageSet`, `.spb`, `.zip` for TouchChat, etc.). |
| 81 | +- **Metadata**: For best accuracy, buttons should include `clone_id` or `semantic_id` where applicable. |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +## ⚖️ Implementation vs. Original Algorithm |
| 86 | + |
| 87 | +This version is optimized for Node.js and adheres strictly to the **v0.2 Algorithm Specification**. |
| 88 | + |
| 89 | +- **Accuracy**: Achieving ~95%+ parity with original benchmarking tools. |
| 90 | +- **Efficiency**: Uses a modified Breadth-First Search (BFS) to find the most efficient user path to any word. |
| 91 | +- **Improved Logic**: Resolves "double-discounting" issues present in legacy implementations, favoring a more realistic motor-planning model. |
| 92 | + |
| 93 | +For detailed technical notes on implementation decisions, see [ALGORITHM_IMPLEMENTATION_NOTES.md](./ALGORITHM_IMPLEMENTATION_NOTES.md). |
0 commit comments