The ideas in this article come from the research of two colleagues.
Mainly about the creation of entities, determination of master-slave, and master-slave switching.
The first instance of the entity is created
There is not much to talk about in itself
What you need to know is that this The entity is Master (nonsense)
Entity master-slave switching principle
- If the entity Master instance is completely under the jurisdiction of the Cell (Green area), there is no need to switch between master and slave.
- If the entity Master instance moves within the Cell boundary and the master-slave switching line, there is no need to perform master-slave switching.
- If the entity Master instance crosses the master-slave switching line, a master-slave switching is performed.
Details, follow the analysis below.
Entity master-slave switching
The picture above shows entity A from Cell1 Go to Cell0 and complete the master-slave switching process. (Note that there is a master-slave switching line here.)
The normal idea is that A1 -> A2, on the dividing line between the two Cells, the master-slave switching can be completed.
But there is a problem with this. After A1->A2, and then A2->A1, if there is an entity running back and forth on the dividing line between the two Cells.
Otherwise, master-slave switching will continue to occur, causing system errors.
Therefore, switch the master-slave line,