Action3.ALG

Software: Action3.ALG

       '*   Adaptron Algorithm - Psuedocode  - Oct 1998
       ' (C) Copyright 1998, Brett N. Martensen
       '
   Do the following 'pay attention' loop for ever.
 
       'When entering this loop we have just finished selecting an input
       ' stimulus, storing it, recalling it and displaying results.
 
       If performing a past experience / habit then
 
           '  If you are concentrating AT LEVEL 1 AND doing a past experience
           '    If its same as before - expected result occurs then
           '      If its complete match then
           '        HAVE SUCCESSFUL RECOGNITION/HABIT so COLLAPSE STM, restore
           '          previous doing list and recall it.
           '      else it matches at sub-level of some habit(s) so
           '        Carry on performing habit(s) trying to recognize sub-habit
           '    ELSE UNEXPECTED SO STOP DOING AND See if any feeling is relevant
 
           If feeling is = expected then  'MATCHED EXPERIENCE
               'IF STIMULUS MATCHES EXPECTED RESULTING STIMULUS
               '  BUT NO RESPONSE DONE (JUST LISTENING) THEN
               'WE HAVE RECOGNIZED A PAIR OF STIMULI - COLLAPSE THEM
 
               'IF STIMULUS MATCHES EXPECTED RESULTING STIMULUS
               '  AND DID DO A RESPONSE THEN
               ' SUCCESS - WE WERE CONCENTRATING AND GOT SAME RESULTS
               '  CAN ESTABLISH A HABIT THAT REPEATS WHEN DONE
             If have one or more matching expectations then 'MATCH SUCCESSFUL
               have RECOGNIZED one or more habits. 'COLLAPSE LAST TWO STIMULI
               Pay attention to next stimulus   'CHECK OUT NEW STIMULUS/HABIT
 
             otherwise 'it matched expected stimulus at sub-level within habit
 
               Carry on recognizing at the SUB-LEVEL
               'SHOULD THEN DO FAMILIAR BELOW
 
             End of If have one or more...
 
             ? If did a response and got expected result should we stop
             ?  performing because its boring to get same result?
 
           otherwise  'FEELING IS = FAMILIAR (BUT NOT EXPECTED),
                       'UNFAMILIAR OR BORED
             STOP IT performing habit and stop concentrating.
 
           End of If feeling is = expected.
 
       End of If performing a past experience.
 
       ' NOW REACT ACCORDING TO FEELINGS - MAY STILL BE PERFORMING HABIT
 
       If feeling is = expected then
           'DOING SUB-LEVEL - ONLY EXPECTED & NOT EXPECTED CONTROLS EXECUTION
           Start doing the FAMILIAR experience.
 
       otherwise If feeling is = familiar then 'LATEST STIMULUS IS FAMILIAR
 
           If last thing we did was to pay attention (Listen) then
               ' INDEPENDENT OF WHAT EXPECTED RESULTING STIMULUS FEELING
               '  IS = FAMILIAR   OR  IS = UNFAMILIAR THEN
               '    DO IT AGAIN (LEVEL 1) TO TRY AND RECOGNIZE IT
 
               Start doing the FAMILIAR experience at matching position.
 
           otherwise        'PREVIOUS DID RESPONSE
               'IF DID A RESPONSE AND EXPECTED RESULTING STIMULUS FEELING
               '  IS = FAMILIAR
               '    DON’T DO SAME RESPONSE BECAUSE SAME THING SHOULD HAPPEN
               '
               '  UNLESS LEVEL > 0 (performing habit) OR
               '  IS = UNFAMILIAR
               '    DO IT AGAIN SEE IF IT REOCCURS AT WHICH POINT IT WILL
               '    BE FAMILIAR AND WE WILL TRY SOMETHING ELSE THE NEXT TIME
 
               If next expected stimulus was unfamiliar or performing a habit then
                       Start doing the FAMILIAR experience.
               otherwise          'PAST EXPERIENCE GAVE FAMILIAR FEELING
                       Pay attention to next stimulus.
               End of If next expected...
 
           End of If last thing did was to pay attention (Listen).
 
       otherwise If feeling is = bored then
               'Produce a reflexive random response.
 
               First STOP IT performing habit.
               'CLEAR OUT BORING STIMULUS FROM STM.
               Produce REFLEX.
 
       otherwise If feeling is = unfamiliar then
               'This is an orienting response.
 
               Do UNFAMILIAR processing - empty STM and default to LISTEN
 
       End of If feeling is = ?
 
       'If last thing done was a response then
       '        pay attention to the kinaesthetic stimulus
       'otherwise
 
       If there are no feelings to use then
               pay attention to input stimulus - LISTEN
 
   End of 'pay attention' loop.
 
DOING:         Perform previous experience / habit
 
       Use the most recent matching experience from recall.
       Set concentrate level.
 
       If the response last time was to pay attention / listen then
               get the next external stimulus
       otherwise
               output the response.
       End of Doing a habit.
 
RECOGNIZED:    Successful recognition of pair so it becomes a habit
               so can collapse pair and give it a position identifier.
 
       Last 2 entries collapse and the new stimulus is the position of the
       recognized habit that was being performed.
 
       REMEMBER this habit and do the recall for matches against experience.
       End of Recognizing.
 
 
SUB-LEVEL:       Recognition at sub habit level so store sub habit match
 
       Use the habits that match with the received / recognized stimulus
       End of Sub Level match
 
 
STOP IT:         Was doing habit and was expecting but no match found so stop.
 
       Stop concentrating and stop doing.
       Only the latest stimulus left in STM.
 
       End of Stopping
 
 
FAMILIAR:      Familiar stimulus received so start doing at most recent match
 
       Start DOING at the top of the list of matching recalls, doing
       past experiences / habits.
       End of Familiar.
 
 
UNFAMILIAR:    Unfamiliar stimulus received so flush STM to LTM
 
       The contents of STM are put in LTM including the unfamiliar
       stimulus.
       The only response is to do nothing, just pay attention to LISTEN
       End of Unfamiliar
 
ECHO:          Kinaesthetic stimulus from response
 
       Create kinaesthetic stimulus for response just made.
       Carry on at LISTEN2
 
LISTEN:        Obtain stimulus from real world
 
       Report on current concentration and habit being done.
       Obtain input stimulus.
 
LISTEN2:
       Put stimulus in memory.
       REMEMBER this stimulus and recall it.
       End of Listening.
 
 
REFLEX:        Produce a random response from all possible responses
 
       Obtain a response not the same as the previous one and store it
       in memory.
       Carry on at RESPOND2.
 
RESPOND:       MOTOR - OUTPUT - Perform real world response
 
       Select response that was done by current habit and store it
       in memory.
 
RESPOND2:      Output the response
 
       Shorten the list of matching stimuli to just those that did this
       response last time. This is the list of stimuli/responses performed.
       Note: This does not need to be done if each response generates a
       kinaesthetic stimulus.
       End of Responding.
 
 
REMEMBER:      Recall input stimulus and then determine if it matches with
               any other experiences or habits that are being performed.
 
       If input stimulus causes a good or bad feeling then
               feelings stimulus occurs.
 
       Do the RECALL of input stimulus - find LTM matches.
 
       If no matches in LTM then
               the feeling for this stimulus is unfamiliar / novel.
       otherwise
               the feeling is familiar / experienced before.
               If the most recent match is previously experienced stimulus then
                       the feeling is boredom.
 
       If stimulus is familiar does it match any expected next stimuli?
 
           If performing a past experience then
 
       'DOES THE LAST ITEM MATCH ANY OF THE EXPECTED DOING ITEMS FROM
       'MATCHES WITH TRIGGERING STIMULUS - i.e. match doing pos +1
       ' if so then have success - EXPECTED = YES
       ' else - produce sub-list of doings/expected stimuli where
       'just received stimulus matches triggering stimulus
       'if list is empty - not expected (must be familiar by this time)
       'ELSE list >0 so WE HAVE FAMILIAR STIMULUS match one or more expected
       '      so do first one on list
 
               For each past stimulus match found (if any)
 
                   Go through each next expected stimulus (if any)
                   and find matches, confirmation/validation of stimulus pair
                   If find a matching expectation then
                       The feeling is expected and novel pair found.
                       (The same thing happened as last time! - SUCCESS)
               Finish of For each past stimulus
 
               If there is no exact expected match there still may be habits
               whose next stimulus matches. So produce a list of habits that
               still match with input stimulus.
 
               If stimulus has not matched a next expected stimulus then
 
                   For each active match that has an expected high level
                   stimulus (if any),
                   check to see if input stimulus is expected as part of habit.
 
                       Get the expected high level stimulus and go down
                       the left side of its tree looking if any stimulus
                       matches with the recalled ones.
                               Feeling is set to expected
                               Expected stimulus matching input put on list
 
               Finish of If stimulus has not matched
           Finish of If performing past experience.
       Finish of If stimulus is familiar.
 
       Display the contents of memory and history of activity.
       End of Remembering.
 
RECALL:
       Find all the locations in LTM where the latest stimulus occurred.
       Produce list of locations ordered by recency for input stimulus.
       End of Recalling.