Member 3051621 wrote:those instances communicate each other to acquire other instance's state and decide the state of itself, is there some protocol or methods to do such work?
There is no protocol that I'm aware of, but you could use a multi purpose protocol like HTTP or XML-RPC
] if you don't want to write your own. Regarding software design, I think you have two alternatives:
Client-server architecture, declare one of the PCs to be 'server' or 'super node', everyone else will need to connect to the server in order to change/receive states. This is probably the easiest way to implement, since there will be only one central instance that decides. If there is a network outage, clients have to automatically reconnect to the server and resync.
Peer-to-peer architecture. Everyone will connect to everyone else and exchange states with each other. This is harder to implement, since you will need to find a more robust algorithm that can handle conflicting information and network outages (and they will happen).
Member 3051621 wrote:The combination of various possible state is huge, the question is how can i determine the state of one instance according to some rule-based methods?
I don't think there is a general mathematical solution to that, the algorithm depends on what you want to do (your projects requirements). For example there could be states that are dominant or differently weighted with each other.
Hope this helps! :)