public void UpdateReferences(float inflationFactor, PlanningDomainBase domain) { List<DefaultState> neighborsList = new List<DefaultState>(); foreach(KeyValuePair<DefaultState, ARAstarNode> node in close) { if(node.Value.weightExpanded > inflationFactor) { float best_g = Mathf.Infinity; node.Value.weightExpanded = inflationFactor; domain.generateNeighbors(node.Key, ref neighborsList); foreach(DefaultState neighbor in neighborsList) { if(close.ContainsKey(neighbor)) { if(close[neighbor].g < best_g){ best_g = close[neighbor].g; close[neighbor].weightExpanded = inflationFactor; close[node.Key].previousState = neighbor; //close[node.Key].action = new ARAstarAction(neighbor, node.Key); close[node.Key].action = domain.generateAction(neighbor, node.Key); } } } } } }
public void UpdateReferences(float inflationFactor, PlanningDomainBase domain) { List <DefaultState> neighborsList = new List <DefaultState>(); foreach (KeyValuePair <DefaultState, ARAstarNode> node in close) { if (node.Value.weightExpanded > inflationFactor) { float best_g = Mathf.Infinity; node.Value.weightExpanded = inflationFactor; domain.generateNeighbors(node.Key, ref neighborsList); foreach (DefaultState neighbor in neighborsList) { if (close.ContainsKey(neighbor)) { if (close[neighbor].g < best_g) { best_g = close[neighbor].g; close[neighbor].weightExpanded = inflationFactor; close[node.Key].previousState = neighbor; //close[node.Key].action = new ARAstarAction(neighbor, node.Key); close[node.Key].action = domain.generateAction(neighbor, node.Key); } } } } } }
void updatePlanReference(PlanningDomainBase domain) { List <DefaultState> neighborsList = new List <DefaultState>(); foreach (DefaultState state in plan.Keys) { float ming = Mathf.Infinity; domain.generateNeighbors(state, ref neighborsList); foreach (DefaultState neighbor in neighborsList) { if (plan.ContainsKey(neighbor)) { if (plan[neighbor].g < ming) { ming = plan[neighbor].g; plan[state].previousState = neighbor; //plan[state].action = new ARAstarAction(neighbor, state); plan[state].action = domain.generateAction(neighbor, state); } } } } }
void updatePlanReference(PlanningDomainBase domain) { List<DefaultState> neighborsList = new List<DefaultState>(); foreach(DefaultState state in plan.Keys) { float ming = Mathf.Infinity; domain.generateNeighbors(state, ref neighborsList); foreach(DefaultState neighbor in neighborsList) { if(plan.ContainsKey(neighbor)) { if(plan[neighbor].g < ming) { ming = plan[neighbor].g; plan[state].previousState = neighbor; //plan[state].action = new ARAstarAction(neighbor, state); plan[state].action = domain.generateAction(neighbor, state); } } } } }