Skip to content

Commit

Permalink
#3 replace "kitchen" with "cookery"
Browse files Browse the repository at this point in the history
  • Loading branch information
jschalk committed Aug 29, 2023
1 parent 23e380d commit 5711006
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 89 deletions.
2 changes: 1 addition & 1 deletion src/agent/examples/example_agent1.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/agent/examples/example_agent2.json
Original file line number Diff line number Diff line change
Expand Up @@ -4675,14 +4675,14 @@
"_weight": 1,
"promise": true
},
"morning kitchen clean-up": {
"morning cookery clean-up": {
"_acptfactunits": {},
"_addin": null,
"_begin": null,
"_grouplinks": {},
"_close": null,
"_denom": null,
"_desc": "morning kitchen clean-up",
"_desc": "morning cookery clean-up",
"_is_expanded": true,
"_kids": {},
"_numeric_road": null,
Expand Down Expand Up @@ -5389,14 +5389,14 @@
"_weight": 1,
"promise": false
},
"kitchen": {
"cookery": {
"_acptfactunits": {},
"_addin": null,
"_begin": null,
"_grouplinks": {},
"_close": null,
"_denom": null,
"_desc": "kitchen",
"_desc": "cookery",
"_is_expanded": true,
"_kids": {},
"_numeric_road": null,
Expand Down
46 changes: 23 additions & 23 deletions src/agent/test_agent/test_agent_agenda.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def test_weekdayAgendaItemsCorrectlyReturned():


def test_agent_create_agenda_item_CorrectlyCreatesAllAgentAttributes():
# WHEN "I am cleaning the kitchen since I'm in the apartment and it's 8am and it's dirty and I'm doing this for my family"
# WHEN "I am cleaning the cookery since I'm in the apartment and it's 8am and it's dirty and I'm doing this for my family"

# GIVEN
src_text = "mysun"
Expand All @@ -601,30 +601,30 @@ def test_agent_create_agenda_item_CorrectlyCreatesAllAgentAttributes():

clean_things_text = "cleaning things"
clean_things_road = Road(f"{src_text},{clean_things_text}")
clean_kitchen_text = "clean kitchen"
clean_kitchen_road = Road(f"{src_text},{clean_things_text},{clean_kitchen_text}")
clean_kitchen_idea = IdeaKid(_desc=clean_kitchen_text, _walk=clean_things_road)
print(f"{clean_kitchen_idea.get_road()=}")
clean_cookery_text = "clean cookery"
clean_cookery_road = Road(f"{src_text},{clean_things_text},{clean_cookery_text}")
clean_cookery_idea = IdeaKid(_desc=clean_cookery_text, _walk=clean_things_road)
print(f"{clean_cookery_idea.get_road()=}")
home_text = "home"
home_road = Road(f"{src_text},{home_text}")
kitchen_room_text = "kitchen room"
kitchen_room_road = Road(f"{src_text},{home_text},{kitchen_room_text}")
kit_dirty_text = "dirty"
kit_dirty_road = Road(f"{kitchen_room_road},{kit_dirty_text}")
cookery_room_text = "cookery room"
cookery_room_road = Road(f"{src_text},{home_text},{cookery_room_text}")
cookery_dirty_text = "dirty"
cookery_dirty_road = Road(f"{cookery_room_road},{cookery_dirty_text}")

# create gregorian timeline
a1.set_time_hreg_ideas(c400_count=7)
daytime_road = Road(f"{src_text},time,jajatime,day")
open_8am = 480
nigh_8am = 480

dirty_kitchen_required = RequiredUnit(base=kitchen_room_road, sufffacts={})
dirty_kitchen_required.set_sufffact(sufffact=kit_dirty_road)
clean_kitchen_idea.set_required_unit(required=dirty_kitchen_required)
dirty_cookery_required = RequiredUnit(base=cookery_room_road, sufffacts={})
dirty_cookery_required.set_sufffact(sufffact=cookery_dirty_road)
clean_cookery_idea.set_required_unit(required=dirty_cookery_required)

daytime_required = RequiredUnit(base=daytime_road, sufffacts={})
daytime_required.set_sufffact(sufffact=daytime_road, open=open_8am, nigh=nigh_8am)
clean_kitchen_idea.set_required_unit(required=daytime_required)
clean_cookery_idea.set_required_unit(required=daytime_required)

# anna_text = "anna"
# anna_memberunit = memberunit_shop(name=anna_text)
Expand All @@ -638,30 +638,30 @@ def test_agent_create_agenda_item_CorrectlyCreatesAllAgentAttributes():
# groupunit_z.set_memberlink(memberlink=anna_memberlink)
# groupunit_z.set_memberlink(memberlink=beto_memberlink)
grouplink_z = grouplink_shop(name=family_text)
clean_kitchen_idea.set_grouplink(grouplink=grouplink_z)
clean_cookery_idea.set_grouplink(grouplink=grouplink_z)

assert len(a1._members) == 0
assert len(a1._groups) == 0
assert len(a1._idearoot._kids) == 1
assert a1.get_idea_kid(road=daytime_road)._begin == 0
assert a1.get_idea_kid(road=daytime_road)._close == 1440
print(f"{clean_kitchen_idea.get_road()=}")
print(f"{clean_cookery_idea.get_road()=}")

# GIVEN
a1.set_dominate_promise_idea(idea_kid=clean_kitchen_idea)
a1.set_dominate_promise_idea(idea_kid=clean_cookery_idea)

# THEN
# for idea_kid in a1._idearoot._kids.keys():
# print(f" {idea_kid=}")

print(f"{clean_kitchen_idea.get_road()=}")
assert a1.get_idea_kid(road=clean_kitchen_road) != None
assert a1.get_idea_kid(road=clean_kitchen_road)._desc == clean_kitchen_text
assert a1.get_idea_kid(road=clean_kitchen_road).promise
assert len(a1.get_idea_kid(road=clean_kitchen_road)._requiredunits) == 2
print(f"{clean_cookery_idea.get_road()=}")
assert a1.get_idea_kid(road=clean_cookery_road) != None
assert a1.get_idea_kid(road=clean_cookery_road)._desc == clean_cookery_text
assert a1.get_idea_kid(road=clean_cookery_road).promise
assert len(a1.get_idea_kid(road=clean_cookery_road)._requiredunits) == 2
assert a1.get_idea_kid(road=clean_things_road) != None
assert a1.get_idea_kid(road=kitchen_room_road) != None
assert a1.get_idea_kid(road=kit_dirty_road) != None
assert a1.get_idea_kid(road=cookery_room_road) != None
assert a1.get_idea_kid(road=cookery_dirty_road) != None
assert a1.get_idea_kid(road=daytime_road)._begin == 0
assert a1.get_idea_kid(road=daytime_road)._close == 1440
assert len(a1._groups) == 1
Expand Down
66 changes: 33 additions & 33 deletions src/agent/test_agent/test_agent_bond.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def test_agentunit_get_bond_status_ReturnsCorrectBool():
assert cx.get_bond_status() == False

# WHEN\THEN 1 action idea exists
clean_kitchen_text = "clean kitchen"
clean_cookery_text = "clean cookery"
cx.add_idea(
idea_kid=IdeaKid(_desc=clean_kitchen_text, promise=True), walk=casa_road
idea_kid=IdeaKid(_desc=clean_cookery_text, promise=True), walk=casa_road
)
assert cx.get_bond_status()

Expand All @@ -59,8 +59,8 @@ def test_agentunit_get_bond_status_ReturnsCorrectBool():
assert cx.get_bond_status()

# WHEN\THEN 1 action idea deleted (0 total)
clean_kitchen_road = Road(f"{jessi_text},{casa_text},{clean_kitchen_text}")
cx.del_idea_kid(road=clean_kitchen_road)
clean_cookery_road = Road(f"{jessi_text},{casa_text},{clean_cookery_text}")
cx.del_idea_kid(road=clean_cookery_road)
assert cx.get_bond_status() == False

# for idea_kid in cx._idearoot._kids.values():
Expand All @@ -74,17 +74,17 @@ def test_agentunit_get_bond_status_ReturnsCorrectBoolWhenOnlyActionIdeaGroupheir
casa_text = "case"
casa_road = Road(f"{jessi_text},{casa_text}")
cx.add_idea(idea_kid=IdeaKid(_desc=casa_text), walk=jessi_text)
clean_kitchen_text = "clean kitchen"
clean_kitchen_road = Road(f"{jessi_text},{casa_text},{clean_kitchen_text}")
clean_cookery_text = "clean cookery"
clean_cookery_road = Road(f"{jessi_text},{casa_text},{clean_cookery_text}")
cx.add_idea(
idea_kid=IdeaKid(_desc=clean_kitchen_text, promise=True), walk=casa_road
idea_kid=IdeaKid(_desc=clean_cookery_text, promise=True), walk=casa_road
)
tom_text = "tom"
cx.add_memberunit(name=tom_text)
assert cx.get_bond_status() == False

# WHEN
cx.edit_idea_attr(road=clean_kitchen_road, grouplink=grouplink_shop(name=tom_text))
cx.edit_idea_attr(road=clean_cookery_road, grouplink=grouplink_shop(name=tom_text))
# THEN
assert cx.get_bond_status()

Expand All @@ -102,19 +102,19 @@ def test_agentunit_get_bond_status_ChecksActionIdeaGroupsheirsEqualAgentGroupuni
casa_text = "case"
casa_road = Road(f"{jessi_text},{casa_text}")
cx.add_idea(idea_kid=IdeaKid(_desc=casa_text), walk=jessi_text)
clean_kitchen_text = "clean kitchen"
clean_kitchen_road = Road(f"{jessi_text},{casa_text},{clean_kitchen_text}")
clean_cookery_text = "clean cookery"
clean_cookery_road = Road(f"{jessi_text},{casa_text},{clean_cookery_text}")
cx.add_idea(
idea_kid=IdeaKid(_desc=clean_kitchen_text, promise=True), walk=casa_road
idea_kid=IdeaKid(_desc=clean_cookery_text, promise=True), walk=casa_road
)
tom_text = "tom"
cx.add_memberunit(name=tom_text)
assert cx.get_bond_status() == False

# WHEN
cx.edit_idea_attr(road=clean_kitchen_road, grouplink=grouplink_shop(name=tom_text))
clean_kitchen_idea = cx.get_idea_kid(road=clean_kitchen_road)
assert len(clean_kitchen_idea._groupheirs) == 1
cx.edit_idea_attr(road=clean_cookery_road, grouplink=grouplink_shop(name=tom_text))
clean_cookery_idea = cx.get_idea_kid(road=clean_cookery_road)
assert len(clean_cookery_idea._groupheirs) == 1
# THEN
assert cx.get_bond_status()

Expand All @@ -132,10 +132,10 @@ def test_agentunit_get_bond_status_ChecksActionIdeaGroupsheirsEqualAgentGroupuni
casa_text = "case"
casa_road = Road(f"{jessi_text},{casa_text}")
cx.add_idea(idea_kid=IdeaKid(_desc=casa_text), walk=jessi_text)
clean_kitchen_text = "clean kitchen"
clean_kitchen_road = Road(f"{jessi_text},{casa_text},{clean_kitchen_text}")
clean_cookery_text = "clean cookery"
clean_cookery_road = Road(f"{jessi_text},{casa_text},{clean_cookery_text}")
cx.add_idea(
idea_kid=IdeaKid(_desc=clean_kitchen_text, promise=True), walk=casa_road
idea_kid=IdeaKid(_desc=clean_cookery_text, promise=True), walk=casa_road
)
assert cx.get_bond_status()

Expand All @@ -152,7 +152,7 @@ def test_agentunit_get_bond_status_ChecksActionIdeaGroupsheirsEqualAgentGroupuni

# WHEN
cx.edit_idea_attr(
road=clean_kitchen_road, grouplink=grouplink_shop(name=home_occupants_text)
road=clean_cookery_road, grouplink=grouplink_shop(name=home_occupants_text)
)
# THEN
assert cx.get_bond_status()
Expand All @@ -172,12 +172,12 @@ def test_agentunit_get_bond_status_ChecksOnlyNecessaryIdeasExist_MultipleScenari
casa_text = "case"
casa_road = Road(f"{jessi_text},{casa_text}")
cx.add_idea(idea_kid=IdeaKid(_desc=casa_text), walk=jessi_text)
clean_kitchen_text = "clean kitchen"
clean_kitchen_road = Road(f"{jessi_text},{casa_text},{clean_kitchen_text}")
clean_cookery_text = "clean cookery"
clean_cookery_road = Road(f"{jessi_text},{casa_text},{clean_cookery_text}")

# WHEN/THEN
cx.add_idea(
idea_kid=IdeaKid(_desc=clean_kitchen_text, promise=True), walk=casa_road
idea_kid=IdeaKid(_desc=clean_cookery_text, promise=True), walk=casa_road
)
assert cx.get_bond_status()

Expand All @@ -193,7 +193,7 @@ def test_agentunit_get_bond_status_ChecksOnlyNecessaryIdeasExist_MultipleScenari

# WHEN/THEN
cx.edit_idea_attr(
road=clean_kitchen_road, required_base=water_road, required_sufffact=rain_road
road=clean_cookery_road, required_base=water_road, required_sufffact=rain_road
)
assert cx.get_bond_status()

Expand All @@ -207,10 +207,10 @@ def test_agentunit_get_agent_sprung_from_single_idea_ReturnsCorrectAgentScenario
cx.add_idea(
idea_kid=IdeaKid(_desc=casa_text, _begin=-1, _close=19), walk=jessi_text
)
clean_kitchen_text = "clean kitchen"
clean_kitchen_road = Road(f"{jessi_text},{casa_text},{clean_kitchen_text}")
clean_cookery_text = "clean cookery"
clean_cookery_road = Road(f"{jessi_text},{casa_text},{clean_cookery_text}")
cx.add_idea(
idea_kid=IdeaKid(_desc=clean_kitchen_text, promise=True, _begin=2, _close=4),
idea_kid=IdeaKid(_desc=clean_cookery_text, promise=True, _begin=2, _close=4),
walk=casa_road,
)
water_text = "water"
Expand All @@ -219,10 +219,10 @@ def test_agentunit_get_agent_sprung_from_single_idea_ReturnsCorrectAgentScenario
assert cx.get_bond_status() == False

# WHEN
bond_agent = cx.get_agent_sprung_from_single_idea(road=clean_kitchen_road)
bond_agent = cx.get_agent_sprung_from_single_idea(road=clean_cookery_road)

# THEN
# assert bond_agent._desc == clean_kitchen_text
# assert bond_agent._desc == clean_cookery_text
print(f"{len(bond_agent._idea_dict)=}")
assert len(bond_agent._idea_dict) == 3
b_src_idea = bond_agent.get_idea_kid(road=jessi_text)
Expand All @@ -239,12 +239,12 @@ def test_agentunit_get_agent_sprung_from_single_idea_ReturnsCorrectAgentScenario
assert b_casa_idea._close == src_casa_idea._close
assert b_casa_idea != src_casa_idea

b_clean_kitchen_idea = bond_agent.get_idea_kid(road=clean_kitchen_road)
src_clean_kitchen_idea = cx.get_idea_kid(road=clean_kitchen_road)
assert b_clean_kitchen_idea._uid == src_clean_kitchen_idea._uid
assert b_clean_kitchen_idea._begin == src_clean_kitchen_idea._begin
assert b_clean_kitchen_idea._close == src_clean_kitchen_idea._close
assert b_clean_kitchen_idea != src_clean_kitchen_idea
b_clean_cookery_idea = bond_agent.get_idea_kid(road=clean_cookery_road)
src_clean_cookery_idea = cx.get_idea_kid(road=clean_cookery_road)
assert b_clean_cookery_idea._uid == src_clean_cookery_idea._uid
assert b_clean_cookery_idea._begin == src_clean_cookery_idea._begin
assert b_clean_cookery_idea._close == src_clean_cookery_idea._close
assert b_clean_cookery_idea != src_clean_cookery_idea

assert bond_agent._idearoot._kids.get(water_text) is None

Expand Down
16 changes: 8 additions & 8 deletions src/agent/test_agent/test_agent_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,18 +592,18 @@ def test_agent_add_idea_CreatesMissingGroups():
a_x = AgentUnit(_desc=src_text)
a_x.set_groupunits_empty_if_null()
new_idea_parent_road = f"{src_text},work,cleaning"
clean_kitchen_text = "clean_kitchen"
clean_kitchen_idea = IdeaKid(_weight=40, _desc=clean_kitchen_text, promise=True)
clean_cookery_text = "clean_cookery"
clean_cookery_idea = IdeaKid(_weight=40, _desc=clean_cookery_text, promise=True)

family_text = "family"
grouplink_z = grouplink_shop(name=family_text)
clean_kitchen_idea.set_grouplink(grouplink=grouplink_z)
clean_cookery_idea.set_grouplink(grouplink=grouplink_z)
assert len(a_x._groups) == 0
assert a_x._groups.get(family_text) is None

# WHEN
a_x.add_idea(
idea_kid=clean_kitchen_idea,
idea_kid=clean_cookery_idea,
walk=new_idea_parent_road,
create_missing_ideas_groups=True,
)
Expand All @@ -620,12 +620,12 @@ def test_agent_add_idea_DoesNotOverwriteGroups():
a_x = AgentUnit(_desc=src_text)
a_x.set_groupunits_empty_if_null()
new_idea_parent_road = f"{src_text},work,cleaning"
clean_kitchen_text = "clean_kitchen"
clean_kitchen_idea = IdeaKid(_weight=40, _desc=clean_kitchen_text, promise=True)
clean_cookery_text = "clean_cookery"
clean_cookery_idea = IdeaKid(_weight=40, _desc=clean_cookery_text, promise=True)

family_text = "family"
grouplink_z = grouplink_shop(name=family_text)
clean_kitchen_idea.set_grouplink(grouplink=grouplink_z)
clean_cookery_idea.set_grouplink(grouplink=grouplink_z)

groupunit_z = groupunit_shop(name=family_text)
groupunit_z.set_memberlink(memberlink=memberlink_shop(name="ann1"))
Expand All @@ -639,7 +639,7 @@ def test_agent_add_idea_DoesNotOverwriteGroups():

# WHEN
a_x.add_idea(
idea_kid=clean_kitchen_idea,
idea_kid=clean_cookery_idea,
walk=new_idea_parent_road,
create_missing_ideas_groups=True,
)
Expand Down
22 changes: 11 additions & 11 deletions src/agent/test_agent/test_agent_idea_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,24 +136,24 @@ def test_agent_add_idea_creates_requireds_ideas():
assert agent_x.get_level_count(level=3) == 2
src_text = agent_x._idearoot._desc
new_idea_parent_road = f"{src_text},work,cleaning"
clean_kitchen_text = "clean_kitchen"
clean_kitchen_idea = IdeaKid(_weight=40, _desc=clean_kitchen_text, promise=True)
clean_cookery_text = "clean_cookery"
clean_cookery_idea = IdeaKid(_weight=40, _desc=clean_cookery_text, promise=True)

buildings_text = "buildings"
buildings_road = Road(f"{src_text},{buildings_text}")
kitchen_room_text = "kitchen"
kitchen_room_road = Road(f"{src_text},{buildings_text},{kitchen_room_text}")
kitchen_dirty_text = "dirty"
kitchen_dirty_road = Road(f"{kitchen_room_road},{kitchen_dirty_text}")
required_x = RequiredUnit(base=kitchen_room_road, sufffacts={})
required_x.set_sufffact(sufffact=kitchen_dirty_road)
clean_kitchen_idea.set_required_unit(required=required_x)
cookery_room_text = "cookery"
cookery_room_road = Road(f"{src_text},{buildings_text},{cookery_room_text}")
cookery_dirty_text = "dirty"
cookery_dirty_road = Road(f"{cookery_room_road},{cookery_dirty_text}")
required_x = RequiredUnit(base=cookery_room_road, sufffacts={})
required_x.set_sufffact(sufffact=cookery_dirty_road)
clean_cookery_idea.set_required_unit(required=required_x)

assert agent_x._idearoot._kids.get(buildings_text) is None

# WHEN
agent_x.add_idea(
idea_kid=clean_kitchen_idea,
idea_kid=clean_cookery_idea,
walk=new_idea_parent_road,
create_missing_ideas_groups=True,
)
Expand All @@ -164,7 +164,7 @@ def test_agent_add_idea_creates_requireds_ideas():
# print(f"{idea_kid._desc=}")
assert agent_x._idearoot._kids.get(buildings_text) != None
assert agent_x.get_idea_kid(road=buildings_road) != None
assert agent_x.get_idea_kid(road=kitchen_dirty_road) != None
assert agent_x.get_idea_kid(road=cookery_dirty_road) != None
assert agent_x.get_node_count() == 22
assert agent_x.get_level_count(level=3) == 4

Expand Down
Loading

0 comments on commit 5711006

Please sign in to comment.