Function Repository Resource:

GenerationalMultiwaySystem

Source Notebook

Compute the evolution of a generational multiway system and many associated properties

Contributed by: Jonathan Gorard and Stephen Wolfram

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

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

ResourceFunction["GenerationalMultiwaySystem"][rules,init,n,"prop"]

gives the property "prop" for the specified generational multiway system evolution.

Details and Options

ResourceFunction["GenerationalMultiwaySystem"] currently only works for string substitution rules of the form {"lhs1""rhs1",}.
Options for ResourceFunction["GenerationalMultiwaySystem"] include:
"StateRenderingFunction"Automatichow to label states that appear in graphs
In MultiwaySystem[rules,init,n,"prop"], the following properties can be requested:
"AllStatesList"the list of all states generated at each successive step (default)
"PredecessorRulesList"the list of states and their corresponding predecessor states at each successive step
"StatesGraph"graph of how each distinct state leads to other states
"StatesGraphStructure"states graph without labeling
ResourceFunction["GenerationalMultiwaySystem"] accepts both individual rules and lists of rules, and likewise for initial conditions.
ResourceFunction["GenerationalMultiwaySystem"] applies the maximal set of spatially-separated string replacements at each step.

Examples

Basic Examples (3) 

Show basic generational multiway system evolution:

In[1]:=
ResourceFunction["GenerationalMultiwaySystem"]["A" -> "AA", "A", 5]
Out[1]=
In[2]:=
ResourceFunction[
 "GenerationalMultiwaySystem"][{"A" -> "AB", "AB" -> "A"}, "A", 5]
Out[2]=
In[3]:=
ResourceFunction[
 "GenerationalMultiwaySystem"][{"AA" -> "BAA", "BAA" -> "AB"}, "AAA",
  3]
Out[3]=

Generate a graph showing how each state is obtained from the others:

In[4]:=
ResourceFunction[
 "GenerationalMultiwaySystem"][{"AA" -> "BAA", "BAA" -> "AB"}, "BAAA", 3, "StatesGraph"]
Out[4]=

Show the structure of the graph, without labels:

In[5]:=
ResourceFunction[
 "GenerationalMultiwaySystem"][{"AA" -> "BAA", "BAA" -> "AB"}, "BAAA", 3, "StatesGraphStructure"]
Out[5]=

Show all states generated along with their corresponding predecessor states:

In[6]:=
ResourceFunction[
 "GenerationalMultiwaySystem"][{"AA" -> "BAA", "BAA" -> "AB"}, "BAAA", 3, "PredecessorRulesList"]
Out[6]=

Scope (2) 

Rules and Initial Conditions (2) 

GenerationalMultiwaySystem accepts both individual rules and lists of rules:

In[7]:=
ResourceFunction["GenerationalMultiwaySystem"][
 "A" -> "AA", "AAA", 3, "StatesGraph"]
Out[7]=
In[8]:=
ResourceFunction[
 "GenerationalMultiwaySystem"][{"A" -> "AB", "AB" -> "BA"}, "AAA", 3, "StatesGraph"]
Out[8]=

Likewise for initial conditions:

In[9]:=
ResourceFunction[
 "GenerationalMultiwaySystem"][{"A" -> "AB", "AB" -> "BA"}, {"ABA", "AAB"}, 3, "StatesGraph"]
Out[9]=

Options (5) 

State Node Rendering (5) 

By default, states are labeled by their contents:

In[10]:=
ResourceFunction[
 "GenerationalMultiwaySystem"][{"A" -> "AA", "B" -> "AB"}, {"ABA"}, 3, "StatesGraph"]
Out[10]=

Use no labeling for states:

In[11]:=
ResourceFunction[
 "GenerationalMultiwaySystem"][{"A" -> "AA", "B" -> "AB"}, {"ABA"}, 3, "StatesGraph", "StateRenderingFunction" -> "Circle"]
Out[11]=

"StatesGraphStructure" yields the same result:

In[12]:=
ResourceFunction[
 "GenerationalMultiwaySystem"][{"A" -> "AA", "B" -> "AB"}, {"ABA"}, 3, "StatesGraphStructure"]
Out[12]=

Use raw state names as node labels:

In[13]:=
ResourceFunction[
 "GenerationalMultiwaySystem"][{"A" -> "AA", "B" -> "AB"}, {"ABA"}, 3, "StatesGraph", "StateRenderingFunction" -> "Name"]
Out[13]=

Use a named shape as each state label:

In[14]:=
ResourceFunction[
 "GenerationalMultiwaySystem"][{"A" -> "AA", "B" -> "AB"}, {"ABA"}, 3, "StatesGraph", "StateRenderingFunction" -> "Square"]
Out[14]=

Version History

  • 3.0.0 – 14 April 2020
  • 2.0.0 – 13 March 2020
  • 1.0.0 – 09 March 2020

Source Metadata

Related Resources

License Information