ifstype.generations¶
This module implements the ifstype.generations.Generations class which
governs the computation of the transition graph from an IFS and other child
dependency relationships.
Public module attributes:
LengthFunction
-
class
ifstype.generations.Generations(ifs: ifstype.ifs.IFS)[source]¶ Compute children relationships and the transition graph based on a fixed iterated function system.
Initialization:
Methods to compute the transition graph:
Methods to determine IFS properties:
Methods to compute children:
-
compute_graph(depth: int = 2000, root: Optional[ifstype.ifs.NetInterval] = None, non_red_nbs: Optional[set] = None) → ifstype.graph.TransitionGraph[source]¶ Compute the transition graph based on the stored IFS.
This method will compute the children for at minimum depth net intervals before stopping; if this method does not terminate earlier, the transition graph may be incomplete.
To verify completeness of thetransition graph, see
ifstype.Graph.is_fncSee also
verify_fnc().- Parameters
depth – the minimum number of net intervals for which children have been computed before stopping.
root – the root net interval from which the transition graph should be computed.
non_red_nbs – a (previously computed) set of reduced neighbours from which the neighbours most be drawn
- Returns
the transition graph
-
verify_fnc(depth: int = 2000) → Tuple[bool, int][source]¶ Attempt to verify if the stored IFS satisfies the finite neighbour condition.
This method is a pared down version of
compute_graph(), where only the graph dependency structure is computed (without creating the transition graph). The method will compute the children for at minimum depth distinct neighbour sets. It returns a verification pair(bool, computed).See also
compute_graph().If
boolis true, then the IFS satisfies the finite neighbour condition with at mostcomputeddistinct neighbour sets (there may be fewer).If
boolis false, then the IFS may or may not be weak finite type, but there are at leastcomputeddistinct neighbour sets.
- Parameters
depth – the minimum number of net intervals for which children have been computed before stopping.
- Returns
the verification pair
-
children(nb_set: ifstype.ifs.NeighbourSet) → Sequence[ifstype.ifs.NeighbourSet][source]¶ Construct the neighbour sets which are the children of a net interval.
See also
children_with_transition().- Parameters
nb_set – the neighbour set to compute the children of
- Returns
sequence of neighbour sets
-
children_with_transition(nb_set: ifstype.ifs.NeighbourSet, non_red_nbs=None, length_func=<function LengthFunction.transition>) → Sequence[Tuple[ifstype.ifs.NeighbourSet, ifstype.graph.EdgeInfo]][source]¶ Compute the transition tuple for every child of the given neighbour set.
This creates a sequence of
ifstype.graph.EdgeInfo, one for each child of the neighbour set. These quantities are invariant of the specific net interval which has given neighbour set and are used as edge attributes of the transition graph. Seecompute_graph()for a usage case, andchildren()for an analgous method without computing the edge info- Parameters
nb_set – the neighbour set for which to compute transition tuples
length_func – the length function used to assign a length to each edge
- Returns
ordered sequence of pairs of the child neighbour set and the edge info, one for each child
-
__init__(ifs: ifstype.ifs.IFS) → None[source]¶ Initialize the Generations object.
- Parameters
ifs – the iterated function system
-
child_intervals(new_nbs: Iterable[ifstype.ifs.Neighbour]) → Sequence[ifstype.exact.interval.Interval][source]¶ Compute all possible normalized intervals formed by endpoints below a net interval [0,1] with from an iterable of neighbours new_nbs.
- Parameters
new_nbs – an iterable of neighbours
- Returns
a list of intervals in ascending order
-