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-rete/src/main/java/tools/refinery/viatra/runtime/rete/index/Indexer.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-rete/src/main/java/tools/refinery/viatra/runtime/rete/index/Indexer.java')
-rw-r--r-- | subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/index/Indexer.java | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/index/Indexer.java b/subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/index/Indexer.java new file mode 100644 index 00000000..fc9d7781 --- /dev/null +++ b/subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/index/Indexer.java | |||
@@ -0,0 +1,71 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2004-2008 Gabor Bergmann and Daniel Varro | ||
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 | |||
10 | package tools.refinery.viatra.runtime.rete.index; | ||
11 | |||
12 | import java.util.Collection; | ||
13 | import java.util.Map; | ||
14 | |||
15 | import tools.refinery.viatra.runtime.matchers.tuple.Tuple; | ||
16 | import tools.refinery.viatra.runtime.matchers.tuple.TupleMask; | ||
17 | import tools.refinery.viatra.runtime.matchers.util.timeline.Timeline; | ||
18 | import tools.refinery.viatra.runtime.rete.network.Node; | ||
19 | import tools.refinery.viatra.runtime.rete.network.Supplier; | ||
20 | import tools.refinery.viatra.runtime.rete.network.communication.Timestamp; | ||
21 | |||
22 | /** | ||
23 | * A node that indexes incoming Tuples by their signatures as specified by a TupleMask. Notifies listeners about such | ||
24 | * update events through the IndexerListener. | ||
25 | * | ||
26 | * Signature tuples are created by transforming the update tuples using the mask. Tuples stored with the same signature | ||
27 | * are grouped together. The group or a reduction thereof is retrievable. | ||
28 | * | ||
29 | * @author Gabor Bergmann | ||
30 | */ | ||
31 | public interface Indexer extends Node { | ||
32 | /** | ||
33 | * @return the mask by which the contents are indexed. | ||
34 | */ | ||
35 | public TupleMask getMask(); | ||
36 | |||
37 | /** | ||
38 | * @return the node whose contents are indexed. | ||
39 | */ | ||
40 | public Supplier getParent(); | ||
41 | |||
42 | /** | ||
43 | * @return all stored tuples that conform to the specified signature, null if there are none such. CONTRACT: do not | ||
44 | * modify! | ||
45 | */ | ||
46 | public Collection<Tuple> get(Tuple signature); | ||
47 | |||
48 | /** | ||
49 | * @since 2.4 | ||
50 | */ | ||
51 | default public Map<Tuple, Timeline<Timestamp>> getTimeline(Tuple signature) { | ||
52 | throw new UnsupportedOperationException(); | ||
53 | } | ||
54 | |||
55 | /** | ||
56 | * This indexer will be updated whenever a Rete update is sent to the active node (or an equivalent time slot | ||
57 | * allotted to it). The active node is typically the indexer itself, but it can be a different node such as its | ||
58 | * parent. | ||
59 | * | ||
60 | * @return the active node that operates this indexer | ||
61 | */ | ||
62 | public Node getActiveNode(); | ||
63 | |||
64 | |||
65 | public Collection<IndexerListener> getListeners(); | ||
66 | |||
67 | public void attachListener(IndexerListener listener); | ||
68 | |||
69 | public void detachListener(IndexerListener listener); | ||
70 | |||
71 | } | ||