MCPcopy Create free account
hub / github.com/Notgnoshi/generative / RuleMapping

Class RuleMapping

generative/lsystem/grammar.py:25–35  ·  view source on GitHub ↗

Each rule is the mapping of a token to a tuple of values; this is the tuple of values. Care should be made in creating the production function, and the condition.

Source from the content-addressed store, hash-verified

23
24@dataclass
25class RuleMapping:
26 """Each rule is the mapping of a token to a tuple of values; this is the tuple of values.
27
28 Care should be made in creating the production function, and the condition.
29 """
30
31 production: Tuple[Token]
32 # If not None, and between 0 and 1, apply this rule with the given probability.
33 probability: Union[None, Number] = None
34 left_context: Union[None, Token] = None
35 right_context: Union[None, Token] = None
36
37
38def triplewise(iterable):

Callers 14

test_simpleMethod · 0.90
test_simple_delimitedMethod · 0.90
test_probabilityMethod · 0.90
setUpMethod · 0.90
setUpMethod · 0.90
test_left_contextMethod · 0.90
test_right_contextMethod · 0.90
test_locomotionMethod · 0.90

Calls

no outgoing calls

Tested by 13

test_simpleMethod · 0.72
test_simple_delimitedMethod · 0.72
test_probabilityMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72
test_left_contextMethod · 0.72
test_right_contextMethod · 0.72
test_locomotionMethod · 0.72