Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "VIATRA/DSE/UserGuide/Strategy"

< VIATRA‎ | DSE
(Using the Strategy class)
m (Nasz013.gmail.com moved page VIATRA2/DSE/UserGuide/Strategy to VIATRA/DSE/UserGuide/Strategy over redirect: Migrate to VIATRA namespace)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Using the Strategy class =
+
= Exploration strategies =
 
+
In this section the components of the '''Strategy''' class are explained including the following four interfaces and its built in implementataions:
+
* ICheckConstraints
+
* ICheckGoalState
+
* ISolutionFound
+
* INextTransition
+
 
+
Its only responsibility is the call delegation to the four interfaces. Implementation of these interfaces can be set via simple set methods. The only exception is the '''INextTransition''' interface which is a required parameter in the constructor.
+
 
+
== ICheckConstraints ==
+
 
+
This interface has only one method and it is responsible for deciding whether the current state satisfies the global constraints returning true if the answer is yes:
+
 
+
<source lang="java">
+
boolean checkConstraints(ThreadContext context);
+
</source>
+
 
+
This method called every time a new state is traversed and if it returns false the current state will be marked as "shouldn't explore further" for the traversal strategy. Default implementation of this interface is the '''CheckAllConstraints''' class, which simply checks all the given constraints and return false if at least one constraint is failed to be satisfied.
+
 
+
Override this implementation if the "AND" logic between the constraints is not suitable or a global constraint cannot be defined using IncQuery.
+
 
+
== ICheckGoalState ==
+
 
+
Implementation of this interface is responsible for determining if the current state is a potential goal state. It declares the next method:
+
 
+
<source lang="java">
+
Map<String, Double> isGoalState(ThreadContext context);
+
</source>
+
 
+
 
+
This method is called every time a new state is traversed. Returning anything but null makes the engine to mark the state as a goal state. Default implementation ('''CheckAllGoals''') checks all the given goal patterns and returns an empty map if all of them is satisfied.
+
 
+
Descend this interface if the "AND" logic between the goals is not suitable, a goal cannot be defined using IncQuery, or measurements between goal states is necessary. In the last case return a map filled with the measurements and also override the implementation of the [[VIATRA/DSE/UserGuide/SolutionStore|SolutionStore]] to compare the goal states and store only the best ones.
+
 
+
== ISolutionFound ==
+
 
+
 
+
 
+
== INextTransition ==
+

Latest revision as of 06:23, 9 February 2015

Exploration strategies

Back to the top