[Geneticd-devel] Queuing commands is not the way.
Status: Alpha
Brought to you by:
jonnymind
|
From: Jonny M. <jon...@ni...> - 2002-01-15 00:47:04
|
Through queuing commands is an elegant solution, and would simplify the engine API, I've come out determined to abandon this way because: 1) the command parser would be inefficent compared to the simple get/set private attribute access, expecially with inline methods. 2) engine modify commands are now limited to agent killing and/or agent loading. 3) I am forecasting for the future that the only other engine changing command will be agent mangling (changing directly the DNA). 4) Queuing those commands would not resolve the problem of agent transfers. The client would not have to wait for the engine to have it's turn ended -- it would have to wait for the engine to execute it's "lage" command... which is the same. 5) Implementing agent exchage in a slave genetic engine class require a "phantom" population, similar to the spare population, that will hold the loaded agent until the engine is able to move them to the real population. This can easily be done by subclassing the GEInABox engine. Lage is implemented with agent de-serialization: you simply put the GStream * in the deserialize method of a newly created agent, and the obtained agent can be put where we want, even in a Vector class, up to the moment in which is copied to the real population. Now, the only change it seem important to me is that the spare population must be moved out from the environment and in to the engine. After each turn, the env_run routine will get the population from the environmnent, will apply cached changes and will copy the spare population in the engine. The engine will only use its private copy of the population to answer queries. How do you feel about it? Giancarlo |