In Depth
[MicoleLib documentation]

Collaboration diagram for In Depth:

Network possibility

NetworkAgent bind "Net:" prefixed message and send it to "other network".

ReachinMicoleApplication * ama = ReachinMicoleApplication::getInstance();
ama->startNetwork();

This is all you need to launch network system. By default, startNetwork use host "127.0.0.1" and port "33843", you can specify different hosts, port with

ama->startNetwork("192.168.0.23",6453);

If you host is "127.0.0.1" and a server do not respond, your program will launch a server agent. Keep in mind that the first agent who need to connect to 127.0.0.1 and if nothing respond, will create his own server on this port.

To broacast your message on "distant bus", you need to prefix your message by "Net: ". This prefix is necessary to prevent overwhelm of ininteressting messages on other bus. Due to TCP/IP asynchronous mode, it's preferable to avoid using networkAgent for low message.

Synchronous/Asynchronous mode

Micole Architecture in depth

You are in the depth part manual of the Micole Library. If you don't want to implement complex things, new force models,... You are not at the right place. Text below explain low level mechanisme of the Micole Library.

AbstractMicoleApplication and ReachinMicoleApplication

These both two classes are basic classes of the Micole Architecture. You can write a lot of code and never see it at any time. These two classes are sinleton and ReachinMicoleApplication inherit AbstractMicoleApplication.

This is a sample of code of FF3DDeviceSenderAgent

Display * dis = ReachinMicoleApplication::getInstance()->getDisplay();

As you can see, a ReachinMicoleApplication can be instanciate before you own first instanciation. Here FF3DDeviceSenderAgent need the Display object of Reachin API.

RegistryAgent

You don't need to instanciate this object. This object is automatically set up when AbstractMicoleApplication::getInstance() is called.

This Agent can register several parameters for you. There's some "defined" vars that you can set to change some force model.

sendMessage("Set stiffness = 1.5;");
sendMessage("Set d = 0.02;");

You can retrieve your vars with getVar and getFloatVar methods

_stiffness = ReachinMicoleApplication::getFloatVar("stiffness");
_d = ReachinMicoleApplication::getFloatVar("d");

Warning ! If you want to set variable on a distant network you need to send

sendMessage("Net: Set stiffness = 1.5;");


Generated on Tue Oct 16 17:10:46 2007 for Micole by  doxygen 1.4.7