Exemple #1
0
 /// <summary>Checks whether this plan is structurally equivalent to the other plan (have exactly the same driving steps).</summary>
 /// <param name="otherPlan">The other plan to compare this plan against.</param>
 /// <returns><c>true</c> if the plans are structurally equivalent; <c>false</c> otherwise.</returns>
 public bool StructurallyEquals(DrivingPlan otherPlan) {
    if (otherPlan == null || otherPlan.Steps.Count != Steps.Count) return false;
    for (var i = 0; i < Steps.Count; i++) {
       if (!Steps[i].TargetEquals(otherPlan.Steps[i])) return false;
    }
    return true;
 }
Exemple #2
0
 /// <summary>Returns a trimmed copy of this driving plan without any computed navigation or energy data.</summary>
 /// <returns>The trimmed copy of this driving plan.</returns>
 public DrivingPlan Prune() {
    var clone = new DrivingPlan();
    foreach (var step in Steps) {
       clone.Steps.Add(step.Prune());
    }
    return clone;
 }
Exemple #3
0
 /// <summary>Creates a new <see cref="Destination"/> instance from the given driving plan.</summary>
 public Destination(DrivingPlan plan) {
    foreach (var step in plan.Steps) {
       Steps.Add(new DestinationStep(step));
    }
 }