MaDKit forum

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

You are not logged in.

#1 2014-03-14 11:56:40

HMR
Member
Registered: 2014-03-14
Posts: 6

How we can convert a text message to a string for use it?

hi dears
can you help me to convert a text message to a string?
I would also launch a number of agents (not abstractAgent) intervals 100ms for example, how can i do it?

Offline

#2 2014-03-17 16:54:49

fmichel
Administrator
From: Montpellier
Registered: 2009-03-24
Posts: 172
Website

Re: How we can convert a text message to a string for use it?

Hello,

1. Use the StringMessage class
2. You could use :

While(true){
launchAgent(new MyAgent());
pause(100);
}

But maybe that what you want is not "launching" but activating the agents at a fixed rate. If so, please check out the simulation tutorial on the website

Offline

#3 2014-03-21 23:30:49

HMR
Member
Registered: 2014-03-14
Posts: 6

Re: How we can convert a text message to a string for use it?

fmichel wrote:

Hello,

1. Use the StringMessage class
2. You could use :

While(true){
launchAgent(new MyAgent());
pause(100);
}

But maybe that what you want is not "launching" but activating the agents at a fixed rate. If so, please check out the simulation tutorial on the website

Indeed I want to implement a sample project that is description in below:
We have a train of cars that follow each movement .every car follows the car in front in speed and direction fields. this means each car at specified intervals send its speed and direction to previous car and car behind updates its speed and direction.
I want simulate but I have some problems:
1-    How can I launch a numbers of agent at specified intervals? (that means I can manage agents launching)
2-    How can I convert agent’s message to string for use it?

I am also happy to hear your suggestions.
Thank you so much…

Offline

Board footer