diff options
author | Kristóf Marussy <marussy@mit.bme.hu> | 2023-09-14 19:29:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-14 19:29:36 +0200 |
commit | 98ed3b6db5f4e51961a161050cc31c66015116e8 (patch) | |
tree | 8bfd6d9bc8d6ed23b9eb0f889dd40b6c24fe8f92 /subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/integration/LocalSearchHintOptions.java | |
parent | Merge pull request #38 from nagilooh/design-space-exploration (diff) | |
parent | Merge remote-tracking branch 'upstream/main' into partial-interpretation (diff) | |
download | refinery-98ed3b6db5f4e51961a161050cc31c66015116e8.tar.gz refinery-98ed3b6db5f4e51961a161050cc31c66015116e8.tar.zst refinery-98ed3b6db5f4e51961a161050cc31c66015116e8.zip |
Merge pull request #39 from kris7t/partial-interpretation
Implement partial interpretation based model generation
Diffstat (limited to 'subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/integration/LocalSearchHintOptions.java')
-rw-r--r-- | subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/integration/LocalSearchHintOptions.java | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/integration/LocalSearchHintOptions.java b/subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/integration/LocalSearchHintOptions.java new file mode 100644 index 00000000..43462204 --- /dev/null +++ b/subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/integration/LocalSearchHintOptions.java | |||
@@ -0,0 +1,70 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010-2016, Gabor Bergmann, IncQueryLabs Ltd. | ||
3 | * This program and the accompanying materials are made available under the | ||
4 | * terms of the Eclipse Public License v. 2.0 which is available at | ||
5 | * http://www.eclipse.org/legal/epl-v20.html. | ||
6 | * | ||
7 | * SPDX-License-Identifier: EPL-2.0 | ||
8 | *******************************************************************************/ | ||
9 | package tools.refinery.viatra.runtime.localsearch.matcher.integration; | ||
10 | |||
11 | import tools.refinery.viatra.runtime.localsearch.planner.cost.ICostFunction; | ||
12 | import tools.refinery.viatra.runtime.localsearch.planner.cost.impl.IndexerBasedConstraintCostFunction; | ||
13 | import tools.refinery.viatra.runtime.matchers.backend.ICallDelegationStrategy; | ||
14 | import tools.refinery.viatra.runtime.matchers.backend.QueryHintOption; | ||
15 | import tools.refinery.viatra.runtime.matchers.psystem.rewriters.IFlattenCallPredicate; | ||
16 | |||
17 | /** | ||
18 | * | ||
19 | * @author Gabor Bergmann | ||
20 | * @since 1.5 | ||
21 | * @noinstantiate This class is not intended to be instantiated by clients. | ||
22 | */ | ||
23 | public final class LocalSearchHintOptions { | ||
24 | |||
25 | private LocalSearchHintOptions() { | ||
26 | // Private constructor for utility class | ||
27 | } | ||
28 | |||
29 | public static final QueryHintOption<Boolean> USE_BASE_INDEX = | ||
30 | hintOption("USE_BASE_INDEX", true); | ||
31 | |||
32 | // This key can be used to influence the core planner algorithm | ||
33 | public static final QueryHintOption<Integer> PLANNER_TABLE_ROW_COUNT = | ||
34 | hintOption("PLANNER_TABLE_ROW_COUNT", 4); | ||
35 | /** | ||
36 | * Cost function to be used by the planner. Must implement {@link ICostFunction} | ||
37 | * @since 1.4 | ||
38 | */ | ||
39 | public static final QueryHintOption<ICostFunction> PLANNER_COST_FUNCTION = | ||
40 | hintOption("PLANNER_COST_FUNCTION", new IndexerBasedConstraintCostFunction()); | ||
41 | /** | ||
42 | * Predicate to decide whether to flatten specific positive pattern calls {@link IFlattenCallPredicate} | ||
43 | * @since 1.4 | ||
44 | */ | ||
45 | public static final QueryHintOption<IFlattenCallPredicate> FLATTEN_CALL_PREDICATE = | ||
46 | hintOption("FLATTEN_CALL_PREDICATE", new DontFlattenDisjunctive()); | ||
47 | /** | ||
48 | * Strategy to decide how hints (most importantly, backend selection) propagate across pattern calls. | ||
49 | * Must implement {@link ICallDelegationStrategy}. | ||
50 | * @since 2.1 | ||
51 | */ | ||
52 | public static final QueryHintOption<ICallDelegationStrategy> CALL_DELEGATION_STRATEGY = | ||
53 | hintOption("CALL_DELEGATION_STRATEGY", ICallDelegationStrategy.FULL_BACKEND_ADHESION); | ||
54 | |||
55 | /** | ||
56 | * A provider of expected adornments {@link IAdornmentProvider}. | ||
57 | * | ||
58 | * The safe default is {@link AllValidAdornments}; | ||
59 | * however, the generic backend variant may safely use {@link LazyPlanningAdornments} instead. | ||
60 | * | ||
61 | * @since 1.5 | ||
62 | */ | ||
63 | public static final QueryHintOption<IAdornmentProvider> ADORNMENT_PROVIDER = | ||
64 | hintOption("ADORNMENT_PROVIDER", new AllValidAdornments()); | ||
65 | |||
66 | // internal helper for conciseness | ||
67 | private static <T, V extends T> QueryHintOption<T> hintOption(String hintKeyLocalName, V defaultValue) { | ||
68 | return new QueryHintOption<>(LocalSearchHintOptions.class, hintKeyLocalName, defaultValue); | ||
69 | } | ||
70 | } | ||