public override Queue <Location> ExtractPlan(Subject s, Intention i, Beliefs b, List <Location> path) { Queue <Location> plan = new Queue <Location>(); Location dest = new Location(); HashSet <Location> fov = FOV.GetFov(b.Agents[i.ID].Direction, b.Agents[i.ID].Location); if (fov.Except(FOV.GetSharedFov(s, b.Agents[i.ID])).Count() > 0) { dest = Util.RandomElement(fov.Except(FOV.GetSharedFov(s, b.Agents[i.ID])).ToList(), s.Location); } else { dest = Util.RandomElement(fov.ToList(), s.Location); } FlankNode fNode = new FlankNode(null, dest, b.Agents[i.ID].Location) { CurLocation = new Location(s.Location), Obstacles = new HashSet <Location>(b.Obstacles.Keys) }; fNode.Obstacles.UnionWith(Util.GetDynamicObstacles(s.ID, s.Location, b)); plan = Planner.Search(fNode); return(plan); }
public override Node ChildNode(Location loc) { FlankNode n = new FlankNode(this, dest, avoid) { CurLocation = loc, Obstacles = Obstacles }; return(n); }
public override Queue <Location> ExtractPlan(Subject s, Intention i, Beliefs b, List <Location> path) { Queue <Location> plan = new Queue <Location>(); FlankNode fNode = new FlankNode(null, b.Agents['0'].Location, b.Agents[i.ID].Location) { CurLocation = new Location(s.Location), Obstacles = new HashSet <Location>(b.Obstacles.Keys) }; fNode.Obstacles.UnionWith(Util.GetDynamicObstacles(s.ID, s.Location, b)); plan = Planner.Search(fNode); return(plan); }
public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) { return(false); } if (ReferenceEquals(this, obj)) { return(true); } if (obj.GetType() != this.GetType()) { return(false); } FlankNode other = (FlankNode)obj; return(!System.Object.ReferenceEquals(null, CurLocation) && CurLocation.Equals(other.CurLocation)); }
public FlankNode(FlankNode parent, Location dest, Location avoid) : base(parent, dest) { G = (parent == null) ? 0 : (parent.G + 1); this.avoid = avoid; this.dest = dest; }