Jump to content




Bee Breeding With Attributes (Credit To Direwolf20 For Idea)

turtle

  • You cannot reply to this topic
128 replies to this topic

#101 troslim

  • Members
  • 8 posts

Posted 19 January 2014 - 04:23 AM

View PostEiktyrner, on 19 January 2014 - 03:49 AM, said:

Are you using Open or misc peripherals?

Can you describe step by step how you end up in the situation so I can repeat it?

Thanks for the help, but managed to get it working :)

#102 OneNonlyNova

  • Members
  • 4 posts

Posted 20 January 2014 - 11:57 AM

i'm trying to extend the programs so that the turtle looks for drones and princesses in the drop off chest below itself,
did someone already look into that?

#103 Eiktyrner

  • Members
  • 9 posts

Posted 22 January 2014 - 01:52 AM

View PostOneNonlyNova, on 20 January 2014 - 11:57 AM, said:

i'm trying to extend the programs so that the turtle looks for drones and princesses in the drop off chest below itself,
did someone already look into that?
If you are breeding with a specific target I don't see the purpose? It will only throw away the ones it doesn't need that are scored the lowest. I guess breeding lines where you need to go "back" to Common for example would be the only case?

But I've been thinking about doing a big sorting system where it keeps all the drones and puts them in specific storage slots for later use. So you could potentially get it to breed everything. I guess it would be kind of the same thing but with more chests.
So when it finds a need for Species X it will look it up in a table of all drones (it will throw extras so the table/storage doesn't get huge) and then go collect it at location Chest Y Slot Z.

#104 McLeopold

  • Members
  • 123 posts

Posted 22 January 2014 - 11:58 AM

View PostEiktyrner, on 22 January 2014 - 01:52 AM, said:

View PostOneNonlyNova, on 20 January 2014 - 11:57 AM, said:

i'm trying to extend the programs so that the turtle looks for drones and princesses in the drop off chest below itself,
did someone already look into that?
If you are breeding with a specific target I don't see the purpose? It will only throw away the ones it doesn't need that are scored the lowest. I guess breeding lines where you need to go "back" to Common for example would be the only case?


The purpose would be to get better results faster, if you have multiple princesses. With only 1, you have to add the right drone and hope for the best mutations. If you have multiple princesses, you can do a few breeding cycles with the difference ones, then pick the best princess from there to continue on.

#105 CaseyRobinson

  • Members
  • 7 posts

Posted 22 January 2014 - 04:12 PM

Using storage space in a chest might be a better way to keep and extra stash of interesting traits around for use once you hit the target species, but I'm skeptical that it will help you get to a species any sooner.

#106 yinduyun

  • Members
  • 5 posts

Posted 31 January 2014 - 04:31 AM

Alright, so the program works with openperipherals 112. I've got that working and working fairly well.
Two issues at this time though - for one, the program does not appear to identify the Flyer trait (which, along with nocturnal and faster work speed really should be given higher priority than cave dwelling or longer life span) or if it does, it doesn't show in the list of traits for the various drones currently held by the turtle.
Second issue is a bit more irritating. Maybe I'm using this wrong, but the program works perfectly well when I just run the program but it kinda fails when I try specifying a target species. If, for example, I run "bee industrious" it tags all drones with 0 score and drops all but one apparently randomly chosen one to breed on with.
Am I doing this wrong?

#107 yinduyun

  • Members
  • 5 posts

Posted 31 January 2014 - 05:53 PM

OK, so apparently what I'd been doing wrong previously was caused by case sensitivity in the program. No big, entirely my stupidity's fault.
Just now DW20 updated once again though and got rid of the severely outdated version of openperipherals, replacing it with these:
OpenMods Lib 0.1-s112
OpenPeripheral Addons 0.1.0-s41
OpenPeripheral Core 0.3.0-s39
This opened up another issue - running the bee program now gives me this error:
Posted Image

That line appears to be part of the score calculation dealing with the speed value. Anyone got a quick fix for that?

#108 Bentenmaru

  • Members
  • 3 posts

Posted 31 January 2014 - 08:34 PM

I got a different error message than you though...but depends what bee program you are using as i try to use the one from https://github.com/eiktyrner/bee but perhaps some change in the peripheral that are incorrect perhaps so thats why it wont work with the score calculation

#109 CaseyRobinson

  • Members
  • 7 posts

Posted 03 February 2014 - 03:16 PM

Regarding the flyer issue, there was a bug in OpenPeripherals that was causing flyer to always appear false in the analyzer regardless of the bee's actual trait. I believe that is fixed, but I don't know exactly what version has that fix.

https://github.com/O...eral/issues/103

With the speed thing, can you post a beealizer screenshot of the specific bee it's choking on? I know I had to add and entry for "" speed because of some weirdness with Magic Bees.

#110 yinduyun

  • Members
  • 5 posts

Posted 04 February 2014 - 08:23 PM

View PostCaseyRobinson, on 03 February 2014 - 03:16 PM, said:

With the speed thing, can you post a beealizer screenshot of the specific bee it's choking on? I know I had to add and entry for "" speed because of some weirdness with Magic Bees.

Posted Image

Turtle had been facing the wrong way before, that's why the turnRight. Forest Princess and Meadows Drone, both fresh from their respective hives. I had the drone in slot 1, princess in slot 2. The error message popped up after the turtle swapped the princess and drone.
Does anyone maybe have a quick few lines of code I can feed into the turtle to make it display a human-readable version of the beeinfo table?

#111 CaseyRobinson

  • Members
  • 7 posts

Posted 05 February 2014 - 09:59 AM

Human readable might be a bit generous, but here's what I use for that:

http://pastebin.com/eC7LK02Q

#112 yinduyun

  • Members
  • 5 posts

Posted 06 February 2014 - 09:58 AM

I just tried that, gave me this error: "textutils: 148: Cannot serialize table with recursive entries"

#113 CaseyRobinson

  • Members
  • 7 posts

Posted 06 February 2014 - 01:14 PM

Hmm, you must be on a different version of OpenPeripherals. Hmm, try adding ".active" after "beeInfo". You could try ".inactive" as well, but I don't think the script does much with inactive attributes.

#114 huffy2404

  • New Members
  • 2 posts

Posted 06 February 2014 - 07:48 PM

I tweaked eiktyrner's version to work with Direwolf20 1.6.4-1.0.14. I have only done some limited testing, but this seems to be working.

http://pastebin.com/5f5qNR0A

#115 Slackratchet

  • Members
  • 10 posts

Posted 06 February 2014 - 11:29 PM

I've been trying to make this work in the .14 version of Direwolf20 and the lack of the MiscPeripherial Bee Analyzer has been a stumbling block. I do have it 99% working but I an curious if anyone else is working on the same solution.

#116 huffy2404

  • New Members
  • 2 posts

Posted 07 February 2014 - 11:04 AM

View PostSlackratchet, on 06 February 2014 - 11:29 PM, said:

I've been trying to make this work in the .14 version of Direwolf20 and the lack of the MiscPeripherial Bee Analyzer has been a stumbling block. I do have it 99% working but I an curious if anyone else is working on the same solution.

See post #74 in this thread for how to use OpenPeripheral instead, and post #114 (the one right above yours) for a modified version of the program that is working with the DW20 1.6.4-1.0.14 pack.

#117 Slackratchet

  • Members
  • 10 posts

Posted 07 February 2014 - 11:15 PM

Whoops. Sorry, I didn't read your post close enough. Sorry.

#118 xBoom

  • New Members
  • 2 posts

Posted 08 March 2014 - 03:12 AM

View PostMcLeopold, on 22 January 2014 - 11:58 AM, said:

View PostEiktyrner, on 22 January 2014 - 01:52 AM, said:

View PostOneNonlyNova, on 20 January 2014 - 11:57 AM, said:

i'm trying to extend the programs so that the turtle looks for drones and princesses in the drop off chest below itself,
did someone already look into that?
If you are breeding with a specific target I don't see the purpose? It will only throw away the ones it doesn't need that are scored the lowest. I guess breeding lines where you need to go "back" to Common for example would be the only case?


The purpose would be to get better results faster, if you have multiple princesses. With only 1, you have to add the right drone and hope for the best mutations. If you have multiple princesses, you can do a few breeding cycles with the difference ones, then pick the best princess from there to continue on.

Has anyone succeeded in doing this, I'm really bad at coding so I can't do it, if you did do it can you post the code here or if someone can give me an idea as how to do it

#119 Zixxl

  • New Members
  • 2 posts

Posted 11 March 2014 - 07:27 PM

View Posthuffy2404, on 06 February 2014 - 07:48 PM, said:

I tweaked eiktyrner's version to work with Direwolf20 1.6.4-1.0.14. I have only done some limited testing, but this seems to be working.

http://pastebin.com/5f5qNR0A

Thanks, works great!

I made a minor tweak for the sorting algorithm, because the swaps are slow:

	-- bubble sort drones
	print("sorting drones...")
	for i = 2, 16 do
	  if turtle.getItemCount(i) > 0 and droneData[i] then
		droneData[i].score = scoreBee(princessData, droneData[i])
		for j = i - 1, 2, -1 do
		  if droneData[j+1].score > droneData[j].score then
			swapBee(j+1, j, freeSlot)
			droneData[j+1], droneData[j] = droneData[j], droneData[j+1]
		  end
		end
	  end
	end

changed to:

	local highestScore
	-- selection sort drones
	logLine("sorting drones...")
	for i = 2, 16 do
	  highestScore = i
	  if turtle.getItemCount(i) > 0 and droneData[i] then
		droneData[i].score = scoreBee(princessData, droneData[i])
		for j = i + 1, 16 do
		  if turtle.getItemCount(j) > 0 and droneData[j] then
			if not droneData[j].score then
			  droneData[j].score = scoreBee(princessData, droneData[j])
			end
			if droneData[j].score > droneData[highestScore].score then
			  highestScore = j
			end
		  end
		end
		-- swap bees
		if highestScore ~= i then
		  swapBee(i, highestScore, freeSlot)
		  droneData[i], droneData[highestScore] = droneData[highestScore], droneData[i]
		end
	  end
	end

/edit because i am the last poster ;)

I also found a bug with the scoring system. If the princess is a purebred of the targeted bee, all bees are scored with max score e.g.:

sl t species f spd n f c tmp hmd score
--|-|-------|-|---|-|-|-|---|---|------
1 P Ind:Ind 2 0.6 - - -   -   -
2 D Unw:Ind 2 0.6 - - -   -   -  4096
3 D Unw:Ind 2 0.6 - - -   -   -  4096
4 D Unw:Ind 2 0.6 - - -   -   -  4096
5 D Unw:Ind 2 0.6 - - -   -   -  4096
6 D Cul:Dil 2 0.6 - - -   -   -  4096
7 D Mea:Dil 2 0.6 - - -   -   -  4096
8 D Unw:Dil 2 1.2 - - -   -   -  4096
9 D Unw:Dil 2 0.6 - - -   -   -  4096
10 D Ind:Ind 2 0.6 - - -   -   -  4096
11 D Unw:Ind 2 0.6 - - -   -   -  4096
12 D Unw:Ind 2 0.6 - - -   -   -  4096

I changed some code and now they are correctly scored:

sl t species f spd n f c tmp hmd score
--|-|-------|-|---|-|-|-|---|---|------
1 P Ind:Ind 2 0.6 - - -   -   -
2 D Ind:Ind 2 0.6 - - -   -   -   128
3 D Unw:Ind 2 0.6 - - -   -   -   112
4 D Cul:Ind 2 0.6 - - -   -   -   100
5 D Unw:Cul 2 0.6 - - -   -   -	84
6 D Dil:Dil 2 0.6 - - -   -   -	80
7 D Cul:Dil 2 0.6 - - -   -   -	76
8 D Com:Dil 2 1.2 - - -   -   -	74

My latest version can be downloaded here:
http://pastebin.com/8ifxPUkc

Edited by Zixxl, 12 March 2014 - 06:16 PM.


#120 Eiktyrner

  • Members
  • 9 posts

Posted 14 March 2014 - 05:59 PM

Why not send a pull request to my repository? That way people don't need to hunt for the latest pastebin links.

I might not have time to update this very often but I'll gladly accept any PRs to the repo.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users