Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplified generator system #657

Merged
merged 34 commits into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4aab9ae
Implement GenerateFullMultihistory and GenerateSingleHistory.
Jun 16, 2021
afe05d7
Rename GenerateFullMultihistory -> GenerateAllHistories.
Jun 17, 2021
2619078
Implement the new generator system.
Jul 7, 2021
bf069ce
Remove unused parsing code from MultisetSubstitutionSystem.
Jul 7, 2021
b979ee7
Update AtomicStateSystem.
Jul 8, 2021
21fe0ed
Update README of generators.
Jul 8, 2021
29314d2
Separate parameter and system declarations.
Jul 8, 2021
fc70091
Add usage to generators.
Jul 8, 2021
077487c
Better organize property declarations.
Jul 8, 2021
dd3b8ee
Change system parameters to symbols.
Jul 8, 2021
0fb464f
Write usage messages for all parameters.
Jul 8, 2021
a76771e
Update Generators README.
Jul 8, 2021
f7a2701
Update Systems documentation.
Jul 8, 2021
060fe59
Update Types documentation.
Jul 8, 2021
760ee3a
Update tests for AtomicStateSystem.
Jul 8, 2021
f995136
Remove old GenerateMultihistory tests.
Jul 8, 2021
09500fb
Update hypergraphMatching tests.
Jul 8, 2021
f1391c9
Update MultisetSubstitutionSystem tests.
Jul 8, 2021
856da20
Update MultisetToWolframModelEvolutionObject tests.
Jul 8, 2021
88bbec5
Allow performance tests to generate messages for old SHAs.
Jul 9, 2021
914be50
Update the test in performanceTest.
Jul 9, 2021
249a9fa
Move resultsFunction to a correct place.
Jul 9, 2021
1e10610
Define SyntaxInformation for parameters.
Jul 9, 2021
6de5e12
Add internal error messages.
Jul 9, 2021
d063dc9
Fix declareSystemGenerator.
Jul 11, 2021
4a7b9ee
Add generator system tests.
Jul 11, 2021
45f5d3e
Cleanup generator system tests.
Jul 11, 2021
20a7e70
Small improvements.
Jul 12, 2021
6fc5f48
Merge branch 'master' into feature/shorthandGenerators
maxitg Jul 13, 2021
3c7e9aa
Improvements to docs readability.
Jul 15, 2021
26a506e
Address remaining review comments.
Jul 15, 2021
2fe9993
Clarify what match is in MaxGeneration.md.
Jul 16, 2021
b63e5e6
Switch generators to the operator form only.
Jul 16, 2021
841f62b
Fix performanceTest.
Jul 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Documentation/Generators/$SetReplaceGenerators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# $SetReplaceGenerators

**`$SetReplaceGenerators`** gives the list of all generators that can be used to evaluate
[computational systems](/Documentation/Systems/README.md):

```wl
In[] := $SetReplaceGenerators
Out[] = {GenerateMultihistory, GenerateSingleHistory}
```
2 changes: 1 addition & 1 deletion Documentation/Generators/$SetReplaceSystems.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# $SetReplaceSystems

**`$SetReplaceSystems`** gives the list of all [computational systems](/Documentation/Systems/README.md) that can be
used with [GenerateMultihistory](/Documentation/Generators/GenerateMultihistory.md) and related functions:
used with [GenerateMultihistory](/Documentation/Generators/GenerateMultihistory.md) and other [generators](README.md):

```wl
In[] := $SetReplaceSystems
Expand Down
142 changes: 0 additions & 142 deletions Documentation/Generators/EventOrderingFunctions.md

This file was deleted.

168 changes: 0 additions & 168 deletions Documentation/Generators/EventSelectionParameters.md

This file was deleted.

29 changes: 6 additions & 23 deletions Documentation/Generators/GenerateMultihistory.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
# GenerateMultihistory

**`GenerateMultihistory`** is the most verbose and configurable generator. It can create both single histories, full
multihistories, as well as partial ones. It, however, requires one to specify all groups of parameters
([system](/Documentation/Systems/README.md), [event selection](EventSelectionParameters.md), deduplication,
[event ordering](EventOrderingFunctions.md) and [stopping conditions](StoppingConditionParameters.md)), nothing is
implied automatically:

```wl
GenerateMultihistory[
system, eventSelectionSpec, tokenDeduplicationSpec, eventOrderingSpec, stoppingConditionSpec] @ init
```
**`GenerateMultihistory`** is the most configurable multihistory generator. With no parameters specified, it attempts to
generate all possible histories starting from the initial state. However, it can be configured to generate partial
multihistories and even single histories, although [`GenerateSingleHistory`](GenerateSingleHistory.md) is more
convenient for that.

For example, for a [`MultisetSubstitutionSystem`](/Documentation/Systems/MultisetSubstitutionSystem.md):

```wl
In[] := multihistory = GenerateMultihistory[MultisetSubstitutionSystem[{a_, b_} :> {a + b}],
{"MaxDestroyerEvents" -> 3},
None,
EventOrderingFunctions[MultisetSubstitutionSystem],
{"MaxEvents" -> 10}] @ {1, 2, 3, 4}
In[] := multihistory = GenerateMultihistory[
MultisetSubstitutionSystem[{a_, b_} :> {a + b}], MaxDestroyerEvents -> 3, MaxEvents -> 10] @ {1, 2, 3, 4}
```

<img src="/Documentation/Images/MultisetMultihistory.png" width="472.2">
Expand All @@ -29,11 +20,3 @@ In[] := #["ExpressionsEventsGraph", VertexLabels -> Placed[Automatic, After]] &
```

<img src="/Documentation/Images/GenerateMultihistoryExample.png" width="478.2">

Everything that can be generated with more specialized `GenerateSingleHistory` and `GenerateFullMultihistory` can be
reproduced with `GenerateMultihistory` as well. This can be done by setting `"MaxDestroyerEvents" -> 1` to emulate
`GenerateSingleHistory` and setting `"MaxDestroyerEvents" -> Infinity` and leaving the
[stopping condition](StoppingConditionParameters.md) empty to emulate `GenerateFullMultihistory`.

However, by setting `"MaxDestroyerEvents"` to finite values larger than 1, one can generate multihistories not possible
with other generators.
Loading