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

Method _compute_output

pddlstream/language/function.py:81–94  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

79 assert len(self.history) == 1
80 return self.history[0]
81 def _compute_output(self):
82 self.enumerated = True
83 self.num_calls += 1
84 if self.history:
85 return self.value
86 input_values = self.get_input_values()
87 value = self.external.fn(*input_values)
88 # TODO: cast the inputs and test whether still equal?
89 # if not (type(self.value) is self.external._codomain):
90 # if not isinstance(self.value, self.external.codomain):
91 if value < 0:
92 raise ValueError('Function [{}] produced a negative value [{}]'.format(self.external.name, value))
93 self.history.append(self.external.codomain(value))
94 return self.value
95 def next_results(self, verbose=False):
96 assert not self.enumerated
97 start_time = time.time()

Callers 1

next_resultsMethod · 0.95

Calls 1

get_input_valuesMethod · 0.80

Tested by

no test coverage detected