August 2018
Intermediate to advanced
344 pages
9h 20m
English
This is our context memory. You can think of this as a pool of information that the robot can remember. We set up the robot's emotion and the model of human emotion to both be neutral". I created some data structure so that we can refer to multiple human users by pointing self.currentHuman to the HumanInformation data object we created previously.
We use the inContext function to retrieve data from the context pool. If no data is available, we return an integer of zero:
class ContextMemory(): def __init__(self): self.currentContext = "None" self.currentHuman = None # pointer to the data file for the human we are currentl talking to self.humanFile = [] self.emotion = "neutral" self.humanEmotion = "neutral" self.contextDict={} ...Read now
Unlock full access