|
1 | | -# from pprint import pprint |
| 1 | +from pprint import pprint |
2 | 2 | from random import random |
3 | 3 | from random import choice |
4 | 4 |
|
@@ -31,13 +31,15 @@ def __init__(self, action_set): |
31 | 31 | self.where = MostSpecific |
32 | 32 | # self.when = 'naive bayes' |
33 | 33 | # self.when = 'always true' |
34 | | - # self.when = 'trestle' |
35 | | - self.when = 'decision tree' |
| 34 | + self.when = 'trestle' |
| 35 | + # self.when = 'cobweb' |
| 36 | + # self.when = 'decision tree' |
36 | 37 | self.skills = {} |
37 | 38 | self.examples = {} |
38 | 39 | self.action_set = action_set |
39 | 40 |
|
40 | 41 | def request(self, state): |
| 42 | + # print(state) |
41 | 43 | # print("REQUEST RECEIVED") |
42 | 44 | tup = Tuplizer() |
43 | 45 | flt = Flattener() |
@@ -85,7 +87,7 @@ def request(self, state): |
85 | 87 | skillset.sort(reverse=True) |
86 | 88 |
|
87 | 89 | # print('####SKILLSET####') |
88 | | - # pprint(skillset) |
| 90 | + pprint(skillset) |
89 | 91 | # print('####SKILLSET####') |
90 | 92 |
|
91 | 93 | # used for grounding out plans, don't need to build up each time. |
@@ -285,6 +287,11 @@ def compute_exp_depth(self, exp): |
285 | 287 | return 0 |
286 | 288 |
|
287 | 289 | def train(self, state, label, foas, selection, action, inputs, correct): |
| 290 | + print('label', label) |
| 291 | + print('selection', selection) |
| 292 | + print('action', action) |
| 293 | + print('input', inputs) |
| 294 | + print('correct', correct) |
288 | 295 |
|
289 | 296 | # label = 'math' |
290 | 297 |
|
@@ -524,8 +531,8 @@ def train(self, state, label, foas, selection, action, inputs, correct): |
524 | 531 | # print("SAI") |
525 | 532 | # print(r_exp[0]) |
526 | 533 |
|
527 | | - # print("CONSTRAINTS") |
528 | | - # print(constraints) |
| 534 | + print("CONSTRAINTS") |
| 535 | + print(constraints) |
529 | 536 |
|
530 | 537 | w_args = tuple(['?foa%s' % j for j, _ in enumerate(args)]) |
531 | 538 |
|
@@ -587,7 +594,9 @@ def generate_tutor_constraints(self, sai): |
587 | 594 | constraints.add(('name', selection, 'done')) |
588 | 595 | else: |
589 | 596 | # constraints.add(('not', ('type', selection, 'MAIN::button'))) |
590 | | - constraints.add(('type', selection, 'MAIN::cell')) |
| 597 | + constraints.add(('not', ('type', selection, 'MAIN::button'))) |
| 598 | + constraints.add(('not', ('type', selection, 'MAIN::label'))) |
| 599 | + # constraints.add(('type', selection, 'MAIN::cell')) |
591 | 600 |
|
592 | 601 | # value constraints, don't select empty values |
593 | 602 | for i, a in enumerate(args[1:]): |
|
0 commit comments