Rebornbuddy
Loading...
Searching...
No Matches
Pathfinding.Arc Class Reference

An arc is defined with its two extremity nodes StartNode and EndNode therefore it is oriented. It is also characterized by a crossing factor named 'Weight'. This value represents the difficulty to reach the ending node from the starting one. More...

Public Member Functions

 Arc (Node Start, Node End)
 Arc constructor.
override string ToString ()
 Returns the textual description of the arc. object.ToString() override.
override bool Equals (object O)
 Object.Equals override. Tells if two arcs are equal by comparing StartNode and EndNode.
override int GetHashCode ()
 Object.GetHashCode override.

Protected Member Functions

virtual double CalculateLength ()
 Performs the calculous that returns the arc's length Can be overriden for derived types of arcs that are not linear.

Properties

Node StartNode [get, set]
 Gets/Sets the node from which the arc starts.
Node EndNode [get, set]
 Gets/Sets the node to which the arc ends.
double Weight [get, set]
 Sets/Gets the weight of the arc. This value is used to determine the cost of moving through the arc.
bool Passable [get, set]
 Gets/Sets the functional state of the arc. 'true' means that the arc is in its normal state. 'false' means that the arc will not be taken into account (as if it did not exist or if its cost were infinite).
double Length [get]
 Gets arc's length.
virtual double Cost [get]
 Gets the cost of moving through the arc. Can be overriden when not simply equals to Weight*Length.

Detailed Description

An arc is defined with its two extremity nodes StartNode and EndNode therefore it is oriented. It is also characterized by a crossing factor named 'Weight'. This value represents the difficulty to reach the ending node from the starting one.

Constructor & Destructor Documentation

◆ Arc()

Pathfinding.Arc.Arc ( Node Start,
Node End )

Arc constructor.

Exceptions
ArgumentNullExceptionExtremity nodes cannot be null.
ArgumentExceptionStartNode and EndNode must be different.
Parameters
StartThe node from which the arc starts.
EndThe node to which the arc ends.

Member Function Documentation

◆ CalculateLength()

virtual double Pathfinding.Arc.CalculateLength ( )
protectedvirtual

Performs the calculous that returns the arc's length Can be overriden for derived types of arcs that are not linear.

Returns

◆ Equals()

override bool Pathfinding.Arc.Equals ( object O)

Object.Equals override. Tells if two arcs are equal by comparing StartNode and EndNode.

Exceptions
ArgumentExceptionCannot compare an arc with another type.
Parameters
OThe arc to compare with.
Returns
'true' if both arcs are equal.

◆ GetHashCode()

override int Pathfinding.Arc.GetHashCode ( )

Object.GetHashCode override.

Returns
HashCode value.

◆ ToString()

override string Pathfinding.Arc.ToString ( )

Returns the textual description of the arc. object.ToString() override.

Returns
String describing this arc.

Property Documentation

◆ Cost

virtual double Pathfinding.Arc.Cost
get

Gets the cost of moving through the arc. Can be overriden when not simply equals to Weight*Length.

◆ EndNode

Node Pathfinding.Arc.EndNode
getset

Gets/Sets the node to which the arc ends.

Exceptions
ArgumentNullExceptionEndNode cannot be set to null.
ArgumentExceptionEndNode cannot be set to StartNode.

◆ Length

double Pathfinding.Arc.Length
get

Gets arc's length.

◆ Passable

bool Pathfinding.Arc.Passable
getset

Gets/Sets the functional state of the arc. 'true' means that the arc is in its normal state. 'false' means that the arc will not be taken into account (as if it did not exist or if its cost were infinite).

◆ StartNode

Node Pathfinding.Arc.StartNode
getset

Gets/Sets the node from which the arc starts.

Exceptions
ArgumentNullExceptionStartNode cannot be set to null.
ArgumentExceptionStartNode cannot be set to EndNode.

◆ Weight

double Pathfinding.Arc.Weight
getset

Sets/Gets the weight of the arc. This value is used to determine the cost of moving through the arc.