Click here to Skip to main content
15,910,872 members

Comments by Member 3051621 (Top 1 by date)

Member 3051621 9-May-10 5:14am View    
Hi.
I use the analog of web service as the solution of my project, that is every instance get the state of other instances through RMI and decide the state of itself. But there are also some issue, since the state of every instance should be different, maybe some instances' state conflict and maybe network break off, so 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? How can i use code to implement this situation? Just like this?

if(instance2.state == 'B' && instance3.state == 'C' && instance4.state == 'D')
{
instance1.state = 'A';
}
else if (instance2.state == 'B' && instance3.state == 'B' && instance4.state == 'E')
{
instance1.state = 'F';
}
else if (instance2.state == 'C' && instance3.state == 'A' && instance4.state == 'E')
{
}
...
...
...

Is there some algorithm to solve this problems?

regards,
gsrbnr.