Answered step by step
Verified Expert Solution
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 hardcoded
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 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 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:
Vector 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 obstacleboundary 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 CreateVector 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 ListpathNodesCount;
for int i ; i pathNodes.Count; i
pathEges.Addnew List;
END STUDENT CODE
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started