⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alife.ctl

📁 MATLAB,VB做成的神经网络计算程序
💻 CTL
📖 第 1 页 / 共 4 页
字号:
    
    lclConcept = lclMoveTag
    
    PSI_Damp
    
    Display_Message " "
    
    Speech
    
    lclMoveTag = lclBestWord
    
    EN_Damp
    
    lclUnknown = 32
    
    Sensorium
    
    Subj_Damp
    
    lclParse = 3
    
    Display_Message " "
    
    Noun_Phrase
    
    Obj_Damp
    
    'return to English module.
End Sub

'Subject assembles a phrase to be subject of verb.
Sub Subject()
    If lclSpy = -1 Then
        Display_Message vbCrLf & "Subject: "
    End If
    
    Noun_Phrase 'finds "le mot juste" to be the subject
    
    'Retro, invoked by Sensorium, will need to store in Ear()
    'the concept number of "motjuste" as move-tag:
    
    lclMoveTag = lclBestWord    'send the found move-tag into Retro
    lclUnknown = 32 'set the Unknown variable to ASCII 32 (spacebar)
    
    'although called separately during Reentry of "le mot juste,"
    
    Sensorium   'must now be called to receive a spacebar
    
    'return to the English module.
End Sub

'Noun-Phrase finds the currently most active noun.
Sub Noun_Phrase()
    lclOptions = 5
    lclUnknown = 0
    lclMoveTag = 0
    lclBestWord = 0
    lclRecallVector = 0
    lclActivation = 0
    
    If lclSpy = 50 Then
        Display_PSI 'diagnostic level 2: show concepts
    End If
    
    FlushVector 'to move deep concepts up to English "EN()"
    
    For lclI = lclTime To lclMidway Step -1
        DoEvents
        
        If lclEN(lclI).Activation > 0 Then  'if EN Activation is positive
            lclActivation = lclEN(lclI).Activation  'then store the Activation level
            
            If lclEN(lclI).GrammarCategory = 5 Then 'if options part-of-speech
                If lclActivation > lclUnknown Then
                    lclMoveTag = lclEN(lclI).MoveTag    'move-tag of item
                    lclRecallVector = lclEN(lclI).RecallVector  'auditory recall-vector
                    lclUnknown = lclActivation  'to test for an even higher Activation
                    lclBestWord = lclMoveTag
                    
                    If lclSpy > 49 Then
                        Display_Message vbCrLf & Chr(9) & "Noun-Phrase: most active a " & lclActivation & " is for mt " & lclMoveTag & " with rv " & lclRecallVector
                    End If
                End If
            End If
        End If
    Next
    
    lclConcept = lclMoveTag
    
    PSI_Damp
    EN_Damp
    Speech
    
    lclActivation = 0
    
    'return to Subject, Predicate
End Sub

'Speech follows recall-vector to say phonemes.
Sub Speech()    'for output of single words, not entire sentences
    lclOnset = lclRecallVector  'save the first recall-vector as the onset of a word.
    
    If lclSpy > 51 Then
        Display_Message vbCrLf & Chr(9) & "Speech:" & vbCrLf
    End If
    
    'next line assumes no word will be longer than 40 phonemes:
    
    For lclI = 1 To 40  'perform this loop up to forty times.
        DoEvents
        
        lclUnknown = lclEar(lclRecallVector).Unknown
        
        Display_Message Chr(lclUnknown) 'say or display recall-vector
        
        lclSource = 45 'internal source; 45 is ASCII for minus "-"
        
        Sensorium   'for reentry of a thought back into the mind
        
        If lclEar(lclRecallVector).Continuation = 0 Then    'if end of word
            Exit For
        End If
        
        'with each loop, increase the recall-vector by one so as
        'to retrieve each successive phoneme from the auditory memory:
        
        lclRecallVector = lclRecallVector + 1
    Next
    
    lclRecallVector = 0
    
    'return to Noun-Phrase, Predicate, etc
End Sub

'FlushVector flushes deep concepts up into syntax.
Sub FlushVector()
    Dim lclI_2 As Integer
    
    lclActivation = 0
    
    For lclI = lclTime + 1 To lclMidway Step -1
        DoEvents
        
        If lclPSI(lclI).Activation > 0 Then 'some psi have Holodyne Activation
            lclActivation = lclPSI(lclI).Activation
            lclEnglishLexicon = lclPSI(lclI).EnglishLexicon
        End If
        
        If lclEnglishLexicon > 0 Then
            For lclI_2 = lclTime + 1 To lclMidway Step -1
                DoEvents
                
                If lclEN(lclI_2).MoveTag = lclEnglishLexicon Then
                    lclEN(lclI_2).Activation = lclActivation
                End If
            Next
        End If
        
        lclEnglishLexicon = 0
        lclActivation = 0
    Next
    
    'return to Noun-Phrase, Predicate
End Sub

'Bootstrap calls the user-written bootstrap sequences.
Sub Bootstrap()
    Ear_1   'I know you
    EN_1
    PSI_1
    
    Ear_2   'You see me
    EN_2
    PSI_2
    
    lclTime = lclTime + 1
    lclNotLaterThan = lclTime   'not-later-than may be basis for Damp functions
    lclEnglishLexiconConceptNumber = 64 'only assign concepts above the pre-set first 64.
    
    'return to the main ALife loop.
End Sub

'EAR-1 is the first auditory engram bootstrap.
Sub Ear_1() 'ASCII storage of words and tags in the array ear{)
    'I
    lclTime = 1
    lclUnknown = 73
    lclBeginning = 1
    lclContinuation = 0
    lclUltimateTag = 9
    lclSource = 45
    
    Short_Term_Memory
    
    'K
    lclTime = 3
    lclUnknown = 75
    lclBeginning = 1
    lclContinuation = 1
    lclUltimateTag = 0
    lclSource = 45
    
    Short_Term_Memory

    'N
    lclTime = 4
    lclUnknown = 78
    lclBeginning = 0    'rrb 4/3/2000 per conv 4/2/2000 - was 1
    lclContinuation = 1
    lclUltimateTag = 0
    lclSource = 0
        
    Short_Term_Memory

    'O
    lclTime = 5
    lclUnknown = 79
    lclBeginning = 0    'rrb 4/3/2000 per conv 4/2/2000 - was 1
    lclContinuation = 1
    lclUltimateTag = 0
    lclSource = 0
    
    Short_Term_Memory

    'W
    lclTime = 6
    lclUnknown = 87
    lclBeginning = 0    'rrb 4/3/2000 per conv 4/2/2000 - was 1
    lclContinuation = 0
    lclUltimateTag = 37
    lclSource = 0
    
    Short_Term_Memory

    'Y
    lclTime = 8
    lclUnknown = 89
    lclBeginning = 1
    lclContinuation = 1
    lclUltimateTag = 0
    lclSource = 45
    
    Short_Term_Memory

    'O
    lclTime = 9
    lclUnknown = 79
    lclBeginning = 0    'rrb 4/3/2000 per conv 4/2/2000 - was 1
    lclContinuation = 1
    lclUltimateTag = 0
    lclSource = 0
    
    Short_Term_Memory

    'U
    lclTime = 10
    lclUnknown = 85
    lclBeginning = 0    'rrb 4/3/2000 per conv 4/2/2000 - was 1
    lclContinuation = 0
    lclUltimateTag = 13
    lclSource = 0
    
    Short_Term_Memory
    
    'Return to the main BOOTSTRAP subroutine.
End Sub

'EAR-2 is the second auditory engram bootstrap.
Sub Ear_2()
    'Y
    lclTime = 13
    lclUnknown = 89
    lclBeginning = 1
    lclContinuation = 1
    lclUltimateTag = 0
    lclSource = 45
    
    Short_Term_Memory

    'O
    lclTime = 14
    lclUnknown = 79
    lclBeginning = 0
    lclContinuation = 1
    lclUltimateTag = 0
    lclSource = 0
    
    Short_Term_Memory

    'U
    lclTime = 15
    lclUnknown = 85
    lclBeginning = 0
    lclContinuation = 0
    lclUltimateTag = 13
    lclSource = 0
    
    Short_Term_Memory

    'S
    lclTime = 17
    lclUnknown = 83
    lclBeginning = 1
    lclContinuation = 1
    lclUltimateTag = 0
    lclSource = 45
    
    Short_Term_Memory

    'E
    lclTime = 18
    lclUnknown = 69
    lclBeginning = 0
    lclContinuation = 1
    lclUltimateTag = 0
    lclSource = 0
    
    Short_Term_Memory

    'E
    lclTime = 19
    lclUnknown = 69
    lclBeginning = 0
    lclContinuation = 0
    lclUltimateTag = 39
    lclSource = 0
    
    Short_Term_Memory
    
    'M
    lclTime = 21
    lclUnknown = 77
    lclBeginning = 1
    lclContinuation = 1
    lclUltimateTag = 0
    lclSource = 45
    
    Short_Term_Memory

    'E
    lclTime = 22
    lclUnknown = 69
    lclBeginning = 0
    lclContinuation = 0
    lclUltimateTag = 10
    lclSource = 0
    
    Short_Term_Memory
    
    lclTime = 23
    lclUltimateTag = 0
        
    'Return to the main BOOTSTRAP subroutine.
End Sub

'EN-1 is the first English lexicon bootstrap sequence.
Sub EN_1()  'Instantiating "I know you."
    '"I" ( "self" ) is mindcore octave two, overall concept #9"
    lclMoveTag = 9
    lclGrammarCategory = 5
    lclFiberIn = 13
    lclFiberOut = 9
    lclRecallVector = 1
    lclTime = 1
    
    Attach

    '"know" is mindcore octave five, concept #37:
    lclMoveTag = 37
    lclGrammarCategory = 8
    lclFiberIn = 37
    lclFiberOut = 37
    lclRecallVector = 3
    lclTime = 6
    
    Attach

    '"you" ( "other" ) is mindcore octave one, concept #13:
    lclMoveTag = 13
    lclGrammarCategory = 5
    lclFiberIn = 9
    lclFiberOut = 13
    lclRecallVector = 8
    lclTime = 10
    
    Attach
    
    lclMoveTag = 0
    
    'Return to the main BOOTSTRAP subroutine.
End Sub

'EN-2 is the second English lexicon bootstrap sequence.
Sub EN_2()
    '"you" is mindcore octave two, concept #13:
    '"you" going in goes to concept fin #9:  "I" ( self ):
    lclMoveTag = 13
    lclGrammarCategory = 5
    lclFiberIn = 9
    lclFiberOut = 13
    lclRecallVector = 13
    lclTime = 15
    
    Attach

    '"see" is mindcore octave five, concept #39:
    lclMoveTag = 39
    lclGrammarCategory = 8
    lclFiberIn = 39
    lclFiberOut = 39
    lclRecallVector = 17
    lclTime = 19
    
    Attach

    '"me" ( "self" ) is mindcore octave two, concept #9:
    lclMoveTag = 10
    lclGrammarCategory = 5
    lclFiberIn = 13
    lclFiberOut = 10
    lclRecallVector = 21
    lclTime = 22
    
    Attach
    
    lclMoveTag = 0
    lclActivation = 0
    lclFiberIn = 0
    lclFiberOut = 0

    'Return to the main BOOTSTRAP subroutine.
End Sub

'PSI-1 is the first mindcore "psi bootstrap sequence.
Sub PSI_1() 'Concept fiber:  f + a + pre + enx + seq + nlp
    'NLP: 1=adj 2=adv 3=conj 4=interj 5=noun 6=prep 7=pron 8=verb

    'Then next line sets up the concept fiber for "I":
    lclTime = 1
    lclFiber = 9
    lclActivation = 1
    lclPrevious = 0
    lclEnglishLexicon = 9
    lclSubsequent = 37
    lclNaturalLanguageProcessing = 5
    
    Instantiate

    'We establish the mindcore fiber of "know":
    lclTime = 6
    lclFiber = 37
    lclActivation = 0
    lclPrevious = 9
    lclEnglishLexicon = 37
    lclSubsequent = 13
    lclNaturalLanguageProcessing = 8
    
    Instantiate

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -