concepts.pdsketch.parsers.pdsketch_parser.load_problem_string#

load_problem_string(problem_string, domain, ignore_unknown_predicates=False, return_tensor_state=True, executor=None)[source]#

Load a problem from a string.

Parameters:
  • problem_string (str) – the string of the problem.

  • domain (Domain) – the domain.

  • ignore_unknown_predicates (bool) – whether to ignore unknown predicates. If set to True, unknown predicates will be ignored with a warning. Otherwise, an error will be raised while parsing the problem.

  • return_tensor_state (bool) – whether to return the initial state as a tensor state. If set to True, the return value wille be a tuple of (initial state, goal). Otherwise, the return value will be the Problem object.

  • executor (PDSketchExecutor | None) – the executor used to create initial states.

Returns:

the problem, as a tuple of (initial state, goal) if return_tensor_state is True, otherwise the Problem object.

Return type:

Tuple[TensorState, ValueOutputExpression] | Problem