Ejemplo n.º 1
0
        //Search in the central floor object to find out what is behind a certain node
        //TODO add stoachastic variable for observing --> approximated edge length and
        public void ObserveRoom(int nodeID, CentralFloor floor)
        {
            List <int> incident = floor.Graph.Node(nodeID).GetIncident;

            foreach (int i in incident)
            {
                FloorGraphEdge e = floor.Graph.Edge(i);
                //Add edge
                if (!(fGraph.Edges.ContainsKey(i)))
                {
                    fGraph.AddEdge(e.Id, e.HardCopy());
                    fGraph.Node(nodeID).GetIncident.Add(i);
                }

                //Add node
                int dest = fGraph.Edge(i).GetDestination;
                if (!fGraph.Nodes.ContainsKey(dest))
                {
                    fGraph.AddNode(dest, new List <int> {
                        i
                    });
                }

                //Add references
                if (!fGraph.Node(dest).GetIncident.Contains(i))
                {
                    fGraph.Node(dest).GetIncident.Add(i);
                }
            }
        }
Ejemplo n.º 2
0
        //TODO observe grid
        public void ObserveGrid(int x, int y, CentralFloor floor /* extra params for fear */)
        {
            int       r     = 0; //ViewRadius
            FloorGrid eGrid = floor.Grid;
            //Potentially simplify --> Observe a square


            //Get the grid from the centralfloor
            //Observe everything in a certain radius, while not going through walls
            //flood fill to a certain eucledian distance? --> allows the agent to look around corners
            //Square of width and height 2r, collision check for each squah (expensive??)
            //Create a spiral that either observes/does not observe if it hits a wall
            //Smoke decreases this radius
            //Panic decreases this radius

            //TODO: colision detection (walls) --> talk about this with timon
            //If a door is found --> perform collision detection for walls AND objects
        }