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(); } }
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; }
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; }
public void ResetMarcs() { this.state = Node_State.Free; if (this.lower != null) { this.lower.ResetMarcs(); } if (this.upper != null) { this.upper.ResetMarcs(); } }
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(); }
public void GetIn() { this.state = Node_State.In; }
public void Free() { this.state = Node_State.Free; }
public void Pop() { this.state = Node_State.JustPop; }