Пример #1
0
 public void Recover()
 {
     if (M_state != Node_State.removed)
     {
         if (M_state == Node_State.infected)
         {
             graph.m_infectedNodes.Remove(this);
         }
         foreach (Node neightbour in m_neighbours)
         {
             if (XORSusAndInf(this, neightbour))
             {
                 graph.susToInfect--;
             }
         }
         foreach (Node neightbour in m_cliqueNeighbours)
         {
             if (XORSusAndInf(this, neightbour))
             {
                 graph.susToInfect--;
             }
         }
         nodestate = Node_State.removed;
         graph.m_recoveredNodes.Add(this);
         graph.m_cliques[Clique_Index].NodeIsRecovered();
     }
 }
Пример #2
0
 public TRNode(TMPoint p, TRNode u, TRNode l, TRRange r)
 {
     this.lower = l;
     this.upper = u;
     this.point = p;
     this.state = Node_State.Free;
     this.rango = r;
 }
Пример #3
0
 public TRNode(TMPoint p, TRNode u, TRNode l, TRRange r)
 {
     this.Lower      = l;
     this.Upper      = u;
     this.Point      = p;
     this.state      = Node_State.Free;
     this.Y_Range    = r;
     this.IsObjetive = false;
 }
Пример #4
0
 public void ResetMarcs()
 {
     this.state = Node_State.Free;
     if (this.lower != null)
     {
         this.lower.ResetMarcs();
     }
     if (this.upper != null)
     {
         this.upper.ResetMarcs();
     }
 }
Пример #5
0
        public void Infect()
        {
            if (M_state != Node_State.infected)
            {
                nodestate = Node_State.infected;
                graph.m_infectedNodes.Add(this);
                foreach (Node neightbour in m_neighbours)
                {
                    switch (neightbour.M_state)
                    {
                    case Node_State.susceptible:
                        graph.susToInfect++;
                        break;

                    case Node_State.infected:
                        graph.susToInfect--;
                        break;
                    }
                }
                if (Get_IsNeighbourWith(this))
                {
                    graph.susToInfect++;
                }
                foreach (Node neightbour in m_cliqueNeighbours)
                {
                    switch (neightbour.M_state)
                    {
                    case Node_State.susceptible:
                        graph.susToInfect += Get_CliqueWeight(neightbour);
                        break;

                    case Node_State.infected:
                        graph.susToInfect -= neightbour.Get_CliqueWeight(this);
                        break;
                    }
                }
            }
            graph.m_cliques[Clique_Index].NodeIsInfected();
        }
Пример #6
0
 public void GetIn()
 {
     this.state = Node_State.In;
 }
Пример #7
0
 public void Free()
 {
     this.state = Node_State.Free;
 }
Пример #8
0
 public void Pop()
 {
     this.state = Node_State.JustPop;
 }