Class WeightMatrixAlgorithm<T>
An algorithm to calculate a weight-matrix for a set of locations.
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public class WeightMatrixAlgorithm<T> : AlgorithmBase, IWeightMatrixAlgorithm<T>, IAlgorithm where T : struct
Type Parameters
|
T
|
Constructors
WeightMatrixAlgorithm(RouterBase, IProfileInstance, WeightHandler<T>, Coordinate[])
Creates a new weight-matrix algorithm.
Declaration
public WeightMatrixAlgorithm(RouterBase router, IProfileInstance profile, WeightHandler<T> weightHandler, Coordinate[] locations)
Parameters
|
RouterBase
router
|
|
IProfileInstance
profile
|
|
WeightHandler<T>
weightHandler
|
|
Coordinate[]
locations
|
WeightMatrixAlgorithm(RouterBase, IProfileInstance, WeightHandler<T>, IMassResolvingAlgorithm)
Creates a new weight-matrix algorithm.
Declaration
public WeightMatrixAlgorithm(RouterBase router, IProfileInstance profile, WeightHandler<T> weightHandler, IMassResolvingAlgorithm massResolver)
Parameters
|
RouterBase
router
|
|
IProfileInstance
profile
|
|
WeightHandler<T>
weightHandler
|
|
IMassResolvingAlgorithm
massResolver
|
WeightMatrixAlgorithm(RouterBase, IProfileInstance, WeightHandler<T>, List<RouterPoint>)
Creates a new weight-matrix algorithm.
Declaration
public WeightMatrixAlgorithm(RouterBase router, IProfileInstance profile, WeightHandler<T> weightHandler, List<RouterPoint> resolvedLocations)
Parameters
|
RouterBase
router
|
|
IProfileInstance
profile
|
|
WeightHandler<T>
weightHandler
|
|
List<RouterPoint>
resolvedLocations
|
Properties
Errors
Returns the errors indexed per original routerpoint index.
Declaration
public Dictionary<int, RouterPointError> Errors { get; }
Property Value
|
Dictionary<System.Int32, RouterPointError>
|
Implements
MassResolver
Gets the mass resolver.
Declaration
public IMassResolvingAlgorithm MassResolver { get; }
Property Value
|
IMassResolvingAlgorithm
|
Implements
Profile
Gets the profile.
Declaration
public IProfileInstance Profile { get; }
Property Value
|
IProfileInstance
|
Implements
Router
RouterPoints
Gets the valid router points.
Declaration
public List<RouterPoint> RouterPoints { get; }
Property Value
|
List<RouterPoint>
|
Implements
Weights
Gets the weights between all valid router points.
Declaration
public T[][] Weights { get; }
Property Value
|
T[][]
|
Implements
Methods
CorrectedIndexOf(Int32)
Returns the corrected index, or the index in the weight matrix for the given routerpoint index.
Declaration
public int CorrectedIndexOf(int resolvedIdx)
Parameters
|
System.Int32
resolvedIdx
The index of the resolved point. |
Returns
|
System.Int32
The index in the weight matrix, -1 if this point is in error. |
Implements
DoRun(CancellationToken)
Executes the algorithm.
Declaration
protected override sealed void DoRun(CancellationToken cancellationToken)
Parameters
|
CancellationToken
cancellationToken
|
Overrides
OriginalIndexOf(Int32)
Returns the routerpoint index that represents the given weight in the weight matrix.
Declaration
public int OriginalIndexOf(int weightIdx)
Parameters
|
System.Int32
weightIdx
The index in the weight matrix. |
Returns
|
System.Int32
The routerpoint index, always exists and always returns a proper value. |