private bool ContainsKeyDict(BayesianClique clique)
        {
            foreach (var key in NeighborMsg.Keys)
                if (key.Name == clique.Name)
                    return true;
            return false;

        }
 private bool ContainsKeyDict(BayesianClique clique)
 {
     foreach (var key in NeighborMsg.Keys)
     {
         if (key.Name == clique.Name)
         {
             return(true);
         }
     }
     return(false);
 }
 public bool MsgSended(BayesianClique neighbor)
 {
     return(neighbor.NeighborMsg.ContainsKey(this));
 }
 public bool CanSendMesg(BayesianClique neighbor)
 {
     return(NeighborMsg.Count == _cantneighbors || (NeighborMsg.Count == _cantneighbors - 1 && !ContainsKeyDict(neighbor)));
 }
 public bool MsgSended(BayesianClique neighbor)
 {
     return neighbor.NeighborMsg.ContainsKey(this);
 }
 public bool CanSendMesg(BayesianClique neighbor)
 {
     return (NeighborMsg.Count==_cantneighbors || (NeighborMsg.Count==_cantneighbors-1 && !ContainsKeyDict(neighbor)));
 }