Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Generate a token-event graph for multicomputational evolution according to particular rules
ResourceFunction["TokenEventGraph"][rules, init, t] generates a token-event graph for t steps of evolution according to rules from init. |
"Mode" | "Tuples" | how to match multiple tokens: "Tuples", "OrderedTuples" or "Subsets" |
"TokenDeduplication" | True | whether to deduplicate tokens, False deduplicates across time steps, None turn off deduplication completely |
"EventDeduplication" | False | whether to deduplicate events |
"EdgeDeduplication" | False | whether to remove multiedges |
"RemoveEventLoops" | True | whether to remove event edge loops |
"RemoveEmptyEvents" | True | wheter to remove events with no outputs |
"TokenDecompositionFunction" | Automatic | function to decompose a state into a list of tokens |
"TokenRecombinationFunction" | Automatic | function to combine a list of output tokens into list of states |
"MultiOutputEvents" | True | whether to allow multi-output events |
"StateVertices" | False | wheter to include additional vertices indicating states |
"TokenLabeling" | True | how to label token vertices |
"EventLabeling" | None | how to label event vertices |
"TokenRenderingFunction" | Identity | how to render tokens inside boxes |
"TokenStyleOptions" | Automatic | options for token box Style |
"TokenFrameOptions" | Automatic | options for token box Frame |
Make a token-event graph of a simple rule:
In[1]:= | ![]() |
Out[1]= | ![]() |
Multiple rules:
In[2]:= | ![]() |
Out[2]= | ![]() |
Make a WolframModel-like TokenEventGraph:
In[3]:= | ![]() |
Out[3]= | ![]() |
Edges are tagged by corresponding input or output list index:
In[4]:= | ![]() |
Out[4]= | ![]() |
Tag edges with keys by having associations on both sides of a rule:
In[5]:= | ![]() |
Out[5]= | ![]() |
Mode of picking tokens can be one of: "Tuples" (default), "OrderedTuples", "Subsets":
In[6]:= | ![]() |
Out[6]= | ![]() |
In[7]:= | ![]() |
Out[7]= | ![]() |
In[8]:= | ![]() |
Out[8]= | ![]() |
Every token is deduplicated by default:
In[9]:= | ![]() |
Out[9]= | ![]() |
"TokenDeduplication"→False turns off deduplication across time steps:
In[10]:= | ![]() |
Out[10]= | ![]() |
"TokenDeduplication"→None turns off any deduplication:
In[11]:= | ![]() |
Out[11]= | ![]() |
Remove multiedges:
In[12]:= | ![]() |
Out[12]= | ![]() |
In[13]:= | ![]() |
Out[13]= | ![]() |
Keep or remove duplicate events:
In[14]:= | ![]() |
Out[14]= | ![]() |
In[15]:= | ![]() |
Out[15]= | ![]() |
Include state vertices:
In[16]:= | ![]() |
Out[16]= | ![]() |
In[17]:= | ![]() |
Out[17]= | ![]() |
Specify how states are decomposed into a list of tokens:
In[18]:= | ![]() |
Out[18]= | ![]() |
Specify how tokens are recombined into states, default is a single state containing union of all output tokens. Here is an example of making a separate state from each token:
In[19]:= | ![]() |
Out[19]= | ![]() |
Split each event with multiple outputs into separate events:
In[20]:= | ![]() |
Out[20]= | ![]() |
In[21]:= | ![]() |
Out[21]= | ![]() |
Disable custom token labeling:
In[22]:= | ![]() |
Out[22]= | ![]() |
Label events by its rule index:
In[23]:= | ![]() |
Out[23]= | ![]() |
Specify rendering for the token:
In[24]:= | ![]() |
Out[24]= | ![]() |
Provide style options for token boxes:
In[25]:= | ![]() |
Out[25]= | ![]() |
Provide frame options for token boxes:
In[26]:= | ![]() |
Out[26]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License