verse.analysis.analysis_tree.AnalysisTreeNode

class verse.analysis.analysis_tree.AnalysisTreeNode(trace: Dict[str, ndarray[Any, dtype[float64]]], init: Dict[str, Sequence[float]], mode: Dict[str, Sequence[str]], static: Dict[str, Sequence[str]], uncertain_param: Dict[str, Sequence[str]], agent: Dict[str, BaseAgent], height: int, assert_hits: Dict[str, Sequence[str]], child: List[AnalysisTreeNode], start_time: float, ndigits: int, type: AnalysisTreeNodeType, id: int)

Bases: object

A AnalysisTreeNode stores the continous execution of the system without transition happening

Methods

get_mode(agent_id, mode)

Filter out the agent mode(s) for a given agent

get_track(agent_id, mode)

Filter out the track mode(s) for a given agent

new_child(init, mode, trace, start_time, id)

Construct a child node, copying unchanged items from the parent node (self).

root_from_inits(init, mode, static, ...)

Construct the root node from initial conditions and other settings.

__init__(trace: Dict[str, ndarray[Any, dtype[float64]]], init: Dict[str, Sequence[float]], mode: Dict[str, Sequence[str]], static: Dict[str, Sequence[str]], uncertain_param: Dict[str, Sequence[str]], agent: Dict[str, BaseAgent], height: int, assert_hits: Dict[str, Sequence[str]], child: List[AnalysisTreeNode], start_time: float, ndigits: int, type: AnalysisTreeNodeType, id: int) None
agent: Dict[str, BaseAgent]

Discrete mode per agent for this node. The key of the dict is the agent id and the value of the dict is the object instance for that agent

assert_hits: Dict[str, Sequence[str]]

Assert hits per agent for this node. The key of the dict is the agent id and the value of the dict is the list of labels hit in the node for that agent

child: List[AnalysisTreeNode]

A list of children nodes for the current node. Can be empty.

get_mode(agent_id: str, mode: Sequence[str]) Sequence[str] | None

Filter out the agent mode(s) for a given agent

get_track(agent_id: str, mode: Sequence[str]) str | None

Filter out the track mode(s) for a given agent

height: int

The height/depth of the current node in the AnalysisTree

id: int

Integer ID for the current node. Unique amongst all nodes in the AnalysisTree

init: Dict[str, Sequence[float]]

Initial conditions per agent for this node. The key of the dict is the agent id and the value of the dict is the range/set of initial conditions for that agent

mode: Dict[str, Sequence[str]]

Discrete mode per agent for this node. The key of the dict is the agent id and the value of the dict is the discrete mode for that agent

ndigits: int

Number of digits to round start_time to.

new_child(init: Dict[str, Sequence[float]], mode: Dict[str, Sequence[str]], trace: Dict[str, ndarray[Any, dtype[float64]]], start_time: float, id: int) AnalysisTreeNode

Construct a child node, copying unchanged items from the parent node (self).

static root_from_inits(init: Dict[str, Sequence[float]], mode: Dict[str, Sequence[str]], static: Dict[str, Sequence[str]], uncertain_param: Dict[str, Sequence[str]], agent: Dict[str, BaseAgent], ndigits: int, type: AnalysisTreeNodeType) AnalysisTreeNode

Construct the root node from initial conditions and other settings.

start_time: float

The earliest simulation time of this node.

static: Dict[str, Sequence[str]]

Static data per agent for this node. The key of the dict is the agent id and the value of the dict is the static data for that agent

trace: Dict[str, ndarray[Any, dtype[float64]]]

The trace for each agent. The key of the dict is the agent id and the value of the dict is the simulated traces for each agent

type: AnalysisTreeNodeType

Type of the node. Can either be “simtrace” or “reachtube”.

uncertain_param: Dict[str, Sequence[str]]

Parameters for uncertainty per agent for this node. The key of the dict is the agent id and the value of the dict is the uncertainty data for that agent