Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » AMP » Agent having dynamic structures
Agent having dynamic structures [message #760272] Thu, 01 December 2011 17:59 Go to next message
giorgos  is currently offline giorgos Friend
Messages: 6
Registered: October 2011
Junior Member

I would like to ask how I could model an agent having some dynamic structures. More particular I would like each of my agents to have its own Vector in order to store some objects. Say for example that there is an agent named Buyer. I have done the following :
I have created a new class named AgentVector

public class AgentVector {

private Vector vector;
private long id;

public AgentVector(long id){ = id;
vector = new Vector();


public Vector getVector(){
return vector;

public long getId(){
return id;


Then inside the class Buyer (and outside any method) I have written the command
private AgentVector BuyerRatingVector;

And then in an initialize method of Buyer I have put the command
BuyerRatingVector = new AgentVector(getUID());

All these work, because in this way I create a unique vector for each agent.
However, every time I change something in the model I have to put by hand in the Buyer class the command
private AgentVector BuyerRatingVector;
How can I do this through the model?
I have noticed that there is a choice in the attributes to create dynamic variables but I have not understood how this works.

Re: Agent having dynamic structures [message #764751 is a reply to message #760272] Mon, 12 December 2011 19:37 Go to previous message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member

First, ignore the dynamic variables bit -- that's from the SD integration and will probably eventually change.

Integrating custom code isn't currently as seamless as it should be. Using the Method rule is a good general solution, but as you discovered it doesn't help when you want to add new state. The idea here would be to create an Agent for the Vector and then set the "Load" option to true using the Implementation "Mode" menu accessible form the property editor.
Previous Topic:AMP contains non IP-approved content?!
Next Topic:distance between agents
Goto Forum:

Current Time: Tue Jul 16 04:24:12 GMT 2024

Powered by FUDForum. Page generated in 0.03076 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top