Skip to content

Commit

Permalink
Renaming / Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
gocklkatz committed Jul 19, 2024
1 parent fb891c2 commit 18c2bd2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main/java/io/gocklkatz/m12s/vrp/VehicleRoutingProblem.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public Solution solveCompleteEnumerationNoCapacityConstraintGivenTruckNumber(int

for(List<Integer> combination : combinations){

List<Route> routes = aufteilung2routes(combination);
List<Route> routes = combinationToRoutes(combination);

List<Route> tspRoutes = new ArrayList<>();
TspSolver tspSolver = new TspSolver(distanceMatrix);
Expand Down Expand Up @@ -130,17 +130,16 @@ private double evalRoute(List<Integer> stops) {
return cost;
}

private List<Route> aufteilung2routes(List<Integer> aufteilung) {
private List<Route> combinationToRoutes(List<Integer> combination) {

List<Route> routes = new ArrayList<>();

List<List<Integer>> collector = new ArrayList<>();
for(Integer xxx : aufteilung) {
collector.add(new ArrayList<>());
}

combination.forEach(s -> collector.add(new ArrayList<>()));

for(int i=0; i<collector.size(); i++){
collector.get(aufteilung.get(i)).add(i+1);
collector.get(combination.get(i)).add(i+1);
}

for (List<Integer> integers : collector) {
Expand Down

0 comments on commit 18c2bd2

Please sign in to comment.