Class GraphTopology
An generic topology representing any graph data strcture with a given maximum degree.
The x-axis is the same as the index, indicating which vertex in the graph. y and z are unused and are always zero.
Inheritance
GraphTopology
Assembly: DeBroglie.dll
Syntax
public class GraphTopology : ITopology
Constructors
|
Edit this page
View Source
GraphTopology(NeighbourDetails[,], bool[])
Constructs a new GraphTopology.
neighbours[i, d] should be an array indicating what the d'th neighbour of the i'th node is.
d should be a Direction, cast to an integer.
Declaration
public GraphTopology(GraphTopology.NeighbourDetails[,] neighbours, bool[] mask = null)
Parameters
Properties
|
Edit this page
View Source
Depth
The extent along the z-axis.
Declaration
public int Depth { get; }
Property Value
|
Edit this page
View Source
DirectionsCount
Number of unique directions
Declaration
public int DirectionsCount { get; }
Property Value
|
Edit this page
View Source
Height
The extent along the y-axis.
Declaration
public int Height { get; }
Property Value
|
Edit this page
View Source
IndexCount
Number of unique indices (distinct locations) in the topology
Declaration
public int IndexCount { get; }
Property Value
|
Edit this page
View Source
Mask
A array with one value per index indcating if the value is missing.
Not all uses of Topology support masks.
Declaration
public bool[] Mask { get; }
Property Value
|
Edit this page
View Source
Width
The extent along the x-axis.
Declaration
public int Width { get; }
Property Value
Methods
|
Edit this page
View Source
GetCoord(int, out int, out int, out int)
Declaration
public void GetCoord(int index, out int x, out int y, out int z)
Parameters
|
Edit this page
View Source
GetIndex(int, int, int)
Reduces a three dimensional co-ordinate to a single integer. This is mostly used internally.
Declaration
public int GetIndex(int x, int y, int z)
Parameters
Returns
|
Edit this page
View Source
TryMove(int, Direction, out int)
Given an index and a direction, gives the index that is one step in that direction,
if it exists and is not masked out. Otherwise, it returns false.
Declaration
public bool TryMove(int index, Direction direction, out int dest)
Parameters
Returns
|
Edit this page
View Source
TryMove(int, Direction, out int, out Direction, out EdgeLabel)
Given an index and a direction, gives the index that is one step in that direction,
if it exists and is not masked out. Otherwise, it returns false.
Additionally returns information about the edge traversed.
Declaration
public bool TryMove(int index, Direction direction, out int dest, out Direction inverseDirection, out EdgeLabel edgeLabel)
Parameters
Returns
|
Edit this page
View Source
TryMove(int, int, int, Direction, out int)
Given a co-ordinate and a direction, gives the index that is one step in that direction,
if it exists and is not masked out. Otherwise, it returns false.
Declaration
public bool TryMove(int x, int y, int z, Direction direction, out int dest)
Parameters
Returns
|
Edit this page
View Source
TryMove(int, int, int, Direction, out int, out Direction, out EdgeLabel)
Given a co-ordinate and a direction, gives the index that is one step in that direction,
if it exists and is not masked out. Otherwise, it returns false.
Additionally returns information about the edge traversed.
Declaration
public bool TryMove(int x, int y, int z, Direction direction, out int dest, out Direction inverseDirection, out EdgeLabel edgeLabel)
Parameters
Returns
|
Edit this page
View Source
TryMove(int, int, int, Direction, out int, out int, out int)
Given a co-ordinate and a direction, gives the co-ordinate that is one step in that direction,
if it exists and is not masked out. Otherwise, it returns false.
Declaration
public bool TryMove(int x, int y, int z, Direction direction, out int destx, out int desty, out int destz)
Parameters
Returns
|
Edit this page
View Source
WithMask(bool[])
Declaration
public GraphTopology WithMask(bool[] mask)
Parameters
Type |
Name |
Description |
bool[] |
mask |
|
Returns
Implements
Extension Methods