| … | … | @@ -47,6 +47,38 @@ |
| 47 | 47 | |
| 48 | 48 | (cog-value (car (cog-value->list next-edges)) (Predicate "*-Mutual Info Key-*")) |
| 49 | 49 | |
| 50 | ; Run the query, pull off the MI |
| 51 | (define (make-mipr-list START) |
| 52 | (Filter |
| 53 | (Rule |
| 54 | (Variable "edge") |
| 55 | (Variable "edge") |
| 56 | (ValueOf (Variable "edge") (Predicate "*-Mutual Info Key-*"))) |
| 57 | (make-next-edge-qry START))) |
| 50 | 58 | |
| 59 | (define next-mi |
| 60 | (cog-execute! (make-mipr-list (Word "start")))) |
| 61 | |
| 62 | (length (cog-value->list next-mi)) |
| 63 | (car (cog-value->list next-mi)) |
| 64 | |
| 65 | ; The MI is the second item. Use Decimate to pull it out. |
| 66 | (define (make-mi-list START) |
| 67 | (Filter |
| 68 | (Rule |
| 69 | ; Some pairs didn't have a valid MI on them! Why ??? |
| 70 | (TypedVariable (Variable "mi-pair") (Type 'FloatValue)) |
| 71 | (Variable "mi-pair") |
| 72 | (Decimate (Number 0 1) (Variable "mi-pair"))) |
| 73 | (make-mipr-list START))) |
| 74 | |
| 75 | (define next-mi |
| 76 | (cog-execute! (make-mi-list (Word "start")))) |
| 77 | |
| 78 | (length (cog-value->list next-mi)) |
| 79 | (car (cog-value->list next-mi)) |
| 80 | |
| 81 | ; Fails due to typechecking |
| 82 | (cog-execute! (Accumulate (make-mi-list (Word "start")))) |
| 51 | 83 | |
| 52 | 84 | |