JumpRule

class JumpRule(jump_target, query: ConditionalQuery = None)

A JumpRule contains information that enables the ShapeMachine engine to jump from one RuleSequence to another within a Program. This is done by querying the current_design with a ConditionalQuery. When the query returns True, the engine proceeds to the rule sequence labeled by jump_target.

Parameters:

Attributes

jump_target

The name of the RuleSequence to jump to if the query succeeds.

query

The ConditionalQuery to use on the engine's current_design.

application_type

The RuleApplicationType to use when selecting a match to apply the rule to.

Methods

apply_to

Not used by the engine.

apply_to(shape: Shape, communication_layer: CommunicationLayer, in_automation: bool = False, _to_design: ndarray = array([0., 0., 0.])) Tuple[Rule, List[Tuple[Shape, Shape]], Shape, Shape, Shape, Shape]

Not used by the engine. Instead, use query’s query_shape() method.

application_type

The RuleApplicationType to use when selecting a match to apply the rule to.

jump_target

The name of the RuleSequence to jump to if the query succeeds.

query

The ConditionalQuery to use on the engine’s current_design.