MaDKit forum

Welcome All !
Please, use explicit topic names when creating new threads. Thanks.

You are not logged in.

#1 Re: HowTo » What is difference between Agent Type and AbstractAgent? » 2014-04-28 16:34:53

Sorry to reply you lately.
As mentioned above, my problem when using threaded Agents is memory. When I launch even 100 nodes, the VIRT memory (in "top" command in Ubuntu) shows 37GB and then it informs "out of memory", although the "true" memory to run programme RES (and also SHR) which only shows 10M. I tested with other size of network and it has the same problem.
Do you know how to reduce the VIRT memory in this case?
Thank you.

#2 Re: HowTo » What is difference between Agent Type and AbstractAgent? » 2014-04-10 16:47:18

System is still slow sad
Let me explain the system: I have N nodes, each node n sends d_n messages to other d_n ones,then of course its friends will receives messages and so does n.
After each node sends message, the scheduler is activated so that all nodes will do some activities with receiving messages. The problem is that: for each ith message (i=1->d_n) of each node n, the scheduler will assign one slot of time for node n to process, then jumpto node (n+1) and so on, but infact it's better to node n to continue processing. Of course when N is large, the time between two process of node n (e.g., ith and (i+1)msg) is large. And i don't know how to reduce this time. Do you have any suggestion? Thanks

#3 Re: HowTo » What is difference between Agent Type and AbstractAgent? » 2014-04-10 15:17:01

The problem is that: I don't know in advance the 1st and 10000th node will take that role (I just give you an example for these two nodes, but in fact it could be other nodes and other number of nodes).
I also take care your suggestion about dynamic leaving/entering group/role but got problem above.
Thanks in advance.

#4 Re: HowTo » What is difference between Agent Type and AbstractAgent? » 2014-04-10 13:32:01

In fact, while waiting for your answer, I recognized this problem. I tried to test the similar code like your last week but I already changed the code like this:
if ((m=nextMessage())==null) return;
in order to not block the system.
But this makes me some problem of time: I have a network with many nodes, and each node has to wait some messages from others. By using scheduler like bee example, each node will be assigned one task and we consider node by node, i.e., after finishing doing task of this node we jump to next node (from 1-->N). However, when testing with large number of messages and transactions amongst nodes, I see the system is very slow. This comes from this problem: you have 10000 nodes, but only node 1th and 10000th communicate together, the remaining (9998 nodes) do not receive/send message, but in fact they also participate into the scheduler (for next step of protocol, for instance) but for nothing. So, the systems gets worse.

Do you have any suggestion to avoid this? I don't want 9998 nodes to be left the scheduler (since they will join in other activities later) but they makes system slowly.

Thank you

#5 Re: HowTo » What is difference between Agent Type and AbstractAgent? » 2014-04-01 13:42:48

Which type of data consume much memory? AbstractAgent or Agent?
In addition, how can I modify the code such that the AbstractAgent could wait a message forever like function waitNextMessage() in the one of Agent?

#6 Re: HowTo » How to add/retrieve new property » 2014-04-01 10:48:42

I want to change it since in my program the agent already has its own id, and I want that id is also hashcode (just for simulation, not real-world address), otherwise the consume other field for id (and in fact, there is a mapping id<-->hashcode).
Moreover, I would like to ask you an unrelated question. I have a problem with virtual memory when running in java (not RES memory in command "top" ubuntu): it increases much important. As I know that the necessary memory to run program is the RES memory (e.g., bee example has ~1G) not VIRT memory, but I get error with outofmemory with virtual memory. In your experience, could you please suggest any thing to decrease it? Thanks

#7 Re: HowTo » How to add/retrieve new property » 2014-03-30 15:28:15

I am sorry, that's other error. Please abandon it.

I have a question, could I change the hashCode of (Abstract)Agent? I see in the code of these classes, we only assign the value in the constructors, but cannot change later.
I demand this since sometimes we need to change hashCode in the simulation model, we don't need to assign automatic hashcode value

#8 Re: HowTo » How to add/retrieve new property » 2014-03-28 10:39:33

Thanks for your new update.
I test my program with large number of nodes and receives the error "cannot assign requested address". Do you know what is really problem of this?

#9 Re: HowTo » How to add/retrieve new property » 2014-03-10 15:43:42

Thanks so much.
Please inform me your update version if it's available.
In addition, do you know how to check the queue of receiving messages? I mean when some msgs with id 1,2,3,4... come to inbox they will put into queue (is it right??), then we have to use func like nextMessage() or waitNextMessage(). However these functions with get the messages out of the queue and we cannot re-obtain it any more in queue. So, if i would like to get msg, e.g. msg id 3, from the queue, I have to use nextMessage three times? do you have any other solutions?

#10 Re: HowTo » How to add/retrieve new property » 2014-03-09 09:22:15

As I know that after activating with func activate(), agent will automatically run func live().
But now I want to postpone it by running some other functions before reaching to live().
Could you please tell me how to do like that?
Moreover, do you know how to get messages from users with role, e.g. function like getMessageWithRole(), as there is function sentMessageWithRole and i would like the receiver can get that message from senders with certain role.
Thank you.

#11 Re: HowTo » How to add/retrieve new property » 2014-03-03 10:31:56

Thank you for your instruction.
I knew these functions in the docs, but the class AgentAddress cannot give the list of Agents (of AbstractAgent). I would like to take that list to send messages to all nodes who have some common role and group.
Do you know how to do that?
Thanks again

#12 Re: HowTo » How to add/retrieve new property » 2014-03-02 17:33:18

Thank you. I understand it now.

In addition, could you please tell me how to list a set of agents who are inside one group? For instance, user A is owner of group GA (by using createGroup()), and some other users  (like B) join in that group. So could A/B know the set of agents in group GA?

#13 Re: HowTo » How to add/retrieve new property » 2014-03-02 01:12:40

Thanks so much.

I have just tested your xml.xml file and get this error
[MadkitKernel-0] SEVERE : launchNode FAILED : Agent( GUI=false class=code.testLauncher logLevel=INFO nbOfInstances=1  )
** java.lang.NoSuchFieldException: aNbAsAnInteger
    at madkit.kernel.MadkitKernel$

The code XML is:
<Agent class="code.testLauncher" nbOfInstances="1" GUI="false" logLevel="INFO">
            <Attributes aNbAsAnInteger="3" aReal="5.5" aString="blabla" />

The problem is I don't understand the tag <Attribute> of the <Agent>. What are the roles of that tag when we modify/add for that agent? Please tell me an example about this.

#14 Re: HowTo » How to add/retrieve new property » 2014-03-01 19:21:30

Thank you so much.
By the way, I don't know how to use XML_config_file.xml file in the project, i.e., where we put it, and how to run the project with it.
I see in that file, I can modify madkit properties in the line <MadkitProperties test="yes" test2="good" desktop="true" />, is it right?
but I don't know how to run with that file.


#15 HowTo » How to add/retrieve new property » 2014-03-01 01:29:51

Replies: 18

Hi all,

I would like to modify the "" file for instance, by adding more pairs <file=abc.txt> .
But I don't know how to get that value in the class which extends madkit.kernal.Agent.

I see in the tutorial examples, in the main function, we can use some parameters to launch the program such as
String[] argss = { "--agentLogLevel", "INFO", "--launchAgents",
                LanceurAgents.class.getName() };

But we cannot read that parameters inside some function, e.g., activate() or live(),....
So could you please tell me how to read that pair?

Thank you

Board footer