【正文】
s time for the wild fruits to ripe. The picturesque Arxan in Autumn is indeed a fairyland only exists in a dream that satisfies all your fantasies. If it rains heavily on Saturday night, some elderly Chinese will say it is because Zhinu, or the Weaving Maid, is crying on the day she met her husband Niulang, or the Cowherd, on the Milky Way. Most Chinese remember being told this romantic tragedy when they were children on Qixi, or the Seventh Night Festival, which falls on the seventh day of the seventh lunar month, which is usually in early August. This year it falls on Saturday, August 2. Folklore Story As the story goes, once there was a cowherd, Niulang, who lived with his elder brother and sisterinlaw. But she disliked and abused him, and the boy was forced to leave home with only an old cow for pany. The cow, however, was a former god who had violated imperial rules and was sent to earth in bovine form. One day the cow led Niulang to a lake where fairies took a bath on earth. Among them was Zhinu, the most beautiful fairy and a skilled seamstress. The two fell in love at first sight and were soon married. They had a son and daughter and their happy life was held up as an example for hundreds of years in China. Yet in the eyes of the Jade Emperor, the Supreme Deity in Taoism, marriage between a mortal and fairy was strictly forbidden. He ordered the heaven troop to catch Zhinu back. Niulang grew desperate when he discovered Zhinu had been taken back to heaven. Driven by Niulang39。 ll wait in the line for one hour to get a ticket, and another two hours at the site, to only see a tiny bit of the place due to the crowds. Last year, 428 million tourists traveled in China over the weeklong holiday in October. Traveling during this period is a matter that needs thorough preparation. If you are short on time to plan the uping Golden Week it may not be a bad idea to avoid some of the most crowded places for now. There is always a place so fascinating that everyone yearns for. Arxan is a place like this. The beauty of Arxan is everlasting regardless of the changing of four seasons. Bestowed by nature, its spectacular seasonal landscape and mountains are just beyond word. Arxan is a crucial destination for the remended travelling route, China Inner Mongolia Arxan — Hailar — Manzhouli. It is also the joint of the four prairies across the SinoMongolian border, where people gravitate towards the exotic atmosphere mixed with Chinese, Russian, and Mongolia elements. As a historic site for the Yitian Battle, Arxan still embodies the spirit of Genghis Khan. Walking into Arxan, you will be amazed by a kaleidoscope of geous colors all the year round the Spring azaleas blooming red in the snow, the Summer sea wavering blue in the breeze, the Autumn leaves painted in yellow covering volcanic traces, and the Winter woods shining white on the vast alpine snowscape. Hinggan League Arxan city is situated in the far eastern area of Inner Mongolia Autonomous Region. Its full name Haren Arxan means hot holy water in the Mongolian language. Arxan is a tourism city in the northern frontier with a blend of large forest, grand prairies, vast snowfield, heaven lake cluster, thermium, as well as volcanic cluster. It is a rare and unique ecotourism base filled with healthy sunshine, clean air and unspoiled green. Nestled close to the country39。在設(shè)計期間,我遇到了很多自己無法解決的問題,多虧老師、同學(xué)的幫忙,才能使我順利完成設(shè)計?,F(xiàn)在的程序基本上可以解決大部分魔方狀態(tài)。在這個時候我認識到,如果想解決這個題目自己必須要學(xué)習(xí)玩魔方,于是就照著我找到的資料開始學(xué)習(xí)如何玩魔方,還好在幾天后終于將魔方復(fù)原了。但是,新的問題又出現(xiàn)了,這個方法是在復(fù)原了八個角塊以后才可以用的,但它并沒有給出如何恢復(fù)八個角塊的序列。在沒有辦法用盲目搜索解決這個問題的時候我考慮到了專家系統(tǒng)。這也就說明我的程序只能解決在七步之內(nèi)找到復(fù)原路徑的魔方,而且速度相當?shù)穆?。所以我改變的了對魔方狀態(tài)圖的存儲方法,采用了不存儲狀態(tài)數(shù)組,而是存儲魔方的旋轉(zhuǎn)方式的,再通過回朔來找到要擴展的狀態(tài)圖的當前狀態(tài)。在開學(xué)后,開始著手搜索部分程序的編寫,當這部分程序編寫完以后,新的問題又出現(xiàn)了。在假期快要結(jié)束的時候,找到了構(gòu)建魔方狀態(tài)圖的方法,也完成了對魔方各個面旋轉(zhuǎn)操作的函數(shù)的編寫。所以本打算在假期就將這個題目徹底解決的念頭也隨著這些困難消失了,而且無論怎么想也找不到很好的解決辦法。在慢慢開始著手做這個程序的時候才發(fā)現(xiàn)有很多東西是我沒有接觸過的,這些都需要通過自己來學(xué)習(xí)。東北石油大學(xué)華瑞學(xué)院本科生畢業(yè)設(shè)計(論文)24結(jié) 論這次畢業(yè)設(shè)計所選的題目對我來說是一個很大的挑戰(zhàn),因為在以前從來沒有寫過任何與專家系統(tǒng)有關(guān)的程序。圖 45 人工操作中間選擇 h 后由電腦自動求解(6)在程序一開始就輸入電腦。東北石油大學(xué)華瑞學(xué)院本科生畢業(yè)設(shè)計(論文)22圖 43 人工操作界面(4)在選擇人工解決后輸入f+ 后的顯示。圖 41 程序啟動后的界面(2)輸入魔方文件后的顯示?!”菊滦〗Y(jié)通過以上可以看出主模塊是建立在各個分模塊相互調(diào)用的基礎(chǔ)上,對文件接收模塊、程序執(zhí)行模塊、旋轉(zhuǎn)操作模塊、搜索模塊以及專揀模塊分別進行說明,并給出基本求解過程和圖解。由于在這個模塊的各個函數(shù)中都是一些專家序列,程序無外就是將魔方的狀態(tài)與它們比較,如果符合要求就調(diào)用專家序列,不符合要求就通過旋轉(zhuǎn)魔方,使魔方的狀態(tài)符合要求再調(diào)用專家序列?;謴?fù)八個角塊的過程是由這個模塊中的firststage()函數(shù)實現(xiàn)的,因為在這里在搜索的過程中要時刻對比搜索到的魔方狀態(tài)是否符合那幾種固定的要求,所以,為了方便操作,用到了一個指向函數(shù)的指針(p),關(guān)于它的定義在前面已給出說明,這樣是可以很方便的來調(diào)用對比函數(shù)(para1()、para2()、para3() 和para4())。但是在魔方的初始狀態(tài)中,要恢復(fù)的角塊不一定是符合要求的,這就需要旋轉(zhuǎn)魔方將要恢復(fù)的角塊轉(zhuǎn)到符合要求的位置。在復(fù)原魔方八個角塊的時候,用到了在上節(jié)提到的搜索技術(shù)。通過上面對“八角法”的敘述可以看出,這個部分沒有什么多大的難度,只要把魔方狀態(tài)考慮完全就可以了。通過上面的八個階段,魔方在大部分情況下就已經(jīng)被復(fù)原了。第八階段是恢復(fù)魔方中間邊塊的色向。當然,有的時候由于情況比較特殊,沒有符合的專家操作序列。在上面幾個階段過后,魔方基本上已經(jīng)被復(fù)原了,只剩下魔方的中間塊沒有被復(fù)原。在這里旋轉(zhuǎn)魔方,把有“洞”的頂面轉(zhuǎn)到左面或者右面,然后選擇合適的旋轉(zhuǎn)序列,恢復(fù)這最后一個邊塊。第六階段是恢復(fù)頂面的最后一個邊塊。把這個“洞”轉(zhuǎn)到前面,然后尋找要到要恢復(fù)的下邊塊的位置套用具體的旋轉(zhuǎn)序列。第五階段是恢復(fù)底面的所有邊塊。在這里邊塊的位置和色向都要考慮,每次只考慮一塊,直到這個階段的完成。然后根據(jù)成對的情況來選擇合適的魔方旋轉(zhuǎn)序列。而這個階段就是要解決這個問題。這個過程與上面的過程相似,只要把底面轉(zhuǎn)到頂面,然后把底面當做頂面來處理。所謂“X ”就是頂面的角塊向上的顏色與中塊的顏色相同。接下來介紹一下“八角法”解決魔方問題的八個階段?!鞍私欠ā苯鉀Q魔方問題一共分為八個階段?!鞍私欠ā?,就是在解決魔方問題的時候,首先復(fù)原魔方的八個角塊。下面就我所采用的專家方法—“八角法”給以說明。我在這里選擇的是“八角法”,這種方法解決魔方問題在求解的步驟上并不是很好,也就是步驟會比較多,選擇它只是因為它學(xué)起來比較容易,因為我也是才接觸魔方,所以選擇了一個比較容易學(xué)習(xí)的方法來處理這個問題。每當找到符合要求的狀態(tài)時就調(diào)用專家序列給出正確的求解步驟。這是程序中最為關(guān)鍵的一個模塊,在這里將魔方中復(fù)雜的旋轉(zhuǎn)序列與程序結(jié)合到了一起,從而完成了對魔方的求解。到這里搜索部分就算是結(jié)束了,剩下的就是如何將它應(yīng)用到解決到魔方復(fù)原的第一段,關(guān)于這個會在談?wù)搶<蚁到y(tǒng)的時候給出。 //恢復(fù)到擴展前的狀態(tài)(1)。 //新結(jié)點插入隊尾,構(gòu)造擴展鏈表nextnode=newnode。 //指向父結(jié)點heref_1=newnode。newnodev=1。}else{newnode=new nodec。 //新結(jié)點插入隊尾,構(gòu)造擴展鏈表 nextnode=newnode。 //指向父結(jié)點 heref_1=newnode。newnodev=1。if(solve_1==true)東北石油大學(xué)華瑞學(xué)院本科生畢業(yè)設(shè)計(論文)18{newnode=new nodec。//不擴展上次旋轉(zhuǎn)的逆操作if(re_check!=2) {front_1()。下面給出剪枝和和搜索的一部分代碼,是對前面順時針旋轉(zhuǎn)操作擴展的代碼,其它面的進行搜索時擴展的代碼和這些基本相同。另一種情況是,每當對同一個面進行四次相同的操作后(四次順時針或四次逆時針)也會回到最初的狀態(tài),如果對上面的剪枝有了了解,這個就不是很難理解。也就是說,對同一個面的兩次相鄰的操作不能是互逆的,也就是,不能對它進行順時針(逆時針)操作后,在進行逆時針(順時針)操作。在魔方的操作中有這么兩種情況值得注