实体“碎片整理” 约束求解器/算法
更新:
实体是使用给定实体模板的属性/方法创建的对象。 一个实体可以有一个父实体和/或多个子实体。
每个实体模板都有线程碎片成本和计算机碎片成本。 它们定义了将该实体的子实体放在与父实体不同的计算机/线程上的成本有多大。
新实体将在每次迭代结束时分配给计算机和线程(通过添加),旧实体可能会重新分配给计算机和每 N 次迭代结束时的线程(通过碎片整理)。
调用 add 时,将创建一个实体并将其附加到给定的父级。 然而,它仍然需要放置在计算机线程的模拟运行器中。
决定分配的因素是子{计算机|线程}碎片成本和可选的碎片成本矩阵。
原创
嗨,
我只是想获得一些关于解决以下问题的总体方向/算法/领域的想法。
我在迭代实时模拟环境中有 N 个实体(每个实体都有一个可能的父实体和可能的 M 个子实体)。 每个实体都放置在服务器环境中,该环境位于1 台计算机和该计算机上的1 个线程。 每个实体都有一个“计算机碎片成本”和“线程碎片成本”,这是一个从 0->1 的值(其中 1 是最昂贵的),定义痛苦/成本有多高这将是让该实体的子级位于不同的计算机或线程上。 “计算机碎片成本”将高于“线程碎片成本”。
我有2次手术。 最初添加实体时执行的“添加”操作。 我还有一个“碎片整理”操作,该操作在每个 Y 迭代结束时运行,将实体重新定位到不同的线程/计算机。
考虑到碎片成本,确保这两个操作的碎片保持在最低限度的通用算法/指南是什么?
此外,每个实体都是根据预定义的模板创建的。 将有一个矩阵定义每对实体模板之间的碎片成本。 如何使用这些额外数据来减少碎片?
谢谢
Update:
A entity is an object created with attributes/methods of a given entity template. A entity may have a parent and/or a number of children.
Every entity template has a thread fragmentation cost and a computer fragmentation cost. They define how costly it will be to have children of that entity on different computers/thread from the parent
New entities will be assigned to a computer and a thread at the end of every iteration (via add) and old entities may be reassigned to a computer and a thread at the end of every N iteration (via defragment).
When add is invoked, a entity is created and attached to a given parent. However, it still still has to be placed in a computer's thread's simulation runner.
The factors deciding assignment are the child {computer|thread} fragmentation costs and optionally the fragmentation cost matrix.
Original
Hi,
I'm just looking to get some ideas on a general direction/algorithm/field to solve the following problem.
I have N Entities (each with a possible parent and possible M children) in an iterative realtime simulation environment. Each entity is placed in a server environment where it is located on 1 computer and 1 thread on that computer. Each entity has a "computer fragmentation cost" and "thread fragmentation cost", which is a value from 0->1 (with 1 being the most expensive) that defines how painful/costly it will be to have that entity's children on different computers or threads. "computer fragmentation cost" will be higher than "thread fragmentation cost".
I have 2 operation. A "add" operation that's executed when a entity is initially added. I also have a "defragment" operation that runs at the end of every Y iterations that relocates entities to different threads/computers.
What is a general algorithm/guideline that makes sure the fragmentation stays at a minimum for those 2 operations, given the fragmentation costs?
Also, each entity is created from a predefined template. There will be a matrix defining the fragmentation costs between every pair of entity template. How can this additional data be used to lower fragmentation?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论