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/OnetimeIndexer.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/OnetimeIndexer.java')
-rw-r--r-- | subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/index/OnetimeIndexer.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/index/OnetimeIndexer.java b/subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/index/OnetimeIndexer.java new file mode 100644 index 00000000..fef84bb1 --- /dev/null +++ b/subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/index/OnetimeIndexer.java | |||
@@ -0,0 +1,47 @@ | |||
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 | |||
14 | import tools.refinery.viatra.runtime.matchers.tuple.Tuple; | ||
15 | import tools.refinery.viatra.runtime.matchers.tuple.TupleMask; | ||
16 | import tools.refinery.viatra.runtime.rete.network.ReteContainer; | ||
17 | import tools.refinery.viatra.runtime.rete.network.Supplier; | ||
18 | |||
19 | /** | ||
20 | * @author Gabor Bergmann Indexer whose lifetime last until the first get() DO NOT connect to nodes! | ||
21 | */ | ||
22 | public class OnetimeIndexer extends GenericProjectionIndexer { | ||
23 | |||
24 | public OnetimeIndexer(ReteContainer reteContainer, TupleMask mask) { | ||
25 | super(reteContainer, mask); | ||
26 | } | ||
27 | |||
28 | @Override | ||
29 | public Collection<Tuple> get(Tuple signature) { | ||
30 | if (tools.refinery.viatra.runtime.rete.util.Options.releaseOnetimeIndexers) { | ||
31 | reteContainer.unregisterClearable(memory); | ||
32 | reteContainer.unregisterNode(this); | ||
33 | } | ||
34 | return super.get(signature); | ||
35 | } | ||
36 | |||
37 | @Override | ||
38 | public void appendParent(Supplier supplier) { | ||
39 | throw new UnsupportedOperationException("onetime indexer cannot have parents"); | ||
40 | } | ||
41 | |||
42 | @Override | ||
43 | public void attachListener(IndexerListener listener) { | ||
44 | throw new UnsupportedOperationException("onetime indexer cannot have listeners"); | ||
45 | } | ||
46 | |||
47 | } | ||