public (bool, List <double>) Match(net.ActionPlan plan, List <Vector> obs) { List <double> dis = net.GetReceptorDistance(plan.observation, obs); for (int i = 0; i < dis.Count; i++) { if (!net.Receptors[i].IsTolerateDistance(dis[i])) { return(false, dis); } } return(true, dis); }
public void PutActionPlan(net.ActionPlan plan) { int index = IndexOfActionPlan(plan.actions); if (index >= 0) { this.records[index] = new ActionRecord(plan.actions, plan.evaulation); } else { this.records.Add(new ActionRecord(plan.actions, plan.evaulation, plan.judgeType == ActionPlan.JUDGE_INSTINCT)); } recomputeDensity(); }
public void Merge(Network net, net.ActionPlan plan, bool evaulation = true) { if (plan == null) { return; } if (evaulation) { plan.evaulation = plan.reward >= 0 ? 1 : -1; } Scene scene = FindMatchedScene(plan.observation).Item1; if (scene == null) { scene = new Scene(plan.observation); this.scenes.Add(scene); } scene.PutActionPlan(plan); }