Example #1
0
 /// <summary>
 /// Get `Mutationfactor` for the state-action
 /// </summary>
 /// <param name="s">For the game state</param>
 /// <param name="a">For the action</param>
 /// <returns>The mutation factor's value</returns>
 protected uint getMutationVal(GameState s, Direction a)
 {
     if (this.PrevMutationfactor.Key == null) return 0;
     var key = new SAPair(s, a);
     if (this.PrevMutationfactor.Key.GetHashCode() == key.GetHashCode())
         return this.PrevMutationfactor.Value;
     return 0;
 }
Example #2
0
 /// <summary>
 /// Updates the `Mutationfactor` table
 /// </summary>
 /// <param name="s">The game state</param>
 /// <param name="a">The action</param>
 /// <param name="val">The mutation factor's value</param>
 protected void updateMutaionFactor(GameState s, Direction a)
 {
     var key = new SAPair(s, a);
     uint val = 0;
     if (this.PrevMutationfactor.Key != null && this.PrevMutationfactor.Key.GetHashCode() == key.GetHashCode())
         val = this.PrevMutationfactor.Value + 1;
     this.PrevMutationfactor = new KeyValuePair<SAPair, uint>(key, val);
 }