2009年11月15日星期日

RepastCity - A demo virtual city


Author: Nick Malleson

Background
I've written a small Repast Simphony program which demonstrates how to create a virtual city and move some agents around a road network. I'm using this type of model for my PhD (an agent-based model of crime/burglar) and hopefully this program will be useful for anyone who needs to be able to move agents around a city.

If you're new to Repast Simphony you should do some tutorials first otherwise the code won't mean anything to you. You could try my tutorial or do some of the ones on the Repast website. Repast Simphony has quite a steep learning curve but is well worth learning if you need to build agent-based models, it's an excellent tool.

There is some background information about how the program works on my research blog. I'm also writing a working paper which should explain it better but haven't finished that yet.

Referencing and Editing
The code is released under the GNU General Public Licence so you're welcome to use the code however you would like to but please put a reference to me ( Nick Malleson) or to this page somewhere. When I finish my working paper you could use that instead.

If you improve or extend the code please let me know and I'll update it on this site. This is my first attempt at building a virtual city and so there will be lots of places where it can be improved (particularly with regards to efficiency, I think the routing algorithm is very slow).

The Program
The program is available as a single compressed file which contains the entire Eclipse project: Repast City Project. Download this file and extract it to a temporary directory.

To run the program you need to download Repast Simphony version 1.1 (it comes bundled with the Eclipse development environment) and then follow these instructions:

Start Repast (Eclipse)
Go to File -> Import
Then under 'General' select 'Existing Projects Into Workspace'.
Next to 'Select root directory' click on browse and select the extracted project.
Then click on 'Finish'. If you left the 'copy projects into workspace' box ticked you can now delete the zip file and the extracted directory because all the code will be copied into your Eclipse workspace.
Finally click on the 'Run' button (green) at the top of Eclipse and select 'Run RepastCity Model'. (If there is not option to run the model try closing the project and then re-opening it).
The only other thing you need to do is create a display so you can see the agents and the city (if you're not sure how to create displays do a tutorial first). Here's briefly how to create one:

When you have started the model scroll down in the scenario tree box until you can see the 'PersonContext' entry. Under that there should be a 'Displays' menu and a 'Person Display' under that.
Delete the person display and create a new one.
When you get to change how the SimplePerson agents are displayed click on the '+' button. Now you can add the shapefiles which represent the city (houses.shp and roads.shp, they are stored in the eclipse_workspace/RepastCity/repast_city_data/shape directory).
Finally, when I add agents or shapefiles to a display I always edit their style (maybe just change their colour slightly) because otherwise Simphony sometimes throws an exception.
That's it! There is a picture below which shows what the program should look like. I''ve also made a video of the simulation running.

I hope the code is useful. If you have any questions my email address is on my School of Geography webpage or even better try the Repast mailing list .



Changes (updated versions of the program)
These updated versions are not necessarily easier to understand so they might not be appropriate for people who just want to get an idea about how to build this sort of program themselves. Have a look at the comments to see if it's better for you to download one of these versions rather than the original.

RepastCity1.1.
I have made the routing algorithm more efficient by caching certain things like the closest road coordinate to each house. It runs much faster and has fixed an occasional bug where agents get stuck on one of the houses but the code is probably harder to understand.

隔壁的中国

版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://zhulinzhao.blogbus.com/logs/51433412.html

(原载于第59期我爱摇滚乐 照片来自杜斌的《上访者》)

当你翻到本页的时,相信你的眼光一定会在这里长久停留。这里的人你一定见过,当你急匆匆走过地下铁的通道,当你在某个政府办公楼去办事,也许某个角落就有他们的身影。体内在你不经意的余光里,在你匆匆的惊诧里。

他们是长久哀怨、悲愤的一群人,他们因某一意外而改变了人生轨迹,奔波于故乡和大都市,顽强地追逐一个说法、一个公正的梦想。他们是固执而又乐观的人群,他们日复一日地失望,年复一年地坚持,始终坚守着我们民族几千年来对“青天”和“人间自有公道”的一线信仰。

也许10年后,或者20年后,他们将悄悄从我们身边消失,然后,不在历史中留下任何痕迹,甚至有一天,我们不会记得还存在“上访”这个词。

历史永远是主流人群的记忆。而上访者无疑是这个社会最彻底的失败者,他们踏上漫漫路,便被从泥土中连根拔起,他们辗转于陌生的城市,在命运的泥水中被抽打。苦难、委屈和仇恨是他们的动力,而韧性往往只是增加他们的挫败和悲苦。

每个在肉体和精神的苦难中挣扎的上访者,都不会参与历史的叙事,他们的故事和心愿无法形诸文字进入我们的视野,不会成为文献进入历史。虽然,他们对任何愿意倾听的人絮絮叨叨,对任何表示同情的人都寄以无限信任。

可我们很忙。

我们需要知道每个成功者的艰辛与光荣,我们需要关心每个公众人物的怪癖和爱好,在一个渴望成功的年代,我们热烈的关心的一切,历史最终都会慷慨地预留足够的篇幅。如果有一天,我们忘记了上访者这个群体的存在,也许真就意味着他们不曾在世界上存在过。

他们离我们很远,与我们的生活没有交集,看到这一页的每个读者,直系亲属应该都不会有上访者吧。他们离我们很近,我们每个人的故乡都有这样的人在上路,我们生活的每个城市都不难看到他们的身影。我们打拼奋斗在中国的光明处,他们挣扎在时代的溃疡里。

有人说,他们是中国高速成长背后的代价与牺牲。但并非所有世界的成长背后都有这样的一群人,都需要付出这样的代价和牺牲。

但 愿若干年后,我们的国家不会再有这样一个特殊部落。如果历史要为中国今天的辉煌成就保留若干辛酸的细节做小小的注脚,也许我们该感谢杜斌这样的人,这位供 职于《纽约时报》的记者,几年来一直用镜头跟随上访者,留下他们的影像,记录了一个与我们平行的世界——他们与幸福、安宁、甜蜜、成功、美满无缘,他们与 中国经济高速增长带来的繁荣与富强无关,他们生活在一个我们陌生的世界,我们隔壁的中国。

“我是个冤死鬼。”
时间:2002年12月2日
地点:黑龙江省哈尔滨市街头
上/访者:黑龙江省伊春市44岁的教师张永印
他哭诉警察霸占了妻子,打残了他的双腿。上/访抗议时,他就穿上自己缝制像鬼穿的白衣,上面写着他在人间的屈辱。

  183次托生为人
    时间:2002年4月
    地点:北京村
    上访者:孙传明,81岁
    因儿子在1983年的“严打”中被处决,认为儿子被冤杀的孙传明20年来京上访183次,先后被北京一个信访办强制收容152次。滞留北京时间最久、上/访村资历最老的他说,“官司打不赢,北京就是我的娘胎。”

  “请你帮我跟美国政府要一个USA国籍”
    时间:2006年6月16日夜
    地点;北京上/访村
    上/访者:刘藩恩(左三),68岁。
    42年前他退伍回乡时发现户籍被人顶替,1991年他的父亲在为他上/访途中被杀害。探访他的是两届普利策奖得主、《纽约时报》专栏作家Nicholas D. Kristof

  陈光诚和他的盲人兄弟
    时间:2002年8月2日
    地点:山东省临沂市沂南县农村
    32岁的盲人代表陈光诚(戴墨镜者)以及一群农民残疾人。

 “见谁都想跪”
    时间:2003年4月
    地点:北京市朝阳区一家报社门前
    上访者:甘肃省下河清农场吴秀英。
    56岁的寡妇吴秀英生来几乎就是给人练手用的“靶子”。20年的上访史,是饱受毒打、收容、遣送、拘留、扣押、刑求、罚款和性骚扰的屈 辱史。吴的胸、肋骨折断过若干次后“有些拽不起身子”;她的膝盖下跪过若干回后“见谁都想跪”。在拍摄此照片前她刚刚在最高法院门前遭打。

  盐腌的证据
    时间:2002年12月1日
    地点:黑龙江省伊春市某山林
    5年来,清洁工于振洋(右一)每周都要若干次到山林中妻子尸体秘密的掩埋处撒食盐和浇盐水。他的妻子在1987年被警察传讯后死在离派出所15米远的男厕所坑池里。法医称是自杀溺死。因为妻子尸体上多处伤痕,于怀疑妻子是被谋杀。
    于振洋以食盐将妻子的尸体腌着,悄悄埋到山林内作为证据储存。“即使我到死,我知道,我的儿子将继续上/访的责任,”他说,“直到他也死。”

  国家赔偿
    时间:2002年4月
    地点:北京村
    上/访者:孙偕文
    1982年以来,他惟一收获,是在上访中捡来老婆和3个孩子。“老婆和孩子跟摆在屋前这排鞋子一样,都从垃圾堆里捡来,”他说,国家对他还算不薄。“好像是国家对我冤狱多年的赔偿。”

   两对父子
    时间:2002年11月
    地点:北京村
    上/访者:李伟(左),于泉(右)
    他们都来自黑龙江省铁力市,因为各自不同遭遇,这两对父子在北京上访村相遇。

一个人的冤墙   

时间:2004年1月   地点:北京最高法院信访办   上访者:无名、无年龄   来自地区:四川省南充市

上访的终点
北京上访村上访者墓地   

他们一次次往返于故乡与北京之间,虽然他们的愿望未能实现,但这一次,他们终于不用再奔波,可以停下来永远休息。



作者简介:
杜斌,生于1972年。先在中国传媒做摄影记者,后为自由职业摄影师。曾在美国《纽约时报》(New York Times)、《时代》(TIME)杂志、英国《卫报》(The Guardian)、德国《明星》(Stern)杂志等知名媒体发表新闻图片。现为《纽约时报》签约摄影师,供职于《纽约时报》北京分社。

2009年11月5日星期四

Radar Reveals Dynamic World Under Antarctica's Ice

by JON HAMILTON

LIMA/NASA
This satellite image shows the region surrounding Mount Erebus and the McMurdo Station research center, as well as Antarctica's Dry Valleys on the right.
text sizeAAANovember 4, 2009
A NASA DC-8 plane equipped with lasers, ice-penetrating radar, and a gravity meter is revealing a dynamic and complex world beneath the massive ice sheet that covers Antarctica.

The plane is flying over Antarctica for six weeks as part of a mission to use airplanes to replace a dying NASA satellite that's been monitoring polar ice.

But the stopgap measure is providing a major scientific bonus: The DC-8 flies just 1,500 feet above the ice and carries instruments that let scientists see right through the ice.

"It's going to change the way that we look at Antarctica," says Thomas Wagner, a NASA Cryosphere Program scientist.

The Antarctic ice sheet covers an area larger than Europe. In places, it's miles thick. If the sheet ever melts, sea level will rise by dozens of feet.

Beneath The Ice

Scientists have known for years that there are volcanoes, mountains, rivers and lakes beneath the ice. But they haven't known many details about these things.

The NASA flights offer a way to learn a great deal more, says William Krabill, a member of the NASA team flying on the DC-8. For example, the plane carries a special radar that lets scientists study the topography of the land beneath the ice sheet, he says. Another instrument detects tiny changes in gravity fields and can reveal liquid water beneath the ice.

The flights are letting scientists burrow down through the layers of ice to see rivers and lakes and the valleys carved by moving glaciers, Krabill says, like "peeling an onion."

And scientists have already found some really surprising stuff happening inside the ice itself:


EnlargeAlison Criscitiello
Antarctica is almost completely covered by ice sheets, which are more than a mile thick on average, and nearly 3 miles thick in places. New data from the plane flyovers is helping scientists learn about the landscape buried below the sheets of ice.
"There are these lakes that form and they literally seem to pop and deflate," Wagner says. "We just learned about this literally in the last couple of years, and we're finding new ones all the time."

If the water in those lakes gets under the ice, it could act as a lubricant and speed up a glacier's movement toward the ocean. That could speed up sea-level rise, scientists say.

For the same reason, scientists are curious about something going on at the place where glacial ice is carving a channel through dirt and rock, Wagner says.

"One of the most important unknowns right now is what is the shape of the bed under the ice," he says. "You need to know that in a very, very precise way to make models that accurately reproduce ice flow."

Seeing Through Ice With Radar

Much of that information is coming from special radars on the DC-8 that produce images in vivid colors on a computer monitor as the plane flies over a targeted area. The images provide a rough sketch of the bed beneath the ice, says Chris Allen from the University of Kansas, who is in charge of the radars.

The radar data will be refined in the coming months, and then combined with information from the lasers and the gravity meter to create a more complete picture of an Antarctica that's been hidden for millions of years.

"We are looking at structures like you see along the coast of Norway, these kinds of deep fiords," says Michael Studinger of Columbia University, who runs the gravity meter.

Right now, these Antarctic fiords are filled with ice, Studinger says. But global warming could eventually change that.

2009年11月4日星期三

话题:张版《西游》官方剧照首曝光 唐僧牵手女儿国王[查看原文]


网易北京网友[我的大爷啊!] ip:219.142.*.*: 2009-10-30 15:17:20 发表
网易安徽合肥网友 [jiky_vip] 的原贴: 1
唐僧:悟空,你变成套套吧,今天为师要亲自收拾这个女妖精。
唐僧:悟空,你变成伟哥吧,今天为师要亲自收拾这个女妖精,直到她求饶。
唐僧:今天好无聊……悟空……你变成女妖精吧……
唐僧:悟空,为师已经厌倦这种生活了……你把我变成女妖精吧
唐僧:悟空,你今天变成为师吧!
唐僧:悟空,你今天不用变了…

网易上海黄浦网友 [xiaofeng5742] 的原贴: 2
牛人

网易浙江杭州网友 [wanruogang] 的原贴: 3
haha

网易广东广州天河网友[1](218.19.*.*) 的原贴: 4
太有内涵了

网易广东东莞网友 [深圳牌冇number] 的原贴: 5
惨了!!我还是太纯真的!1点都不明白...哎....顺便问一下为什么不变芙蓉JJ...

网易上海网友 [vv] 的原贴: 6
1楼强淫!!

网易广东汕尾网友 [跟帖,为何淫才多] 的原贴: 7
他妈的,我也看不懂1L的弦外之音,哪个淫才可以详解一下么?

网易江西南昌网友 [yunpeng012] 的原贴: 8
1L应该是讲唐僧口味一步一步变重?越来越BT

网易江苏淮安网友[某人0363](222.184.*.*) 的原贴: 9
这是一篇魔幻现实主义的巨作
我觉得应该包括三个层次:1-3行一层,4、5行一层,6行一层
第一层是讲唐僧性的需要和饥渴
第二层是讲需要得不到满足后心里的纠结,进而对现实的怀疑与反叛
第三层是讲最终对现实的无奈顺应,唐僧也就成了唐僧。
这里的性和唐僧都只是符号,也可以说,我们每个人都是唐僧,唐僧是我们每个人

网易河南安阳网友[hsplc](222.88.*.*) 的原贴: 10
楼上是是大学博士后吧

网易广东广州天河网友 [xiazengjia.c] 的原贴: 11
爱因斯坦得来学习下

网易北京网友 [mo.mokz] 的原贴: 12
厉害

网易江苏无锡网友(121.235.*.*) 的原贴: 13
果然,术业有专攻~强啊,今届的状元酒你了~~

网易火星网友 [ab1982711] 的原贴: 14
好,很好很强大!
已阅。

网易陕西西安网友 [hull008] 的原贴: 15
九楼真乃牛人也!

网易火星网友[最高70楼](unknown) 的原贴: 16
我喜欢这个蝎子精啊

网易江苏苏州网友 [阿狗0937] 的原贴: 17
九楼,人才啊,比那些专家强多了:)

网易安徽宿州网友[ztbg](60.173.*.*) 的原贴: 18
本人见解:第一曾唐僧饥渴,想ml,第二层进一步想提高质量,第三层口味变粗,第四层和第五层想搞个角色互换,第六曾直接赤裸的想来人兽

网易浙江杭州网友 [22698488] 的原贴: 19
楼上港的 才对!

网易火星网友 [justcom] 的原贴: 20
1L的观点可以引用于人生的任何一个层面。就像八卦中的六爻,从主动到被动再到主动。实为高人。
第一层:冒进但又有所忌惮。象征为事情的初始、幼年。
第二层:激进而意志坚定。象征为人生的抱负,少年。
第三层:目的地深远而百无聊赖。象征为抱负的遥远,人生的索味。青年
第四层:厌倦,又想有所突破。象征为不甘于沉寂,欲求变。中年
第五层:失望,而变成自责。象征为目标未成,感慨人生。老年。
第六层:坦然,而不再苛求。象征事已定型,人已逢棺。暮年。

网易河南郑州网友 [zhoushikun] 的原贴: 21
人才

网易广东深圳网友 [wkvxia] 的原贴: 22
这天碰到的油菜花最多

网易北京网友 [怪男难怪] 的原贴: 23
人有三魂七魄,三魂指:天魂、地魂、人魂;七魄是指:一魄喜、二魄怒、三魄哀、四魄惧、五魄爱、六魄恶、七魄欲。楼主所说的是指人性七魄!第1层,即是唐僧遇到PP的女妖精,喜,于是……;第2层,唐僧第一次萎了,怒,于是……;第3层,由于唐僧服用之后,功力大增,把妖精收拾死了,哀,于是……;第4层,由于长时间猴子变妖精,担心精亡而竭,惧,于是……;第5层,由于长时间和别性,不如和自己,爱,于是……;第6层,人道暮年,还有许多愿望没实现,比如和动物,顿生邪念,恶,于是……;终究是只有6层啊,还有1层就七级浮屠了,看来唐僧的修为终究是赶不上如来佛祖啊!第7层是:把JJ埋在土里,然后QJ整个地球!

网易浙江台州网友 [abc7444885] 的原贴: 24
LS这不成了地震了

网易欧洲网友 [hfwdjlive] 的原贴: 25
1楼和23楼最强!

网易浙江杭州网友 [偶不是狮子座] 的原贴: 26
自古WY出人才!!

网易浙江台州网友 [小烂头] 的原贴: 27
一人淫过一人啊

网易江苏淮安网友 [夜不能寐の君] 的原贴: 28
分析的头头是道

网易广东深圳网友 [xuguang707] 的原贴: 29
学习,加强学习!
WY太多的高人...

网易上海网友 [red_line] 的原贴: 30
日了 此贴牛人居多啊

网易浙江台州网友 [kcaijinru] 的原贴: 31
学习中

网易河北唐山网友 [娜娜] 的原贴: 32
好多牛人

网易陕西西安网友[32131](117.36.*.*) 的原贴: 33
牛人太多,你们平时玩股票吗?

网易浙江杭州网友 [zbing0203] 的原贴: 34
好多牛人

网易浙江衢州网友 [maml1949] 的原贴: 35
张纪中,炒得比拍得好!

网易广西河池网友 [劝妓从良] 的原贴: 36
口味越来越重了啊师父

网易山东网友[20102地](123.129.*.*) 的原贴: 37
修炼的境界也在慢慢提升么 好兆头

网易江苏徐州网友 [hbds] 的原贴: 38
我也来卖弄下(人生):
第一层:梦回剑指天边月,酒纵歌狂年少词
第二层:敢于世上放开眼,不向人间浪皱眉
第三层:幸生太平无事日,恐逢年老不多时
第四层:顶天立地奇男子,要把乾坤扭过来
第五层:人生到处知何似,应是飞鸿踏雪泥
第六层:本来无一物,何处惹尘埃

网易江苏徐州网友 [hbds] 的原贴: 39
吾再来卖弄下(性事):
第一层:春色恼人眠不得,月移花影上栏杆(少年懵懂)
第二层:春宵一刻值千金,花有清香月有阴(青春激情)
第三层:紫凤放娇含楚佩,赤鳞狂舞拨湘弦(沉醉放纵)
第四层:天生一个仙人洞,无限风光在险峰(寻求刺激)
第五层:王孙莫做多清客,自古多情损少年(后悔自责)
第六层:服药不如独自眠,从她别后一少年(终得大道)

网易上海闵行网友[ww](220.232.*.*) 的原贴: 40
哈哈^_^,好像大家都把第6句理解错了。
其实还有第7句:悟空,你把八戒叫来。
大家意会吧~~

网易广东云浮网友 [longda_1983] 的原贴: 41
唐僧:悟空,你变成套套吧,今天为师要亲自收拾这个女妖精。
唐僧:悟空,你变成伟哥吧,今天为师要亲自收拾这个女妖精,直到她求饶。
唐僧:今天好无聊……悟空……你变成女妖精吧……
唐僧:悟空,为师已经厌倦这种生活了……你把我变成女妖精吧
唐僧:悟空,你今天变成为师吧!
唐僧:悟空,你今天不用变了…
唐僧:悟空,你今天把为师变成你吧
唐僧:悟空,你把八戒叫来吧

网易宁夏网友[oooomg](119.60.*.*) 的原贴: 42
路过,学习

网易广东惠州网友 [zhiyun198689] 的原贴: 43
膜拜牛人

网易河北唐山网友 [jimxu1983] 的原贴: 44
唐僧:悟空,他们来了吧......
唐僧:悟空,白马来了吧!
唐僧:悟空,为师已经绝望了......你把我变成套套吧

呀呵!好多牛 好多人啊。。