public void Iterate(ConflictState state) { int h = 10; DPItem item = new DPItem(); if (!space.TryGetValue(state.GetHashCode(), out item)) { return; } for (int i = 0; i < iterationCount; i++) { foreach (KeyValuePair <int, DPItem> pair in space) { //int min = int.MaxValue; h = pair.Value.State.cost; ConflictState current = pair.Value.State; foreach (ConflictState s in pair.Value.Children) { h += s.probability * s.cost; //if (state.cost < min) //{ // min = state.cost; //} } pair.Value.State = current; } } }
public override int GetHashCode() { return(state.GetHashCode());// +action.GetHashCode() + probability.GetHashCode(); }