MCPcopy Create free account
hub / github.com/caelan/pddlstream / process_instance

Function process_instance

pddlstream/algorithms/incremental.py:47–66  ·  view source on GitHub ↗
(instantiator, store, instance, verbose=False)

Source from the content-addressed store, hash-verified

45##################################################
46
47def process_instance(instantiator, store, instance, verbose=False): #, **complexity_args):
48 if instance.enumerated:
49 return []
50 start_time = time.time()
51 new_results, new_facts = instance.next_results(verbose=verbose)
52 store.sample_time += elapsed_time(start_time)
53
54 evaluations = store.evaluations
55 #remove_blocked(evaluations, instance, new_results)
56 for result in new_results:
57 complexity = result.compute_complexity(evaluations)
58 #complexity = instantiator.compute_complexity(instance)
59 for evaluation in add_certified(evaluations, result):
60 instantiator.add_atom(evaluation, complexity)
61 fact_complexity = 0 # TODO: record the instance or treat as initial?
62 for evaluation in add_facts(evaluations, new_facts, result=UNKNOWN_EVALUATION, complexity=fact_complexity):
63 instantiator.add_atom(evaluation, fact_complexity)
64 if not instance.enumerated:
65 instantiator.push_instance(instance)
66 return new_results
67
68def process_stream_queue(instantiator, store, complexity_limit=INF, verbose=False):
69 instances = []

Callers 1

process_stream_queueFunction · 0.70

Calls 7

elapsed_timeFunction · 0.90
add_certifiedFunction · 0.90
add_factsFunction · 0.90
add_atomMethod · 0.80
push_instanceMethod · 0.80
next_resultsMethod · 0.45
compute_complexityMethod · 0.45

Tested by

no test coverage detected