Show / Hide Table of Contents

Class CheapestInsertionDirectedHelper

Contains extension methods to help with cheapest insertion in a context with directed weights.

Inheritance
System.Object
CheapestInsertionDirectedHelper
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 static class CheapestInsertionDirectedHelper

Methods

CalculateCheapestInsert(Single[][], Single[], Int32, Int32, Int32, Boolean, Boolean, out Int32, out Int32, out Int32)

Gets the minimum weight from customer1 -> customer3 while inserting customer2 and the best direction and turns to use.

Declaration
public static float CalculateCheapestInsert(this float[][] weights, float[] penalties, int directedId1, int id2, int directedId3, bool includeTurn1, bool includeTurn3, out int departureOffset1, out int arrivalOffset3, out int turn2)
Parameters
System.Single[][] weights

System.Single[] penalties

System.Int32 directedId1

System.Int32 id2

System.Int32 directedId3

System.Boolean includeTurn1

System.Boolean includeTurn3

System.Int32 departureOffset1

System.Int32 arrivalOffset3

System.Int32 turn2

Returns
System.Single

CalculateCheapestInsert(Weight[][], Weight[], ProfileMetric, Int32, Int32, Int32, Boolean, Boolean, out Int32, out Int32, out Int32)

Gets the minimum weight from customer1 -> customer3 while inserting customer2 and the best direction and turns to use.

Declaration
public static Weight CalculateCheapestInsert(this Weight[][] weights, Weight[] penalties, ProfileMetric metric, int directedId1, int id2, int directedId3, bool includeTurn1, bool includeTurn3, out int departureOffset1, out int arrivalOffset3, out int turn2)
Parameters
Weight[][] weights

Weight[] penalties

ProfileMetric metric

System.Int32 directedId1

System.Int32 id2

System.Int32 directedId3

System.Boolean includeTurn1

System.Boolean includeTurn3

System.Int32 departureOffset1

System.Int32 arrivalOffset3

System.Int32 turn2

Returns
Weight

GetForMetric(Weight, ProfileMetric)

Gets the weight for the given metric.

Declaration
public static float GetForMetric(this Weight weight, ProfileMetric metric)
Parameters
Weight weight

ProfileMetric metric

Returns
System.Single

InsertCheapestDirected(Tour, Single[][], Single[], Int32, Single)

Inserts the given customer at the best location if possible.

Declaration
public static float InsertCheapestDirected(this Tour tour, float[][] weights, float[] turnPenalties, int customer, float max = 3.40282347E+38F)
Parameters
Tour tour

The tour to insert into.

System.Single[][] weights

The directed weights.

System.Single[] turnPenalties

The turn pentalties.

System.Int32 customer

The customer to insert.

System.Single max

The maximum allowed cost of the insertion.

Returns
System.Single

InsertCheapestDirected(Tour, Weight[][], Weight[], ProfileMetric, Int32, Weight)

Inserts the given customer at the best location if possible.

Declaration
public static Weight InsertCheapestDirected(this Tour tour, Weight[][] weights, Weight[] turnPenalties, ProfileMetric metric, int customer, Weight max)
Parameters
Tour tour

The tour to insert into.

Weight[][] weights

The directed weights.

Weight[] turnPenalties

The turn pentalties.

ProfileMetric metric

The metric to use, time, distance or custom.

System.Int32 customer

The customer to insert.

Weight max

The maximum allowed cost of the insertion.

Returns
Weight

Back to top Built by Itinero, MIT licensed.