ai.libs.hasco.gui.statsplugin.HASCOModelStatisticsPluginController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hasco Show documentation
Show all versions of hasco Show documentation
HASCO is a framework for reducing configuration tasks (e.g. software system configuration or algorithm configuration) into an HTN planning problem. This can then in turn be reduced to a graph search problem that can be solved by any kind of standard graph search algorithm, e.g., breadth-first-search.
package ai.libs.hasco.gui.statsplugin;
import ai.libs.hasco.events.HASCOSolutionEvent;
import ai.libs.jaicore.basic.algorithm.events.serializable.PropertyProcessedAlgorithmEvent;
import ai.libs.jaicore.graphvisualizer.plugin.ASimpleMVCPluginController;
import ai.libs.jaicore.graphvisualizer.plugin.solutionperformanceplotter.ScoredSolutionCandidateInfo;
import ai.libs.jaicore.graphvisualizer.plugin.solutionperformanceplotter.ScoredSolutionCandidateInfoAlgorithmEventPropertyComputer;
/**
*
* @author fmohr
*
* The controller of the HASCOModelStatisticsPlugin
*
*/
public class HASCOModelStatisticsPluginController extends ASimpleMVCPluginController {
public HASCOModelStatisticsPluginController(HASCOModelStatisticsPluginModel model, HASCOModelStatisticsPluginView view) {
super(model, view);
}
@Override
protected void handleAlgorithmEventInternally(PropertyProcessedAlgorithmEvent algorithmEvent) {
if (algorithmEvent.correspondsToEventOfClass(HASCOSolutionEvent.class)) {
Object rawScoredSolutionCandidateInfo = algorithmEvent.getProperty(ScoredSolutionCandidateInfoAlgorithmEventPropertyComputer.SCORED_SOLUTION_CANDIDATE_INFO_PROPERTY_NAME);
if (rawScoredSolutionCandidateInfo != null) {
ScoredSolutionCandidateInfo scoredSolutionCandidateInfo = (ScoredSolutionCandidateInfo) rawScoredSolutionCandidateInfo;
getModel().addEntry(scoredSolutionCandidateInfo);
}
}
}
}