用于控制项目产卵中可能性空间的算法
我很难找到以下问题的好解决方案(和一个好的标题):
说我有一个球体的蓝图。这个sphere-blueprint包含一系列独特的颜色。产卵后,每个球体都会呈现其颜色阵列的随机颜色。
现在,我有了一个产卵器,其中包含一个说可能产生的100个不同的斜纹刺激性列表。这些都可以具有不同的颜色阵列。现在,产卵器试图从该列表中产生10个领域。
在产生了现在的时间,Spheres可以采用其颜色。但是,没有一个球体在另一个球体之前扮演的颜色!第一个球从其颜色阵列中呈现随机颜色。随后的每个球体都可以看到先前的球体所采用的颜色,并能够选择任何以前的球体都没有选择的颜色。
我如何确保我不产生一个不再有颜色选择的球体,因为其他领域已经采取了颜色阵列中的所有颜色?
我试图使用上面有数字的粘稠笔记来原型,但这肯定不是一个琐碎的问题
I have trouble finding a good solution (and a good title) to the following problem:
Say I have a blueprint of a sphere. This sphere-blueprint contains an array of unique colors. Each sphere will take on a random color of its color array after spawning.
Now I have a Spawner, which holds a list of say 100 different sphere-blueprints it could spawn. Each of these can have differing color arrays. The Spawner now tries to spawn 10 spheres from that list.
After spawning its now time for the spheres to take on their colors. However, no sphere can take on a color another sphere has taken on before! The first sphere takes on a random color from its color array. Each subsequent sphere is are able to see the color previous spheres have taken on and are able to chose a color that hasn't been chosen by any previous sphere.
How can I make sure that I don't spawn a sphere, which could be left with no more color-choices, because all colors within its color-array have been already taken by other spheres?
I tried to prototype this using sticky notes with numbers on them, but it sure is not a trivial problem
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每个唯一的“蓝图”都需要包含以下...
创建了“ 100个蓝图”列表,您需要将所有唯一的唯一唯一的列表组合在一起。颜色变成全球冠状器。
每个“蓝图”的“ spawn”(实例)都需要包含以下...
示例Spawn BluePrint方法...。
Each of your unique "blueprint" needs to contain the following...
Once your list of "100 blueprints" is created you need to combine all of the unique colors into a GlobalColorHashSet.
Each "spawn" (instance) of a "blueprint" needs to contain the following...
Example spawn blueprint method....