swarm-modeling
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swarm-Modelling] How to send and get messages between two agents of


From: Darren Schreiber
Subject: Re: [Swarm-Modelling] How to send and get messages between two agents of different types?
Date: Thu, 6 Jan 2005 08:44:05 -0500


Here are some brief answers. Be more specific about your questions and you can get some more specific answers.

1. In this case, if the agent types A, B, C, and D are going to be using different methods (as opposed to different parameter values) in making their decisions then I would probably just create four sub-classes (A, B, C, D) of the agent class. If the agent types would only vary in some parameter values, but share the same methods, then I would keep them in the same agent class. This is really a question of what are good modeling techniques. In principle, I don't subclass things unless I have a very good reason for doing so.

Exactly how you pass the messages depends on what kinds of messages you want to pass. So being specific about the kind of information your agents need to exchange would help.

2. It only makes sense to compile and debug the code in A.h/A.m alone, if there is a simple version of A.h/A.m that can stand alone. If not, then there are both conceptual and technical problems with trying to debug A alone. However, one goal for successful model development is to move in really small steps and evaluate your code at each of those small steps. So, if you can evaluate A.h/A.m alone in version 0.0001 of your software, you should do so. Then continue to develop it until you've got to the point where you need B.h/B.m and evaluate both A.h/A/m and B.h/B.m together (e.g. version 0.0010). If your intuition is to make sure each small part is working before you bring in another part then you are heading in the right direction. But, usually the reason you have put your code into multiple parts is because they are interdependent on each other in some way. So that will require you to create the simplest version of A and the simplest version of B to test together, before adding additional complexity to their code or before adding another object C that should be kept out until you get A and B working well together.

Darren


On Jan 6, 2005, at 8:17 AM, James Liu wrote:

Dear All:

I am new user of Swarm and I plan to use it for simulating a Multi-agent system in my Msc thesis. Now I have some questions in simuation with Swarm as follows:

1.There are four types of agent such as A,B,C,D in the model.They interact with each other.
How to send and get messages between two agents of different types,for example,A send a message to B(A tell something to B) and get a message from B(A receive a reply from B)to decide what to do next.How to relize it in Swarm with ObjC?

2.There are many source code files such as A.h,A.m,B.h,B.m,C.h,C.m,D.h,D.m,then what shoud I do if I want to debug and compile a file A.h/A.m after finishing the souce code of A.h/A.m respectively instead of debugging and compiling the project to a executable file after all the files(A.h,A.m,B.h,B.m,C.h,C.m,D.h,D.m) finished?

btw:I know little about gcc and gdb.

I would appreciate your feedback. Thanks a ton!

Best regards,

James



James Liu
Room 313, Laodixuelou Building
College of Environmental Science
Peking University
Beijing,100871
China



     2005-01-06

_______________________________________________
Modelling mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/modelling


reply via email to

[Prev in Thread] Current Thread [Next in Thread]