Repast仿真学习

Repast模型包括:model对象(仿真模型本身,运行也是从这个文件运行)、space对象(Agent动作发生的环境)、agent

Model会继承RePast的SimModelImpl对象。





Repast仿真分为:batch-run(运行过程中不需要人的交互)和non-batch(需要人的交互)

Repast仿真过程阶段:1.准备阶段(Setup)

 2.实际运行阶段


Repast仿真实现流程:1.定义各种类型对象的属性和状态

 2.定义对象所处于的环境

 3.定义Agent的移动规则和博弈规则

 4.程序用户界面的设计

时间表机制:负责仿真中用户定义的状态的改变。

这些时间步执行的动作由BasiceAction的子类来封装

Class BasicAction{

execute();//必须实现

}

动作的调度方式有五种:1.每个时间步运行一次

    2.特定的时间步运行一次

    3.固定时间间隔运行

    4.仿真暂停时候运行

   

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 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、付费专栏及课程。

余额充值