You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to use STRIPSWorld.get_subtasks to check the incomplete subtasks (given the arglist and recipes from the env) in the GamePlay after each keyboard event, just like in RealAgent. But it always shows all the subtasks instead of the incomplete subtasks. So, how should I get incomplete subtasks in the play mode?
Modification in main.py:
game = GamePlay(env.filename, env.world, env.sim_agents, env.recipes, env.arglist)
Modifications In GamePlay.py
def __init__(self, filename, world, sim_agents, recipes, arglist):
self.recipes = recipes
self.arglist = arglist
...
if event.key in KeyToTuple.keys():
action = KeyToTuple[event.key]
self.current_agent.action = action
interact(self.current_agent, self.world)
# After a movement
sw = STRIPSWorld(world=self.world, recipes=self.recipes)
subtasks = sw.get_subtasks(max_path_length=self.arglist.max_num_subtasks)
all_subtasks = [subtask for path in subtasks for subtask in path]
print('Subtasks:', all_subtasks, '\n')
Finding incomplete subtasks in Agent.py:
def get_subtasks(self, world):
self.sw = STRIPSWorld(world, self.recipes)
# [path for recipe 1, path for recipe 2, ...] where each path is a list of actions.
subtasks = self.sw.get_subtasks(max_path_length=self.arglist.max_num_subtasks)
all_subtasks = [subtask for path in subtasks for subtask in path]
return all_subtasks
...
def setup_subtasks(self, env):
self.incomplete_subtasks = self.get_subtasks(world=env.world)
self.delegator = BayesianDelegator(
agent_name=self.name,
all_agent_names=env.get_agent_names(),
model_type=self.model_type,
planner=self.planner,
none_action_prob=self.none_action_prob)
Sample output in the console (the returned subtasks never change even if dishes are delivered):
I try to use
STRIPSWorld.get_subtasks
to check the incomplete subtasks (given thearglist
andrecipes
from theenv
) in theGamePlay
after each keyboard event, just like inRealAgent
. But it always shows all the subtasks instead of the incomplete subtasks. So, how should I get incomplete subtasks in the play mode?Modification in
main.py
:Modifications In
GamePlay.py
Finding incomplete subtasks in
Agent.py
:Sample output in the console (the returned subtasks never change even if dishes are delivered):
The text was updated successfully, but these errors were encountered: