concepts.dm.pdsketch.strips.strips_expression.SStateDict#
- class SStateDict[source]#
Bases:
dict
,Dict
[str
,Set
[Tuple
[int
|str
, …]]]Methods
add
(predicate_name, arguments)as_state
()clear
()clone
()contains
(predicate_name, arguments[, ...])Check whether the state contains the given proposition.
copy
()fromkeys
([value])Create a new dictionary with keys from iterable and values set to value.
get
(key[, default])Return the value for key if key is in the dictionary, else default.
items
()keys
()pop
(k[,d])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem
()Remove and return a (key, value) pair as a 2-tuple.
remove
(predicate_name, arguments)setdefault
(key[, default])Insert key with a value of default if key is not in the dictionary.
update
([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values
()- contains(predicate_name, arguments, negated=False, check_negation=False)[source]#
Check whether the state contains the given proposition.
- Parameters:
predicate_name (str) – the name of the predicate.
arguments (Sequence[int | str]) – the arguments of the predicate, as a tuple of integers or strings.
negated (bool) – whether the proposition is negated. If True, the function will check whether the state does not contain the proposition.
check_negation (bool) – whether the function should also check “{predicate_name}_not” in the state. This will only be used when negated is True. This is useful for delete-relaxed planning.
- Returns:
True if the state contains the proposition, False otherwise.
- Return type: