Code center > Specialization, Metabolism, Digestions and Env Grid

General approach to metabolism

(1/9) > >>

shvarz:
OK, I worked out the system.  It is very easy to start using, it requires only small changes in existing bots and will be completely backwards-compatible for any bot that is designed with metabolism in mind.  Even if we change the metabolism pathways a lot in the future.  The system is very intuitive, so can be picked up quickly by anyone.

This is very general description, I don't want to go into details and balances.  If you have doubts - ask "how will this work" and I'll explain.  

Finally, this is a summary of many ideas from different people, so don't blame it all on me :)  But do praise me a lot :)


1. We make a molecule array.  Things like venom, poison, fat and energy are now referred to that array instead of usual memlocs.  The molecules can also be addressed as numbers (not by name).  I'd say 256 slots should be enugh.

2. We make an enzyme array.  The enzymes Nums desribed are processed only once, when robot is created (or born) and those found will have 1, those absent - 0.  This is minimal level of enzyme and it never gets lower.  The amounts can go up automatically or bots can make them through DNA.  Enzymes are slowly decayed (but never below 1).  I'd say we'll need 2048 slots for enzymes.

3. Molecules are divided into two types - terminal and intermediate.  In a chain of A>B>C>D, A and D are terminal, while B and C are intermediate.  Terminal molecules are not acted upon unless there is a command from DNA.  Intermediate molecules are automatically processed, but this processing can be overriden by DNA commands.  Only terminal molecules are passed over during feeding.

4. Stomach size is defined by the total number of enzymes.  Its content  is purged every N cycles, which is also defined by total number of enzymes (the more enzymes the longer food stays).  Molecules from stomach are transferred to bot at the rate corresponding to the number of specific enzymes they have (no DNA commands here).  If there is no enzyme, the molecule is not absorbed but is dropped into env. grid (not as waste, as molecule) during purging.

5. Digesting is done by DNA command.  All you need to say is molecule's name (or number) and "break" command.  The program checks if bot has that molecule and if it has appropriate enzymes and will convert the molecule to energy.  The rate of conversion is proportional to the amount of specific enzyme bot has.  The program actually runs the broken molecule through intermediates, but bot does not have to see this.  Digesting can be improved by specifying the path of digestion.  The most efficient way is to spell out each and every step in DNA - then bot can get more energy and it can get it faster.

6. Same goes for making molecules.  All you need to say is molecules' name and "make" command in DNA (no more store commands here).  Program will do it for you.  But you'll be better if you spell out the path.

PurpleYouko:
Like most of it with a few minor problems


--- Quote ---Stomach size is defined by the total number of enzymes. Its content is purged every N cycles, which is also defined by total number of enzymes (the more enzymes the longer food stays).
--- End quote ---

Purging every N cycles is not very feasible. What if the robot has just eaten 1 cycle before the purge? Does he lose it all. Or are you saying that each food particale only stays in the stomach for N cycles? If so then nice idea but very difficult to implement as each particle of food in each robot's stomach would have to have its own counter. Processor intensive doesn't even come close. Billions of food particles could be present in all the robots combined stomachs at any given time.

Better to purge a small percentage of the stomach contents each cycle

(Also have a secondary storage area like intestines which stores undigested food particles and waste products that will collectively be contained by .waste which needs to be manually purged just like it is now before the bot gets sick.)


--- Quote ---5. Digesting is done by DNA command. All you need to say is molecule's name (or number) and "break" command. The program checks if bot has that molecule and if it has appropriate enzymes and will convert the molecule to energy. The rate of conversion is proportional to the amount of specific enzyme bot has. The program actually runs the broken molecule through intermediates, but bot does not have to see this. Digesting can be improved by specifying the path of digestion. The most efficient way is to spell out each and every step in DNA - then bot can get more energy and it can get it faster.

6. Same goes for making molecules. All you need to say is molecules' name and "make" command in DNA (no more store commands here). Program will do it for you. But you'll be better if you spell out the path.
--- End quote ---

Not so keen on this in its present form. I see problems with running this from DNA. It would be impossible under the present DNA scanning to perform more than one of your break or make commands per cycle as subsequent instances will simply overwrite the first one such that only the very last one would ever be performed.

Another possibility would be to design custom paths in a setup section of the DNA file in a similar way to the enzyme list. Maybe only allow a limited number of path slots (say 10). Then they can run automatically each cycle or be accessed by a series of sysvars like make1, make2....break1, break2. These controls will take up minimal space in the sysvars registry and will allow the custom make and break paths to be executed from DNA.

How does that sound?

 :D  PY  :D

shvarz:
About purging:  It was Nums idea.  The timer starts when bot eats something.  N cycles later ALL food is purged even the one just swallowed and timer is reset.  If N is >10, this should not handicap bots too much.

About multiple break commands: Is there absolutely no way to make it so that "molecule array" is changed after each command?

shvarz:
I am confused.  Again, how come "break" commands will override each other?  Store commands don't.

You can say

1 2 store
3 4 store
5 6 store

Same here:
you have molecules called 1, 2, and 3

1 break
2 break
3 break

"break" command simply means decrease value in molloc (molecular location) 1, increase value in molloc 2

Works like this:

Before: 9 0 0 (these are values in mollocs 1, 2,3 correspondingly)
Cycle 2: 8 1 0
Cycle 3: 7 1 1
Cycle 4: 6 1 2

Should work, or am I dumb?

PurpleYouko:
NO NO NO NO NO NO to infinity.

I Hate that idea.

Besides which that would really penalize heavy duty tank type bots or a bot who spends a lot of energy powering up a shot.

Just imagine that a stray shot containing tiny amounts of food hits this bot and sets off the timer.

Then a couple of cycles later he manages to land a really big shot on his target grabbing about 1000 energy in one go after spending about 200 to make the supershot. It takes at least 3 cycles for the shot to reach its target, then another 3 to get back. That is 8 cycles gone before he fills his stomach.

Cycle 9 he gets to digest about 50 points of the 1000 that he just went to a whole bunch of trouble and expense to get.

Then 950 points of food is dumped to the grid!

Terrible Terrible idea.

 :(  PY  :(

Navigation

[0] Message Index

[#] Next page

Go to full version