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: False,True, "Inputs", "Outputs”, All |
"EdgeDeduplication" | False | whether to remove multiedges |
"RemoveEventLoops" | False | whether to remove event edge loops |
"RemoveEmptyEvents" | True | whether to remove events with no outputs |
"TokenDecompositionFunction" | Automatic | function to decompose a state into a list of tokens |
"TokenRecombinationFunction" | ({Union@@#1}&) | function to combine a list of output tokens into list of states |
“TokenEquivalenceFunction" | SameQ | function to merge equivalent tokens |
"EventStoreFunction" | Splice[{#1,#2,#3,#4}] & | what part of an event to store inside an event vertex |
"MultiOutputEvents" | True | whether to allow multi-output events |
"EventVertices" | True | whether to include event vertices |
"StateVertices" | False | whether to include state vertices |
"TokenVertices" | True | whether to include token vertices |
"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 Wolfram Model-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]= |
Deduplicate events based on a rule:
In[13]:= |
Out[13]= |
Deduplicate events based on its "Inputs", "Outputs" or both:
In[14]:= |
Out[14]= |
In[15]:= |
Out[15]= |
Deduplicate all events:
In[16]:= |
Out[16]= |
Exclude event vertices:
In[17]:= |
Out[17]= |
Include state vertices:
In[18]:= |
Out[18]= |
Exclude token vertices:
In[19]:= |
Out[19]= |
Specify how states are decomposed into a list of tokens:
In[20]:= |
Out[20]= |
Specify how tokens are recombined into states (the default is a single state containing the union of all output tokens). Here is an example of making a separate state from each token:
In[21]:= |
Out[21]= |
Specify an equivalence function for tokens:
In[22]:= |
Out[22]= |
Change what is stored inside "Event" vertices:
In[23]:= |
Out[23]= |
By default, only stepId, ruleId, eventId and positions are stored:
In[24]:= |
Out[24]= |
Whether to split each event with multiple outputs into separate events:
In[25]:= |
Out[25]= |
In[26]:= |
Out[26]= |
Disable custom token labeling:
In[27]:= |
Out[27]= |
Label events by its rule index:
In[28]:= |
Out[28]= |
Specify rendering for the tokens:
In[29]:= |
Out[29]= |
Provide style options for token boxes:
In[30]:= |
Out[30]= |
Provide frame options for token boxes:
In[31]:= |
Out[31]= |
Wolfram Language 12.3 (May 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License