Code center > Darwinbots3

Bot testbed

<< < (9/13) > >>

spike43884:

--- Quote from: Numsgil on April 12, 2017, 08:03:16 AM ---
--- Quote from: spike43884 on April 11, 2017, 08:53:22 AM ---Where'd 9600 come from?
Anyway, 9000 seems a pretty nice value.

--- End quote ---

Okay, I might just go with 9000, even though I think 9600 is better in a lot of ways, since 9000 is both a round number and evenly divided by 360, which should make math easier for humans.

In terms of where they come from: the prime factors help to determine how many different ways you can divide up the full circle evenly.  3, 4, and 6 are important, since triangles, squares, and hexagons form a full tesselation of the plane, and are the only regular shapes to do so, so you need some multiple of 12 at least (the lowest common multiple of 3, 4, and 6).

If you ever wondered why there's 360 degrees in a circle, it's because it's the closest round number to 365 in base 60 (which was the base the Sumerians used thousands of years ago).  Their number system was base 60 because it makes math easy: 60 divides cleanly in to all sorts of different divisors.  For Darwinbots, we have a similar requirement.  The more ways there are to divide the circle in to even parts, the more different symmetries are possible, or at least easy.  The prime factors show you the raw ingredients to combine to divide the circle up.

2 is an important prime factor, because splitting things in to halves, or quarters, or sixteenths, etc. are very natural ways to break things apart, and can easily mimic the way cells in biology cleave in half during reproduction.  3 is important, but multiple copies of 3 aren't so much: being able to split things in to thirds and being able to represent 30, 45, and 60 degrees is important, but being able to represent 40 degrees or divide things in to 9ths isn't very important.

Sunweaver is sort of built to be base 10, to make math easy for humans, so 5 is an important factor in so far as 10 is.

But 7 isn't an important factor.  It would let you split circles in to 7ths, but there probably isn't much call for that.    As the prime factors get larger, they become less useful.  About the only use 101 would be for is if the bot had 101 segments.  Otherwise there's not much call for splitting a circle evenly in to 101 pieces.

So generally speaking finding a good number is balancing the needs for 2, 3, and 5 as prime factors, taking up as much of the [0,9999] range as possible, and making it easy for humans to do the math.

--- End quote ---

I knew about prime factors, I just meant the number 9600 as an option in and of itself. It didn't divide cleanly at all into 360 so even as an option for better primes seemed a bit unusual.

I suspect actually having 7 could be a useful prime. Less useful then 2, 3 and 5, however there's still a reasonable chance a bot could have 7 segments, 11 and 13 and 17 being reasonably useful as it's not unimaginable for a bot to have that many segments, and in the case of multi-bots. As you get larger primes less numbers use them, however these are just the first few primes so will crop up regularly.

Billy:
Nice work, Nums! Took you long enough :P

Here's a quick 'swimmer' I threw together:


--- Code: ---const myage 360
{ *myage 1 add myage store } call
//{ 0 myage store } call
*numspindles { dup *numspindles 2 div sub abs     *myage *numspindles 2 div mod sub abs 30 mul 100 swap sub 1000 add   swap store } loop
--- End code ---

Sometimes it bugs out and you have to uncomment the line and recomment it to make it work.

Numsgil:
Looks good but I think shadowgod still has you beat :)

If you can figure out under which circumstances it bugs out that would be good.  It's possible it's a bug in the program that I should fix.

Billy:
Mine is more concise though!

I think it was when I was fiddling with the number on the last line that is now 30, I can't seem to reproduce it now unfortunately.

Botsareus:
I like the idea of using multiples for memory range, basing it from days in year aka about 360 is not a bad idea. However, we need to consider what other values stuff will return and incorporate the prime numbers from these into it. That is why I prefer to go with large ranges with stuff like this. In my experiments I always go with longs actually even though I do not need them.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version