TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A Very Simple Genetic Algorithm Written in Swift 3

105 pointsby brothrockover 8 years ago

5 comments

LoSboccaccover 8 years ago
&gt; let POP_SIZE = 50<p>c&#x27;mon everyone knows genetic population is 30<p>(I kid I kid but that number has an interesting story <a href="https:&#x2F;&#x2F;statswithcats.wordpress.com&#x2F;2010&#x2F;07&#x2F;11&#x2F;30-samples-standard-suggestion-or-superstition&#x2F;" rel="nofollow">https:&#x2F;&#x2F;statswithcats.wordpress.com&#x2F;2010&#x2F;07&#x2F;11&#x2F;30-samples-st...</a> )
评论 #12932868 未加载
hellofunkover 8 years ago
&gt; Note -- this is much slower than the python version<p>Surprising. Swift, a compiled, static language, is slower than python in this use case?
评论 #12932769 未加载
评论 #12931631 未加载
评论 #12932972 未加载
评论 #12931609 未加载
cfdrakeover 8 years ago
Did not expect to see &quot;cfdrake&quot; when I initially clicked the link - nice port! :)<p>Agreed with e28eta - I actually saw RubikSwift demoed at Swift Summit a few days ago as well and enjoyed it. Definitely check it out if you&#x27;re interested in the topic.
e28etaover 8 years ago
I thought this was going to be a link to [1], from a talk given at Swift Summit a couple days ago. I haven&#x27;t really looked at the code for either one to compare them, but for people who are interested, here&#x27;s a second simple genetic algorithm in Swift (found in RubikSwift&#x2F;GeneticsSolver.swift)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;JaviSoto&#x2F;RubikSwift" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;JaviSoto&#x2F;RubikSwift</a>
评论 #12932887 未加载
proyb2over 8 years ago
The other languages are here: <a href="https:&#x2F;&#x2F;github.com&#x2F;jsvazic&#x2F;GAHelloWorld" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jsvazic&#x2F;GAHelloWorld</a>