V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
Livoras
V2EX  ›  分享创造

用遗传算法做一个会进化的字符串

  •  2
     
  •   Livoras ·
    livoras · 2016-03-16 11:03:24 +08:00 · 6136 次点击
    这是一个创建于 2955 天前的主题,其中的信息可能已经有所发展或是发生改变。

    用遗传算法随机生成一堆字符串,然后慢慢进化成目标字符串。虽然没什么卵用,但是看起来很鬼畜很带感哈哈。

    弄到了个人主页上: http://livoras.com/ ,源码都可以看到。欢迎一起学习讨论

    44 条回复    2016-03-19 10:55:33 +08:00
    Livoras
        1
    Livoras  
    OP
       2016-03-16 11:04:45 +08:00
    有时候发现某些字符不对,那么就是进化失败了!
    MicroPan
        2
    MicroPan  
       2016-03-16 11:25:39 +08:00
    前排点赞
    laobubu
        3
    laobubu  
       2016-03-16 11:38:10 +08:00 via Android
    233 确实带感
    LevineChen
        4
    LevineChen  
       2016-03-16 11:40:52 +08:00
    集成在加密通讯里.. 有种解密 ing 的赶脚
    ooh
        5
    ooh  
       2016-03-16 11:41:39 +08:00 via Android
    6 得不行
    7654
        6
    7654  
       2016-03-16 11:43:42 +08:00
    首先续 1S ,实力膜蛤
    Kilerd
        7
    Kilerd  
       2016-03-16 12:23:01 +08:00
    这不就是猴子排序方法吗?
    Livoras
        8
    Livoras  
    OP
       2016-03-16 12:30:57 +08:00
    @Kilerd 跟排序没半毛钱关系。实际上是一个最优解算法: https://zh.wikipedia.org/wiki/%E9%81%97%E4%BC%A0%E7%AE%97%E6%B3%95
    icedx
        9
    icedx  
       2016-03-16 12:32:45 +08:00
    +1S
    frozenshadow
        10
    frozenshadow  
       2016-03-16 12:38:24 +08:00
    看着好带感~
    pupboss
        11
    pupboss  
       2016-03-16 12:40:43 +08:00
    暴力膜蛤😂🐸🔫
    northisland
        12
    northisland  
       2016-03-16 12:43:15 +08:00
    跟着续了,只是现在主页只显示...和下面的信息

    这是怎么回事儿吗?
    Livoras
        13
    Livoras  
    OP
       2016-03-16 12:44:49 +08:00
    @northisland 你用的是什么浏览器呢?能看到 console 有什么报错信息吗?
    nuomi
        14
    nuomi  
       2016-03-16 12:51:32 +08:00 via iPhone
    猝不及防
    MaiCong
        15
    MaiCong  
       2016-03-16 12:53:22 +08:00 via iPhone
    猴塞雷
    northisland
        16
    northisland  
       2016-03-16 13:30:53 +08:00
    @Livoras
    ubuntu 下的火狐 37 ,有问题

    http://imgur.com/kywXHJP
    northisland
        17
    northisland  
       2016-03-16 13:31:17 +08:00
    northisland
        18
    northisland  
       2016-03-16 13:36:20 +08:00
    所用的 getPreventDefault() 已不赞成使用。请使用 defaultPrevented 替代。
    hxtheone
        19
    hxtheone  
       2016-03-16 13:48:04 +08:00
    点进续 1s
    Iuranus
        20
    Iuranus  
       2016-03-16 14:01:13 +08:00
    哈哈哈哈,手工点赞~
    whahuzhihao
        21
    whahuzhihao  
       2016-03-16 14:08:37 +08:00
    遗传算法~ 想起来大学人工智能课的时候 也写过一个遗传算法解 TSP 问题的 demo
    http://www.bewithyou.me/demo/gatsp/index.html
    hackerwgf
        22
    hackerwgf  
       2016-03-16 14:17:53 +08:00
    LZ 搞的这个东西啊, excited !
    Livoras
        23
    Livoras  
    OP
       2016-03-16 14:18:16 +08:00
    @whahuzhihao 这个赞
    Mutoo
        24
    Mutoo  
       2016-03-16 14:23:34 +08:00   ❤️ 2
    前天刚好看到一个 js 的遗传算法库 Genetic.js
    hello world 演示的也正好是解字符串:
    http://subprotocol.com/system/genetic-hello-world.html
    alafeizai
        25
    alafeizai  
       2016-03-16 14:33:59 +08:00
    这个吊
    closeid
        26
    closeid  
       2016-03-16 14:38:52 +08:00
    科技感
    Livoras
        27
    Livoras  
    OP
       2016-03-16 14:50:12 +08:00
    @Mutoo 吓得我赶紧 star 了一下
    hahastudio
        28
    hahastudio  
       2016-03-16 14:58:40 +08:00
    我当时玩无限猴子的时候用的还是 to be or not to be= =
    现在人怎么突然就膜法起来了= =
    Strikeactor
        29
    Strikeactor  
       2016-03-16 15:18:18 +08:00
    OS X 10.10.5 , Firefox 44.0.2 ,同 17L
    DemoJameson
        30
    DemoJameson  
       2016-03-16 15:42:48 +08:00
    卧槽,突然惊醒刚刚搜到的关于 MVC MVP MVVM 的文章就是楼主写的
    Livoras
        31
    Livoras  
    OP
       2016-03-16 15:51:34 +08:00
    @Strikeactor 无法复现...升级到 45 吧,或者用 Chrome
    Livoras
        32
    Livoras  
    OP
       2016-03-16 15:51:59 +08:00
    @DemoJameson 这一定是个巧合
    aaaron7
        33
    aaaron7  
       2016-03-16 16:55:59 +08:00
    非常 6
    wd0g
        34
    wd0g  
       2016-03-16 17:55:27 +08:00
    不错!楼主是蛤蟆的粉丝吗?
    sinux
        35
    sinux  
       2016-03-16 17:55:59 +08:00
    6 的不要不要的
    Livoras
        36
    Livoras  
    OP
       2016-03-16 18:00:40 +08:00 via iPhone
    @sinux 国际膜蛤协会副主席
    stonex
        37
    stonex  
       2016-03-16 21:08:58 +08:00
    cool !
    toosimple
        38
    toosimple  
       2016-03-16 23:51:11 +08:00 via iPhone
    excited!
    plqws
        39
    plqws  
       2016-03-17 09:52:51 +08:00
    一颗赛艇!
    zix
        40
    zix  
       2016-03-17 13:01:40 +08:00
    给你 82 分,剩下 666
    DT27
        41
    DT27  
       2016-03-17 13:18:45 +08:00
    为什么我觉得应该叫返祖算法。。。
    armnotstrong
        42
    armnotstrong  
       2016-03-17 17:47:29 +08:00
    Excited!
    LeoQ
        43
    LeoQ  
       2016-03-17 18:16:11 +08:00
    @Mutoo 谢谢!!!这个网站上好多东西都很有趣
    simoncos
        44
    simoncos  
       2016-03-19 10:55:33 +08:00
    哈哈哈,脑洞
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2916 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 15:10 · PVG 23:10 · LAX 08:10 · JFK 11:10
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.