From 42f48aacb86a3cc77a6f5cf01192866e5faabc5a Mon Sep 17 00:00:00 2001 From: Jochen Keil Date: Tue, 29 Jun 2010 21:31:26 +0200 Subject: [PATCH] cosmetic changes --- aco/environment/Environment.java | 29 ++--------------------------- aco/strategy/ASStrategy.java | 2 ++ 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/aco/environment/Environment.java b/aco/environment/Environment.java index 158af5a..6956119 100644 --- a/aco/environment/Environment.java +++ b/aco/environment/Environment.java @@ -27,23 +27,10 @@ public class Environment this.ed = new EnvironmentData(acom); /* add a shutdown hook to print out the last best solution */ - Runtime.getRuntime().addShutdownHook( - new EnvironmentShutdownHook(this)); + Runtime.getRuntime().addShutdownHook(new EnvironmentShutdownHook(this)); /* run the garbage collector after all the initialization is done */ System.gc(); - - /* - if (graph.hasCoordinates()) { - if (GuiSize == 0) - av = new AntView(this); - else - av = new AntView(GuiSize, this); - this.addObserver(av); - new Thread(av).start(); - } - */ - } /* d'tor */ @@ -70,7 +57,6 @@ public class Environment for (Ant ant : ants) { ant.reset(); acom.pickInitialRandomCity(ant); - //ant.pickInitialRandomCity(); } /* let each ant construct a complete tour @@ -101,15 +87,10 @@ public class Environment acom.setGlobalBestTour(i, ant.getTour(i)); } - /* - if (acom.hasCoordinates()) { - this.setChanged(); - this.notifyObservers(this); - } - */ } } + /* since we are already at it.. run the garbage collector */ System.gc(); } @@ -161,12 +142,6 @@ public class Environment return result.toString(); } - /* TODO */ - /* - public Vector getBestTours() { - } - */ - public int[] getGlobalBestTour() { return ed.getGlobalBestTour(); } diff --git a/aco/strategy/ASStrategy.java b/aco/strategy/ASStrategy.java index 2a77809..85934e1 100644 --- a/aco/strategy/ASStrategy.java +++ b/aco/strategy/ASStrategy.java @@ -22,10 +22,12 @@ public class ASStrategy if ( ant.getVisited( acom.getNearestNeighbour(CurrentCity,j) ) ) { SelectionProbability[j] = 0.0; } else { + SelectionProbability[j] = acom.getChoiceInformation( CurrentCity, acom.getNearestNeighbour(CurrentCity,j) ); SumProbabilities += SelectionProbability[j]; + } } -- 2.11.4.GIT