SAM

class amlgym.algorithms.SAM.SAM[source]

Bases: PassiveAlgorithmAdapter

Adapter class for running the SAM algorithm: “Safe Learning of Lifted Action Models”, B. Juba and H. S. Le, and R. Stern, Proceedings of the 18th International Conference on Principles of Knowledge Representation and Reasoning, 2021. https://proceedings.kr.org/2021/36/

Example

from amlgym.algorithms import get_algorithm
sam = get_algorithm('SAM')
model = sam.learn('path/to/domain.pddl', ['path/to/trace0', 'path/to/trace1'])
print(model)
__init__()
learn(domain_path, trajectory_paths)[source]
Learns a PDDL action model from:
  1. a (possibly empty) input model which is required to specify the predicates and operators signature;

  2. a list of trajectory file paths.

Parameters:
  • domain_path (str) – input PDDL domain file path

  • trajectory_paths (List[str]) – list of trajectory file paths

Return type:

str

Returns:

a string representing the learned PDDL model