From: harry m. <hme...@ha...> - 2012-02-22 20:43:35
|
Dear all, I posted this question a while ago, yet I did not get any response. If you need more info regarding the code, I can provide it. I think the issue of converting simulation time ticks to real time may be critical to many other Repast users as well. If there is some good reads on this topic, I will appreciate if you could refer me to it. Thanks a lot, Harry. harry meh wrote: > > Dear Jonathan, > > Thanks for your reply. I have copied a number of scheduled methods here: > > Initially I create the seeded cells in the build method of context > builder: > > for (int i=1; i<=howManyCells; i++){ > Cell cell = new Cell(“Cell”,space, grid, network); > cellContext.add(cell); > … > vessel.setLocation(new Vector3d(location)); > cell.currentLength = 0.0; > space.moveTo(cell, location); > network.addEdge(prevCell, cell); > } > > Then the following method runs for each new agent, with delay = 0.002 > > private void scheduleStep(double delay){ > ISchedule schedule = RunEnvironment.getInstance().getCurrentSchedule(); > double currentTick = schedule.getTickCount(); > schedule.schedule(ScheduleParameters.createOneTime(currentTick+delay, > ScheduleParameters.FIRST_PRIORITY),new > StepAction()); > } > > The StepAction is an inner class which executes a method performing cell > elongation, and also calling back the scheduleStep() method. Elongation > leads to creating a new cell instead of increasing the cell length, when > the cell length reaches a threshold value. > > private void insideStep(){ > scheduleStep(0.5); > elongate(UnitElongation); > } > > This creates a loop that leads to repeated cell elongation, and creation > of new cells when maximum length is reached. > > There are also other scheduled steps similar to this. > > Best, > Harry. > > > > Jonathan Ozik-2 wrote: >> >> Hi Harry, >> >> It might be helpful to see how you're scheduling the relevant methods. If >> you can send that along, we might be able to figure out what the issue >> is. >> >> Jonathan >> >> On Jan 25, 2012, at 4:23 PM, harry meh wrote: >> >>> >>> Hello, >>> >>> I am developing an agent-based model using Repast. In this simulation, a >>> limited number of agents (about 40) are created initially, and then >>> Scheduled methods are used in this agents to reproduce these agents >>> during >>> time. >>> >>> This simulation models a biological system, and you can think of it as >>> biological cells giving birth to new cells by division. As a result of >>> this >>> division, the length of the body of tissue increase, and I measure this >>> increase as a function of time. A number of initial seeds (the number is >>> chosen randomly, it can be between 3 to 20) are placed on a scaffold and >>> I >>> measure the length of tissue created from each seed at fixed time >>> points. I >>> also measure the time when first one of the seeds reach the end of >>> scaffold. >>> >>> Basically, it is expected that the average time to reach the end of >>> scaffold >>> to not depend on how many initial seeds exist, as all seeds are >>> comprised of >>> similar agent types. To my surprise, this is not true, and when more >>> seeds >>> exist, the speed decrease and more time is required. >>> >>> My question is about the scheduling in Repast. Is it happening like when >>> we >>> have more actions scheduled, the time ticks take longer time? Otherwise >>> why >>> should it take longer to reach the end of the scaffold when we have more >>> number of agents (in the same conditions)? >>> >>> And I need to convert the time ticks to real time (e.g. hours). I do >>> this by >>> comparing simulation results with available experimental results. >>> However, >>> due to this inconsistency, I cannot use one single conversion factor, >>> rather >>> the conersion factor depends on the number of initial seeds. How can I >>> avoid >>> this? >>> >>> I will really appreciate your help, and I hope I have been clear enough. >>> >>> Thanks, >>> >>> Harry. >>> >>> -- >>> >> > > -- View this message in context: http://old.nabble.com/Simulation-ticks-are-not-equal---How-to-convert-to-real-time--tp33204315p33373705.html Sent from the repast-interest mailing list archive at Nabble.com. |