Author Topic: 2.43u delgene defect? RESOLVED 2.43w  (Read 6138 times)

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
2.43u delgene defect? RESOLVED 2.43w
« on: December 06, 2007, 11:09:23 AM »
I tried to make a gene that deletes itself after initializating some values for the first gneration, I placed it at the end of the genome but neither *.thisgene,*.genes, nor 8 .delgene deleted the gene always the previous gene number seven got deleted instead.
« Last Edit: December 22, 2007, 12:42:37 AM by EricL »

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
2.43u delgene defect? RESOLVED 2.43w
« Reply #1 on: December 06, 2007, 11:20:05 AM »
Please post the bot.

I suspect you have an else in a prior gene body...
Many beers....

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
2.43u delgene defect? RESOLVED 2.43w
« Reply #2 on: December 06, 2007, 04:02:07 PM »
http://www.darwinbots.com/Forum/index.php?...=0#entry1373115 the bot attached to my last post, but I do not thing it has anything to do with else, I have put the delgene command even in other genes in order to test it and the result was the same.
« Last Edit: December 06, 2007, 04:02:38 PM by Welwordion »

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
2.43u delgene defect? RESOLVED 2.43w
« Reply #3 on: December 06, 2007, 07:23:21 PM »
Your bot has a typo.  Count the starts.  There are only 7 starts, not 8.

The problem is that *.thisgene uses start or else to increment .thisgene but the geneposition routine uses cond to find the gene to delete.   Hmmmm.  I will have to noddle on what the right fix should be.

Please always post a bot or sim with a bug report.  There is no way I can keep track of everyone's posts and how else would I be able to know your bot has a typo?
Many beers....

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
2.43u delgene defect? RESOLVED 2.43w
« Reply #4 on: December 07, 2007, 01:12:50 AM »
Sorry I did so much testing before that I did really think it had nothing to do with the bot, should have tested a different bot first ^^.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
2.43u delgene defect? RESOLVED 2.43w
« Reply #5 on: December 18, 2007, 01:16:39 PM »
.vshoot also seems to have a similar problem.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
2.43u delgene defect? RESOLVED 2.43w
« Reply #6 on: December 22, 2007, 01:17:10 AM »
To fix this, we need to agree on exactly what a gene is - where it begins and ends and what should happen with gene numbers for .mkvirus and .thisgene in certain cases.  We need them to use idencial rules for determining where genes begin and end.

I assume it's agreed that genes start at number 1 and begin with either a Cond, a Start (or an even an Else) and that genes end in a Stop or when another Cond is encounterred.

Q1) What if one or more Starts (or Elses) follow a Cond before a Stop or another Cond is encounterred?  
Is this one gene or two?

cond
start
start
stop

Q2) What about this?

start
start
stop
Many beers....

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
2.43u delgene defect? RESOLVED 2.43w
« Reply #7 on: December 22, 2007, 08:09:32 AM »
I would say make it like this:
Cond = this will be added to the next gene that occurs
Start=  if (lock == 0) Gene begins set lock = 1 else ignore
Stop = end gene set lock = 0
that means :

cond
start
start
stop

is one gene and

start
start
stop

is also one gene

Offline MacadamiaNuts

  • Bot Destroyer
  • ***
  • Posts: 273
    • View Profile
2.43u delgene defect? RESOLVED 2.43w
« Reply #8 on: December 22, 2007, 08:53:15 AM »
From a virus point of view, it would be anything between two stores, in-gene conditions included.

But that would mean that all virus would need to be One-Store, which appeals me, as they wouldn't totally choke the host bot, but would be more annoying to code.
Sometimes you win, and sometimes you lose...

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
2.43u delgene defect? RESOLVED 2.43w
« Reply #9 on: December 22, 2007, 01:32:48 PM »
We need to keep in mind that gene numbers are also used for other things besides viruses such as for human debugging.  The gene activations histogram will use the same definition of gene to show activations for example.  So, while I understand the one gene per store philosophy, I think that is too fine grain for a number of reasons.

One opinion I hold is that it should be possible for non-coding DNA to lie between genes and in particular for the definition of the end of a gene to require that semanticly, non-coding DNA may follow.  Thus, I would agree with Peter that multiple starts without corrosponding stops should not represent gene boundaries.  An embedded start will "AND UP" the boolean stack and control execution of stores for it's section, but it does not represent a gene boundary.  Thus the following is one gene:

cond
true
start
'this gets executed
false
start
'this does not get executed
start
'this does not get executed
dropbool
start
'this gets executed
stop

So, Peter has it I think.  Restated, a gene begines on a cond or start without a cond and only ends when a stop or another cond is encounterred.  Cond's can be thought of as containing an implicit stop.  

Personally, I would like somday to do away with cond completly.  It is superfilous given that boolean logic can now control store execution in-gene.  That would mean that genes start on a start and end on an stop and are controlled internally by boolean logic and if you want to simulate the cond-start-stop structure, you use a second start.  e.g.

start
boolean logic
start ' AND it all up
do the stores
stop

But realisticly I won't be doing away with cond anytime soon.  

So, to fix this bug (and some other related ones) I will impliment gene boundaries as above unless there are objections.
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
2.43u delgene defect? RESOLVED 2.43w
« Reply #10 on: December 22, 2007, 04:10:55 PM »
To put it more succinctly: a gene is all the stuff between a cond statement and the next cond statement (with the beginning of the genome having an implicit cond statement)?  Ie: junk included?

Consider this alternative:
A gene is anything between a start or else and another flow command.  If there's a cond block before the gene, the gene's boundaries are increased to include that cond block.

Thus the DNA:
cond
start
start
stop

is two genes:

 cond
 start
 (implicit stop)

and:

 start
 stop

The benefit here is that it neatly transitions into a time when cond blocks don't exist while maintaining backwards compatibility.  Remember that the DNA block:

cond
start
start
stop
cond
start
stop

May have the boolean stack entirely modified by the first start statement or the second.  Meaning that the cond block is just a redundant aspect of the first gene, but does not necessarily have anything more to do with the second gene than the second gene does with the third gene.
« Last Edit: December 22, 2007, 04:11:40 PM by Numsgil »

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
2.43u delgene defect? RESOLVED 2.43w
« Reply #11 on: December 22, 2007, 05:01:39 PM »
Quote from: Numsgil
Thus the DNA:
cond
start
start
stop

is two genes:

 cond
 start
 (implicit stop)

and:

 start
 stop

I think it should be one gene.  I disagree with you because it violates my rule that boolean logic (which I think of as the gene promoter) should not carry over from one gene to the next.  I.e. that is, by definition, a gene boundary (be it explicit via a stop or implicit via a cond encounterred in an already coding region) implies clearing of the boolean stack.  By defining genes in this way, it makes them more self-contained, more able to be transported in tact with their promoters.  

A start does not clear the boolean stack (like an implicit stop-cond or an explicit stop does) nor should it IMHO imply a break in a coding sequence if encounterred within a coding sequence.  It's a start, not a stop-start.    A start should imply the beginning of a new gene only in the case where the DNA preceeding it is non-coding and the boolean stack is clear, having been previously terminated by a stop.  If the DNA preceeding it is coding, be it a cond section or a gene body, it means "and up the boolean stack".   So, an embedded start does having meaning.  It operates on the boolena stack for the gene.   If we don't do it this way, then we will need to invent a new operator "andupstack"

I beleive this methodology of not treating embdedded starts as implicit gene terminators is in keeping with the way biological gene sequences are defined in genbank.  Embedded start codons are generally ignored by DNA transcription biology and as such, sequneces in genback with embedded start codons are generally considerred single genes.  In short, it takes a stop codon to terminate a gene.

Quote from: Numsgil
The benefit here is that it neatly transitions into a time when cond blocks don't exist while maintaining backwards compatibility.
So does my way.  If we allow stores in cond regions, then cond and start become equivalent except for a cond's implicit stop.   If anything, we should do away with all implicit stops and change it so that a cond encounterred in an already coding sequence does not imply a stop.  But doing so would imply that conds would not clear the boolean stack and prior boolean logic would thus implact the evalutation of the boolean statements in the cond section, which would break backward compatability.

Quote from: Numsgil
Remember that the DNA block:

cond
start
start
stop
cond
start
stop

May have the boolean stack entirely modified by the first start statement or the second.  Meaning that the cond block is just a redundant aspect of the first gene, but does not necessarily have anything more to do with the second gene than the second gene does with the third gene.

So, the way it currently works and the way I have it codedup currently, that sequnce is two genes and boolean logic from the first gene does not influence the second.
 
cond
start
start
stop

cond
start
stop
« Last Edit: December 22, 2007, 05:06:39 PM by EricL »
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
2.43u delgene defect? RESOLVED 2.43w
« Reply #12 on: December 22, 2007, 06:14:06 PM »
In the Darwinbots universe, gene boundaries are artificial abstractions that matter only for deleting genes, creating viruses, and human debugging.  Human debugging is trivial because we can always modify those sorts of controls anyway we want.  Deleting genes is trivial because all it has to do is mirror the way viruses are made, since that's delgene's primary reason for existance.

So it all boils down to viruses.  What makes the most sense from a virus's perspective?  Consider this genome:

cond
start
start
start
start

start
start
start
start

start
start
start
start

start
start
start
start

start
start
start
start

It's a bot with a single cond and 20 start blocks.  A virus gets inserted in to this genome that came from a bot with this DNA:

start
*.thisgene .mkvirus store
1000 .vshoot store

With your system, this virus could only get inserted at the beginning or the end of that first genome.  Let's say it gets inserted at the end.  Then the virus fires again and tries to make itself in to a virus.  What does the resulting virus look like?


cond

start start start start
start start start start
start start start start
start start start start
start start start start

start
*.thisgene .mkvirus store
1000 .vshoot store

If you don't look at that and feel that something's wrong, I think there's a problem   That virus should be able to get inserted anywhere between two start blocks, otherwise suddenly cond is a super antivirus magic command.  And that virus should be able to replicate itself, and only itself, barring mutations.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
2.43u delgene defect? RESOLVED 2.43w
« Reply #13 on: December 23, 2007, 01:59:44 PM »
Okay, I'll yield.  A start or an else will always indicate the beginning of a new gene with the execption of the first one following a cond.  Thus:

cond
start
stop

is one gene.

cond
else
stop

is also one gene.


cond
start
else
stop

is two genes

start
start
start

is three genes.

It will be this way in 2.43w.
Many beers....

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
2.43u delgene defect? RESOLVED 2.43w
« Reply #14 on: December 24, 2007, 04:57:36 AM »
Is gues there has something gone wrong with the change, after reproduction bots seem to have no genes.

Atleast that is what I see after ''number of genes. And the sysvar genes also gives zero.

In the sim posted with this you can see it. If you manually reproduce a bot you can see the newborn gives a *.genes of zero.
Oh my god, who the hell cares.