本文整理汇总了Python中agent.Agent.present_word方法的典型用法代码示例。如果您正苦于以下问题:Python Agent.present_word方法的具体用法?Python Agent.present_word怎么用?Python Agent.present_word使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类agent.Agent
的用法示例。
在下文中一共展示了Agent.present_word方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from agent import Agent [as 别名]
# 或者: from agent.Agent import present_word [as 别名]
#.........这里部分代码省略.........
self.test_nr_index = -1
def train_number(self):
self.test_nr_index = self.test_nr_index + 1
self.agent.marc.subtitle(self.test_nr[self.test_nr_index])
def check_nr(self, received):
if received != str(self.test_nr[self.test_nr_index]):
self.agent.marc.headNo()
print 'received is false'
else:
self.agent.marc.headYes()
self.test_correct += 1
print 'recieved is corrrect'
def subtitle(self, text, duration='2.0'):
self.agent.marc.subtitle(text,duration)
def save_start_time(self):
self.start_time = datetime.datetime.now()
self.agent.emo_module.wasabi.log_wasabi=True
def start(self):
''' Show init text and wait for start button.
'''
print 'started!'
return self.agent.start()
def present_word(self, now):
'''
'''
time_delta = now-self.start_time
print time_delta, ': PRESENT WORD', time_delta.seconds
if self.has_next():
word = self.pairs[self.index].word
number = self.pairs[self.index].number
self.logger.log('\nTask [{0} : {1}] @ {2}s'.format(
word.word, number.word, time_delta))
self.pairs[self.index].word_called(utilities.milliseconds(now))
self.start_time_answer = now
self.answer_given = False
return self.agent.present_word(word, number)
else:
print 'Index Error'
def present_number(self, now):
'''
'''
time_delta = now-self.start_time
print time_delta, ': PRESENT NR', time_delta.seconds
# Check if answer has been given. If not evaluate.
if not self.answer_given:
self.logger.log(' No answer given')
self.evaluate('-1', now)
if 0 <= self.index and self.index <= len(self.pairs):
number = self.pairs[self.index].number