Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] Re: Agents and network (Was (for reasons unnown): Path fin
Home

[Freeciv-Dev] Re: Agents and network (Was (for reasons unnown): Path fin

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Cc: Freeciv Development List <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Agents and network (Was (for reasons unnown): Path findig)
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Tue, 26 Nov 2002 19:59:48 +0100

On Tue, Nov 26, 2002 at 01:17:23PM +0000, Gregory Berkolaiko wrote:
> On Tue, 26 Nov 2002, Jason Dorje Short wrote:
> 
> > Raimar Falke wrote:
> > > 
> > > After 100 turns:
> > > 2: update_map_canvas_visible: 43,916252s from 490 calls
> > > 2: unqueue: 36,182100s from 390 calls
> > > 2: update_map_canvas: 51,305540s from 7420 calls
> > > 
> > > CMA local CPU time is 3.3s:
> > > 2: CMA: overall=3,364782s queries=4007 0,839726ms / query
> > > 2: CMA: apply_result: ignored=92.2% (3696) applied= 7.8% (311) total=4007
> > > 
> > > Waiting for the server (network):
> > > 2: A:SMA: waited 4,085804s in total for network; requests=83; waited 83 
> > > times
> > > 2: A:CMA: waited 44,630560s in total for network; requests=644; waited 
> > > 318 times
> > > 2: A:GA: waited 24,971887s in total for network; requests=742; waited 742 
> > > times
> > > 
> > > So the drawing costs us about the same time as waiting for the server
> > > (2 * ~1min) while the actual CMA calculations only took 3.3s.
> > 
> > Note this is on a localhost connection: on a remote connection this will 
> > be far slower.
> > 
> > The problem with network latency is that the agents must work 
> > synchronously, in series.  When a query is made all calculations must 
> > stop until there is a reply.  This fundamentally limits the 
> > effectiveness of agents.  I can imagine that getting rid of this 
> > limitation will be hard (you don't always know when one agent is 
> > stepping on another's toes), but it is probably the only way to get 
> > usable results.
> 
> Possible solutions are:

> 1. Make client fully rules-aware (duplicate rules engine in client)

The client already knows how a city is recalculated. Note that this
doesn't help since only the server state is important. So at some
point the client has to "update" the server state.

> 2. Move the agents to the server.

Depends on what you mean by this. The obvious interpretation would be
to move cma_core.c into server/ and also adapt the protocol. This is
bad and I won't do it.

Another interpretation would be that the client can "somehow" send an
agent to the server and this agent then is executed "near" the
server. Another process of the same host for example. You can a lot of
other problems with this however.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  "With a PC, I always felt limited by the software available.
   On Unix, I am limited by my knowledge."
    -- Peter J. Schoenster <pschon@xxxxxxxxxxxxxxxxx>


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