diff options
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftCost.java')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftCost.java | 209 |
1 files changed, 0 insertions, 209 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftCost.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftCost.java deleted file mode 100644 index ca71cdd8..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftCost.java +++ /dev/null | |||
@@ -1,209 +0,0 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SpacecraftOfKind; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AdditionalCommSubsystemCost; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.BasePrice; | ||
9 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.InterferometryPayloadCost; | ||
10 | import java.util.Arrays; | ||
11 | import java.util.LinkedHashSet; | ||
12 | import java.util.List; | ||
13 | import java.util.Set; | ||
14 | import org.eclipse.emf.ecore.EClass; | ||
15 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
16 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
17 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
18 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
36 | |||
37 | /** | ||
38 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
39 | * | ||
40 | * <p>Original source: | ||
41 | * <code><pre> | ||
42 | * private pattern spacecraftCost(Mission : InterferometryMission, Spacecraft : Spacecraft, Cost : java Double) { | ||
43 | * ConstellationMission.spacecraft(Mission, Spacecraft); | ||
44 | * find spacecraftOfKind(Spacecraft, Kind); | ||
45 | * KindCount == count find spacecraftOfKind(_, Kind); | ||
46 | * find basePrice(Spacecraft, BasePrice); | ||
47 | * find interferometryPayloadCost(Spacecraft, InterferometryPayloadCost); | ||
48 | * find additionalCommSubsystemCost(Spacecraft, AdditionalCommSubsystemCost); | ||
49 | * Cost == eval(BasePrice Math.pow(KindCount, -0.25) + InterferometryPayloadCost + AdditionalCommSubsystemCost); | ||
50 | * } | ||
51 | * </pre></code> | ||
52 | * | ||
53 | * @see GenericPatternMatcher | ||
54 | * @see GenericPatternMatch | ||
55 | * | ||
56 | */ | ||
57 | @SuppressWarnings("all") | ||
58 | public final class SpacecraftCost extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
59 | private SpacecraftCost() { | ||
60 | super(GeneratedPQuery.INSTANCE); | ||
61 | } | ||
62 | |||
63 | /** | ||
64 | * @return the singleton instance of the query specification | ||
65 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
66 | * | ||
67 | */ | ||
68 | public static SpacecraftCost instance() { | ||
69 | try{ | ||
70 | return LazyHolder.INSTANCE; | ||
71 | } catch (ExceptionInInitializerError err) { | ||
72 | throw processInitializerError(err); | ||
73 | } | ||
74 | } | ||
75 | |||
76 | /** | ||
77 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftCost (visibility: PUBLIC, simpleName: SpacecraftCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftCost, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
78 | * <b>not</b> at the class load time of the outer class, | ||
79 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftCost (visibility: PUBLIC, simpleName: SpacecraftCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftCost, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
80 | * | ||
81 | * <p> This workaround is required e.g. to support recursion. | ||
82 | * | ||
83 | */ | ||
84 | private static class LazyHolder { | ||
85 | private static final SpacecraftCost INSTANCE = new SpacecraftCost(); | ||
86 | |||
87 | /** | ||
88 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
89 | * This initialization order is required to support indirect recursion. | ||
90 | * | ||
91 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
92 | * | ||
93 | */ | ||
94 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
95 | |||
96 | public static Object ensureInitialized() { | ||
97 | INSTANCE.ensureInitializedInternal(); | ||
98 | return null; | ||
99 | } | ||
100 | } | ||
101 | |||
102 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
103 | private static final SpacecraftCost.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
104 | |||
105 | private final PParameter parameter_Mission = new PParameter("Mission", "satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT); | ||
106 | |||
107 | private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); | ||
108 | |||
109 | private final PParameter parameter_Cost = new PParameter("Cost", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT); | ||
110 | |||
111 | private final List<PParameter> parameters = Arrays.asList(parameter_Mission, parameter_Spacecraft, parameter_Cost); | ||
112 | |||
113 | private GeneratedPQuery() { | ||
114 | super(PVisibility.PRIVATE); | ||
115 | } | ||
116 | |||
117 | @Override | ||
118 | public String getFullyQualifiedName() { | ||
119 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftCost"; | ||
120 | } | ||
121 | |||
122 | @Override | ||
123 | public List<String> getParameterNames() { | ||
124 | return Arrays.asList("Mission","Spacecraft","Cost"); | ||
125 | } | ||
126 | |||
127 | @Override | ||
128 | public List<PParameter> getParameters() { | ||
129 | return parameters; | ||
130 | } | ||
131 | |||
132 | @Override | ||
133 | public Set<PBody> doGetContainedBodies() { | ||
134 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
135 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
136 | { | ||
137 | PBody body = new PBody(this); | ||
138 | PVariable var_Mission = body.getOrCreateVariableByName("Mission"); | ||
139 | PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft"); | ||
140 | PVariable var_Cost = body.getOrCreateVariableByName("Cost"); | ||
141 | PVariable var_Kind = body.getOrCreateVariableByName("Kind"); | ||
142 | PVariable var_KindCount = body.getOrCreateVariableByName("KindCount"); | ||
143 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
144 | PVariable var_BasePrice = body.getOrCreateVariableByName("BasePrice"); | ||
145 | PVariable var_InterferometryPayloadCost = body.getOrCreateVariableByName("InterferometryPayloadCost"); | ||
146 | PVariable var_AdditionalCommSubsystemCost = body.getOrCreateVariableByName("AdditionalCommSubsystemCost"); | ||
147 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission"))); | ||
148 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
149 | new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Double.class)); | ||
150 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
151 | new ExportedParameter(body, var_Mission, parameter_Mission), | ||
152 | new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft), | ||
153 | new ExportedParameter(body, var_Cost, parameter_Cost) | ||
154 | )); | ||
155 | // ConstellationMission.spacecraft(Mission, Spacecraft) | ||
156 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "ConstellationMission"))); | ||
157 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
158 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "ConstellationMission", "spacecraft"))); | ||
159 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
160 | new Equality(body, var__virtual_0_, var_Spacecraft); | ||
161 | // find spacecraftOfKind(Spacecraft, Kind) | ||
162 | new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_Kind), SpacecraftOfKind.instance().getInternalQueryRepresentation()); | ||
163 | // KindCount == count find spacecraftOfKind(_, Kind) | ||
164 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
165 | new PatternMatchCounter(body, Tuples.flatTupleOf(var___0_, var_Kind), SpacecraftOfKind.instance().getInternalQueryRepresentation(), var__virtual_1_); | ||
166 | new Equality(body, var_KindCount, var__virtual_1_); | ||
167 | // find basePrice(Spacecraft, BasePrice) | ||
168 | new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_BasePrice), BasePrice.instance().getInternalQueryRepresentation()); | ||
169 | // find interferometryPayloadCost(Spacecraft, InterferometryPayloadCost) | ||
170 | new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_InterferometryPayloadCost), InterferometryPayloadCost.instance().getInternalQueryRepresentation()); | ||
171 | // find additionalCommSubsystemCost(Spacecraft, AdditionalCommSubsystemCost) | ||
172 | new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_AdditionalCommSubsystemCost), AdditionalCommSubsystemCost.instance().getInternalQueryRepresentation()); | ||
173 | // Cost == eval(BasePrice * Math.pow(KindCount, -0.25) + InterferometryPayloadCost + AdditionalCommSubsystemCost) | ||
174 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
175 | new ExpressionEvaluation(body, new IExpressionEvaluator() { | ||
176 | |||
177 | @Override | ||
178 | public String getShortDescription() { | ||
179 | return "Expression evaluation from pattern spacecraftCost"; | ||
180 | } | ||
181 | |||
182 | @Override | ||
183 | public Iterable<String> getInputParameterNames() { | ||
184 | return Arrays.asList("AdditionalCommSubsystemCost", "BasePrice", "InterferometryPayloadCost", "KindCount");} | ||
185 | |||
186 | @Override | ||
187 | public Object evaluateExpression(IValueProvider provider) throws Exception { | ||
188 | Double AdditionalCommSubsystemCost = (Double) provider.getValue("AdditionalCommSubsystemCost"); | ||
189 | Double BasePrice = (Double) provider.getValue("BasePrice"); | ||
190 | Double InterferometryPayloadCost = (Double) provider.getValue("InterferometryPayloadCost"); | ||
191 | Integer KindCount = (Integer) provider.getValue("KindCount"); | ||
192 | return evaluateExpression_1_1(AdditionalCommSubsystemCost, BasePrice, InterferometryPayloadCost, KindCount); | ||
193 | } | ||
194 | }, var__virtual_2_ ); | ||
195 | new Equality(body, var_Cost, var__virtual_2_); | ||
196 | bodies.add(body); | ||
197 | } | ||
198 | return bodies; | ||
199 | } | ||
200 | } | ||
201 | |||
202 | private static double evaluateExpression_1_1(final Double AdditionalCommSubsystemCost, final Double BasePrice, final Double InterferometryPayloadCost, final Integer KindCount) { | ||
203 | double _pow = Math.pow((KindCount).intValue(), (-0.25)); | ||
204 | double _multiply = ((BasePrice).doubleValue() * _pow); | ||
205 | double _plus = (_multiply + (InterferometryPayloadCost).doubleValue()); | ||
206 | double _plus_1 = (_plus + (AdditionalCommSubsystemCost).doubleValue()); | ||
207 | return _plus_1; | ||
208 | } | ||
209 | } | ||