From: Önder G. <ond...@gm...> - 2009-09-01 07:49:11
|
Hi all, I think I figured out my problem. But before how I solved it, Let me give you a more clear description of my example model. Then I will explain what I tried, and finally I will give my solution. There 3 kinds of agents: CentralPatternGenerator, Neuron, Muscle. As a start, there are two instances of each kind of agent. Each CentralPatternGenerator is connected to a Neuron, and each Neuron is connected to a Muscle. Each agent has a potential. At resting state potential of each agent is -70 + noise (a random number between -0.2 and +0.2), at each tick if an agent do not generate a pulse this random value is generated and set to potential. Each CentralPatternGenerator generates a 100 pulses per second (frequency = 100). I implemented the pulse generation as setting the potential to +30 at one tick. First one starts at tick=0 and second one starts at tick=1000 (1000 tick represents 1 second). These pulses propagate from a CentralPatternGenerator to the Neuron connected to it. When a Neuron gets 50 pulses, it generates 1 pulse and propagates it to the Muscle connected to it. Finally when a Muscle receives a single pulse, it contracts. I represented the contraction of Muscle by changing their size (and this is the only graphical animation in my model). As the time pass, contracted Muscles return to their original sizes. When I run my simulation although Schedule Tick Delay is 0 in my Run Options I think it is so slow. I already check my code for optimization, but I dont claim that I made a great optimization in my code. I thought that there must be some option to narrow the time between ticks. So I tried to change the interval parameter of the ScheduledMethod annotation (less than 1). And it worked!!! When I set all my scheduled methods interval to 0.5 it became much faster, but Repast GUI freezes sometimes. @ScheduledMethod(start = 1, interval = 0.5, priority = 0) Also when I set interval to 0.1, I got weird results such as tick count gets weird values like 134.0000009999 and Repast GUI freezes again. @ScheduledMethod(start = 1, interval = 0.1, priority = 0) My another big problem is that as the simulation runs, even though it is quite fast when interval is set to 0.5, it slowly gets slow down. I really did not understand this because I do not create any additional agents or links. Just change the potential values of my agents. The solution was somewhat unexpected. I realised that my problem was based on my previous problem (I posted it as Chart Plotting Problem to the list). When use the solution for Chart Plotting Problem as Weizhi told, I realized that all the problems listed above solved. Besides, I still wonder why changing interval value below 1, especially to 0.1, generates weird tick counts. Thank you all, Best, Önder. 2009/9/1 North, Michael <no...@an...>: > > The design of your model is not clear from your description. Can you provide another description of your model? > > Mike > > -----Original Message----- > From: Önder Gürcan [mailto:ond...@gm...] > Sent: Monday, August 31, 2009 5:50 AM > To: rep...@li... > Subject: [Repast-interest] Speeding Up Simulations? > > Hi all, > > Is there a way to speed up simulations? Although Schedule Tick Delay is 0 in my Run Options I think it is so slow. I implemented the same model (even more complexly) in NetLogo but it was a lot more faster than Repast S. Also you can accelerate your simulation in NetLogo, I wonder if something like that is possible in Repast S? > > Let me give some more detail about my model. I only have 3 agents and I do make no animation on them. One tick corresponds to 1 millisecond. > At every millisecond a random value is generated (scheduled method). > At every 10 milliseconds a value of 30 is generated(scheduled method). > And at every 2000 milliseconds value (30) generation is started (scheduled method). What I am trying to do is generate a specific in a specific frequency, and except for this value in the other times another random value will be generated. > > Best, > > Önder. > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ > Repast-interest mailing list > Rep...@li... > https://lists.sourceforge.net/lists/listinfo/repast-interest > |