Software & Design
Software
Not Quite C-- NQC
NQC is a three-letter abbreviation for Not Quite C, a programming language, API and native byte-code compiler toolkit for Lego Mindstorms RCX. It is based primarily on the C programming language, but has limitations, such as the maximum number of subroutines and variables allowed, which differ depending on the version of firmware the RCX has. The language was invented by David Baum.
MindStorm Brick (RCX)
The RCX microcomputer is the brain of the LEGO MindStorms system. It receives programs for the ROBOLAB software or NQC via an infrared computer link and stores up to five programs at a time. The RCX then runs the programs when activated to do so.
Up to three inputs can be used by the RCX to sense events in its environment, which in turn can determine what the three outputs will do to react to the sensing data.
Design
The Basic Robot
The robots use a simple two motor. When the robots receive the mating command, they will exchange genomes, creating a child robot. The child bots produce two very distinct robots that replace their parents and exhibit new and unique behavior.
The Genome
In these robots, the genome acts to determine behavior. The genome dictates the following behaviors:
1. The robots primary execution loop
2. What to do if the left sensor is hit
3. What to do if the right sensor is hit
And, the genetic code determines what happens in each of the above three tasks. Possible actions include:
1. Turn left
2. Turn right
3. Attempt to reproduce/mate
4. Go forward
5. Go backward
6. Do nothing
An example of a task might be:
1. Right sensor loop (if the right sensor is hit): backward, backward, forward
2. Execution loop: do nothing, attempt to reproduce
Mating
When the robot attempts to reproduce, an infrared (IR) signal is sent out. If another robot is around/available to mate, the two robots will acknowledge the mating call and then genome transfer will begin (via IR). Robots will only initiate mating if they are "mature." That is, each robot will have to perform a certain number of movements before it will be mature enough to initiate a mating signal. Also, robots with more mature and/or "dominant" genes will be better capable of maneuvering around and will thus have a better chance of finding another robot and procreating.
When the robots reproduce, each receives a copy of the other's genetic code; however, the program does include code that will dictate a 1-5% chance of random mutation that might occur for each action that is copied.
*This programming project would not have been possible without inspiration from the sexbot master, Jason Striegel. Thank-you to Jason for all of the feedback and guidance in creating the programming for the sexbot farm.*



