Details and Options
Rules can be a list of the form {rule1,rule2,…} where each of the rulei has the form {{a1,a2,…},{b1,b2,…}, …}→{{u1,u2,…},…}. In this case, the ai etc. can be any expressions, but are assumed to be pattern variables for the purposes of the rule.
Rules of the form <|"PatternRules"→rules|> can be used to specify explicit pattern rules, in which pattern variables must be given as x_, etc., and literals are treated verbatim.
The initial condition init should be of the form {{i1,i2,…},{j1,j2,…},…}.
The initial condition can be
Automatic, in which case the minimum
{{1,1,…},…} initial condition that provides a unification of the rule will be used.
ResourceFunction["WolframModel"][rules,init,t,…] gives results for t complete generations, or fewer if a fixed point is reached earlier.
ResourceFunction["WolframModel"][rules,init,assoc,…] can be used to specify alternative termination criteria. Possible elements in assoc include:
"MaxEvents" | maximum number of events to allow |
"MaxGenerations" | maximum number of generations to allow |
"MaxVertices" | maximum number of hypergraph vertices |
"MaxEdges" | maximum number of hypergraph edges |
"MaxVertexDegree" | maximum degree of any vertex |
A generation is defined to end when no more updates can be done without re-updating a node that has already been updated in that generation.
Each generation in effect contains all updates in a single layer in the causal network.
In ResourceFunction["WolframModel"][rules,init,t,prop], possible forms for prop include:
"EvolutionObject" (default) | the complete evolution object |
"StatesList" | the list of states for each complete generation |
"StatesPlotsList" | list of plots of states |
"FinalState" | the final state only |
"FinalStatePlot" | plot of the 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 |
"ExpressionsEventsGraph" | the causal graph that includes both expressions and events as vertices |
{prop1,prop2,…} | list of results for multiple properties |
ResourceFunction["WolframModel"][rules][state] gives the result of one generation of evolution from state according to rules.
RulePlot[ResourceFunction["WolframModel"][rules]] gives a visual representation of the specified Wolfram model rules.
The property "EventsList" gives specifications of all updating events done on the system. Each is given as the index of the original rule used, as well as the indices of the edges used. These indices can be converted to instantiated edges using "AllEventsEdgesList".
"EventsStatesList" gives pairs of events and the states they produce. The events are specified as a list of edges from "AllEventsEdgesList".
The following options for ResourceFunction["WolframModel"] can be used:
EventOrderingFunction | Automatic | how to order possible updating events |
EventSelectionFunction | "GlobalSpacelike" | how to select the rule matches to be instantiated |
IncludeBoundaryEvents | None | whether to include initial or final events |
IncludePartialGenerations | Automatic | whether to include incomplete generations |
Method | Automatic | the method to use ("LowLevel", "Symbolic") |
TimeConstraint | Infinity | how much CPU time to allow the evolution to run |
VertexNamingFunction | Automatic | how to name generated elements |
VertexNamingFunction→All renames all vertices to be labeled sequentially starting from 1 , across all generations in the evolution.
VertexNamingFunction→Automatic uses any existing labels, and labels each new vertex with the smallest unallocated integer.
VertexNamingFunction→None uses internal symbol names for new vertices.
Possible settings for IncludeBoundaryEvents include
"Initial",
"Final",
All and
None.
Possible settings for EventOrderingFunction include:
Automatic | use standard order (least-recent edge, rule ordering, rule index) |
"Random" | pick the next event at random |
{ord1,ord2,…} | use the specified sequence of criteria to determine the next event |
With the default setting
EventOrderingFunction→Automatic,
ResourceFunction["WolframModel"] chooses first whatever possible event involves as its newest edge the least recently generated edge. In case of a tie, the permutation of edges closest to the order from the statement of the rule is used. If there is still a tie, then the smallest index rule is used.
Possible ordering criteria:
"OldestEdge" | sort rule inputs by edge index, and pick the smallest list |
"LeastOldEdge" | sort rule inputs by edge index, and pick the largest list |
"LeastRecentEdge" | sort rule inputs by edge index in reverse order, and pick the smallest list |
"NewestEdge" | sort rule inputs by edge index in reverse order, and pick the largest list |
"RuleOrdering" | pick the smallest list of edge indices, arranged as in the rule input |
"ReverseRuleOrdering" | pick the largest list of edge indices, arranged as in the rule input |
"RuleIndex" | use the earlier rule in a multirule system |
"ReverseRuleIndex" | use the later rule in a multirule system |
"Random" | out of events selected by other criteria, pick one uniformly at random |
EventSelectionFunction determines the type of the singleway/multiway system to run. Possible values:
"GlobalSpacelike" | a normal singleway system, expressions are deleted after they are used |
None | a match-all multiway system that matches spacelike, branchlike and timelike expressions |
See the SetReplace
README for a more detailed documentation.
Install the
SetReplace paclet to get syntax autocompletion, better performance and bleeding-edge functionality.