Skip to content

Commit adbe162

Browse files
committed
Removes learning/rewards
1 parent 92c61f8 commit adbe162

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

agents/bt_agent.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@ def __init__(self):
3333
50, CONTINUOUS_TICK_TOCK, None, None))
3434

3535
def act(self):
36-
# print (BLACKBOARD.next_action)
3736
action = BLACKBOARD.get("next_action") or [0, 0, 0, 0, 0]
3837
BLACKBOARD.set("next_action", None)
3938
return action
40-
# return [0, 1, 0, random.randint(0, 1), 0]
4139

4240
def sense(self, obs):
4341

@@ -47,27 +45,6 @@ def sense(self, obs):
4745
BLACKBOARD.set("focus", field[9:14, 11:16].flatten())
4846
BLACKBOARD.set("can_shoot", obs[0])
4947

50-
def learn(self):
51-
T = "learn aciton"
52-
while self.cum_reward < 1:
53-
perform_action(sequence(T_safe, T))
54-
if is_executed("action learn"):
55-
T_cond = get_situation()
56-
T_acts = learn_single_action(T)
57-
if T_acts.children == 0:
58-
T_acts = get_actions_gp(T)
59-
if is_present(T_acts):
60-
T_cond_exist = get_conditions(T_acts)
61-
T_cond_exist = simplify(fallback(T_cond_exist, T_cond))
62-
else:
63-
T = fallback(sequence(T_cond, T_acts), T)
64-
self.get_rewards(sequence(T_safe, T))
65-
return T
66-
67-
68-
# def giveRewards(self, reward, cum_reward):
69-
# return 0.1
70-
7148
def create_tree(self):
7249
BLACKBOARD.next_action = [0,0,0,0,0]
7350
root = Selector("root")

0 commit comments

Comments
 (0)