Function Repository Resource:

WolframModelEvolutionObject

Source Notebook

Represent the result of evolution of a Wolfram model

Contributed by: Stephen Wolfram & Max Piskunov

ResourceFunction["WolframModelEvolutionObject"][][t]

gives the state of a Wolfram model evolution after t generations.

ResourceFunction["WolframModelEvolutionObject"][][prop]

gives the specified property of a Wolfram Model evolution object.

ResourceFunction["WolframModelEvolutionObject"][][prop,opts]

uses the specified options for the result.

Details and Options

In ResourceFunction["WolframModelEvolutionObject"][][prop] possible properties include:
tthe state at generation t
-tthe state t generations from the end
"StatesList"the list of states for each complete generation
"StatesPlotsList"list of plots of states
"FinalState"the final state only
"FinalStatePlot"plot of final state
"AllEventsStatesList"the list of all states after all updating events
"AllEventsList"the list of all updating events during the evolution
"AllEventsRuleIndices"list of indices of transformation rules used during the evolution
"EventsStatesList"the list of successive events and states during the evolution
"EventsStatesPlotsList"list of plots of successive states with each event highlighted
"AllEventsEdgesList"the list of all edges in the order they are generated by events
"EdgeCreatorEventIndices"the indices of the updating event that creates each edge
"EdgeDestroyerEventIndices"the indices of the updating event that destroys each edge
"VertexCountList"the list of vertex counts for each complete generation
"EdgeCountList"the list of edge counts for each complete generation
"GenerationsCount"the number of complete and partial generations
"GenerationEventsCountList"the number of events between successive generations
"GenerationEventsList"the list of events between successive generations
"EdgeGenerationsList"which generation each edge is associated with
"EventGenerationsList"which generation each event is associated with
"AllEventsCount"the total number of events in the evolution
"CausalGraph"the causal graph for the evolution
"LayeredCausalGraph"the causal graph rendered in layered form
"Rules"the underlying rules for the Wolfram model system
"TerminationReason"why the evolution was stopped
Reasons for termination include:
"MaxEvents"maximum number of events reached
"MaxGenerations"maximum number of generations reached
"MaxVertices"maximum number of hypergraph vertices reached
"MaxEdges"maximum number of hypergraph edges reached
"MaxVertexDegree"maximum degree of any vertex reached
"FixedPoint"rule does not have any more matches
"TimeConstraint"specified execution time reached
"Aborted"externally aborted
The following options are support:
IncludePartialGenerationsTruewhether to include data on incomplete generations
IncludeBoundaryEventsNonewhether to include boundary events in properties like "CausalGraph"
Properties behave the same way as the properties with the same name in WolframModel.
IncludeBoundaryEvents can be set to None, "Initial", "Final", or All.
See SetReplace README for a more detailed documentation.
Install the SetReplace paclet to get better performance and bleeding edge functionality.

Examples

Basic Examples (3) 

Create an evolution object:

In[1]:=
evolution = ResourceFunction[
  "WolframModel"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 10]
Out[1]=

Get the plot of the final state:

In[2]:=
evolution["FinalStatePlot"]
Out[2]=

Make a causal graph for the same evolution:

In[3]:=
evolution["CausalGraph"]
Out[3]=

Scope (20) 

Properties (20) 

"StatesList" yields the list of states at each generation:

In[4]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/a4a8d10b-1780-4522-b229-3f4541d53129"]
Out[4]=

Make the list of plots of all states:

In[5]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/568e3aa4-b3ee-46a4-a3be-4be3a7a39958"]
Out[5]=

"FinalState" yields the state obtained after all replacements of the evolution have been made:

In[6]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/9cc5ed94-2263-4124-b77d-b5ac695efc65"]
Out[6]=

Make the plot of the final state:

In[7]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/4338c20f-1583-4815-8e1e-952adbebb483"]
Out[7]=

"StatesList" shows a compressed version of the evolution. To see how state changes with each applied replacement, use "AllEventsStatesList":

In[8]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/91061752-5fc3-4af3-8f18-3cff1a516254"]
Out[8]=

"AllEventsList" returns all replacement events throughout the evolution:

In[9]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/b12c806f-7692-408c-8bec-1b32d2d853cf"]
Out[9]=

"AllEventsRuleIndices" returns which rule was used for each event:

In[10]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/dc0bfedb-d2c2-41cc-8554-97305b162c40"]
Out[10]=

"EventsStatesList" just produces a list of {event,state} pairs, where state is the complete state right after this event is applied:

In[11]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/5198dc2d-3b9c-4652-a032-4b20e85d3402"]
Out[11]=

"EventsStatesPlotsList" plots not only the states, but also the events that produced them:

In[12]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/f0329bc0-ef35-4b5b-9eab-291fb74efa55"]
Out[12]=

"AllEventsEdgesList" returns the list of edges throughout evolution:

In[13]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/466c36e0-f19b-4344-9837-29c0f0fb2da6"]
Out[13]=

Get creator and destroyer events for each edge throughout the evolution:

In[14]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/3e295914-103e-4d6b-9a73-2bef0e062c82"]
Out[14]=

"VertexCountList" and "EdgeCountList" return counts of vertices and edges respectively in each state of "StatesList":

In[15]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/4868fb76-ef90-4422-ba6a-f13bfc1326f8"]
Out[15]=

"GenerationsCount" returns both complete and partial generations count:

In[16]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/1b9e9ef4-f05b-4acf-8fa5-847944a902fe"]
Out[16]=

"GenerationEventsCountList" gives the number of events per each generation:

In[17]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/af4b495c-7e30-4a92-9d48-e1d5fe0b0263"]
Out[17]=

"GenerationEventsList" returns the same list of events, but splits them into sublists for each generation:

In[18]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/ff635f3d-91c2-40a4-bb02-7a61ee08d99e"]
Out[18]=

"EdgeGenerationsList" yields the list of generation numbers for each edge in "AllEventsEdgesList":

In[19]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/7ea22213-026b-44e9-902c-ac8752d385da"]
Out[19]=

"EventsGenerationsList" gives the same for events:

In[20]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/22d92afc-1cba-4341-bbad-38375c6b12f4"]
Out[20]=

"AllEventsCount" returns the overall number of events throughout the evolution:

In[21]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/85acb721-2e19-4bed-bec3-312d0efb384f"]
Out[21]=

Get a causal graph for an evolution:

In[22]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/4b12d5a0-ab01-409f-9f89-cf0396ea6cbe"]
Out[22]=

The causal graph can be layered putting events from each generation on a different level:

In[23]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/20024599-22ac-4a10-b589-0178af766223"]
Out[23]=

Options (7) 

IncludePartialGenerations (2) 

Drop partial generations from the evolution:

In[24]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/d4cd4d87-a166-4426-a4c0-09f236440b52"]
Out[24]=

If partial generations were not dropped, there would be one more element in the plots list:

In[25]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/26c7122a-e881-40c5-8670-586ce83ca61f"]
Out[25]=

IncludeBoundaryEvents (3) 

Include the initial event in a causal graph:

In[26]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/57a6d5d0-85bc-49a7-a1b1-1d41b79407ce"]
Out[26]=

Include both the final event in the list of events:

In[27]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/98162ac0-fa49-4ec5-bf7a-f04c436f46bc"]
Out[27]=

Include both the initial and the final events in "EventsStatesList":

In[28]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/4ee4523f-2271-4403-a2b6-d981d012d518"]
Out[28]=

WolframModelPlot options (1) 

For state plots, WolframModelPlot options can be given:

In[29]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/8ce611f6-79de-488a-9737-35979e9793d6"]
Out[29]=

CausalGraph options (1) 

For causal graphs, Graph options can be given:

In[30]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/c250de2d-d3a9-4ebe-b978-8c5353e94cac"]
Out[30]=

Properties and Relations (2) 

Evolution objects are created by WolframModel without a property argument:

In[31]:=
ResourceFunction[
 "WolframModel"][{{1, 2}, {2, 3}} -> {{4, 2}, {4, 1}, {2, 1}, {3, 4}}, {{1, 2}, {2, 3}, {3, 4}, {4, 1}}, 7]
Out[32]=

WolframModelPlot is used internally generate graphics:

In[33]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/75cdf454-9704-4fdc-98ff-d4453c1e43aa"]
Out[33]=
In[34]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/490459f6-deeb-4a88-ba67-fa7141567b1f"]
Out[34]=

Possible Issues (2) 

The content of very large evolutions will not be saved in the notebook by default:

In[35]:=
ResourceFunction[
 "WolframModel"][{{1, 2}, {2, 3}} -> {{4, 2}, {4, 1}, {2, 1}, {3, 4}}, {{1, 2}, {2, 3}, {3, 4}, {4, 1}}, 10]
Out[35]=

Click "Store now" to save for you in other Kernel sessions:

Neat Examples (2) 

Show which rule is used for each event on a causal graph:

In[36]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/28c86872-7d20-46a2-82c5-7c67a98c8016"]
Out[36]=

Color edges of different generations differently in a "StatesPlotsList":

In[37]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/96eafa19-57fc-4eaa-840b-b3c3b13a7b23"]
Out[37]=

Version History

  • 5.0.0 – 13 April 2020
  • 4.0.0 – 07 April 2020
  • 3.0.0 – 10 March 2020
  • 2.0.0 – 26 February 2020
  • 1.0.0 – 26 February 2020

Related Resources

License Information