SolutionInsertJobPart Method

Inserts a JobPart into a Resource's route directly after the node indicated by the position parameter. The position parameter starts at zero. This means the first node in the route (the Resource's starting location) is position zero. This will insert the JobParts even if it results in an infeasible solution.

Definition

Namespace: VRSolver
Assembly: VRSolver (in VRSolver.dll) Version: 1.15.0+d867f7e856f281547f683ef6449a86e433a2356d
C#
public bool InsertJobPart(
	Resource resource,
	JobPart jobPart,
	int position
)

Parameters

resource  Resource
The Resource to assign the JobPart to.
jobPart  JobPart
The JobPart to be inserted.
position  Int32
The position to insert the JobPart directly after (the first position i.e. the locations starting point is position zero).

Return Value

Boolean
False if the insertion could not be completed. True otherwise.

Exceptions

ArgumentNullExceptionResource is null.
ArgumentNullExceptionJobPart is null.
ArgumentExceptionResource does not exist in the Problem.
ArgumentExceptionPosition in not valid for Resource's route.
ArgumentExceptionJobPart cannot be inserted after the Resource's end location.

See Also