Hello,
I am curious if anyone has a method for assigning persistent characteristics to an agent that does not involve creating
a variable to hold that value. I am modeling many thousands of simultaneous agents, each of whom will have a mix of 4
unique characteristics. I want to assign these at the start of the simulation, and have each agent retain these until
they are destroyed at a rate throughout the simulation.
Victor Gleim — 27.11.07
to PJ:
Could you make an example of agent's characteristics? I guess I understand what you want, but just wish to be sure.
PJ — 27.11.07
Victor,
What I had in mind was three different preference characteristics. So, for example, each agent represents a possible
homeowner looking to purchase a house. Although there are many more than three variables in this decision, you could
start with price, location, and type of dwelling for example.
Victor Gleim — 28.11.07
to PJ:
So, you have a some kind of list with defined set of characteristics which you want to setup to the agents in casual
combination. Is it right?
PJ — 28.11.07
Sort of,
I currently have these preference values defined in table variables, and they are randomly assigned to a variable. Each
agent pulls the value that is provided when it comes time to make a decision (I have this process defined using
statecharts). Once the agent moves to one location, it then pulls another value, as it enters the decision-making
process. So, while the broader distribution is being represented, each individual agent does not retain those
preferences that were initially assigned (which is fairly important to my model, that they are not changing their
preference characteristics after one decision-making step-this is not very realistic). So, I would like the agents to
retain these characteristics, in order to begin incorporation adaptation and competition characteristics into the model.
The problem I am running into, is that with 100,000s of agents, it is prohibitive to create a set of variables to hold
each of these values for each agent. I would like each of these agents to be simultaneously acting according to their
unique characteristics, therefore they need to retain (i.e. have persistence) the value that was randomly assigned to
them. I suppose this could be done with some type of database structure, but I was wondering if there is any simpler,
more memory efficient way?
Victor Gleim — 29.11.07
to PJ:
If you are using a double variable to store a value, you don't need to think about the memory and simulation speed, even
if there are 100,000 agents in your model. Is there any technical problems in your model which you cannot overcome?
PJ — 29.11.07
Victor,
It is not the memory problem, it is the problem of actually making and coding 100,000s of variables to represent the
unique combinations of agent characteristics. I want each agent to 'carry' these characteristics with them for the
duration of the simulation, and be able to interact with each other, and adapt to changes in the simulation environment.
Perhaps I am missing something, but persistence seems to be one of the main characteristics that defines an ABM.
Victor Gleim — 30.11.07
to PJ:
If you don't change these values, they will be persistent. You could use the Java class called HashMap to store these
characteristics. For that, in the root active object, you should create a HashMap containing pairs like "String -
double". Then you should create a variable of the HashMap type in your agent. At the model startup, you should
randomly select pairs from the HashMap in the root and add them to the agent's HashMap variable, and do it for each
agent. How to work the HashMap class, please refer to the Java API Documentation.