-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.gd
84 lines (75 loc) · 2.15 KB
/
test.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
extends Node
var brain
var Brain = preload("res://brain.gd")
var actors: Array[Actor]
func _ready():
print("Running test")
# reset_state()
# test1()
# reset_state()
# test2()
# reset_state()
# test3()
# reset_state()
# test4()
# reset_state()
# test5()
# reset_state()
# test6()
func reset_state():
if brain != null:
brain.queue_free()
actors.resize(0)
actors.append(Actor.new())
actors.append(Actor.new())
actors[ChatText.ACTOR.HUMAN].name = "human"
actors[ChatText.ACTOR.COMPI].name = "compi"
brain = Brain.new(actors)
add_child(brain)
func test1():
print("test 1")
brain.chat.read_message("WHO ARE YOU?", ChatText.ACTOR.COMPI)
brain.chat.only_weights(ChatText.ACTOR.COMPI)
for q in brain.chat.quips:
prints(q, brain.chat.quips[q].weight)
func test2():
print("test 2")
brain.chat.read_message("WHO ARE YOU?", ChatText.ACTOR.HUMAN)
brain.chat.only_weights(ChatText.ACTOR.HUMAN)
for q in brain.chat.quips:
prints(q, brain.chat.quips[q].weight)
func test3():
print("test 3")
brain.chat.read_message("WHO ARE YOU?", ChatText.ACTOR.HUMAN)
var a = brain.chat.select_answer(ChatText.ACTOR.HUMAN)
print(a)
func test4():
print("test 4")
brain.chat.read_message("WHO ARE YOU?", ChatText.ACTOR.HUMAN)
var a = brain.chat.select_answer(ChatText.ACTOR.HUMAN)
print(a)
brain.chat.read_message("WHO ARE YOU?", ChatText.ACTOR.COMPI)
a = brain.chat.select_answer(ChatText.ACTOR.COMPI)
print(a)
brain.chat.read_message("WHO ARE YOU?", ChatText.ACTOR.COMPI)
a = brain.chat.select_answer(ChatText.ACTOR.COMPI)
print(a)
func test5():
print("test 5")
brain.chat.read_message("HELLO", ChatText.ACTOR.HUMAN)
var a = brain.chat.select_answer(ChatText.ACTOR.HUMAN)
print(a)
brain.chat.read_message("HELLO", ChatText.ACTOR.COMPI)
a = brain.chat.select_answer(ChatText.ACTOR.COMPI)
print(a)
brain.chat.read_message("WHO ARE YOU?", ChatText.ACTOR.COMPI)
a = brain.chat.select_answer(ChatText.ACTOR.COMPI)
print(a)
func test6():
print("test 6")
brain.chat.only_weights(ChatText.ACTOR.COMPI)
var a = brain.chat.select_answer(ChatText.ACTOR.COMPI)
for q in brain.chat.quips:
prints(q, brain.chat.quips[q].weight)
print(brain.chat.quips["I JUST KNOW IT"].weight)
print(a)