using instrumenter on Knapsack problem
A Free and Open Source Java Framework for Multiobjective Optimization
Brought to you by:
dhadka
In the Knapsack example, when i try to use the Instrumenter to collect the GenerationalDistance after every 100 evaluations, i get this error
"no reference set available".
This works fine with predefined problems but running a customized problem such as Knapsack have this error.
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Some of the performance indicators require a reference set (the best Pareto solutions for a problem). Since the Knapsack problems does not have a reference set, you need to specify one with
instrumenter.withReferenceSet(File).If the reference set for a problem is not known, you can create an approximation by combining the Pareto sets produced from many runs. See for example the
ReferenceSetMergerclass at http://www.moeaframework.org/javadoc/org/moeaframework/util/ReferenceSetMerger.html.View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Thanks for answering but i am still not able to catch properly as i am quite new to the framework and just started, it would be really helpful if there is any kind of example available for such implementation
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Here's an example. I'll be using the 100 item, 2 knapsack instance from http://www.tik.ee.ethz.ch/sop/download/supplementary/testProblemSuite/. You'll want to download both the test data knapsack.100.2 (ftp.tik.ee.ethz.ch) and Pareto-optimal front knapsack.100.2.pareto (ftp.tik.ee.ethz.ch) for this problem and save them to the MOEAFramework-2.4/ folder.
Then, modify the
KnapsackExample.javafile in theexamples/org/moeaframework/examples/ga/knapsackfolder to contain:The two key lines are
withProblemClass(Knapsack.class, new File("knapsack.100.2"))andwithReferenceSet(new File("knapsack.100.2.pareto")). The former sets the file that describes the knapsack problem we are solving. The latter sets the reference set that is required for computing the generational distance.The output will look similar to the following:
Last edit: Anonymous 2015-04-09
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Thanks a lot sir, its was really helpful.
Glad this helped. Closing the ticket. Please open a new ticket if you have additional questions.