diff options
author | 2023-09-14 19:29:36 +0200 | |
---|---|---|
committer | 2023-09-14 19:29:36 +0200 | |
commit | 98ed3b6db5f4e51961a161050cc31c66015116e8 (patch) | |
tree | 8bfd6d9bc8d6ed23b9eb0f889dd40b6c24fe8f92 /subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/matcher/TimelyReteBackendFactory.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/matcher/TimelyReteBackendFactory.java')
-rw-r--r-- | subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/matcher/TimelyReteBackendFactory.java | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/matcher/TimelyReteBackendFactory.java b/subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/matcher/TimelyReteBackendFactory.java new file mode 100644 index 00000000..2777f169 --- /dev/null +++ b/subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/matcher/TimelyReteBackendFactory.java | |||
@@ -0,0 +1,64 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010-2019, Tamas Szabo, Istvan Rath 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 | package tools.refinery.viatra.runtime.rete.matcher; | ||
10 | |||
11 | import tools.refinery.viatra.runtime.matchers.backend.IQueryBackend; | ||
12 | import tools.refinery.viatra.runtime.matchers.context.IQueryBackendContext; | ||
13 | import tools.refinery.viatra.runtime.rete.matcher.TimelyConfiguration.AggregatorArchitecture; | ||
14 | import tools.refinery.viatra.runtime.rete.matcher.TimelyConfiguration.TimelineRepresentation; | ||
15 | |||
16 | /** | ||
17 | * A {@link ReteBackendFactory} implementation that creates {@link ReteEngine}s that use non-scattered timely | ||
18 | * evaluation. | ||
19 | * | ||
20 | * @author Tamas Szabo | ||
21 | * @since 2.4 | ||
22 | */ | ||
23 | public class TimelyReteBackendFactory extends ReteBackendFactory { | ||
24 | |||
25 | private final TimelyConfiguration configuration; | ||
26 | |||
27 | public static final TimelyReteBackendFactory FIRST_ONLY_SEQUENTIAL = new TimelyReteBackendFactory( | ||
28 | new TimelyConfiguration(TimelineRepresentation.FIRST_ONLY, AggregatorArchitecture.SEQUENTIAL)); | ||
29 | public static final TimelyReteBackendFactory FIRST_ONLY_PARALLEL = new TimelyReteBackendFactory( | ||
30 | new TimelyConfiguration(TimelineRepresentation.FIRST_ONLY, AggregatorArchitecture.PARALLEL)); | ||
31 | public static final TimelyReteBackendFactory FAITHFUL_SEQUENTIAL = new TimelyReteBackendFactory( | ||
32 | new TimelyConfiguration(TimelineRepresentation.FAITHFUL, AggregatorArchitecture.SEQUENTIAL)); | ||
33 | public static final TimelyReteBackendFactory FAITHFUL_PARALLEL = new TimelyReteBackendFactory( | ||
34 | new TimelyConfiguration(TimelineRepresentation.FAITHFUL, AggregatorArchitecture.PARALLEL)); | ||
35 | |||
36 | public TimelyReteBackendFactory(final TimelyConfiguration configuration) { | ||
37 | this.configuration = configuration; | ||
38 | } | ||
39 | |||
40 | @Override | ||
41 | public IQueryBackend create(final IQueryBackendContext context) { | ||
42 | return create(context, false, configuration); | ||
43 | } | ||
44 | |||
45 | @Override | ||
46 | public int hashCode() { | ||
47 | return TimelyReteBackendFactory.class.hashCode(); | ||
48 | } | ||
49 | |||
50 | @Override | ||
51 | public boolean equals(final Object obj) { | ||
52 | if (this == obj) { | ||
53 | return true; | ||
54 | } | ||
55 | if (obj == null) { | ||
56 | return false; | ||
57 | } | ||
58 | if (!(obj instanceof TimelyReteBackendFactory)) { | ||
59 | return false; | ||
60 | } | ||
61 | return true; | ||
62 | } | ||
63 | |||
64 | } | ||