1 from __future__
import print_function
3 female_names = [
"adel",
"angel",
"axel",
"charlie",
"jane",
"jules",
"morgan",
"paris",
"robin",
"simone"]
4 male_names = [
"adel",
"angel",
"axel",
"charlie",
"john",
"jules",
"morgan",
"paris",
"robin",
"simone"]
5 names = set(female_names)
6 names.update(set(male_names))
7 names = sorted(list(names))
10 {
"name":
"bed",
"room":
"bedroom",
"manipulation":
False},
11 {
"name":
"bedside_table",
"room":
"bedroom",
"manipulation":
True},
12 {
"name":
"shelf",
"room":
"bedroom",
"manipulation":
True},
13 {
"name":
"trashbin",
"room":
"kitchen",
"manipulation":
False},
14 {
"name":
"dishwasher",
"room":
"kitchen",
"manipulation":
True},
15 {
"name":
"potted_plant",
"room":
"kitchen",
"manipulation":
False},
16 {
"name":
"kitchen_table",
"room":
"kitchen",
"manipulation":
True},
17 {
"name":
"pantry",
"room":
"kitchen",
"manipulation":
True},
18 {
"name":
"refrigerator",
"room":
"kitchen",
"manipulation":
True},
19 {
"name":
"sink",
"room":
"kitchen",
"manipulation":
True},
20 {
"name":
"cabinet",
"room":
"study",
"manipulation":
True},
21 {
"name":
"coatrack",
"room":
"study",
"manipulation":
False},
22 {
"name":
"desk",
"room":
"study",
"manipulation":
True},
23 {
"name":
"armchair",
"room":
"study",
"manipulation":
False},
24 {
"name":
"waste_basket",
"room":
"study",
"manipulation":
False},
25 {
"name":
"tv_stand",
"room":
"living_room",
"manipulation":
True},
26 {
"name":
"storage_rack",
"room":
"living_room",
"manipulation":
True},
27 {
"name":
"lamp",
"room":
"living_room",
"manipulation":
False},
28 {
"name":
"side_tables",
"room":
"living_room",
"manipulation":
True},
29 {
"name":
"sofa",
"room":
"living_room",
"manipulation":
True},
30 {
"name":
"bookshelf",
"room":
"living_room",
"manipulation":
True},
33 location_rooms = list(set([o[
"room"]
for o
in locations]))
34 location_names = list(set([o[
"name"]
for o
in locations]))
35 manipulation_locations = list(set([o[
"name"]
for o
in locations
if o[
"manipulation"]]))
38 {
"name":
"sponge",
"category":
"cleaning_supplies"},
39 {
"name":
"cleanser",
"category":
"cleaning_supplies"},
40 {
"name":
"red_wine",
"category":
"drinks"},
41 {
"name":
"juice_pack",
"category":
"drinks"},
42 {
"name":
"cola",
"category":
"drinks"},
43 {
"name":
"tropical_juice",
"category":
"drinks"},
44 {
"name":
"milk",
"category":
"drinks"},
45 {
"name":
"iced_tea",
"category":
"drinks"},
46 {
"name":
"orange_juice",
"category":
"drinks"},
47 {
"name":
"tuna",
"category":
"food"},
48 {
"name":
"tomato_soup",
"category":
"food"},
49 {
"name":
"spam",
"category":
"food"},
50 {
"name":
"mustard",
"category":
"food"},
51 {
"name":
"strawberry_jello",
"category":
"food"},
52 {
"name":
"chocolate_jello",
"category":
"food"},
53 {
"name":
"coffee_grounds",
"category":
"food"},
54 {
"name":
"sugar",
"category":
"food"},
55 {
"name":
"pear",
"category":
"fruits"},
56 {
"name":
"plum",
"category":
"fruits"},
57 {
"name":
"peach",
"category":
"fruits"},
58 {
"name":
"lemon",
"category":
"fruits"},
59 {
"name":
"orange",
"category":
"fruits"},
60 {
"name":
"strawberry",
"category":
"fruits"},
61 {
"name":
"banana",
"category":
"fruits"},
62 {
"name":
"apple",
"category":
"fruits"},
63 {
"name":
"tennis_ball",
"category":
"toys"},
64 {
"name":
"soccer_ball",
"category":
"toys"},
65 {
"name":
"rubiks_cube",
"category":
"toys"},
66 {
"name":
"dice",
"category":
"toys"},
67 {
"name":
"baseball",
"category":
"toys"},
68 {
"name":
"pringles",
"category":
"snacks"},
69 {
"name":
"cornflakes",
"category":
"snacks"},
70 {
"name":
"cheezit",
"category":
"snacks"},
71 {
"name":
"spoon",
"category":
"dishes"},
72 {
"name":
"plate",
"category":
"dishes"},
73 {
"name":
"cup",
"category":
"dishes"},
74 {
"name":
"fork",
"category":
"dishes"},
75 {
"name":
"bowl",
"category":
"dishes"},
76 {
"name":
"knife",
"category":
"dishes"},
79 object_names = list(set([o[
"name"]
for o
in objects]))
80 object_categories = list(set([o[
"category"]
for o
in objects]))
82 category_locations = {
83 "cleaning_supplies": {
"shelf":
"on_top_of"},
84 "drinks": {
"cabinet":
"on_top_of"},
85 "food": {
"pantry":
"on_top_of"},
86 "fruits": {
"desk":
"on_top_of"},
87 "toys": {
"bookshelf":
"on_top_of"},
88 "snacks": {
"side_tables":
"on_top_of"},
89 "dishes": {
"kitchen_table":
"on_top_of"},
93 "pantry": [
"shelf2",
"shelf3"],
105 'shelf3_r':
'in_front_of_r',
106 'shelf4_r':
'in_front_of_r',
112 drink_spec =
"T['drink': O] -> OPTIONS[O]\n\n"
113 for drink
in [obj[
"name"]
for obj
in objects
if obj[
"category"] ==
"drinks"]:
114 drink_spec +=
"OPTIONS['{drink}'] -> {drink}\n".format(drink=drink)
118 for loc
in locations:
119 if loc[
"name"] == location:
125 for loc
in locations:
126 if loc[
"name"] == location:
132 return entity_id
in location_rooms
136 if location
in inspect_areas:
137 return inspect_areas[location]
143 if location
in inspect_positions
and area
in inspect_positions[location]:
144 return inspect_positions[location][area]
150 for loc
in locations:
151 if loc[
"name"] == location
and loc[
"manipulation"] ==
True:
157 return [loc[
"name"]
for loc
in locations
158 if (room ==
None or loc[
"room"] == room)
and \
170 return [obj[
"name"]
for obj
in objects
171 if category ==
None or category == obj[
"category"]]
200 location, area_name = next(iter(category_locations[obj_cat].items()))
201 return location, area_name