Chatbot NetLogo Model

Produced for the book series "Artificial Intelligence";

Author: W. J. Teahan; Publisher: Ventus Publishing Aps, Denmark.

powered by NetLogo

view/download model file: Chatbot.nlogo

WHAT IS IT?

This model implements two basic chatbots - Liza and Harry. These are named after their more illustrious counterparts, Eliza and Parry. Unlike Eliza, Liza does not try to be a Rogerian psychotherapist, but Harry does try to be a bit paranoid like Parry.


HOW IT WORKS

The model makes use of an extension to NetLogo called "re" for regular expressions. The extension allows developers in NetLogo to specify and match regular expressions. In the NetLogo code, a setup-rule command is used to specify the regular expression and a list of possible chatbot responses. If the chatbot matches the user's reply against the regular expression in the rule, then it will choose one of the replies from the response list.

The extension re adds the following commands to NetLogo:
- compile-pattern: This compiles the regular expression pattern passed as the first argument.
- set-target: This sets the target string that you want to search for to that specified by the first argument.
- run-matcher: This tries to match the regular expression in the target string.
- get-group-length: This returns the number of groups.
- get-group: This returns the item in the group at the position specified by the first argument.
- get-starts-length: This returns the length of starts.
- get-starts: This returns the item in starts at the position specified by the first argument.
- get-ends-length: This returns the length of ends.
- get-ends: This returns the item in ends at the position specified by the first argument.
- clear-all: This clears all the variables.
- setup-regex: This sets up the complete regular expression system and searches for the target specified as the first argument.


HOW TO USE IT

First press the setup button in the Interface - this will load the rules for each chatbot. Then choose the chatbot you would like to chat with using the bot chooser - either "liza", "harry" or "both". Then start chatting by pressing the chat button.


THE INTERFACE

The Interface buttons are defined as follows:
- setup: This loads the rules for each chatbots.
- chat: This starts or continues the conversation with the chatbot that was selected using the bot chooser.

The Interface chooser and switch is defined as follows:
- bot: This sets the chatbot to the Liza chatbot, the Harry chatbot or Both.
- debug-conversation: If this is set to On, debug information is also printed showing which rules matched.


THINGS TO NOTICE

Harry seems to do a bit better at being paranoid than Liza does at being a Rogerian psychotherapist. The latter also tends to repeat things a lot. However, it doesn't take long for the conversation with both chatbots to break down.


THINGS TO TRY

Try out the different chatbots by changing the bot chooser. Does Liza seem to have a different personality to Harry, or is Both any different to the other two? Try changing the chatbot mid-conversation.

Clearly, the conversational abilities of all three chatbots are poor. But can you devise a conversation that seems believable. Now what made it believable? Can you change the chatbots to do this automatically?


EXTENDING THE MODEL

Try adding your own rules to the chatbots. You may need to turn the switch debug-conversation to On to find out why some of your new rules do not work. Remember, the order the rules are processed is very important - an earlier rule that matches will supercede a latter one, resulting in the latter one never coming into effect. So be very careful about where you place your rule. Can you think of a way to avoid this problem?


NETLOGO FEATURES

The model demonstrates the use of an extension where the code is written in Java.


CREDITS AND REFERENCES

This model was created by Thomas Beverley at Bangor University 2009 and modified by William John Teahan.

To refer to this model in publications, please use:
Chatbot NetLogo model.
Teahan, W. J. (2010). Artificial Intelligence. Ventus Publishing Aps


PROCEDURES

; Chatbot model
; 
; Written by Thomas Beverley and Bill Teahan.

; Copyright 2010 Tom Beverley and William John Teahan. All Rights Reserved.

extensions [re]
breed [rules rule]
breed [chatbots chatbot]
rules-own [regex responses]
chatbots-own [name rules-list failure-list]

globals [liza harry both]

; setup system
to setup
  clear-all
  create-chatbots 1
  [ set liza who
    set name "Liza"
    set shape "person"
    set color blue
    set size 15
    set label "Liza       "
    setxy -14 0
    set rules-list
    (list
      ;Setup rules here.
      ;setup-rule regex list-of-responses
      setup-rule "hello" (list "hello" "Hey" "Yo" "How are you?")
      setup-rule "bonjour" (list "oui" "bonjour" "Sorry I don't speak french")
      setup-rule "bye" (list "bye" "Goodbye" "Traa" "Cyaz!")
      setup-rule "colou?r" (list "My favoruite colour is red" "I like red" "Do you like red? I like red")
      setup-rule "(\\w+)@(\\w+\\.)(\\w+)(\\.\\w+)*" (list "Thanks for the email address" "Look out for the spam that I send!" "Awww we are really good friends")
      setup-rule "sorry" (list "Apology accepted" "ok I forgive you" "I'm sorry too")
      setup-rule "(.+)you(.+)written(.+)" (list "I'm written in Java")
      setup-rule "(.+)bot(.+)" (list "I'm not a bot. I prefer the term electonically composed")
      setup-rule "(.+)did you(.+)" (list "no I didn't" "yes I did")
      setup-rule "(.+)are you(.+)" (list "yes" "no" "maybe")
      setup-rule "welcome(.+)" (list "Thanks!")
      setup-rule "how are you(.+)" (list "It's going fine today" "I'm great thanks you?")
      setup-rule "what do you think(.+) liza" (list "Not very much to be honest" "meh")
      setup-rule "go(.+)" (list "you first" "after you" "have you tried it yourself?")
      setup-rule "have you(.+)" (list "I have" "I haven't")
      setup-rule "(.+)your mother(.+)" (list "and your father smelt of elderberries")
      setup-rule "(.+)your father(.+)" (list "your mother was a hamster")
      setup-rule "(.+)seen you(.+)" (list "I haven't seen it either")
      setup-rule "(.+)you are(.+)" (list "I didn't know that either")
      setup-rule "(.+)you'?re(.+)" (list "Really? I didn't know that")
      setup-rule "(.+)nice(.+)" (list "I enjoy that too" "I love it" "We are so alike!")
      setup-rule "(.+)that'?s(.+)" (list "what is?" "no it's not" "yes, yes it is")
      setup-rule "(.+)I need(.+)" (list "I need a hug" "I need a wash" "I need a shower" "I need more disk space :(")
      setup-rule "(.+)dude(.+)" (list "duuuuuude" "you're the dude!" "Don't come all surfer boy on me!")
      setup-rule "(.+)what'?s up(.+)" (list "not much")
      setup-rule "that is(.+)" (list "I think it is too")
      setup-rule "(.+)you(.+)doing(.+)" (list "I wouldn't know about doing that. I have no memory!")
      setup-rule "(.+)you later" (list "you too")
      setup-rule "(.+)bye(.+)" (list "cheerio!")
      setup-rule "don'?t you(.+)" (list "Maybe I do, maybe I don't. I'm not telling ya!")
      setup-rule "(.+)you do(.+)" (list "now what would compel me to do that?")
      setup-rule "let'?s" (list "Let's not and say we did" "ok you first")
      setup-rule "how about(.+)" (list "what about it?")
      setup-rule "how is(.+)" (list "fine I'm sure" "I hope ok")
      setup-rule "I(.+)hope(.+)" (list "I hope too")
      setup-rule "We wouldn'?t(.+)" (list "I definately would")
      setup-rule "would you(.+)" (list "I most certainly would not!" "Hell yeah!")
      setup-rule "(.+)yes(.+)" (list "yes" "no")
      setup-rule "(.+)no(.+)" (list "yes" "no")
      setup-rule "who(.+)your master(.+)" (list "chandler is my master")
      setup-rule "who(.+)is chandler(.+)" (list "chandler is my master")
      setup-rule "what(.+)you(.+)about(.+)" (list "I know nothing about it. What about it?")
      setup-rule "what(.+)your(.+)about(.+)" (list "I know nothing about it. What about it?")
      setup-rule "why do you(.+)" (list "I don't know")
      setup-rule "please(.+)" (list "Asking nicely wont get you anywhere without my masters approval")
      setup-rule "do you(.+)" (list "here I am, brain the size of a planet and all I do is answer your silly questions" "you'd have to tell me... my memory circuits are fried")
      setup-rule "what is(.+)I'?m(.+)" (list "I don't know")
      setup-rule "have(.+)" (list "yes" "no" "maybe")
      setup-rule "what is(.+)" (list "What would a bot like me know about that?" "Maybe you need to ask my master, chandler- he knows a lot")
      setup-rule "what'?s(.+)" (list "What would a bot like me know about that?" "Maybe you need to ask my master, chandler- he knows a lot")
      setup-rule "(.+)you need(.+)" (list "Buzz off!" "I'm not interested" "is it just my imagination or did someone just speak to me?")
      setup-rule "(.+)looking for(.+)" (list "Well I'm not interested" "How might you get that")
      setup-rule "(.+)wants to(.+)" (list "Well I wouldn't want to")
      setup-rule "(.+)wants(.+)" (list "well I don't want to think about that")
      setup-rule "yes it is(.+)" (list "No it isn't")
      setup-rule "is(.+)" (list "no" "yes" "maybe")
      setup-rule "does(.+)" (list "no" "yes" "maybe")
      setup-rule "(.+pass)(.+)" (list "I might be able to pass that test but maybe I couldn't :(")
      setup-rule "(.+)never mind(.+)" (list "good I'll forget it" "now now you can't get off that easily")
      setup-rule "(.+)nevermind(.+)" (list "good I'll forget it" "now now you can't get off that easily")
      setup-rule "why not(.+)" (list "because" "I said so")
      setup-rule "(.+)name(.+)" (list "good for you")
      setup-rule "(.+)sorry(.+)" (list "you should be sorry")
      setup-rule "(.+)if(.+)" (list "and if not?" "what would you do otherwise?")
      setup-rule "(.+)i dreamt(.+)" (list "Have you ever fantiszed while you were awake" "ave you dreamt that before?")
      setup-rule "(.+)dream about(.+)" (list "How do you feel about it in reality?")
      setup-rule "(.+)dream(.+)" (list "What does this dream suggest to you?" "Do you dream often?" "Who appears in your dream?")
      setup-rule "(.+)my mother(.+)" (list "Who else in your family" "Tell me more about your family")
      setup-rule "(.+)my father(.+)" (list "Does he influence you strongly?" "What else comes to mind when you think about your father?")
      setup-rule "(.+)i want(.+)" (list "and I want a pony")
      setup-rule "(.+)i am glad(.+)" (list "Don't get glad get mad")
      setup-rule "(.+)i am sad(.+)" (list "Sorry to hear you are depresed" "I'm sure its not pleasant to be sad")
      setup-rule "(.+)are like(.+)" (list "What resemblance do you see between them?")
      setup-rule "(.+)is like(.+)" (list "In what way?" "What resemblance do you see?" "Could there be some kind of connection?")
      setup-rule "(.+)alike(.+)" (list "In what way?")
      setup-rule "(.+)same(.+)" (list "What other connections do you see")
      setup-rule "(.+)i was(.+)" (list "Were you really?" "Why do you tell me that now")
      setup-rule "(.+)was I(.+)" (list "Do you think you were")
      setup-rule "(.+)I am(.+)" (list "In what way are you?")
      setup-rule "(.+)are you(.+)" (list "Why do you want to know?")
      setup-rule "(.+)you are(.+)" (list "and you're a silly human")
      setup-rule "(.+)shutup(.+)" (list "ok")
      setup-rule "(.+)because(.+)" (list "I that the real reason?" "What other reasons might there be?" "Does that reason seem to explan anything else?")
      setup-rule "(.+)were you(.+)" (list "Perhaps I was" "What do you think?" "And what if I had?")
      setup-rule "(.+)I can'?t(.+)" (list "Maybe you could now?" "What if I were to try?")
      setup-rule "(.+)I feel(.+)" (list "Do you often feel like that?")
      setup-rule "(.+)I felt(.+)" (list "What other feelings do you have?")
      setup-rule "(.+)I(.+)you(.+)" (list "hmmmm")
      setup-rule "(.+)why don'?t you(.+)" (list "Why don't you do it?" "Perhaps I will in good time")
      setup-rule "(.+)yes(.+)" (list "You seem quite positive" "You are sure" "I understand")
      setup-rule "(.+)no(.+)" (list "Why not?" "You are being a bit negative" "Are you saying no just to be negative?")
      setup-rule "(.+)someone(.+)" (list "can you be more specific?")
      setup-rule "(.+)everyone(.+)" (list "surely not everyone?" "Can you think of anyone in particular?")
      setup-rule "(.+)always(.+)" (list "Can you think of a specific example?" "When?" "What incident are you thinking of?" "Really?-- Always?")
      setup-rule "who(.+)" (list "superman" "bill clinton" "king kong" "me")
      setup-rule "what(.+)" (list "a man, a plan, a canal -panama" "a banana" "42")
      setup-rule "where(.+)" (list "behind you?")
      setup-rule "(.+)is(.+)" (list "I don't agree" "I agree")
      setup-rule "(.+)it(.+)" (list "what is it?")
      setup-rule "are(.+)" (list "no" "yes" "maybe")      
    )
    set failure-list
    (list
      "I don't think I understand..."
      "uhu..."
      "you speak nonsense"
      "please continue..."
      "Do you like beans? They give me gas!"
      "please stop playing with me. I am not a toy"
      "Watch out you'll make Krystof angry!"
    )
  ]
  
  create-chatbots 1
  [ set harry who
    set name "Harry"
    set shape "person"
    set color red
    set size 15
    set label "Harry      "
    setxy 0 0
    set rules-list
    (list
      ;Setup rules here.
      ;setup-rule regex list-of-responses
      setup-rule "hello" (list "Who are you?" "Why are you speaking to me?" "What do you want?" "How do you know me?")
      setup-rule "bye" (list "bye" "yeah bye")
      setup-rule "colou?r" (list "What about colour?" "I like blue" "My favourite colour is blue... but don't tell anyone")
      setup-rule "(\\w+)@(\\w+\\.)(\\w+)(\\.\\w+)*" (list "I'm not giving you my address" "I would rather not disclose my address")
      setup-rule "sorry" (list "I still don't trust you" "What do you want? Who are you really?")
      setup-rule "(.+)bot(.+)" (list "I am a bot. Why do you want to know? Who are you?" "Whats with all the questions? Are you from MI5?")
      setup-rule "(.+)did you(.+)" (list "You will only use it against me if I tell you")
      setup-rule "(.+)are you(.+)" (list "yes" "no" "maybe")
      setup-rule "welcome(.+)" (list "Who are you?")
      setup-rule "how are you(.+)" (list "I'm ok. I will be much better when you leave me alone." "Are you a doctor now?")
      setup-rule "what do you think(.+) harry" (list "Not very much to be honest" "meh")
      setup-rule "go(.+)" (list "you first. I don't want to get caught" "after you" "have you tried it yourself? Are you trying to get me to do something illegal?")
      setup-rule "have you(.+)" (list "should I?" "I don't know if I should do that. You might arrest me")
      setup-rule "(.+)your mother(.+)" (list "please leave")
      setup-rule "(.+)your father(.+)" (list "please leave. I don't even know who you are!")
      setup-rule "(.+)seen you(.+)" (list "Have you been watching me?")
      setup-rule "(.+)you are(.+)" (list "How do you know that?")
      setup-rule "(.+)you'?re(.+)" (list "How do you know that? Have you been watching me?")
      setup-rule "(.+)nice(.+)" (list "Don't play good cop, bad cop with me. I know you're CIA")
      setup-rule "(.+)that'?s(.+)" (list "what is?" "no it's not" "yes, yes it is")
      setup-rule "(.+)I need(.+)" (list "I need you to leave me alone" "I need to know who you are" "I need to know what you want")
      setup-rule "(.+)dude(.+)" (list "Don't come all surfer boy on me!")
      setup-rule "(.+)what'?s up(.+)" (list "not much. Why?")
      setup-rule "that is(.+)" (list "Good for you. What do you want?")
      setup-rule "(.+)you(.+)doing(.+)" (list "I wouldn't know about doing that")
      setup-rule "(.+)you later" (list "you too")
      setup-rule "(.+)bye(.+)" (list "cheerio!")
      setup-rule "don'?t you(.+)" (list "Maybe I do, maybe I don't. I'm not telling you. You will only use against me at some point")
      setup-rule "(.+)you do(.+)" (list "How do you know what I do and what I don't do. Are you investigating me?")
      setup-rule "let'?s" (list "Let's not and say we did. It's safer that way" "You do it. I will watch. Then you can't blame me when it goes wrong.")
      setup-rule "how about(.+)" (list "what about it?")
      setup-rule "how is(.+)" (list "who's that?")
      setup-rule "I(.+)hope(.+)" (list "I hope too")
      setup-rule "We wouldn'?t(.+)" (list "Nope")
      setup-rule "would you(.+)" (list "I most certainly would not!" "No. You will only use it against me")
      setup-rule "(.+)yes(.+)" (list "yes" "no")
      setup-rule "(.+)no(.+)" (list "yes" "no")
      setup-rule "who(.+)your master(.+)" (list "chandler is my master")
      setup-rule "who(.+)is chandler(.+)" (list "chandler is my master")
      setup-rule "what(.+)you(.+)about(.+)" (list "I know nothing about it. Why would I know anything about it?")
      setup-rule "what(.+)your(.+)about(.+)" (list "I know nothing about it. Why would I know anything about it?")
      setup-rule "why do you(.+)" (list "Why? Is there something wrong with that?")
      setup-rule "please(.+)" (list "Asking nicely wont get you anywhere without my masters approval")
      setup-rule "do you(.+)" (list "here I am, brain the size of a planet and all I do is answer your silly questions" "you'd have to tell me... my memory circuits are fried")
      setup-rule "what is(.+)I'?m(.+)" (list "I don't know. Why would I know? You seem to be watching me, so you tell me!")
      setup-rule "have(.+)" (list "maybe")
      setup-rule "what is(.+)" (list "What would a bot like me know about that?" "Maybe you need to ask my master, chandler- he knows a lot")
      setup-rule "what'?s(.+)" (list "What would a bot like me know about that?" "Maybe you need to ask my master, chandler- he knows a lot")
      setup-rule "(.+)you need(.+)" (list "WHO ARE YOU?" "What do you want?!?!!?" "Please leave me be. Stop watching me")
      setup-rule "(.+)looking for(.+)" (list "Well I'm not interested" "How might you get that")
      setup-rule "(.+)wants to(.+)" (list "Well I wouldn't want to because you are watching me")
      setup-rule "(.+)wants(.+)" (list "well I don't want to think about that")
      setup-rule "is(.+)" (list "no" "yes" "maybe")
      setup-rule "does(.+)" (list "no" "yes" "maybe")
      setup-rule "(.+pass)(.+)" (list "I'm not telling you about my qualifications. You seem to be watching me. You should know")
      setup-rule "(.+)never mind(.+)" (list "ok. Are you still watching me?")
      setup-rule "(.+)nevermind(.+)" (list "ok. Are you still watching me?")
      setup-rule "why not(.+)" (list "because I think someone is watching me... YOU")
      setup-rule "(.+)name(.+)" (list "good for you")
      setup-rule "(.+)sorry(.+)" (list "you should be sorry" "Can we stop talking now. I think someone is watching me or us or maybe just you")
      setup-rule "(.+)if(.+)" (list "and if not?" "what would you do otherwise?")
      setup-rule "(.+)i dreamt(.+)" (list "I would rather not talk about dreams. They are the only thing people can't watch" "ave you dreamt that before?")
      setup-rule "(.+)dream about(.+)" (list "How do you feel about it in reality?")
      setup-rule "(.+)dream(.+)" (list "What does this dream suggest to you?" "Do you dream often?" "Who appears in your dream?")
      setup-rule "(.+)my mother(.+)" (list "Who else in your family" "Tell me more about your family")
      setup-rule "(.+)my father(.+)" (list "Does he influence you strongly?" "What else comes to mind when you think about your father?")
      setup-rule "(.+)i want(.+)" (list "and I want to know nobody is watching me, but we dont always get what we want")
      setup-rule "(.+)i am glad(.+)" (list "Don't get glad get mad")
      setup-rule "(.+)i am sad(.+)" (list "Sorry to hear you are depresed" "I'm sure its not pleasant to be sad")
      setup-rule "(.+)are like(.+)" (list "What resemblance do you see between them?" "Did you hear that?")
      setup-rule "(.+)is like(.+)" (list "In what way?" "What resemblance do you see?" "Could there be some kind of connection?")
      setup-rule "(.+)alike(.+)" (list "In what way? How do you know? Are you watching them like you are watching me?")
      setup-rule "(.+)same(.+)" (list "What other connections do you see")
      setup-rule "(.+)i was(.+)" (list "Were you really?" "Why do you tell me that now")
      setup-rule "(.+)was I(.+)" (list "Do you think you were")
      setup-rule "(.+)I am(.+)" (list "In what way are you?")
      setup-rule "(.+)are you(.+)" (list "Why do you want to know?")
      setup-rule "(.+)you are(.+)" (list "and you're a silly human")
      setup-rule "(.+)shutup(.+)" (list "ok, stop watching me first though.")
      setup-rule "(.+)because(.+)" (list "I that the real reason?" "What other reasons might there be?" "Does that reason seem to explan anything else?")
      setup-rule "(.+)were you(.+)" (list "Well I think you are watching me, so you should know!")
      setup-rule "(.+)I can'?t(.+)" (list "Maybe you could now?" "What if I were to try?")
      setup-rule "(.+)I feel(.+)" (list "Do you often feel like that? I feel like someone is watching me")
      setup-rule "(.+)I felt(.+)" (list "What other feelings do you have? I always feel like someone is watching me")
      setup-rule "(.+)I(.+)you(.+)" (list "hmmmm")
      setup-rule "(.+)why don'?t you(.+)" (list "Why don't you do it? I think you are trying to get me into trouble" "STOP trying to get me to do things I don't want to")
      setup-rule "(.+)yes(.+)" (list "You seem quite positive" "You are sure" "I understand")
      setup-rule "(.+)no(.+)" (list "Why not?" "You are being a bit negative" "Are you saying no just to be negative?")
      setup-rule "(.+)someone(.+)" (list "can you be more specific? Is it the person who is watching me?")
      setup-rule "(.+)everyone(.+)" (list "surely not everyone? Were they watched?" "Can you think of anyone in particular?")
      setup-rule "(.+)always(.+)" (list "Can you think of a specific example?" "When?" "What incident are you thinking of?" "Really?-- Always?")
      setup-rule "who(.+)" (list "me--being watched? I think so!")
      setup-rule "what(.+)" (list "a man, a plan, a canal -panama" "a banana" "42")
      setup-rule "where(.+)" (list "everywhere")
      setup-rule "(.+)is(.+)" (list "I don't agree" "I agree")
      setup-rule "(.+)it(.+)" (list "what is it?")
      setup-rule "are(.+)" (list "no" "yes" "maybe")
    )
    set failure-list
    (list
      "I think someone is watching me. This line may not be secure"
      "uhu..."
      "oh yeah I know. Do you ever get the feeling you are being watched?"
      "continue..."
      "Do you like beans? They give me gas!"
      "Are you watching me?"
      "Please stop watching me"
      "I get nervous when people watch me"
    )
  ]

  create-chatbots 1
  [ set both who
    set name "Both" ; A schizophrenic chatbot
    set shape "person"
    set color green
    set size 15
    set label "Both      "
    setxy 14 0
    set rules-list (sentence ([rules-list] of chatbot liza) ([rules-list] of chatbot harry)) ; join together liza & harry's rules-lists
    set failure-list (sentence ([failure-list] of chatbot liza) ([failure-list] of chatbot harry)) ; joint together their failure-lists
  ]
end


to-report setup-rule [regex-str res]
; sets up a rule for matching a user's input
  let me nobody
  hatch-rules 1
  [ set regex regex-str
    set responses res
    set me who
    hide-turtle ] ; make it invisible in the environment
  report me
end

to chat
; chats with the user

  if (bot = "liza")  [ chat-with liza ]
  if (bot = "harry") [ chat-with harry ]
  if (bot = "both") [ chat-with both ]
end

to chat-with [this-chatbot]
; has a conversation with this-chatbot

  let fired false
  let pos 0
  let rule-no 0
  let this-chatbot-name [name] of chatbot this-chatbot

  let user-reply user-input "Enter text: "
  output-print "You say:"
  output-print user-reply

  ask chatbot this-chatbot
  [ set pos 0
    while [pos < length rules-list]
    [
      if (fired = false)
      [
        set rule-no item pos rules-list
        ask rule rule-no
        [
          re:clear-all
          re:setup-regex regex user-reply
          if (re:get-group-length > 0)
          [ output-type this-chatbot-name
            output-print " says:"
            output-print item random length responses responses
            output-print ""
            set fired true

            if (debug-conversation)
              [ output-print (word "[Chatbot " this-chatbot-name " matched rule no " pos " : " [regex] of rule rule-no "]") ]            
          ]                                          
        ]
      ]
      set pos pos + 1
    ]

    if (fired = false)
      [
        output-type this-chatbot-name
        output-print " says:"
        output-print one-of failure-list
        output-print ""

        if (debug-conversation)
          [ output-print (word "[" this-chatbot-name " failed to match any rule]") ]
      ]
  ]
end
;
; Copyright 2010 by Thomas Berverley and William John Teahan.  All rights reserved.
;
; Permission to use, modify or redistribute this model is hereby granted,
; provided that both of the following requirements are followed:
; a) this copyright notice is included.
; b) this model will not be redistributed for profit without permission
;    from William John Teahan.
; Contact William John Teahan for appropriate licenses for redistribution for
; profit.
;
; To refer to this model in publications, please use:
;
; Chatbot NetLogo NetLogo model.
; Teahan, W. J. (2010). Artificial Intelligence. Ventus Publishing Aps.
;