operator: train-of-thought

    description:
        train-of-thought[n] sp
        the train-of-thought function
        given a seed ket, randomly walk through operator links to other kets
        works best with a large, well connected network
        
        The pseudo-code for this function is:

        train-of-thought[n] (*) #=>
            |X> => pick-elt |_self>
            |train> .=> "" |X>
            repeat[n]:
                |X> => pick-elt apply(pick-elt supported-ops "" |X>, ""|X>)
                print "" |X>
                |train> .=> "" |X>
            return "" |train>

    examples:
        load fred-sam-friends.sw
        find-inverse[friends]
        train-of-thought[10] |Fred>
            context: global context
            one: |Fred>
            n: 10
            |X>: |Fred>
            ------------
            |Mary>
            |Fred>
            |Rob>
            |Fred>
            |Jack>
            |Fred>
            |Charlie>
            |Sam>
            |Frank>
            |Sam>
            |Fred> . |Mary> . |Fred> . |Rob> . |Fred> . |Jack> . |Fred> . |Charlie> . |Sam> . |Frank> . |Sam>

        load family.sw
        find-inverse[age]
        train-of-thought[10] |sara>
            context: sw console
            one: |sara>
            n: 10
            |X>: |sara>
            ------------
            |sam>
            |56>
            |sam>
            |trude>
            |sally>
            |tom>
            |40>
            |tom>
            |mike>
            |60>
            |sara> . |sam> . |56> . |sam> . |trude> . |sally> . |tom> . |40> . |tom> . |mike> . |60>

    see also:


Home