verse.automaton.guard.GuardExpressionAst
- class verse.automaton.guard.GuardExpressionAst(guard_list, guard_idx=0)
Bases:
object
Methods
evaluate_guard_disc
(agent, ...)Evaluate guard that involves only discrete variables.
evaluate_guard_hybrid
(agent, ...)Handle guard atomics that contains both continuous and hybrid variables Especially, we want to handle function calls that need both continuous and discrete variables as input We will perform interval arithmetic based on the function calls to the input and replace the function calls with temp constants with their values stored in the continuous variable dict By doing this, all calls that need both continuous and discrete variables as input will now become only continuous variables.
The return value of this function will be a bool/str
evaluate_guard
evaluate_guard_cont
get_agent_dictionaries
get_agent_variable_indices
parse_any_all
parse_any_all_new
unroll_any_all
unroll_any_all_new
- __init__(guard_list, guard_idx=0)
- evaluate_guard_disc(agent, discrete_variable_dict, continuous_variable_dict, track_map)
Evaluate guard that involves only discrete variables.
- evaluate_guard_hybrid(agent, discrete_variable_dict, continuous_variable_dict, track_map: LaneMap, stars)
Handle guard atomics that contains both continuous and hybrid variables Especially, we want to handle function calls that need both continuous and discrete variables as input We will perform interval arithmetic based on the function calls to the input and replace the function calls with temp constants with their values stored in the continuous variable dict By doing this, all calls that need both continuous and discrete variables as input will now become only continuous variables. We can then handle these using what we already have for the continous variables
- generate_z3_expression()
The return value of this function will be a bool/str
If without evaluating the continuous variables the result is True, then the guard will automatically be satisfied and is_contained will be True
If without evaluating the continuous variables the result is False, th- en the guard will automatically be unsatisfied
If the result is a string, then continuous variables will be checked to see if the guard can be satisfied