Skip to content

Implemented 11.1 Job-Shop-Problem #422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
Next Next commit
create HLA
  • Loading branch information
KaiRawal committed Mar 26, 2017
commit 7425b90a6f02a7d4efe36a7a76fcf0a1433d5829
37 changes: 37 additions & 0 deletions planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,3 +574,40 @@ def goal_test(kb):
go = Action(expr("Go(actor, to)"), [precond_pos, precond_neg], [effect_add, effect_rem])

return PDLL(init, [hit, go], goal_test)


class HLA(Action):
"""
Define Actions for the real-world (that may be refined further), and satisfy resource
constraints.
"""
unique_group = 1

def __init__(self, action, precond=[None,None], effect=[None,None], duration=0, consume={}, use={}):
super().__init__(action, precond, effect)
self.duration = duration
self.consumes = consume
self.uses = use
self.completed = False
self.priority = -1 # must be assigned in relation to other HLAs
self.job_group = -1 # must be assigned in relation to other HLAs

def __call__(self, kb, args, resources):
if self.check_resources(resources):
return self.act(kb, args)

def order(hlas):
global unique_group
i = 1
for hla in hlas:
if (hla.job_group == -1): # could replace if-test with assert
hla.priority = i
hla.job_group = unique_group
i += 1
else:
raise Exception("Can't order HLA across job groups")
unique_group += 1

def check_resources(self, resources):
"""Checks if the resources conditions are satisfied"""
pass
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy