Home | Community | Message Board


This site includes paid links. Please support our sponsors.


Welcome to the Shroomery Message Board! You are experiencing a small sample of what the site has to offer. Please login or register to post messages and view our exclusive members-only content. You'll gain access to additional forums, file attachments, board customizations, encrypted private messages, and much more!

Shop: Myyco.com Golden Teacher Liquid Culture For Sale   Unfolding Nature Unfolding Nature: Being in the Implicate Order

Jump to first unread post Pages: 1
Artifical life
    #9145544 -

.

Edited by DieCommie (11/06/13 05:39 AM)

Extras: Filter Print Post Top
Re: Artifical life [Re: DieCommie]
    #9145812 -

Wow, that's pretty amazing, I'm not even sure what to say about it haha

Extras: Filter Print Post Top
Re: Artifical life [Re: zugzugz]
    #9145878 -

Yea, it is amazing.  Here are some pictures from the Tierra program.

In the begging its all red.  Red represents the ancestor program (80 instructions).  The yellow are parasites.


Then yellow dominates and it gets some blue, where blue represents the ancestors that are resistant to parasites.


Eventually immune ones dominate the landscape.


Got these from the Tierra web site -> http://life.ou.edu/tierra/
(they get funding from the grateful dead?)



Remember, this is nearly 20 year old technology.  The new project, Avida, incorporates much more complexity, including an environment that evolves along with the program/creatures.  You can run Avida on your own computer, and adjust the parameters too.  I briefly tried it, and its not very user friendly, but doable. -> http://sourceforge.net/project/showfiles.php?group_id=46761

I wonder if this approach has/could be incorporated into traditional development by utilizing mutation and selection to optimize designs in ways the people couldnt.  Eventully they may use it to design airplanes... or even computers..

:borg:

Edited by Qubit (10/28/08 12:37 AM)

Extras: Filter Print Post Top
Re: Artifical life [Re: DieCommie]
    #9146764 -

We already have created new life in, for example, the e.coli that's had a snip of its DNA replaced with the particular snip from humans that codes for insulin production. This is how we treat diabetics. We convert part of a bacteria into a human so it produces genuine human insulin with the same cellular machinery humans use.

I remember reading a few years ago that the c.elegans nematode has been fully sequenced and I think it was in the ballpark of only a few million bases. This means that we could construct one from individual elements and nothing else if we invested the resources to assemble that first molecule.

Put those two ideas together and it's only a matter of applying the time and resources before we have a new, fully synthetic, made-from-base-elements, living thing.


--------------------
Republican Values:

1) You can't get married to your spouse who is the same sex as you.
2) You can't have an abortion no matter how much you don't want a child.
3) You can't have a certain plant in your possession or you'll get locked up with a rapist and a murderer.

4) We need a smaller, less-intrusive government.

Extras: Filter Print Post Top
Re: Artifical life [Re: DieCommie]
    #9146847 -

Wow, thanks, thats really interesting. I'll definitely be reading up on this.


--------------------
The Prophecy!

Learn To Code

Extras: Filter Print Post Top
Re: Artifical life [Re: blewmeanie]
    #9148304 -

blewmeanie said:
Wow, thanks, thats really interesting. I'll definitely be reading up on this.




--------------------

Extras: Filter Print Post Top
Re: Artifical life [Re: DieCommie]
    #9154079 -

Wow! Awesome post! I've read a tiny bit about cellular automata based on Wolfram's principles. I didn't completely understand everything, but the concept of interacting rule sets is very intriguing.

Craig Venter is creating synthetic life using already available parts in cells to create new lifeforms that make vats of petro-energy. I think we'll create a new life form in a lab before we create synthetic true intelligence.


--------------------
As the life of a candle,
my wick will burn out.
But, the fire of my mind
shall beam into infinite.


Extras: Filter Print Post Top
Re: Artifical life [Re: DieCommie]
    #9155475 -
Log in to view attachment

I studied this when I was in school back in the late 80s and implemented it in DOS. An article in Scientific American in May 1989 gave me the idea.

I found the DOS command line executable last night. It's attached. Running it without parameters starts with defaults or add a ? on the command line for the usage notes. It runs without modification on my XP box. I spent many hours watching the little bugs live, die, and evolve.

I'm pretty sure I still have the C source code. I'll try to find it if anyone's interested.


--------------------
Republican Values:

1) You can't get married to your spouse who is the same sex as you.
2) You can't have an abortion no matter how much you don't want a child.
3) You can't have a certain plant in your possession or you'll get locked up with a rapist and a murderer.

4) We need a smaller, less-intrusive government.

Extras: Filter Print Post Top
Re: Artifical life [Re: Diploid]
    #13958683 -

Bump for interest.  Diploid, did you ever find the source code to that program?


--------------------
We are all in the gutter, but some of us are looking at the stars.

Extras: Filter Print Post Top
Re: Artifical life [Re: deCypher]
    #13959148 -

Alright, you made me dig out a box of floppy disks from the garage.

I think this is it. I tried compiling it and it does compile except for some of the ancient graphics macros and obviously the linker isn't going to find any of the DOS CGA graphics routines. You'll have to update those to make it work. Shouldn't be too hard though.

Have fun!

Code:

#include <graphics.h>
#include <time.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <conio.h>
#include <stdlib.h>

int dead_bug_color = 1;
int live_bug_color = 2;
int erased_bug_color = 0;
int food_color = 3;

int xmove6þ = {0,2,2,0,-2,-2};
int ymove6þ = {2,1,-1,-2,-1,1};
int bug_count, a, generation, max_bug_count;
long max_food_colonies;

double probrain;

int change_age = 1,
change_shape = 1;

int initial_number_of_bugs =10;
int initial_energy =1000;
int energy_per_turn =1;
long food_colonies =200;
int energy_for_food_pelet =40;
int age_for_reproduction =800;
int energy_to_reproduce =1000;
double probability_of_rain =0.01;
int maximum_energy =1500;
int x_hi, y_hi;



typedef struct bug {
int x_1, y_1;
int x_2, y_2;
int x_3, y_3;
int x_4, y_4;
int x_5, y_5;
int x_6, y_6;
int x_7, y_7;
int x_8, y_8;
int x_9, y_9;
int energy;
int age;
int reproduce_age;
int f, r, hr, rv, hl, l;
double prob_0, prob_1, prob_2, prob_3, prob_4, prob_5;
int direction;
struct bug *next;
struct bug *prev;
} OBJECT;


OBJECT *bug_list=NULL,
*free_list = NULL;


OBJECT *newobject()
{
OBJECT *temp;

if (free_list != NULL)
{
temp = free_list;
free_list = free_list->next;
free_list->prev = NULL;
return (temp);
}
else
return ((OBJECT *) malloc (sizeof(OBJECT)));
}



void freeobject(OBJECT *obj)
{
if (free_list != NULL)
{
obj->next = free_list;
free_list->prev = obj;
obj->prev = NULL;
}
else
{
free_list = obj;
free_list->prev=NULL;
free_list->next=NULL;
}
}



int out_of_memory()
{
closegraph();
clrscr();
printf("Out of memory error\n");
printf("Bug count: %d\n",bug_count);
exit(0);
}


int init_drivers()
{
int g_driver=DETECT, g_mode, g_error;

detectgraph(&g_driver, &g_mode);
g_error = graphresult();
if (g_error <0)
{
printf("Detect graph error: %s.\n",grapherrormsg(g_error));
exit(1);
}

if (g_driver == CGA)
{
g_mode = CGAC1;
g_driver = CGA;
x_hi=319;
y_hi=199;
dead_bug_color = 1;
live_bug_color = 2;
erased_bug_color = 0;
food_color = 3;
registerfarbgidriver(CGA_driver_far);
}
else if (g_driver == MCGA)
{
g_mode = CGAC1;
g_driver = CGA;
x_hi=319;
y_hi=199;
dead_bug_color = 1;
live_bug_color = 2;
erased_bug_color = 0;
food_color = 3;
registerfarbgidriver(CGA_driver_far);
}
else if (g_driver >= EGA && g_driver <=EGAMONO)
{
g_mode = EGAHI;
x_hi=639;
y_hi=349;
registerfarbgidriver(EGAVGA_driver_far);
}
else if (g_driver == IBM8514)
{
g_mode = IBM8514HI;
x_hi=639;
y_hi=479;
registerfarbgidriver(IBM8514_driver_far);
}
else if (g_driver == VGA)
{
g_mode = VGAHI;
x_hi=639;
y_hi=479;
registerfarbgidriver(EGAVGA_driver_far);
}
else if (g_driver == PC3270)
{
g_mode = CGAC1;
g_driver = CGA;
x_hi=319;
y_hi=199;
dead_bug_color = 1;
live_bug_color = 2;
erased_bug_color = 0;
food_color = 3;
registerfarbgidriver(CGA_driver_far);
}
else if (g_driver >= EGA64)
{
g_mode = EGA64HI;
x_hi=639;
y_hi=349;
registerfarbgidriver(EGAVGA_driver_far);
}
else
{
printf("Unsupported graphics driver, please contact the author\n");
exit(1);
}

g_error = graphresult();
if (g_error <0)
{
printf("Registration error: %s.\n",grapherrormsg(g_error));
exit(1);
}

initgraph(&g_driver, &g_mode, "");
g_error = graphresult();
if (g_error <0)
{
printf("Init graph error: %s.\n",grapherrormsg(g_error));
exit(1);
}
}




int draw_bug(OBJECT *bugs, int color)
{
putpixel(bugs->x_1, bugs->y_1, color);
putpixel(bugs->x_2, bugs->y_2, color);
putpixel(bugs->x_3, bugs->y_3, color);
putpixel(bugs->x_4, bugs->y_4, color);
putpixel(bugs->x_5, bugs->y_5, color);
putpixel(bugs->x_6, bugs->y_6, color);
putpixel(bugs->x_7, bugs->y_7, color);
putpixel(bugs->x_8, bugs->y_8, color);
putpixel(bugs->x_9, bugs->y_9, color);
}



int food_here(OBJECT *bugs)
{
int food;
int color;

food = 0;
color = getpixel(bugs->x_1,bugs->y_1);
if (color == food_color)
food++;

color = getpixel(bugs->x_2,bugs->y_2);
if (color == food_color)
food++;

color = getpixel(bugs->x_3,bugs->y_3);
if (color == food_color)
food++;

color = getpixel(bugs->x_4,bugs->y_4);
if (color == food_color)
food++;

color = getpixel(bugs->x_5,bugs->y_5);
if (color == food_color)
food++;

color = getpixel(bugs->x_6,bugs->y_6);
if (color == food_color)
food++;

color = getpixel(bugs->x_7,bugs->y_7);
if (color == food_color)
food++;

color = getpixel(bugs->x_8,bugs->y_8);
if (color == food_color)
food++;

color = getpixel(bugs->x_9,bugs->y_9);
if (color == food_color)
food++;

max_food_colonies -= (long) food;
return (food * energy_for_food_pelet);
}




int initialize_screen()
{
long i;
double exp_0, exp_1, exp_2, exp_3, exp_4, exp_5, exps;
OBJECT *temp_bug, *place_hold;

for (i=0; i<food_colonies; i++)
putpixel(random(x_hi)+1, random(y_hi)+1, food_color);

max_food_colonies = food_colonies*5;

bug_count = initial_number_of_bugs;
max_bug_count = bug_count;
bug_list = newobject();

if (bug_list == NULL)
out_of_memory();

bug_list->prev = NULL;
bug_list->next = NULL;
place_hold = bug_list;

for (i=1; i<bug_count; i++)
{
temp_bug = newobject();
if (temp_bug == NULL)
out_of_memory();

temp_bug->prev = place_hold;
place_hold->next = temp_bug;
place_hold = temp_bug;
}

place_hold->next = NULL;
temp_bug = bug_list;
for (i=0; i<bug_count; i++)
{
temp_bug->x_1 = random(x_hi);
temp_bug->y_1 = random(y_hi);
temp_bug->x_2 = temp_bug->x_1 + 1;
temp_bug->x_3 = temp_bug->x_1 + 2;
temp_bug->x_4 = temp_bug->x_1;
temp_bug->x_5 = temp_bug->x_1 + 1;
temp_bug->x_6 = temp_bug->x_1 + 2;
temp_bug->x_7 = temp_bug->x_1;
temp_bug->x_8 = temp_bug->x_1 + 1;
temp_bug->x_9 = temp_bug->x_1 + 2;
temp_bug->y_2 = temp_bug->y_1;
temp_bug->y_3 = temp_bug->y_1;
temp_bug->y_4 = temp_bug->y_1+1;
temp_bug->y_5 = temp_bug->y_1+1;
temp_bug->y_6 = temp_bug->y_1+1;
temp_bug->y_7 = temp_bug->y_1+2;
temp_bug->y_8 = temp_bug->y_1+2;
temp_bug->y_9 = temp_bug->y_1+2;
temp_bug->energy = initial_energy;
temp_bug->age = 0;

if (change_age == 1)
temp_bug->reproduce_age = age_for_reproduction + random(10)-5;
else
temp_bug->reproduce_age = age_for_reproduction;

temp_bug->l = random(9) - 4;
temp_bug->r = random(9) - 4;
temp_bug->f = random(9) - 4;
temp_bug->hr = random(9) - 4;
temp_bug->rv = random(9) - 4;
temp_bug->hl = random(9) - 4;

exp_0 = pow(2.0,(double)temp_bug->l);
exp_1 = pow(2.0,(double)temp_bug->r);
exp_2 = pow(2.0,(double)temp_bug->f);
exp_3 = pow(2.0,(double)temp_bug->hr);
exp_4 = pow(2.0,(double)temp_bug->rv);
exp_5 = pow(2.0,(double)temp_bug->hl);

exps = exp_0+exp_1+exp_2+exp_3+exp_4+exp_5;

temp_bug->prob_0 = exp_0 / exps;
temp_bug->prob_1 = exp_1 / exps;
temp_bug->prob_2 = exp_2 / exps;
temp_bug->prob_3 = exp_3 / exps;
temp_bug->prob_4 = exp_4 / exps;
temp_bug->prob_5 = exp_5 / exps;

temp_bug->direction = random(6);
draw_bug(temp_bug, live_bug_color);
temp_bug = temp_bug->next;
}
}




int reproduce (OBJECT *parent, int energy)

{
double exp_0, exp_1, exp_2, exp_3, exp_4, exp_5, exps;
OBJECT *temp_bug, *place_hold;


temp_bug = bug_list;
bug_count++;
if (bug_count > max_bug_count)
max_bug_count = bug_count;

place_hold = newobject();
if (place_hold == NULL)
out_of_memory();

place_hold->prev = NULL;
temp_bug->prev = place_hold;
place_hold->next = temp_bug;

bug_list = place_hold;
temp_bug = place_hold;

temp_bug->age = 0;

if (change_age == 1)
temp_bug->reproduce_age = parent->reproduce_age + random(10)-5;
else
temp_bug->reproduce_age = parent->reproduce_age;

temp_bug->energy = energy;
temp_bug->x_1 = parent->x_1;
temp_bug->y_1 = parent->y_1;

if (change_shape == 1)
{
temp_bug->x_2 = parent->x_2 + random (3) - 1;
temp_bug->y_2 = parent->y_2 + random (3) - 1;
temp_bug->x_3 = parent->x_3 + random (3) - 1;
temp_bug->y_3 = parent->y_3 + random (3) - 1;
temp_bug->x_4 = parent->x_4 + random (3) - 1;
temp_bug->y_4 = parent->y_4 + random (3) - 1;
temp_bug->x_5 = parent->x_5 + random (3) - 1;
temp_bug->y_5 = parent->y_5 + random (3) - 1;
temp_bug->x_6 = parent->x_6 + random (3) - 1;
temp_bug->y_6 = parent->y_6 + random (3) - 1;
temp_bug->x_7 = parent->x_7 + random (3) - 1;
temp_bug->y_7 = parent->y_7 + random (3) - 1;
temp_bug->x_8 = parent->x_8 + random (3) - 1;
temp_bug->y_8 = parent->y_8 + random (3) - 1;
temp_bug->x_9 = parent->x_9 + random (3) - 1;
temp_bug->y_9 = parent->y_9 + random (3) - 1;
}
else
{
temp_bug->x_2 = parent->x_2;
temp_bug->y_2 = parent->y_2;
temp_bug->x_3 = parent->x_3;
temp_bug->y_3 = parent->y_3;
temp_bug->x_4 = parent->x_4;
temp_bug->y_4 = parent->y_4;
temp_bug->x_5 = parent->x_5;
temp_bug->y_5 = parent->y_5;
temp_bug->x_6 = parent->x_6;
temp_bug->y_6 = parent->y_6;
temp_bug->x_7 = parent->x_7;
temp_bug->y_7 = parent->y_7;
temp_bug->x_8 = parent->x_8;
temp_bug->y_8 = parent->y_8;
temp_bug->x_9 = parent->x_9;
temp_bug->y_9 = parent->y_9;
}
temp_bug->l = random(2) - 1 + parent->l;
temp_bug->r = random(2) - 1 + parent->r;
temp_bug->f = random(2) - 1 + parent->f;
temp_bug->hr = random(2) - 1 + parent->hr;
temp_bug->rv = random(2) - 1 + parent->rv;
temp_bug->hl = random(2) - 1 + parent->hl;

exp_0 = pow(2.0,(double)temp_bug->l);
exp_1 = pow(2.0,(double)temp_bug->r);
exp_2 = pow(2.0,(double)temp_bug->f);
exp_3 = pow(2.0,(double)temp_bug->hr);
exp_4 = pow(2.0,(double)temp_bug->rv);
exp_5 = pow(2.0,(double)temp_bug->hl);

exps = exp_0+exp_1+exp_2+exp_3+exp_4+exp_5;

temp_bug->prob_0 = exp_0 / exps;
temp_bug->prob_1 = exp_1 / exps;
temp_bug->prob_2 = exp_2 / exps;
temp_bug->prob_3 = exp_3 / exps;
temp_bug->prob_4 = exp_4 / exps;
temp_bug->prob_5 = exp_5 / exps;

temp_bug->direction = random(6);
draw_bug(temp_bug, live_bug_color);
}




int move_bugs()
{
int temp_dir, turn, half_energy;
int x_move1, y_move1, x_move2, y_move2, x_move3, y_move3, x_move4,
y_move4, x_move5, y_move5, x_move6, y_move6, x_move7, y_move7,
x_move8, y_move8, x_move9, y_move9;
double new_move, p0, p1, p2, p3, p4, p5;
OBJECT *temp_bug, *prev_bug, *next_bug;

temp_bug = bug_list;
while (temp_bug != NULL)
{
new_move = (double) rand() / 32767.0;
p0 = temp_bug->prob_0;
p1 = p0 + temp_bug->prob_1;
p2 = p1 + temp_bug->prob_2;
p3 = p2 + temp_bug->prob_3;
p4 = p3 + temp_bug->prob_4;
p5 = p4 + temp_bug->prob_5;

if (new_move > 0.0 && new_move <= p0)
turn=0;
else if (new_move > p0 && new_move <= p1)
turn=1;
else if (new_move > p1 && new_move <= p2)
turn=2;
else if (new_move > p2 && new_move <= p3)
turn=3;
else if (new_move > p3 && new_move <= p4)
turn=4;
else if (new_move > p4 && new_move <= p5)
turn=5;

temp_dir = (temp_bug->direction + turn) % 6;
x_move1 = temp_bug->x_1 + xmovetemp_dirþ;
y_move1 = temp_bug->y_1 + ymovetemp_dirþ;
x_move2 = temp_bug->x_2 + xmovetemp_dirþ;
y_move2 = temp_bug->y_2 + ymovetemp_dirþ;
x_move3 = temp_bug->x_3 + xmovetemp_dirþ;
y_move3 = temp_bug->y_3 + ymovetemp_dirþ;
x_move4 = temp_bug->x_4 + xmovetemp_dirþ;
y_move4 = temp_bug->y_4 + ymovetemp_dirþ;
x_move5 = temp_bug->x_5 + xmovetemp_dirþ;
y_move5 = temp_bug->y_5 + ymovetemp_dirþ;
x_move6 = temp_bug->x_6 + xmovetemp_dirþ;
y_move6 = temp_bug->y_6 + ymovetemp_dirþ;
x_move7 = temp_bug->x_7 + xmovetemp_dirþ;
y_move7 = temp_bug->y_7 + ymovetemp_dirþ;
x_move8 = temp_bug->x_8 + xmovetemp_dirþ;
y_move8 = temp_bug->y_8 + ymovetemp_dirþ;
x_move9 = temp_bug->x_9 + xmovetemp_dirþ;
y_move9 = temp_bug->y_9 + ymovetemp_dirþ;

temp_bug->age += 1;
temp_bug->energy -= energy_per_turn;

if
(!(x_move1>x_hi || x_move1< 0 || y_move1< 0 || y_move1> y_hi) &&
!(x_move2>x_hi || x_move2< 0 || y_move2< 0 || y_move2> y_hi) &&
!(x_move3>x_hi || x_move3< 0 || y_move3< 0 || y_move3> y_hi) &&
!(x_move4>x_hi || x_move4< 0 || y_move4< 0 || y_move4> y_hi) &&
!(x_move5>x_hi || x_move5< 0 || y_move5< 0 || y_move5> y_hi) &&
!(x_move6>x_hi || x_move6< 0 || y_move6< 0 || y_move6> y_hi) &&
!(x_move7>x_hi || x_move7< 0 || y_move7< 0 || y_move7> y_hi) &&
!(x_move8>x_hi || x_move8< 0 || y_move8< 0 || y_move8> y_hi) &&
!(x_move9>x_hi || x_move9< 0 || y_move9< 0 || y_move9> y_hi))
{
draw_bug(temp_bug, erased_bug_color);
temp_bug->direction = temp_dir;
temp_bug->x_1 = x_move1;
temp_bug->y_1 = y_move1;
temp_bug->x_2 = x_move2;
temp_bug->y_2 = y_move2;
temp_bug->x_3 = x_move3;
temp_bug->y_3 = y_move3;
temp_bug->x_4 = x_move4;
temp_bug->y_4 = y_move4;
temp_bug->x_5 = x_move5;
temp_bug->y_5 = y_move5;
temp_bug->x_6 = x_move6;
temp_bug->y_6 = y_move6;
temp_bug->x_7 = x_move7;
temp_bug->y_7 = y_move7;
temp_bug->x_8 = x_move8;
temp_bug->y_8 = y_move8;
temp_bug->x_9 = x_move9;
temp_bug->y_9 = y_move9;
temp_bug->energy += food_here(temp_bug);

if (temp_bug->energy >= maximum_energy)
temp_bug->energy = maximum_energy;
draw_bug(temp_bug, live_bug_color);
}

if (temp_bug->energy <= 0)
{
prev_bug = temp_bug->prev;
next_bug = temp_bug->next;
draw_bug(temp_bug, dead_bug_color);
freeobject(temp_bug);
bug_count--;

if (bug_count == 0)
temp_bug = NULL;
else
{
if (prev_bug != NULL)
prev_bug->next = next_bug;
else
bug_list = next_bug;

if (next_bug != NULL)
next_bug->prev = prev_bug;

temp_bug = next_bug;
}
}

else if (temp_bug->age > temp_bug->reproduce_age &&
temp_bug->energy > energy_to_reproduce)
{
half_energy = temp_bug->energy/2;
draw_bug(temp_bug, erased_bug_color);
reproduce(temp_bug, half_energy);
reproduce(temp_bug, half_energy);
prev_bug = temp_bug->prev;
next_bug = temp_bug->next;
freeobject(temp_bug);
bug_count--;

if (prev_bug != NULL)
prev_bug->next = next_bug;
else
bug_list = next_bug;

if (next_bug != NULL)
next_bug->prev = prev_bug;

temp_bug = next_bug;
}
else
temp_bug = temp_bug->next;

if (kbhit()!=0)
temp_bug=NULL;
}
}




int rain()
{
long i;
long new_colonies;

new_colonies = (long) (((double) rand() / 32767) * food_colonies);
for (i=0; i<new_colonies; i++)
putpixel(random(x_hi)+1, random(y_hi)+1, food_color);
max_food_colonies += new_colonies;
}




evolve()
{
OBJECT *temp_bug;

init_drivers(); /* x_hi x y_hi */

randomize();
initialize_screen();
while (kbhit()==0 && bug_count != 0)
{
move_bugs();
probrain = (double) rand() / 32767.0;
if (probrain < probability_of_rain)
rain();
generation += 1;
}
if (bug_count != 0)
getch();
closegraph();
clrscr();
printf("Max bugs was %d\n",max_bug_count);
temp_bug = bug_list;
a=0;
while (temp_bug != NULL && kbhit() ==0 && bug_count != 0)
{
printf("Age of bug %d reached %d ",a++,temp_bug->age);
if (change_age == 1)
printf("reproduction age reached %d\n",
temp_bug->reproduce_age);
else
printf("\n");
temp_bug = temp_bug->next;
}

if (temp_bug != NULL)
getch();

printf("Number of time units %d\n",generation);
temp_bug = bug_list;
while (temp_bug != NULL)
{
bug_list = temp_bug->next;
free(temp_bug);
temp_bug = bug_list;
}

temp_bug = free_list;
while (temp_bug != NULL)
{
free_list = temp_bug->next;
free(temp_bug);
temp_bug = free_list;
}
}



main(int argc, char *argvþ)
{
int i;
char *ptr;
int running=1;

if ((argc > 1) && (strcmp(argv1þ,"?")==0))
{
printf("\nEVOLVE - an evolution demonstration\n");
printf(" By: Robert Simonoff (S427359 at GBGVM3)\n\n");
printf("Command syntax is: \n");
printf("EVOLVE options\n\n");
printf("Where options can be any of the following, but must\n");
printf("be in the order shown: \n");
printf(" ? ");
printf("Displays this help screen\n");
printf(" /CS=Y ");
printf("Allows shape mutation\n");
printf(" /CA=Y ");
printf("Allows age mutation\n");
printf(" /IB=# ");
printf("Sets initial number of bugs\n");
printf(" /IE=# ");
printf("Sets the initial energy\n");
printf(" /IF=# ");
printf("Sets the number of initial food colonies\n");
printf(" /EM=# ");
printf("Energy required for a move\n");
printf(" /EG=# ");
printf("Energy gained for 1 food colony\n");
printf(" /AR=# ");
printf("Minimum age for reproduction\n");
printf(" /ER=# ");
printf("Energy required for reproduction\n");
printf(" /PR=.######### ");
printf("Probability of rain in a time unit\n");
printf(" /ME=# ");
printf("Maximum amount of energy stored in bug\n");
running = 0;
}
else
{
if (argc > 1)
for (i=1; i<argc; i++)
{
ptr = strtok(argviþ,"=");
if (strcmp(strupr(ptr),"/CS")==0)
{
if (strupr(strtok(NULL,"\n "))0þ == 'N')
change_shape = 0;
}
else if (strcmp(strupr(ptr),"/CA")==0)
{
if (strupr(strtok(NULL,"\n "))0þ == 'N')
change_age = 0;
}
else if (strcmp(strupr(ptr),"/IB")==0)
{
initial_number_of_bugs = atoi(strtok(NULL,"\n "));
}
else if (strcmp(strupr(ptr),"/EM")==0)
{
energy_per_turn = atoi(strtok(NULL,"\n "));
}
else if (strcmp(strupr(ptr),"/IE")==0)
{
initial_energy =atoi(strtok(NULL,"\n "));
}
else if (strcmp(strupr(ptr),"/IF")==0)
{
food_colonies =atol(strtok(NULL,"\n "));
}
else if (strcmp(strupr(ptr),"/EG")==0)
{
energy_for_food_pelet = atoi(strtok(NULL, "\n "));
}
else if (strcmp(strupr(ptr),"/AR")==0)
{
age_for_reproduction = atoi(strtok(NULL, "\n "));
}
else if (strcmp(strupr(ptr),"/ER")==0)
{
energy_to_reproduce = atoi(strtok(NULL, "\n "));
}
else if (strcmp(strupr(ptr),"/PR")==0)
{
probability_of_rain = atof(strtok(NULL, "\n "));
}
else if (strcmp(strupr(ptr),"/ME")==0)
{
maximum_energy = atoi(strtok(NULL, "\n "));
}
}
}

if (running == 1)
evolve();
}



--------------------
Republican Values:

1) You can't get married to your spouse who is the same sex as you.
2) You can't have an abortion no matter how much you don't want a child.
3) You can't have a certain plant in your possession or you'll get locked up with a rapist and a murderer.

4) We need a smaller, less-intrusive government.

Extras: Filter Print Post Top
Re: Artifical life [Re: Diploid]
    #13959154 -

Awesome, thanks!  :mushroom2:


--------------------
We are all in the gutter, but some of us are looking at the stars.

Extras: Filter Print Post Top
Re: Artifical life [Re: deCypher]
    #13961386 -

thought this may fit the subject

Scientists Create First Self-Replicating Synthetic Life on Wired

a hacked yeast cell which then self-replicates

Extras: Filter Print Post Top
Re: Artifical life [Re: cc2]
    #13976073 -

"I wonder if this approach has/could be incorporated into traditional development by utilizing mutation and selection to optimize designs in ways the people couldnt.  Eventully they may use it to design airplanes... or even computers.."

I'd like to see something like this hooked up to a rapid prototype machine.

It could spit out airfoils and hold them up in a wind tunnel, if it creates more lift that design "breeds" and carries on.

Slight randomization of chord depth, airfoil thickness, wing length, sweep, texture and curve could make thousands of shapes.

Breed for less drag with more lift without the restrictions people impose on wings.
Could be cool. Several thousand pins with flattened disks on the ends of them along the length of a flattened beam. You could really end up with any shape at all.

Perhaps several wings staggered in a deep V like migrating birds...a little twist on each wing tip flips a vortex off it to ride along the next wing causing more lift.

The mind wanders...


--------------------
Give a man a fire and he will be warm for the rest of the night.
Set a man on fire and he will be warm for the rest of his life.
NEWB NEWBIE NEWCOMER IGNORANT? QUESTIONS?
Click HERE HERE HERE HERE For detailed instructions with pictures on how to grow mushrooms. There is a lot of info on the Shroomery and this is what you need to know.

Extras: Filter Print Post Top
Jump to top Pages: 1

Shop: Myyco.com Golden Teacher Liquid Culture For Sale   Unfolding Nature Unfolding Nature: Being in the Implicate Order


Similar ThreadsPosterViewsRepliesLast post
* Crawfish from Germany that can reproduce itself by cloning is taking over Madagascar myco myco unday 323 5 02/13/18 07:13 PM
by Byrain
* Simple C Program Help Needed Che_Night_Soil 630 1 01/30/04 07:03 PM
by Che_Night_Soil
* Spread this number now AlteredAgain 1,431 19 05/04/07 07:39 AM
by Ythan
* Need help with a simple if/else problem in c++, anyone out there? OnePerEyeM8 293 1 02/23/14 02:49 AM
by OnePerEyeM8
* Format String Attack (you gotta be experienced with coding)
( 1 2 all )
Xeny 2,925 22 03/06/08 04:46 PM
by Diploid
* Learning How to program with Python.
( 1 2 all )
teknix 3,444 32 10/16/13 02:12 AM
by teknix
* Evolution question... lamarboarder1 1,268 7 10/09/05 09:17 AM
by phi1618
* Artificial Stupidity Great Scott 944 5 06/09/08 11:58 PM
by Great Scott

Extra information
You cannot start new topics / You cannot reply to topics
HTML is disabled / BBCode is enabled
Moderator: trendal, automan, Northerner
1,220 topic views. 0 members, 6 guests and 1 web crawlers are browsing this forum.
[ Show Images Only | Sort by Score | Print Topic ]
Search this thread:

Copyright 1997-2026 Mind Media. Some rights reserved.

Generated in 0.028 seconds spending 0.007 seconds on 14 queries.