Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

create a code in c# for the following this assignment, you will be provided with different terrains with obstacles and hard - coded path nodes.

create a code in c# for the following this assignment, you will be provided with different terrains with obstacles and hard-coded
path nodes. You must write the code to generate the path network, as a set of edges
between path nodes. An edge between path nodes exists when (a) there is no obstacle or
boundary wall between the two path nodes, (b) there is sufficient space on either side of the
edge so that an agent can follow the line without colliding with any obstacles or boundary
wall and (c) a path node that is inside the boundary but outside of any obstacles. Nodes that
are outside of the boundary or inside of obstacles, should not connect.
Furthermore, there should be edges in both directions. If there is an edge from Node A to
Node B, then there should be an edge from Node B to Node A. Also, if there should be an
edge from Node A to Node B, it should appear exactly once in the edge list for Node A (no
duplicates). Also, no nodes should link to self.
If two nodes are arbitrarily close together, including possibly located at exactly the same
location, they should still be connected.
What you need to know
Please consult homework 1 for background on the Unity Project. In addition to the
information about the game engine provided there, the following applies.
Also, make sure you first watch the Path Network lecture before attempting this assignment.
CreatePathNetwork
This is the only file you will be modifying and submitting for this homework. It provided
functionality to create a path network from provided pathNodes.
String StudentAuthorName - Please change to your name
Create()
This is the method you will be finishing. You can create helper methods in the same source
code file if you like.
Parameters:
Vector2 canvasOrigin - Bottom left corner of navigable space
float canvasWidth - Width of navigable space
float canvasHeight - Height of navigable space
List
code ://Student code to build the path network from the given pathNodes and Obstacles
//Obstacles - List of obstacles on the plane
//agentRadius - the radius of the traversing agent
//minPoVDist AND maxPoVDist - used for Points of Visibility (see assignment doc)
//pathNodes - ref parameter that contains the pathNodes to connect (or return if pathNetworkMode is set to PointsOfVisibility)
//pathEdges - out parameter that will contain the edges you build.
// Edges cannot intersect with obstacles or boundaries. Edges must be at least agentRadius distance
// from all obstacle/boundary line segments. No self edges, duplicate edges. No null lists (but can be empty)
//pathNetworkMode - enum that specifies PathNetwork type (see assignment doc)
public static void Create(Vector2 canvasOrigin, float canvasWidth, float canvasHeight,
List obstacles, float agentRadius, float minPoVDist, float maxPoVDist, ref List pathNodes, out List> pathEdges,
PathNetworkMode pathNetworkMode)
{
//STUDENT CODE HERE
pathEdges = new List>(pathNodes.Count);
for (int i =0; i pathNodes.Count; ++i)
{
pathEges.Add(new List());
}
// END STUDENT CODE
}
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

Find the cosine of the angle between the vectors. i + j, j + 2k

Answered: 1 week ago

Question

Should job descriptions be abandoned in recruitment and selection?

Answered: 1 week ago