Example #1
0
 public void OnGotJeton(MeikoMessage m)
 {
     if (etati == SiteEtat.Demandeur)
     {
         jetonDispi = true;
     }
     else
     {
         SendJetonToTheNextSite();
     }
 }
Example #2
0
        public void OnGotJeton(MeikoMessage m)
        {
            jeton      = (int[])m["Jeton"];
            jetonDispi = true;

            // ∀ j : nbreqi[j] := max(nbreqi[j], jeton[j])
            foreach (var k in Ri)
            {
                nbreqi[k] = Math.Max(nbreqi[k], jeton[k]);
            }
            // TODO/FIXME: Mine as well? I believe not
            nbreqi[i] = Math.Max(nbreqi[i], jeton[i]);
        }
Example #3
0
        public void OnGotRequest(MeikoMessage m)
        {
            var j  = m.Src;
            var nj = (int)m["n"];

            nbreqi[j] = Math.Max(nbreqi[j], nj);

            if (jetonDispi && etati == SiteEtat.Dehors && (nbreqi[j] > jeton[j]))
            {
                jetonDispi = false;
                SendMessage(new MeikoMessage
                {
                    Type      = "Jeton",
                    ["Jeton"] = jeton,
                    Dst       = j,
                });
            }
        }
 public void OnGotJeton(MeikoMessage m)
 {
     jeton      = (int[])m["Jeton"];
     jetonDispi = true;
 }