eta.lf.parse_eventuality
- parse_eventuality(s, ep=None, expectation=False, prob_dict={})[source]
Parse an S-expression into an eventuality.
- Parameters:
s (s-expr) – An S-expression to parse. If s contains a condition or repetition keyword as the first element, a Condition or Repetition object is created respectively; otherwise, a basic Eventuality object is created containing s as a formula.
ep (str, optional) – If given, use this episode symbol for the created eventuality, rather than generating a new symbol.
expectation (bool, default=False) – If True, this will interpret the eventuality as an expected episode rather than an observed episode, i.e., ep will become an episode variable instead of an episode constant.
prob_dict (dict, optional) – A dictionary mapping episode symbols to probabilities, used to set the probability of this eventuality.
- Returns:
The eventuality generated according to the above parameters.
- Return type: