Encapsulate Ruleset, Patterns in separate Data Structure #53

Closed
opened 2018-10-16 15:58:02 +00:00 by marty-oehme · 5 comments
marty-oehme commented 2018-10-16 15:58:02 +00:00 (Migrated from gitlab.com)

currently patterns are hardcoded in Simulation code to be added to the Simulation grid via function.

Patterns should be contained in a ruleset to be accessed (randomly, or perhaps via enum?)

Ruleset should in turn be contained in the simulation, injected into its creation.

currently patterns are hardcoded in Simulation code to be added to the Simulation grid via function. Patterns should be contained in a ruleset to be accessed (randomly, or perhaps via enum?) Ruleset should in turn be contained in the simulation, injected into its creation.
marty-oehme commented 2018-10-16 16:28:45 +00:00 (Migrated from gitlab.com)

Simulation contains reference to a 'Ruleset' interface (abstract class).
This contains methods for checkSurvival(neighbors, range); checkBirth(neighbors, range);

Ruleset is then implemented in e.g. GameOfLife, which checks for 2/3 and 3 respectively (with range 1 - maybe range should be kept for later)


Rulesets could also contain a list of 'Pattern' objects which is again an interface for simple data objects that describe common/interesting patterns, which could be used to create start configurations in the simulation (by being invoked in Ruleset.createInterestingPattern or something similar) as well as being invoked when clicking the add random pattern button. This should be a separate step and is more involved than the ruleset itself.

Simulation contains reference to a 'Ruleset' interface (abstract class). This contains methods for checkSurvival(neighbors, range); checkBirth(neighbors, range); Ruleset is then implemented in e.g. GameOfLife, which checks for 2/3 and 3 respectively (with range 1 - maybe range should be kept for later) ----- Rulesets could also contain a list of 'Pattern' objects which is again an interface for simple data objects that describe common/interesting patterns, which could be used to create start configurations in the simulation (by being invoked in Ruleset.createInterestingPattern or something similar) as well as being invoked when clicking the add random pattern button. This should be a separate step and is more involved than the ruleset itself.
marty-oehme commented 2018-10-16 16:29:18 +00:00 (Migrated from gitlab.com)
created branch [`53-encapsulate-ruleset-patterns-in-separate-data-structure`](https://gitlab.com/marty.oehme/cellular-automata/compare/master...53-encapsulate-ruleset-patterns-in-separate-data-structure)
marty-oehme commented 2018-10-16 16:29:19 +00:00 (Migrated from gitlab.com)

mentioned in merge request !14

mentioned in merge request !14
marty-oehme commented 2018-10-18 09:06:57 +00:00 (Migrated from gitlab.com)

assigned to @marty.oehme

assigned to @marty.oehme
marty-oehme commented 2018-10-18 09:35:12 +00:00 (Migrated from gitlab.com)

closed via commit b37487a222

closed via commit b37487a222f8b878fbfa08b2928febbfdbb47a69
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: experiments/cellular-automata#53
No description provided.