void PropagateChanges() { foreach (int v in this.front) { StrategyWithUpdate s = this.S[v]; s.edge = s.newEdge; s.prob = s.newProb; s.weight = s.newWeight; } }
/// <summary> /// </summary> /// <param name="graph">is the graph we are playing the game on</param> /// <param name="P">the set to reach</param> ///<param name="order">compares strategies</param> ///<param name="maxSteps">maximum number of steps to go in the game</param> internal StrategyCalculator(IGraph graph, IEnumerable P, IOrder order, int maxSteps) { this.maxSteps = maxSteps; this.order = order; this.graph = graph; S = new StrategyWithUpdate[graph.NumberOfVertices]; for (int i = 0; i < graph.NumberOfVertices; i++) { S[i] = new StrategyWithUpdate(); } foreach (int v in P) { if (v < graph.NumberOfVertices) { this.P.Insert(v); this.front.Insert(v); S[v] = new StrategyWithUpdate(null, 1, 0); } } }
/// <summary> /// </summary> /// <param name="graph">is the graph we are playing the game on</param> /// <param name="P">the set to reach</param> ///<param name="order">compares strategies</param> ///<param name="maxSteps">maximum number of steps to go in the game</param> internal StrategyCalculator(IGraph graph,IEnumerable P,IOrder order,int maxSteps) { this.maxSteps=maxSteps; this.order=order; this.graph=graph; S=new StrategyWithUpdate[graph.NumberOfVertices]; for(int i=0;i<graph.NumberOfVertices;i++) S[i]=new StrategyWithUpdate(); foreach(int v in P) { if(v<graph.NumberOfVertices){ this.P.Insert(v); this.front.Insert(v); S[v]=new StrategyWithUpdate(null,1,0); } } }