Monday, 8 April 2013

Modification of Motor Molecule Design

Vera points out a flaw in the current design for motor molecules and suggests the following modification.

A motor atom specifies a transmission delay D(trans) that is specific to each outflowing edge. This determines the delay between one atom being activated and it signalling that downstream atoms should be activated.

Currently I'm using a rather bizarre receiver delay D(rec) which delays the action itself after a signal has been received, and then cycles the action with this period. This is just odd. The D(rec) will be removed totally from the system.

A second idea is to include mutation operators on motor molecules such as "Reverse direction of all causal links" so e.g. a motor molecule A to B to C would mutate to the new molecule C to B to A for example. These are mutation operators on directed graphs, i.e. graph re-write rules, rather than the traditional mutation operators on ACGT string sequences.

Delays can be shown on the molecule as an edge label in matplotlib/networkx. OK good, these changes are now made. Each atom stores as well as a message list, a list of messageDelays which specify how long after an active message is received from an upstream atom it will become active. There is in addition another delay which says how long it will remain active before inactivating itself. Thus there are two timers and two delay specifications that determine when a motorP atom will turn on, and how long it will stay on for. This I hope provides some descriptive richness that is appropriate for motor sequences to evolve.

Semantically Functional Motor Mutations

Standard molecular and atomic mutations used now:
1. If a to b to c, then a to b to c and a to b' [Currently the outflow links of a node are not copied, only the inflow links.]
2. If a then a'

Other kinds of mutation are possible.

Rearrangements

1. a -. b -. c   mutates to a -. c -.b, i.e. two adjacent atoms are flipped.

The genetic operators may well be inspired by those found in genetic programming so we should look at those.

Meta Genetic Programming
1. http://journals.tubitak.gov.tr/elektrik/issues/elk-01-9-1/elk-9-1-2-0008-5.pdf

Learning to Learn
2. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.21.3140


OK, after fixing a bug in the atom deletion function.. 


        if random.random() < 0.05 and deleted == 0 and len(newMol) >= 3 and newMol[index].type == "motorP":
          print "Length new mol before deletion = " + str(len(newMol))
          #Go through the molecules data structure removing this atom id.
          for index4,q in enumerate(self.molecules):
            for index5, q2 in enumerate(self.molecules[index4]):
              if q2 == i.id:
#                del self.molecules[index3][index4]
                del self.molecules[index4][index5]

it seems the evolution is working much better, especially with a pop size of 20 molecules being maintained. 



No comments:

Post a Comment