RSS

Monthly Archives: March 2012

Repast Simphony: Run a method at the end of the simulation


Published on: Mar 26, 2012

I need to update some files just at the end of my simulation. The Outputters have given me a lot of problems and I need more functionality to gather and compute data. The problem is that, at that point, I only know that my simulation finishes when the stop button is pushed. Unfortunately, the official information given by Repast Simphony about the Scheduler doesn’t say too much.

I checked in the API the classes related to the Scheduler and I found that there is a method in the class Schedule called executeEndActions() which executes all the actions scheduled to execute at simulation end. However how can I indicate that an action should be executed at the end?

Read the rest of this entry »

Advertisements
 
2 Comments

Posted by on March 26, 2012 in Agent-Based System, Repast Simphony

 

Online lectures on Agent-Based System


Published on: Mar 19, 2012

In the next link you can have access to a really interesting set of lectures about Agent-Based System from the School of Informatics of Edinburgh University. These lectures were recorded in 2007.

The lectures cover multiple aspects about this kind of cooperative modelling from a beginner level.

I have to say that I didn’t really have time to see all of them, but it seems a good resource to take into account. I hope it can help whoever works with ABS.

 
4 Comments

Posted by on March 19, 2012 in Agent-Based System

 

New release: a stable version of Repast Simphony 2.0


Published on: Mar 15, 2012

On 5 March 2012, the developer team of Repast Simphony released the new stable version 2.0.

According to the documentation the major change between both versions is that the data collection architecture and its GUI has changed from 2.0 beta to 2.0. However, at a first sigh,t the program seems the same, except the lattice which represents my city is properly centred on the panel 🙂

Installation in Linux

For linux users, the Eclipse version should be updated from Eclipse Helios 3.6.2 to Eclipse Helios 3.7.1 Classic Edition. Here is when we find the first problem: the most updated version of Eclipse Helios is 3.6.2 as we can see here, meanwhile the updated version of Eclipse Indigo is 3.7.2.

Read the rest of this entry »

 
1 Comment

Posted by on March 15, 2012 in Repast

 

How to stop and pause the model in Repast Simphony


Published on: Mar 7, 2012

The problem can be seen from different perspectives. Firstly, the model can be stopped because the simulation holds a determined condition, like for instance, if the simulation achieves a determined tick of the clock or if the total number of agents allocated in the lattice is greater than a certain number. The first of the cases can be programmed using the method of the class schedule called schedule.getTickCount(). The second one is shown in the following code:

@ScheduledMethod( start=1, interval=1,priority=ScheduleParameters.FIRST_PRIORITY )
public void spacer(){
    totalPopulation = context.getObjects( Agent.class ).size();
    //Stop the simulator
    if(totalPopulation > 100){
        if(schedule != null){
            System.err.println("Population more than 100. Stopping the system");
        }else{
            schedule.executeEndActions();
            RunEnvironment.getInstance().endRun();
        }
    }

Read the rest of this entry »

 
2 Comments

Posted by on March 7, 2012 in Repast

 

Tags:

Click automatically the play button in Repast from a script


Published on: Mar 1, 2012

This post belongs to a series of posts which allows me to start Repast Simphony automatically from a script. Please take first a look to:

Once I have fulfill to start Repast automatically from a script (click here for more info about that), I am going to use the library xdotool to click in the play button of Repast to start the simulation. Xdotool is a tool that simulate keyboard input and mouse activity, move and resize windows, etc..

First of all, I included the libraries of xdotool in the environment. In my case this is done with the following lines of code:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/u1/pg/mv59/Software/xdotool-2.20110530.1
export LD_LIBRARY_PATH
/u1/pg/mv59/Software/xdotool-2.20110530.1/xdotool

Read the rest of this entry »

 
1 Comment

Posted by on March 1, 2012 in Repast

 

Repast Simphony 2.0 beta and Java 7 in Linux


Published on: Mar 1, 2012

It was a very happy day when I arrived to my University and I tried to run the simulation as usually without success. When I though that the nightmare would continue I discovered that my normal IDE version failed as well. The error was the following:

Cannot construct repast.simphony.engine.schedule.ScheduleParameters as it does not have a no-args constructor

When I googled on that, I found this information here:

It looks like this is probably an issue with the xstream library that we use for serialization and Java 7. Are you using Java 7? If so, can you try with Java 6? Apparently the latest xstream fixes the issue so you could also download that replace the xstream jar in:

X/eclipse/plugins/repast.simphony.runtime_2.0.0/lib

Read the rest of this entry »

 
Leave a comment

Posted by on March 1, 2012 in Java, Repast

 

Run the launcher of Repast Simphony in Eclipse from a Script


Published on: Mar 1, 2012

Working to make Repast more flexible in the minimun space of time (I need to create a paper for the 7th of March) I need to run Repast Simphony automatically from a script. When I googled for that information I found the next post that really make me feel scared. It seems very complicated due to the lack of information.

Then, I decided make the things easier and I avoid to modify the Repast code. Luckily in another post I found how to copy the script that Eclipse use to start Repast. To do that we should start Repast with the corresponding launcher, then we should go to the Debug perspective and there, in the list of process, select the one that is currently running and in properties you can copy the information.

Read the rest of this entry »

 
2 Comments

Posted by on March 1, 2012 in Eclipse, Java, Repast

 

Tags: , ,

 
%d bloggers like this: