Repast HPC1.0.1实例运行总结

☞ 运行repastHPC的实例需要两个先决条件:

         1.  MPI

         2.  Boost库

☞ 运行前准备步骤:

         1.  安装MPI(过程略)

         2.  安装Boost库

               ①  下载boost压缩包,下载地址:

  http://sourceforge.net/projects/boost/files/boost/1.44.0/

               ②   解压上面下载的压缩包,双击里面的bootstrap.bat文件,这一步完后将会产生“bjam”工具,该工具可以用来编译boost库

               ③ 为了编译boost,需要让boost知道我们的MPI位于何方,因此在编译之前需要对如下文件做修改

在解压后的boost文件夹中按tools\build\v2\tools\mpi.jam 找到mpi.jam ,把其中的第249行的

localcluster_pack_path_native = “C:\\Program Files\\Microsoft Compute Cluster Pack”;

 替换为你当前安装的MPI所在目录,如

localcluster_pack_path_native = "C:\\Program Files\\MPICH2" ;

               ④  用第②步产生的bjam工具进行编译,用如下命令进行编译操作(该步骤需要耗时30-40分钟):

bjam --with-mpi--with-serialization --with-filesystem --with-system install

    做完该步操作后,编译便已经完成,同时也将boost的文件拷贝到了C:\Boost,更多关于编译和使用boost库的信息请查看:http://www.boost.org/doc/libs/release/more/getting_started/index.html

    

 

 完成了上述所有操作后,准备工作就完成了,接下来就可以运行repast HPC里面的自带的例子了。

 

 

 

☞ 实例运行:

     repast HPC带有两个实例(rumor模型,zombie模型),可以在 examples_bin 文件夹中找到, cd到相应的文件夹下用如下命令即可运行实例:

mpiexec -np 4 rumor_model config.propsrumor.props

mpiexec -np 4 zombie_model config.propszombie.props  

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
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. The ones on the Repast website are excellent (in particular do the Java one). 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. 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 the repastcity2.zip file and extract it to a temporary directory. To run the program you need to download Repast Simphony version 2.0 (it comes bundled with the Eclipse development environment) and then follow these instructions: 1.Start Repast (Eclipse) 2.Go to File -> Import 3.Then under 'General' select 'Existing Projects Into Workspace'. 4.Next to 'Select root directory' click on browse and select the extracted project. 5.Then click on 'Finish'. If you left the 'copy projects into workspace' box ticked you can now
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值