georghinkel/ttc2017smartGrids

Benchmark framework: ModelJoin solution

Closed this issue · 2 comments

Hi, we're currently trying to understand the benchmark framework. In particular, since we want to submit an Eclipse-based solution, we try to understand how the benchmarking of the ModelJoin solution (where everything is put in a Jar file) works.

We're currently stuck with the following question: How is the solution invoked from the benchmark framework? We think that somewhere there needs to be a mapping from views to specific classes/methods from the Jar file. However, the solution.ini only mentions the views, but no specific classes or methods.

[run]
OutageDetection=java -Xmx8G -jar solution.jar -view OutageDetection
OutagePrevention=java -Xmx8G -jar solution.jar -view OutagePrevention

Hi,

the benchmark framework executes whatever is contained in the run section of the solution.ini for the respective task. That way, you could execute both tasks in entirely different executables, if you wish. The ModelJoin solution uses the same executable, namely an executable Jar file and passes the task as a parameter.

All the other execution parameters such as the change sequence that is to be run, the run index, etc. are passed through environment variables. You can simply copy the code from the ModelJoin solution to fetch them:

Map<String, String> env = System.getenv();
String changeSet = env.get("ChangeSet");
String changePath = env.get("ChangePath");
String runIndex = env.get("RunIndex");
int sequenceLength = Integer.parseInt(env.get("Sequences"));

Ah, indeed. I now see that the Jar is in fact executable (initially, I couldn't find the MainClass entry because I was looking at the wrong Manifest.MF file), and the main class contains the logic for dealing with the "view" parameter.

Thanks for the fast and helpful reply.