| 89 | # return curr_task_seq |
| 90 | |
| 91 | def add_current_place(curr_obs, look, places): |
| 92 | # Extract current place |
| 93 | index = curr_obs.find("move to the") |
| 94 | if index != -1: |
| 95 | place = curr_obs[index + 12: -1].strip() |
| 96 | if place not in places: |
| 97 | places.append(place) |
| 98 | |
| 99 | # Extract the first room the where the agent is |
| 100 | start = look.find("This room is called the") |
| 101 | end = look.find(".") |
| 102 | if start != -1: |
| 103 | if look[start + 24 : end] not in places: |
| 104 | places.append(look[start + 24 : end]) |
| 105 | return |
| 106 | |
| 107 | |
| 108 | def add_current_objects(task_id, look, objects, limit=20): |