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: Paul Johnson
Subject: Re: [Swarm-Modelling] How to send and get messages between two agents of different types?
Date: Thu, 06 Jan 2005 10:55:41 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922

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?
>  
>

import A.h in the file B.m, and then the agent of type A can tell
"agentB" to do something

[agentB doSomething];

You really ought to work through the programs in the swarmapps package,
particularly the Swarm tutorial, for things like that.

>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?
>
>  
>
Not possible. It is necessary to have a compilable simple model in order
to test particular classes. I almost always start Swarm models with some
working template, such as Heatbugs or one of the other models, and then
begin adding classes and testing changes. Swarm tutorial is pretty
emphatic about starting with a program that works dependably, then make
small changes.

>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
>  
>


-- 
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ku.edu/~pauljohn
1541 Lilac Lane, Rm 504                              
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66044-3177           FAX: (785) 864-5700



reply via email to

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