docs, test: genetic algorithm#338
Merged
Merged
Conversation
Member
|
@siriak could you review and merge this, I'm in the process of cleaning up the directory structure and this would create a merging conflict which I would need to solve before I progress with my PR further. |
raklaptudirm
approved these changes
Sep 6, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Package
genetic_algorithm/geneticalgorithmcontains single function calledGeneticString. Couple changes has been made to the code of the function related to providing configuration to function and retrieving result of the function execution.Previously, function used to return tuple which contains result of generation as well as some details about generation process. Output was changed to the single go struct and an error, in order to make function testable (in case of errors).
In comparison with the previous output, when only a resulting string was provided, new output also contains a value, used inside the process, what can be useful for later function extensions.
Configuration previously hardcoded, now can be provided withing configuration structure. This feature can be used to optimize execution time. Despite the fact that PR does not provide any benchmarks, ability to provide configuration can be used to create a specter of tests, showing function efficiency based on the configuration parameters.
Checklist
docsandtestin one title, because otherwise PR makes no sense);golang_lint_and_testpassed in fork;Notes
Testing provided with this PR is nominal. Still more relevant tests could be added such as edge case testing and tests for correct error occurrences.
Previously description of the package stated using of concurrency. It was removed, because no actual concurrency has been used in the implementation.