/******************************************************************************* * Copyright (c) 2010-2014, Marton Bur, Akos Horvath, Zoltan Ujhelyi, Istvan Rath and Daniel Varro * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at * http://www.eclipse.org/legal/epl-v20.html. * * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package tools.refinery.viatra.runtime.localsearch.matcher; import java.util.Optional; import tools.refinery.viatra.runtime.localsearch.ExecutionLoggerAdapter; import tools.refinery.viatra.runtime.localsearch.MatchingFrame; import tools.refinery.viatra.runtime.localsearch.operations.ISearchOperation; import tools.refinery.viatra.runtime.localsearch.plan.SearchPlan; import tools.refinery.viatra.runtime.localsearch.profiler.LocalSearchProfilerAdapter; /** * A local search adapter allows external code to follow the internal executions of the local search matcher. Possible * implementations of the interface include profilers and debuggers. *
* EXPERIMENTAL. A few shortcomings have been found for this interface late during the development * lifecycle of version 2.0 whose solution might need breaking possible future implementors. Because of this, right now * it is not recommended to provide implementations outside of VIATRA. If necessary, have a look at the built-in * adapters that should fulfill most cases in the meantime. See bugs https://bugs.eclipse.org/bugs/show_bug.cgi?id=535101 * and https://bugs.eclipse.org/bugs/show_bug.cgi?id=535102 for details. * * @author Marton Bur * @see ExecutionLoggerAdapter * @see LocalSearchProfilerAdapter * */ public interface ILocalSearchAdapter { /** * * @since 1.2 */ default void adapterRegistered(ILocalSearchAdaptable adaptable) {}; /** * * @since 1.2 */ default void adapterUnregistered(ILocalSearchAdaptable adaptable) {}; /** * Callback method to indicate the start of a matching process * * @param lsMatcher the local search matcher that starts the matching */ default void patternMatchingStarted(LocalSearchMatcher lsMatcher) {}; /** * Callback method to indicate the end of a matching process *
* WARNING: It is not guaranteed that this method will be called; * it is possible that a match process will end after a match is found and no other matches are accessed. * * @param lsMatcher the local search matcher that finished * @since 2.0 */ default void noMoreMatchesAvailable(LocalSearchMatcher lsMatcher) {}; /** * Callback method to indicate switching to a new plan during the execution of a pattern matching * * @param oldPlan the plan that is finished. Value is null when the first plan is starting. * @param newPlan the plan that will begin execution * @since 2.0 */ default void planChanged(Optional