Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3991


Ignore:
Timestamp:
06/30/10 15:54:47 (14 years ago)
Author:
svonolfe
Message:

Fixed small issues in the VRP implementation (#1039)

Location:
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Creators/AlbaPermutationCreator.cs

    r3938 r3991  
    5252      Parameters.Add(new ValueLookupParameter<IPermutationCreator>("PermutationCreatorParameter", "The permutation creator.", new RandomPermutationCreator()));
    5353
     54      Initialize();
    5455      ParameterizeSolutionCreator();
    55 
    56       Initialize();
    5756    }
    5857
     
    7574    void CitiesParameter_ValueChanged(object sender, EventArgs e) {
    7675      CitiesParameter.Value.ValueChanged += new EventHandler(CitiesValue_ValueChanged);
    77      
    7876      ParameterizeSolutionCreator();
    7977    }
     
    8482
    8583    private void ParameterizeSolutionCreator() {
    86       PermutationCreatorParameter.Value.LengthParameter.Value = CitiesParameter.Value;
    8784      PermutationCreatorParameter.Value.PermutationTypeParameter.Value = new PermutationType(PermutationTypes.RelativeUndirected);
    8885    }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs

    r3947 r3991  
    8484      Permutation permutation = VRPSolutionParameter.ActualValue as Permutation;
    8585      string moveName = TranslocationMoveGeneratorParameter.ActualValue.TranslocationMoveParameter.Name;
     86      int cities = VRPSolutionParameter.ActualValue.Cities;
    8687
    8788      List<Scope> toBeDeleted = new List<Scope>();
     
    9495            if(move.Index1 - 1 >= 0 &&
    9596              move.Index3 -1 >= 0)
    96               criteria1 = (permutation[move.Index1] >= 100 &&
    97                 permutation[move.Index1 - 1] >= 100 &&
    98                 permutation[move.Index3 - 1] >= 100);
     97              criteria1 = (permutation[move.Index1] >= cities &&
     98                permutation[move.Index1 - 1] >= cities &&
     99                permutation[move.Index3 - 1] >= cities);
    99100
    100101            int index3 = move.Index3 + (move.Index2 - move.Index1) + 1;
     
    102103            if (move.Index2 + 1 < permutation.Length &&
    103104              index3 < permutation.Length)
    104               criteria2 = (permutation[move.Index2] >= 100 &&
    105                 permutation[move.Index2 + 1] >= 100 &&
    106                 permutation[index3] >= 100);
     105              criteria2 = (permutation[move.Index2] >= cities &&
     106                permutation[move.Index2 + 1] >= cities &&
     107                permutation[index3] >= cities);
    107108
    108109            if(criteria1 && criteria2)
Note: See TracChangeset for help on using the changeset viewer.