@@ -173,9 +173,9 @@ class Action:
173173 Precondition and effect are both lists with positive and negative literals.
174174 Negative preconditions and effects are defined by adding a 'Not' before the name of the clause
175175 Example:
176- precond = [expr(" Human(person)" ), expr(" Hungry(Person)" ), expr(" NotEaten(food)" )]
177- effect = [expr(" Eaten(food)" ), expr(" Hungry(person)" )]
178- eat = Action(expr(" Eat(person, food)" ), precond, effect)
176+ precond = [expr(' Human(person)' ), expr(' Hungry(Person)' ), expr(' NotEaten(food)' )]
177+ effect = [expr(' Eaten(food)' ), expr(' Hungry(person)' )]
178+ eat = Action(expr(' Eat(person, food)' ), precond, effect)
179179 """
180180
181181 def __init__ (self , action , precond , effect , domain = None ):
@@ -1371,7 +1371,12 @@ def execute(self, display=True):
13711371 self .constraints = self .protect ((act0 , G , act1 ), action , self .constraints )
13721372
13731373 if step > 200 :
1374- print ("Couldn't find a solution" )
1374+ print ('Couldn'
1375+ t
1376+ find
1377+ a
1378+ solution
1379+ ')
13751380 return None , None
13761381
13771382 if display :
@@ -1450,12 +1455,18 @@ def do_action(self, job_order, available_resources, kb, args):
14501455 if not self .has_consumable_resource (available_resources ):
14511456 raise Exception ('Not enough consumable resources to execute {}' .format (self .name ))
14521457 if not self .inorder (job_order ):
1453- raise Exception ("Can't execute {} - execute prerequisite actions first" .
1454- format (self .name ))
1455- kb = super ().act (kb , args ) # update knowledge base
1456- for resource in self .consumes : # remove consumed resources
1457- available_resources [resource ] -= self .consumes [resource ]
1458- self .completed = True # set the task status to complete
1458+ raise Exception ('Can'
1459+ t
1460+ execute
1461+ {} - execute
1462+ prerequisite
1463+ actions
1464+ first
1465+ '.format (self .name ))
1466+ kb = super ().act (kb , args ) # update knowledge base
1467+ for resource in self .consumes : # remove consumed resources
1468+ available_resources [resource ] -= self .consumes [resource ]
1469+ self .completed = True # set the task status to complete
14591470 return kb
14601471
14611472 def has_consumable_resource (self , available_resources ):
0 commit comments