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

標(biāo)題: 51單片機(jī)模擬二維宇宙演化 [打印本頁(yè)]

作者: exv    時(shí)間: 2015-1-7 18:10
標(biāo)題: 51單片機(jī)模擬二維宇宙演化
本帖最后由 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說(shuō)過(guò)“The god does not play the game which throw the dice.",Game與Law的不同在于前者是不定的,如同Schrodinger's Cat的狀態(tài)是不定的。

如果模擬宇宙的維數(shù)達(dá)到11,并且有合適的Law及相應(yīng)起始狀態(tài),復(fù)現(xiàn)我們這個(gè)世界也是可能的,這便是The Grand Design之意。

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

以下是編碼原則(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單片機(jī)在12864液晶上模擬的二位宇宙演化,該宇宙的演化經(jīng)歷時(shí)間為43演化單位。

相關(guān)書籍及代碼晚些時(shí)候附上。

此模擬方案可用于:
1. 練習(xí)編寫與液晶/單片機(jī)有關(guān)的代碼優(yōu)化;
2. 測(cè)試硬件性能,類似計(jì)算PI來(lái)評(píng)價(jià)計(jì)算機(jī)性能的那個(gè)程式。

作者: exv    時(shí)間: 2015-1-8 20:07
相關(guān)代碼請(qǐng)參考我這個(gè)帖子:
http://m.zg4o1577.cn/bbs/dpj-30318-1.html

霍金的The Grand Design請(qǐng)到這下載:
http://vdisk.weibo.com/s/B4iksprsm65q
相關(guān)編碼原理請(qǐng)參考第八章

以上資料僅供交流學(xué)習(xí)之用~
作者: exv    時(shí)間: 2015-1-9 12:38
更多細(xì)胞自動(dòng)機(jī)參考:

1.一位網(wǎng)友在彩色液晶上做的屏保


2.網(wǎng)友withparadox2的作品



3.另外一位網(wǎng)友的作品



提示:
您若用手上的51單片機(jī)和液晶實(shí)現(xiàn)這些,請(qǐng)適當(dāng)更改我的算法,否則會(huì)等上很久的。


作者: 2808569472    時(shí)間: 2015-1-11 17:10
謝謝樓主分享,好漂亮。
作者: exv    時(shí)間: 2015-1-12 22:47
本帖最后由 exv 于 2015-1-12 22:50 編輯

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

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架構(gòu)了一個(gè)可無(wú)限延展的二維棋盤陣列。
每格僅陰陽(yáng)二態(tài):陽(yáng)(綠)陰(黑)。
(注:書上的顏色和我提供的程序中的顏色正好相反)
每格8鄰:上下左右及四斜角。
此世界中的時(shí)間是離散而非連續(xù)。
若給定陰陽(yáng)變易法則及始態(tài),則可向時(shí)間軸前方推演此世界:

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. 若陽(yáng)格周圍有 2 ~ 3 陽(yáng)格,其繼為陽(yáng)。
2. 若陰格周圍恰 3 陽(yáng)格,此格轉(zhuǎn)陽(yáng)。
3. 其他所有情形,陰繼為陰。陽(yáng)格周陽(yáng)格少則死于孤寂;反之死于擁擠。

作者: gonggu8181    時(shí)間: 2015-1-13 22:41
大師級(jí)的人物,專門注冊(cè)來(lái)學(xué)習(xí)!
作者: exv    時(shí)間: 2015-1-13 23:17
如果有STM32板子的朋友,可參考我的這個(gè)帖子:
www點(diǎn)openedv點(diǎn)com/posts/list/0/45175.htm
運(yùn)算速度會(huì)快上很多。
作者: exv    時(shí)間: 2015-1-13 23:28
gonggu8181 發(fā)表于 2015-1-13 22:41
大師級(jí)的人物,專門注冊(cè)來(lái)學(xué)習(xí)!

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

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

民國(guó)時(shí)有位詩(shī)人寫過(guò)這樣一首詩(shī):
你站在橋上看風(fēng)景
看風(fēng)景人在橋上看你
明月裝飾了你的窗子
你裝飾了別人的夢(mèng)

咱不過(guò)是風(fēng)景中的風(fēng)景,夢(mèng)中的夢(mèng),真正的萬(wàn)有在這一切之外。
作者: boss654321    時(shí)間: 2015-1-14 08:25
太強(qiáng)了.不曉得要好久才能達(dá)到這個(gè)水平
作者: exv    時(shí)間: 2015-1-14 12:48
附上一個(gè)可在89c52+12864液晶上運(yùn)行的hex文件(51hei5默認(rèn)配置即可)
效率比之前高約二十倍。
部分修改后的代碼亦在附件中。
底層代碼請(qǐng)各位朋友依據(jù)自己的硬件實(shí)現(xiàn)。
Evolution.rar (3.74 KB, 下載次數(shù): 9)

作者: exv    時(shí)間: 2015-1-18 10:50
重新用STM32寫了一遍代碼,支持互動(dòng)式操作(可在屏幕上繪圖)。



相關(guān)代碼可到 百度 STM32下的元胞自動(dòng)機(jī)。(第一個(gè)即是)





歡迎光臨 (http://m.zg4o1577.cn/bbs/) Powered by Discuz! X3.1
主站蜘蛛池模板: 国产一区不卡 | 综合伊人久久 | 91色网站| 在线天堂av | 久操视频在线 | 午夜在线 | 青青草成人在线 | 夜夜操夜夜爽 | 欧美国产激情 | 欧美视频一二三区 | 18色av| 国产99页 | 欧美日韩在线视频观看 | 在线看的av| 丁香六月综合 | 曰本毛茸茸性生活 | 精品一区二区在线播放 | 国产蜜臀av| 中文字幕在线观看免费 | 久久免费国产 | www.毛片| 日本乱子伦 | 免费看黄色大片 | 香蕉成人 | 久久国内精品 | 国产精品福利在线观看 | 97精品视频在线观看 | 亚洲午夜精品 | 日韩精品极品视频在线观看免费 | 日本高清视频www | 成人伊人网 | 一区二区三区在线免费 | 国产伦精品一区二区免费 | 一级片日韩 | 国产欧美日韩综合精品 | 亚洲欧美日韩综合 | 午夜激情小视频 | 国产一区二区三区免费视频 | 亚洲精品色图 | 97精品国产 | 在线播放国产精品 |