You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Changes
* This is a complete rewrite of the generator system.
* Old `GenerateMultihistory` syntax is removed.
* Instead, all generators have the format
```wl
Generator[System[rules], param1 -> value1, ...] @ init
```
Note that `param1`, etc. are symbols rather than strings. They have usage messages, etc. Also, one can use lists or associations instead, e.g.,
```wl
Generator[System[rules], {param1 -> value1}, <|param2 -> value2|>, param3 -> value3] @ init
```
* Parameters are now declared separately from systems and generators.
* Systems need to declare a logical expression specifying which parameters can be specified. For example,
```wl
Implies[MaxEvents || MaxDestroyerEvents, EventOrder]
```
means that `EventOrder` needs to be specified if either `MaxEvents` or `MaxDestroyerEvents` are specified.
* Generators have predefined values for some parameters. E.g., `GenerateSingleHistory` sets `MaxDestroyerEvents -> 1`, which can no longer be changed.
## Comments
* Apologies for a huge PR. There is a lot of refactoring here as all instances of `GenerateMultihistory` had to be changed.
* Ordering functions page is deleted for now but should return as a page for the `EventOrder` parameter once it is used somewhere.
* @daneelsan, unfortunately, it will break #643, but on the flip side, it should make it a lot easier to define parameters (as one does not need to think where to put them anymore).
## Examples
* `GenerateSingleHistory`:
```wl
In[] := #["StatesList"] & @
SetReplaceTypeConvert[{WolframModelEvolutionObject, 2}] @
GenerateSingleHistory[MultisetSubstitutionSystem[{a_, b_} :> {a + b}], MaxEvents -> 4] @ {1, 2, 3}
Out[] = {{1, 2, 3}, {3, 3}, {6}}
```
* `GenerateAllHistories`:
```wl
In[] := #["ExpressionsEventsGraph", VertexLabels -> Placed[Automatic, After]] & @
SetReplaceTypeConvert[{WolframModelEvolutionObject, 2}] @
GenerateMultihistory[
MultisetSubstitutionSystem[{a_, b_} /; a < b :> {a + b}], MaxGeneration -> 2] @ Range[3]
```
<img width="399" alt="image" src="https://user-images.githubusercontent.com/1479325/122285946-f08ade80-ceb4-11eb-882d-7da3fdeb75fb.png">
0 commit comments