Download MooN developer manual
Transcript
3 EXTENDING MOON
17
The logging is usually done after each generation was computed. It might
be convenient to delegate this task to a separate method. The output handler
stores the logging intervals. The heuristic calls isLogIteration(int,String) to
determine if the particular category is to log in the current generation. If this is the
case, the output handler receives the category name and related log information.
private void doTheLogging() throws LoggingException {
if (myOutputHandler.isLogIteration(currentGeneration,
SPECIAL_CATEGORY)){
myOutputHandler.write(SPECIAL_CATEGORY,
"<The special informations>");
}
...
}
3.1.3
Problem Plug-Ins
The problem plug-in has only one special method. It is called by heuristics, which
receive fitness values for their produced solutions:
public FitnessValue getFitness(Solution aSolution)
throws ProblemException;
3.1.4
Exit Condition Plug-Ins
The exit condition plug-in is used by the runtime to determine when a single run
needs to terminate its execution. Via the method mustTerminate() the exit condition receives a heuristic object which is examined to decide if the exit condition
is met.
boolean mustTerminate(Heuristic heuristic)
throws ExitConditionException;
3.2
The plugin.properties File
In order to use a plug-in one has to provide additional information next to the plugin’s code. The file where this information is stored is called plugin.properties.
It has to reside in the main-folder of the plug-in and provide a required set of
plug-in details.
MooN
Developers Manual