Biological processes are often used as a basis for computer science algorithms. In computer science a "Genetic Algorithm" is a group of algorithms used to search large spaces to optimize a problem. There are a wide variety of variations in the implementations, all of which depend on the problem you're trying to solve. For this assignment, you will implement a very small element of a Genetic Algorithm, recombination. Recombination is the process of constructing new chromosomes from specific segments of two selected parent chromosomes.
The most common type of recombination involves making two new chromosomes from the sequences of two selected parents. This is done by choosing a point in the two parent sequences, copying each gene up to the point, then swapping all the remaining genes. For instance, if the chosen point splits the parents in half, then the first half of Parent A is joined to the latter half of Parent B, while the first half of Parent B is joined to the latter half of Parent A. This creates two new offspring with the varying features of both parents.
In this assignment you will prompt the user to input from the keyboard two strings of characters, each of length 16, and an integer value representing the cross-over point (ranging from 0 thru 15). You will write code that performs the cross-over operation and then subsequently writes the output to the terminal. Use of at least 2 functions is required.
A number of system services, mainly for input and output, are available for use by your MIPS program. They are described in the table found under the syscalls tab of the MARS help page. MIPS register contents are not affected by a system call, except for result registers as specified in the help page.
How to use SYSCALL system services:
Example: display the value stored in $t0 on the console
li $v0, 1 # service 1 is print integer
add $a0, $t0, $zero # load desired value into argument register $a0 syscall
Sample run of code:
Enter your first string with no spaces (16 total): aaaabbbbccccdddd
Enter your second string with no spaces (16 total): 0000111100001111 Enter an integer between 0 & 15 (to be later used as an upper limit for splitting the arrays): 6
You entered the following:
Creating newly evolved candidates from your specified inputs...
Child One and Child Two are shown below:
-- program is finished running --<>.data>
#pre-made prompt messages
Prompt_encDec: .asciiz "type `e' to encrypt or `d' to decrypt: "
INBUFFER: .byte 0x11:100 #filling memory with this to make it easy to see
OUTBUFFER: .byte 0x22:100 #filling memory with this to make it easy to see
#prompt user to input 'e' or 'd' li $v0,4 la $a0,Prompt_encDec syscall
#read encrypt or decrypt choice li $v0,12 #set syscall to read char syscall
#jump to encrypt if 'e' or 'E' entered beq $v0,101,ENCRYPT #lowercase e
Proj 3: Evolutionary Algorithm Teaser
Programs that don't assemble/compile will receive a grade of 0.
points given for above:
Assignment Writing Help
Engineering Assignment Services
Do My Assignment Help
Write My Essay Services