adam.model.tree#
Classes#
Module Contents#
- class adam.model.tree.Node[source]#
The node class
- arcs: list[adam.model.abc_factories.Joint][source]#
- parent: adam.model.abc_factories.Link | None = None[source]#
- parent_arc: adam.model.abc_factories.Joint | None = None[source]#
- get_elements() tuple[adam.model.abc_factories.Link, adam.model.abc_factories.Joint, adam.model.abc_factories.Link] [source]#
returns the node with its parent arc and parent link
- class adam.model.tree.Tree[source]#
Bases:
Iterable
The directed tree class
- static build_tree(links: list[adam.model.abc_factories.Link], joints: list[adam.model.abc_factories.Joint]) Tree [source]#
builds the tree from the connectivity of the elements
- get_ordered_nodes_list(start: str) list[str] [source]#
get the ordered list of the nodes, given the connectivity
- Parameters:
start (str) – the start node
- Returns:
the ordered list
- Return type:
list[str]
- classmethod get_children(node: Node, list: Tree.get_children.list)[source]#
Recursive method that finds children of child of child :param node: the analized node :type node: Node :param list: the list of the children that needs to be filled :type list: list
- get_idx_from_name(name: str) int [source]#
- Parameters:
name (str) – node name
- Returns:
the index of the node in the ordered list
- Return type:
int
- get_name_from_idx(idx: int) str [source]#
- Parameters:
idx (int) – the index in the ordered list
- Returns:
the corresponding node name
- Return type:
str
- get_node_from_name(name: str) Node [source]#
- Parameters:
name (str) – the node name
- Returns:
the node istance
- Return type:
- __iter__() Iterator[Node] [source]#
This method allows to iterate on the model :returns: the node istance :rtype: Node
- Yields:
Iterator[Node] – the list of the nodes
- __reversed__() Iterator[Node] [source]#
- Returns:
Node
- Yields:
Iterator[Node] – the reversed nodes list