Function Repository Resource:

WolframModelGlocalMultiwaySystem

Source Notebook

Simulate the evolution of a Wolfram model system as a "glocal" (hybrid of global and local) multiway system

Contributed by: Jonathan Gorard

ResourceFunction["WolframModelGlocalMultiwaySystem"][rules,init,n]

generates the results of n steps in the glocal multiway evolution of a Wolfram model system with the specified rules, starting from initial conditions init.

ResourceFunction["WolframModelGlocalMultiwaySystem"][rulessel,init,n]

uses the function sel to select which of the events obtained at each step to include in the evolution.

Details and Options

Glocal multiway systems combine the global events (and the corresponding causal structure) of ordinary multiway systems, with the individual token philosophy of local multiway systems. A single event vertex in the evolution causal graph (or token event graph) will, in general, have many incoming and outgoing evolution edges, corresponding to the fact that several tokens must be assembled together in order to reconstruct a single global input or output state for the event.
Argument and option patterns for ResourceFunction["WolframModelGlocalMultiwaySystem"] are similar to those of the resource function MultiwaySystem.
Replacement rules for Wolfram model systems are specified as {{{a1,a2,},{b1,b2,},}{{u1,u2,},},}.
ResourceFunction["WolframModelGlocalMultiwaySystem"] accepts both individual rules and lists of rules, and likewise for initial conditions. ResourceFunction["WolframModelGlocalMultiwaySystem"][rules,init,n] is interpreted as ResourceFunction["WolframModelGlocalMultiwaySystem"][rules,{init},n], etc.
The event selection function sel in ResourceFunction["WolframModelGlocalMultiwaySystem"][rulessel,] can have the following special forms:
"Sequential"applies the first possible replacement (sequential substitution system)
"Random"applies a random replacement
{"Random",n}applies n randomly chosen replacements
Duplicated tokens are displayed separately at each time step by default, although this can be overridden by setting "DeduplicateTokens"True.
Events are represented in the form {rule,input,rest}, where rule is the instantiated rule used in the updating event, input is the part of the state to which the rule is applied and rest is the remainder of the state. For hypergraph substitution systems, rest is given in the form {prefix,suffix}.
Options for ResourceFunction["WolframModelGlocalMultiwaySystem"] include:
"DeduplicateTokens"Falsewhether to merge all instances of equivalent tokens that appear at each time step
"VertexRendering"Truewhether to use special rendering for state/token and event vertices
"IncludeInitializationEvents"Falsewhether to include pseudoevents that set up initial conditions
"StateRenderingFunction"Automatichow to label states/tokens that appear in the evolution causal graph/token event graph
"EventRenderingFunction"Automatichow to labels events that appear in the evolution causal graph/token event graph
All of the standard options for the Graph function can also be applied to ResourceFunction["WolframModelGlocalMultiwaySystem"].
Possible settings for "StateRenderingFunction" and "EventRenderingFunction" include:
Automaticmake a label from the name of the vertex
Inheriteduse the explicit vertex name as the label
Noneuse no label for the vertex
"string"use a shape from the VertexShapeFunction collection
funcapply the function func to the name of the vertex

Examples

Basic Examples (3) 

Generate evolution causal graphs (token event graphs) for two simple Wolfram model glocal multiway systems:

In[1]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}} -> {{x, y}, {y, z}}, {{1, 2}}, 2, VertexSize -> 0.8]
Out[1]=
In[2]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{{1, 1, 2}} -> {{2, 2, 1}, {2, 3, 2}, {1, 2, 3}}, {{1, 2, 1}, {3, 4, 2}} -> {{4, 3, 2}}}, {{{1, 1, 1}}}, 2, VertexSize -> 0.8]
Out[2]=

Show just the structure of the graphs, without labels:

In[3]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}} -> {{x, y}, {y, z}}, {{1, 2}}, 2, "VertexRendering" -> False]
Out[3]=
In[4]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{{1, 1, 2}} -> {{2, 2, 1}, {2, 3, 2}, {1, 2, 3}}, {{1, 2, 1}, {3, 4, 2}} -> {{4, 3, 2}}}, {{{1, 1, 1}}}, 2, "VertexRendering" -> False]
Out[4]=

Generate an evolution causal graph (token event graph) for a more complicated Wolfram model glocal multiway evolution:

In[5]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, VertexSize -> 8]
Out[5]=

Show just the structure of the graph, without labels:

In[6]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, "VertexRendering" -> False]
Out[6]=

Merge all instances of equivalent tokens that appear at each time step:

In[7]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, "DeduplicateTokens" -> True, VertexSize -> 0.8]
Out[7]=

Run the system for more steps:

In[8]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 3, "DeduplicateTokens" -> True, VertexSize -> 1.5]
Out[8]=

Show just the structure of the graphs, without labels:

In[9]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, "VertexRendering" -> False, "DeduplicateTokens" -> True]
Out[9]=
In[10]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 3, "VertexRendering" -> False, "DeduplicateTokens" -> True]
Out[10]=

Specify an event selection function that picks only up to two events at each step:

In[11]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][({{x, y}, {x, z}} -> {{x, z}, {x,
       w}, {y, w}, {z, w}}) -> (Take[#, UpTo[2]] &), {{0, 0}, {0, 0}}, 3, VertexSize -> 1]
Out[11]=

Scope (5) 

Rules and Initial Conditions (2) 

WolframModelGlocalMultiwaySystem accepts both individual rules and lists of rules:

In[12]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 2, VertexSize -> 1]
Out[12]=
In[13]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{{1, 1, 2}} -> {{2, 2, 1}, {2, 3, 2}, {1, 2, 3}}, {{1, 2, 1}, {3, 4, 2}} -> {{4, 3, 2}}}, {{1, 1, 1}}, 2, VertexSize -> 1]
Out[13]=

Likewise for initial conditions:

In[14]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{{1, 1, 2}} -> {{2, 2, 1}, {2, 3, 2}, {1, 2, 3}}, {{1, 2, 1}, {3, 4, 2}} -> {{4, 3, 2}}}, {{{1, 1, 1}}, {{1, 1, 1}, {2, 2, 2}}}, 2, VertexSize -> 4]
Out[14]=

Event Selection Functions (3) 

Apply only the first possible event at each step:

In[15]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][({{x, y}, {x, z}} -> {{x, z}, {x,
       w}, {y, w}, {z, w}}) -> "Sequential", {{0, 0}, {0, 0}}, 3, VertexSize -> 0.6]
Out[15]=

Apply the first and last possible events at each step:

In[16]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][({{x, y}, {x, z}} -> {{x, z}, {x,
       w}, {y, w}, {z, w}}) -> ({First[#], Last[#]} &), {{0, 0}, {0, 0}}, 3, VertexSize -> 0.8]
Out[16]=

Compare this to the full evolution causal graph (token event graph):

In[17]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, VertexSize -> 8]
Out[17]=

Options (19) 

DeduplicateTokens (2) 

By default, equivalent tokens remain unmerged at each time step:

In[18]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 3, VertexSize -> 2]
Out[18]=

Merging of equivalent tokens at each time step can be enforced using the option "DeduplicateTokens":

In[19]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 3, "DeduplicateTokens" -> True, VertexSize -> 0.8]
Out[19]=

VertexRendering (2) 

By default, state/token vertices and event vertices use special rendering (inherited from the MultiwaySystem resource function):

In[20]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}} -> {{x, y}, {y, z}}, {{1, 2}}, 3, VertexSize -> 0.8]
Out[20]=

This rendering can be disabled using the option "VertexRendering":

In[21]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}} -> {{x, y}, {y, z}}, {{1, 2}}, 3, "VertexRendering" -> False]
Out[21]=

StateRenderingFunction (4) 

By default, states/tokens are labeled by their contents:

In[22]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, VertexSize -> 8]
Out[22]=

Use no labeling for states/tokens:

In[23]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, "StateRenderingFunction" -> None, VertexSize -> 8]
Out[23]=

Use raw state/token names as vertex labels:

In[24]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, "StateRenderingFunction" -> Inherited, VertexSize -> 8]
Out[24]=

Use a named shape as each state/token label:

In[25]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, "StateRenderingFunction" -> "Square", VertexSize -> 8]
Out[25]=

EventRenderingFunction (5) 

By default, both states/tokens and events are labeled by their contents:

In[26]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 2, VertexSize -> 0.6]
Out[26]=

Use no labeling for states/tokens:

In[27]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 2, "StateRenderingFunction" -> None,
  VertexSize -> 0.6]
Out[27]=

Also use no labeling for events:

In[28]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 2, "StateRenderingFunction" -> None,
  "EventRenderingFunction" -> None]
Out[28]=

Disabling vertex rendering yields an equivalent result:

In[29]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 2, "VertexRendering" -> False]
Out[29]=

Use raw event expressions as their labels:

In[30]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 2, "StateRenderingFunction" -> None,
  "EventRenderingFunction" -> Inherited]
Out[30]=

IncludeInitializationEvents (3) 

By default, Wolfram model glocal multiway systems do not include initialization events:

In[31]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}} -> {{x, y}, {y, z}}, {{{0, 0}}, {{1, 2}}, {{1, 2}, {2, 3}}}, 2, VertexSize -> 3]
Out[31]=

Disable vertex rendering:

In[32]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}} -> {{x, y}, {y, z}}, {{{0, 0}}, {{1, 2}}, {{1, 2}, {2, 3}}}, 2, "VertexRendering" -> False]
Out[32]=

The option "IncludeInitializationEvents" allows one to override this default (note that initialization events have special default rendering):

In[33]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}} -> {{x, y}, {y, z}}, {{{0, 0}}, {{1, 2}}, {{1, 2}, {2, 3}}}, 2, "IncludeInitializationEvents" -> True, "VertexRendering" -> False]
Out[33]=

EdgeShapeFunction (1) 

Place arrows in the middle of edges:

In[34]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{{1, 1, 2}} -> {{2, 2, 1}, {2, 3, 2}, {1, 2, 3}}, {{1, 2, 1}, {3, 4, 2}} -> {{4, 3, 2}}}, {{1, 1, 1}}, 2, EdgeShapeFunction -> GraphElementData["ShortFilledArrow", "ArrowSize" -> 0.03], VertexSize -> 0.8]
Out[34]=

GraphLayout (2) 

Generate an example glocal multiway evolution:

In[35]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, VertexSize -> 8]
Out[35]=

Force a layered digraph embedding with the initial state/token at the top:

In[36]:=
ResourceFunction[
 "WolframModelGlocalMultiwaySystem"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, GraphLayout -> "LayeredDigraphEmbedding", AspectRatio -> 1/2, VertexSize -> 8]
Out[36]=

Publisher

Jonathan Gorard

Version History

  • 1.0.0 – 22 November 2021

Source Metadata

Related Resources

License Information