久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 6731|回復: 10
打印 上一主題 下一主題
收起左側

51單片機模擬二維宇宙演化

[復制鏈接]
跳轉到指定樓層
樓主
本帖最后由 exv 于 2015-1-7 18:11 編輯



霍金在The Grand Design中寫道
"In the Game of Life, as in our world, self-reproducing patterns are complex objects. One estimate, based on the earlier work of mathematician John von Neumann, places the minimum size of a self- replicating pattern in the Game of Life at ten trillion squares—roughly the number of molecules in a single human cell."

這里Game指的是Law而非游戲,Einstein說過“The god does not play the game which throw the dice.",Game與Law的不同在于前者是不定的,如同Schrodinger's Cat的狀態是不定的。

如果模擬宇宙的維數達到11,并且有合適的Law及相應起始狀態,復現我們這個世界也是可能的,這便是The Grand Design之意。

由于是既定的演化路徑,故而可用51單片機模擬二維宇宙演化。

以下是編碼原則(The Law of A 2D World,摘自霍金的書The Grand Design

The world Conway envisioned is a square array, like a chessboard, but extending infinitely in all directions. Each square can be in one of two states: alive (shown in green) or dead (shown in black). Each square has eight neighbors: the up, down, left, and right neighbors and four diagonal neighbors. Time in this world is not continuous but moves forward in discrete steps. Given any arrangement of dead and live squares, the number of live neighbors determine what happens next according to the following laws:

1.  A live square with two or three live neighbors survives (survival).
2.  A dead square with exactly three live neighbors becomes a live cell (birth).
3.  In all other cases a cell dies or remains dead. In the case that a live square has zero or one neighbor, it is said to die of loneliness; if it has more than three neighbors, it is said to die of overcrowding.


上圖是自己用51單片機在12864液晶上模擬的二位宇宙演化,該宇宙的演化經歷時間為43演化單位。

相關書籍及代碼晚些時候附上。

此模擬方案可用于:
1. 練習編寫與液晶/單片機有關的代碼優化;
2. 測試硬件性能,類似計算PI來評價計算機性能的那個程式。
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏1 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:67796 發表于 2015-1-8 20:07 | 只看該作者
相關代碼請參考我這個帖子:
http://www.zg4o1577.cn/bbs/dpj-30318-1.html

霍金的The Grand Design請到這下載:
http://vdisk.weibo.com/s/B4iksprsm65q
相關編碼原理請參考第八章

以上資料僅供交流學習之用~
回復

使用道具 舉報

板凳
ID:67796 發表于 2015-1-9 12:38 | 只看該作者
更多細胞自動機參考:

1.一位網友在彩色液晶上做的屏保


2.網友withparadox2的作品



3.另外一位網友的作品



提示:
您若用手上的51單片機和液晶實現這些,請適當更改我的算法,否則會等上很久的。

回復

使用道具 舉報

地板
ID:70129 發表于 2015-1-11 17:10 來自手機 | 只看該作者
謝謝樓主分享,好漂亮。
回復

使用道具 舉報

5#
ID:67796 發表于 2015-1-12 22:47 | 只看該作者
本帖最后由 exv 于 2015-1-12 22:50 編輯

霍金的書向來以難懂著稱,為了讓更多朋友能看懂,我稍翻譯下霍金書上的文字:

The world Conway envisioned is a square array, like a chessboard, but extending infinitely in all directions. Each square can be in one of two states: alive (shown in green) or dead (shown in black). Each square has eight neighbors: the up, down, left, and right neighbors and four diagonal neighbors. Time in this world is not continuous but moves forward in discrete steps. Given any arrangement of dead and live squares, the number of live neighbors determine what happens next according to the following laws:

Conway架構了一個可無限延展的二維棋盤陣列。
每格僅陰陽二態:陽(綠)陰(黑)。
(注:書上的顏色和我提供的程序中的顏色正好相反)
每格8鄰:上下左右及四斜角。
此世界中的時間是離散而非連續。
若給定陰陽變易法則及始態,則可向時間軸前方推演此世界:

1.  A live square with two or three live neighbors survives (survival).
2.  A dead square with exactly three live neighbors becomes a live cell (birth).
3.  In all other cases a cell dies or remains dead. In the case that a live square has zero or one neighbor, it is said to die of loneliness; if it has more than three neighbors, it is said to die of overcrowding.

1. 若陽格周圍有 2 ~ 3 陽格,其繼為陽。
2. 若陰格周圍恰 3 陽格,此格轉陽。
3. 其他所有情形,陰繼為陰。陽格周陽格少則死于孤寂;反之死于擁擠。
回復

使用道具 舉報

6#
ID:72183 發表于 2015-1-13 22:41 | 只看該作者
大師級的人物,專門注冊來學習!
回復

使用道具 舉報

7#
ID:67796 發表于 2015-1-13 23:17 | 只看該作者
如果有STM32板子的朋友,可參考我的這個帖子:
www點openedv點com/posts/list/0/45175.htm
運算速度會快上很多。
回復

使用道具 舉報

8#
ID:67796 發表于 2015-1-13 23:28 | 只看該作者
gonggu8181 發表于 2015-1-13 22:41
大師級的人物,專門注冊來學習!

真正的大師在書里:
John von Neumann(馮諾依曼)有兩個大作為后人稱道:
一個是包括51單片機都在使用的馮諾依曼結構,另一個便是這細胞自動機。

霍金引用了馮諾依曼的一個大作,
而我只是引用了霍金的大作。

民國時有位詩人寫過這樣一首詩:
你站在橋上看風景
看風景人在橋上看你
明月裝飾了你的窗子
你裝飾了別人的夢

咱不過是風景中的風景,夢中的夢,真正的萬有在這一切之外。
回復

使用道具 舉報

9#
ID:65707 發表于 2015-1-14 08:25 | 只看該作者
太強了.不曉得要好久才能達到這個水平
回復

使用道具 舉報

10#
ID:67796 發表于 2015-1-14 12:48 | 只看該作者
附上一個可在89c52+12864液晶上運行的hex文件(51hei5默認配置即可)
效率比之前高約二十倍。
部分修改后的代碼亦在附件中。
底層代碼請各位朋友依據自己的硬件實現。
Evolution.rar (3.74 KB, 下載次數: 9)
回復

使用道具 舉報

11#
ID:67796 發表于 2015-1-18 10:50 | 只看該作者
重新用STM32寫了一遍代碼,支持互動式操作(可在屏幕上繪圖)。



相關代碼可到 百度 STM32下的元胞自動機。(第一個即是)
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 久久国内 | 日韩精品一区二区三区中文字幕 | 欧美最猛性xxxxx亚洲精品 | 国产一二区视频 | 成人精品一区二区三区 | 成人精品视频 | 91精品国产综合久久福利软件 | 久久av一区二区三区 | 九色av| 欧美精品一区二区三区蜜桃视频 | 亚洲欧洲精品一区 | 国产精品成人品 | 国产欧美一区二区三区国产幕精品 | 一片毛片| 黄色日本片 | 欧美v日韩v | 精品av| 中文字幕一区二区在线观看 | 欧美成人a∨高清免费观看 欧美日韩中 | 日韩中文字幕在线播放 | 国内久久精品 | 亚洲视频免费 | 综合精品 | 日本精品视频在线 | 免费观看a级毛片在线播放 黄网站免费入口 | 成人精品鲁一区一区二区 | 亚洲一区| 午夜天堂精品久久久久 | 亚洲欧洲中文日韩 | 在线 丝袜 欧美 日韩 制服 | 91精品国产99 | 在线观看免费高清av | 国产精品无码专区在线观看 | 久久久九九 | 91精品国产91久久久久久密臀 | 亚洲精品二区 | 欧美日韩不卡合集视频 | 亚洲成人一级片 | 99久久久久久 | 国产精品久久国产精品 | 日韩免费在线 |