About sending and receiving mesages.

From: Adrin Jalali (adrin_jalali@yahoo.com)
Date: Wed 01 Sep 2004 - 10:54:11 GMT


Dear All,
I want to discuss something about messages and the time that they are received
by the kernel and are sent to the agents.
As I understood from the kernel code :

        void System::loopCore(long& count, int division)
        {
                //printf("system time %ld\n", (long)m_systemTime);

                ASSERT(division == 2);
                switch(count++ % division) {
                default:
                        ASSERT(false);
                case 0: // this case is run in the mid time of the cycle.
                {
                        receiveMessages(publicSocket());
                        receiveMessages(agentSocket());
                        sendToSimulators();
                        if(m_logFile != 0)
                                fflush(m_logFile);
                }
                        break;
                case 1: // this case is run at the end of the cycle.
                        receiveMessages(simulatorSocket());
                        step();
                        m_time++;
                        sendToAngents();
                        sendUpdate(m_time - 1);
                        printf("time=%ld\n", (long)m_time);
                        break;
                }
        }

Recall that this finction is called twice by kernel in each cycle. Once after
passing t/2 (t is the total cycle time) of the cycle, and once at the end of
the cycle. This means that all the actions of agents (containing tell, say,
move, ...) are read by the kernel at the mid time of the cycle. And all updates
and received messages are sent at the end of the cycle.
We know that only the last command of agents sent to the kernel is to affect
the world model, but why are tell and say commands processed like this?
I think that's better and nearer to the real situation if kernel did the same
about action commands, but were listening for the say & tell commands
continuesly and when ever such a command were received, kernel sent them to the
desired agents. We know that communication must make delay on dicision making
of agents, but we can probably design much better agenst in the suggested
situation and still have the delay time. I think that in the real world we
don't have any restriction on the receiving of the messages.

Best Regards.
Adrin Jalali.
Tehran Polytechnic.

                
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush



This archive was generated by hypermail 2.1.3 : Wed 01 Sep 2004 - 10:54:26 GMT