Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Several mining bots working simultaneously
#2
I don't know if it's most efficient way to do this (didn't coded with public classes so much), but I think about public class ResourceManager with array storing coordinates of every thing. It would be shared for all bots (that's why it's public class) and every bot should read it before touching anything. It would work like this:
Bot #1 search for ore. Found one, but after searching in array it turns out it's present in there, because another bot marked it as "his", so other bots won't take it before him. So first bot search further and found another ore, that's not present in array, so bot write ore coordinates to array, then simply go for it, grab and deliver to destination point. When ore won't be needed anymore for bot, then its coordinates are removed from array.
Spoiler :
[Image: unknown.png]


Messages In This Thread
RE: Several mining bots working simultaneously - by tomangelo - 10-07-2016, 08:51 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)