Show / Hide Table of Contents

Class STSProblem

The default STSP profile definition.

Inheritance
System.Object
STSProblem
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public sealed class STSProblem

Constructors

STSProblem(Int32, Int32, Single[][], Single, Single)

Creates a new TSP, 'closed' when first equals last.

Declaration
public STSProblem(int first, int last, float[][] weights, float turnPenalty, float max)
Parameters
System.Int32 first

System.Int32 last

System.Single[][] weights

System.Single turnPenalty

System.Single max

STSProblem(Int32, Single[][], Single, Single)

Creates a new TSP 'open' TSP with only a start customer.

Declaration
public STSProblem(int first, float[][] weights, float turnPenalty, float max)
Parameters
System.Int32 first

System.Single[][] weights

System.Single turnPenalty

System.Single max

Properties

First

Gets the first customer.

Declaration
public int First { get; set; }
Property Value
System.Int32

Last

Gets the last customer if the problem is closed.

Declaration
public int ? Last { get; set; }
Property Value
System.Nullable<System.Int32>

Max

Gets or sets the maximum weight.

Declaration
public float Max { get; set; }
Property Value
System.Single

TurnPenalties

Gets or sets the turn penalties per type of turn. 0: forward, forward. 1: forward, backward. 2: backward, forward. 3: backward, backward.

Declaration
public float[] TurnPenalties { get; set; }
Property Value
System.Single[]

Weights

Gets the weights.

Declaration
public float[][] Weights { get; set; }
Property Value
System.Single[][]

Methods

CreateEmptyTour()

Creates an initial empty tour, add fixed first and/or last customer.

Declaration
public Tour CreateEmptyTour()
Returns
Tour

GetNearestNeighboursBackward(Single, Int32)

Generate the nearest neighbour list.

Declaration
public SortedNearestNeighbours GetNearestNeighboursBackward(float weight, int id)
Parameters
System.Single weight

System.Int32 id

Returns
SortedNearestNeighbours

GetNearestNeighboursForward(Single, Int32)

Generate the nearest neighbour list.

Declaration
public SortedNearestNeighbours GetNearestNeighboursForward(float weight, int id)
Parameters
System.Single weight

System.Int32 id

Returns
SortedNearestNeighbours

GetNNearestNeighboursBackward(Int32, Int32)

Generate the nearest neighbour list.

Declaration
public NearestNeighbours GetNNearestNeighboursBackward(int n, int id)
Parameters
System.Int32 n

System.Int32 id

Returns
NearestNeighbours

GetNNearestNeighboursForward(Int32, Int32)

Generate the nearest neighbour list.

Declaration
public NearestNeighbours GetNNearestNeighboursForward(int n, int id)
Parameters
System.Int32 n

System.Int32 id

Returns
NearestNeighbours

Solve()

Solves this TSP using a default solver.

Declaration
public Tour Solve()
Returns
Tour

Solve(ISolver<Single, STSProblem, STSPObjective, Tour, STSPFitness>)

Solvers this problem using the given solver.

Declaration
public Tour Solve(ISolver<float, STSProblem, STSPObjective, Tour, STSPFitness> solver)
Parameters
ISolver<System.Single, STSProblem, STSPObjective, Tour, STSPFitness> solver

Returns
Tour

Back to top Built by Itinero, MIT licensed.