I think I'm going to try batches. 

I have this idea that we can try breaking up different size ranges for a
specific goal, then compare the designs by size. I bet there's some
interesting results waiting to be found under this particular proverbial
rock.

Any suggestions on a range of settings for the varibles? And are there
exponet/power and root functions that I'm not aware of for the fitness
functions? I'd love a cap or range ability. The method I use is really
just a hack involving some algebraic equations' properties. Even an
absolute value, signum, or modulas function would be great!

Thanks for the great program, and hope to hear from you soon - Joe

Forums: 
williamsharkey's picture

I admit, that was a pretty clever hack. But it is easier to do piece-wise
functions.

Lets say you want to compare the velocity of small creatures ( 3-5 sticks),
with large creatures (10-20 sticks). Put this code in the fitness formula:

// start
var validator = 0;
if ( ( this.strsiz >= 3 ) && ( this.strsiz <= 5 ) || ( this.strsiz >=
10 ) && ( this.strsiz <= 20 ) ) validator = 1;

return this.velocity*validator; //sets fitness to 0 if conditions not
met
// end

Maciej Komosinski's picture

> I have this idea that we can try breaking up different size ranges for a
> specific goal, then compare the designs by size. I bet there's some
> interesting results waiting to be found under this particular proverbial
> rock.
>
> Any suggestions on a range of settings for the varibles? And are there
> exponet/power and root functions that I'm not aware of for the fitness
> functions? I'd love a cap or range ability. The method I use is really
> just a hack involving some algebraic equations' properties. Even an
> absolute value, signum, or modulas function would be great!
>
> Thanks for the great program, and hope to hear from you soon - Joe

Dear Joe,

Sorry for answering so late.
Yes, you have a wide range of possibilities in your fitness functions.
You can develop a regular function, as in any programming language,
with conditions, loops, etc.

For a list of basic math functions, see

http://www.framsticks.com/common/script/docs/c_math.html

and the fitness function may for example look like

---
if (this.distance<50) return 50;
if (this.velocity<0) return 0;
return Math.abs(this.strsiz-120);
---

or something like

--
var model = Model.newFromGeno(this.geno);
return this.strsiz / model.size_x;
--

good luck,

Maciej

I've been to busy to try the program out for the last month but when I'm
done with this semester of college, I'll be sure to look into that. Thanks!

Maciej Komosinski's picture

> I've been to busy to try the program out for the last month but when I'm
> done with this semester of college, I'll be sure to look into that.

See also

http://www.framsticks.com/common/tutorial/index.html

up to section IV.3.

Maciej