Class ShiftAfter
Contains general shiftafter operations.
Inheritance
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public static class ShiftAfter
Methods
Do(Single[][], Tour, Int32, Int32, out Single)
Shifts the given customer after the given 'before' customer and returns the difference in fitness between the solution before the shift and after the shift.
Declaration
public static bool Do(float[][] weights, Tour tour, int customer, int before, out float difference)
Parameters
|
System.Single[][]
weights
|
|
Tour
tour
|
|
System.Int32
customer
|
|
System.Int32
before
|
|
System.Single
difference
|
Returns
|
System.Boolean
|
GetShiftedAfter(ITour, Int32, Int32)
Pretends to shift the given customer to a new location and places it after the given 'before' customer.
Declaration
public static ShiftedAfterTour GetShiftedAfter(this ITour tour, int customer, int before)
Parameters
|
ITour
tour
|
|
System.Int32
customer
The customer to shift. |
|
System.Int32
before
The new customer that will come right before. |
Returns
|
ShiftedAfterTour
The enumerable that represents the new route. |
Remarks
example: route: 1->2->3->4->5->6 customer: 2 before: 4
new route: 1->3->4->2->5->6
Exceptions
|
System.ArgumentException
When customer equals before. |
If(Single[][], ITour, Int32, Int32, Int32, Int32, Int32)
Returns the difference in fitness 'if' the shift-after would be executed with the given settings.
Declaration
public static float If(float[][] weights, ITour tour, int customer, int before, int oldBefore, int oldAfter, int newAfter)
Parameters
|
System.Single[][]
weights
|
|
ITour
tour
|
|
System.Int32
customer
|
|
System.Int32
before
|
|
System.Int32
oldBefore
|
|
System.Int32
oldAfter
|
|
System.Int32
newAfter
|
Returns
|
System.Single
|