Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a1090c0
Update to include test code, realize issues, and clean up unnecessary…
carwyn987 Sep 25, 2025
f023860
Update, identified location of bug that exists within linearize, but …
carwyn987 Sep 27, 2025
31349ba
Add initial layer interference test, recursive goal testing, and appr…
carwyn987 Sep 27, 2025
e2f48d3
Add action application to verify results
carwyn987 Sep 27, 2025
0fb3902
Add changes, stuff doesn't work
carwyn987 Sep 29, 2025
7a3ad7c
I have made the formulation understandable now. Each level is grouped…
carwyn987 Sep 29, 2025
5234d7b
Cake problem works now. On to debugging shopping problem );
carwyn987 Sep 29, 2025
5fbbc85
If I ever see GraphPlan in a dark alley it's not leaving alive. ... b…
carwyn987 Sep 30, 2025
60d33ea
Now I'm confused about some of the tests. ... tennis problem also fai…
carwyn987 Sep 30, 2025
cb71b64
Improved extract_solution
carwyn987 Sep 30, 2025
256863c
Most tests consistently passing
carwyn987 Oct 1, 2025
204b19b
Working! Needed to update the extract_solution to attempt every power…
carwyn987 Oct 4, 2025
ea6ca75
Cleanup
carwyn987 Oct 4, 2025
c6ce67c
Cleanup and pytest configuration work
carwyn987 Oct 5, 2025
a2265d7
Merge pull request #1 from carwyn987/experimental/revert_ordering_and…
carwyn987 Oct 5, 2025
82e061b
More cleanup, removed unnecessary functions
carwyn987 Oct 5, 2025
4a24a2e
Further cleanup
carwyn987 Oct 5, 2025
497414c
Issue identified. Leveloff condition failing to check for mutex equiv…
carwyn987 Oct 5, 2025
b16e862
Differentiated between state and action mutexes. Fixed leveloff funct…
carwyn987 Oct 5, 2025
dabd9bd
Remove lingering print statement
carwyn987 Oct 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cake problem works now. On to debugging shopping problem );
  • Loading branch information
carwyn987 committed Sep 29, 2025
commit 5234d7b90e4aff8c690aecc7a55b2db17f233069
Binary file removed Screenshot from 2025-09-28 11-02-00.png
Binary file not shown.
Binary file removed Screenshot from 2025-09-29 11-24-54.png
Binary file not shown.
Binary file added cake_example_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cake_problem_graph2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cake_problem_graph3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 37 additions & 4 deletions planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@ def __init__(self, kb, is_first_layer=False):

self.is_first_layer = is_first_layer
self.next_state_mutexes = []
self.state_mutexes = []

def __call__(self, actions, objects):
self.build(actions, objects)
Expand Down Expand Up @@ -916,6 +917,7 @@ def find_mutex(self):
"Therefore, we're computing it for the current state and current (state+1) action layer"

#breakpoint()
self.state_mutexes = self.mutex # save state mutexes
self.mutex = [] # clear out effects from state mutex prior computation

# Inconsistent effects - one action adds a literal that another deletes
Expand All @@ -930,11 +932,15 @@ def find_mutex(self):
if {a, b} not in self.mutex:
self.mutex.append({a, b})

# Interference will be calculated with the last step
# Interference will be calculated with the last step ???
# Interference - One action deletes a precondition or effect of another
pos_csl, neg_csl = self.separate(self.current_state_links)


# Competing needs - preconditions of two actions are mutex at previous proposition layer
"""
pos_csl, neg_csl = self.separate(self.current_state_links)
# Why are we looking at syntactic components (negation)???
breakpoint()
for pos_precond in pos_csl:
for neg_precond in neg_csl:
new_neg_precond = Expr(neg_precond.op[3:], *neg_precond.args)
Expand All @@ -943,9 +949,36 @@ def find_mutex(self):
for b in self.current_state_links[neg_precond]:
if {a, b} not in self.mutex:
self.mutex.append({a, b})

# Only consider actual actions (not propositions)
"""

# Competing Needs
# self.current_state_links = map from current state vars -> actions applicable
# self.current_action_links = map from current actions -> starting states

# Implement here: Iterate over all valid pairs of actions, and if the states they come from are mutex (use self.state_mutexes), add a mutex pair to self.mutex
# Competing Needs - two actions are mutex if any of their preconditions are mutex at the previous state level
for a1, a2 in itertools.combinations(self.current_action_links.keys(), 2):
preconds_a1 = self.current_action_links[a1] # states
preconds_a2 = self.current_action_links[a2]

#if len(preconds_a1) > 1 or len(preconds_a2) > 1:
# print("An action has multiple preconditions (state)? Is the following logic implemented correctly? I think so")

# check all pairs of preconditions
for p in preconds_a1:
for q in preconds_a2:
if {p, q} in self.state_mutexes:
mutex_pair = {a1, a2}
if mutex_pair not in self.mutex:
self.mutex.append(mutex_pair)
# no need to keep checking once we've marked them
break
else:
continue
break

"""
# Only consider actual actions (not propositions)
action_keys = [a for a in self.next_action_links.keys() if not a.op.startswith("P")]

if self.is_first_layer:
Expand Down
6 changes: 3 additions & 3 deletions submission1_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ def verify_solution(P):
P.act(expr(act))
assert P.goal_test() == True

def ptest_air_cargo():
def test_air_cargo():
P = air_cargo()
verify_solution(P)

def test_spare_tire():
P = spare_tire()
verify_solution(P)

def ptest_three_block_tower():
def test_three_block_tower():
P = three_block_tower()
verify_solution(P)

Expand Down Expand Up @@ -80,7 +80,7 @@ def test_logistics_plan_valid(goal_state):
"In(C1, D3) & In(C2, D3) & In(C3, D3)",
"In(C1, D2) & In(C3, D3) & In(C2, D1)",
])
def ptest_logistics_plan_no_plan(goal_state):
def test_logistics_plan_no_plan(goal_state):
"""These are known to have no valid plan."""
init = "In(C1, R1) & In(C2, D1) & In(C3, D2) & In(R1, D1) & Holding(R1)"
P = logisticsPlanCustom(init, goal_state)
Expand Down