aboutsummaryrefslogtreecommitdiffstats
path: root/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java
diff options
context:
space:
mode:
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java')
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java591
1 files changed, 0 insertions, 591 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java
deleted file mode 100644
index 0fe520c2..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java
+++ /dev/null
@@ -1,591 +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 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf;
7import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork;
8import java.util.Arrays;
9import java.util.Collection;
10import java.util.LinkedHashSet;
11import java.util.List;
12import java.util.Objects;
13import java.util.Optional;
14import java.util.Set;
15import java.util.function.Consumer;
16import java.util.stream.Collectors;
17import java.util.stream.Stream;
18import org.apache.log4j.Logger;
19import org.eclipse.emf.ecore.EClass;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
25import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
26import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
27import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
29import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
32import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
33import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference;
34import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
36import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
37import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
38import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
39import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
40import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
41import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
42import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
43import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
44import satellite.CubeSat3U;
45
46/**
47 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
48 *
49 * <p>Original source:
50 * <code><pre>
51 * // 3U CubeSats are assumed to only be able to downlink to Earth using an X-band trasmitter,
52 * // but cross-link using UHF
53 *
54 * {@literal @}Constraint(severity = "error", key = {Sat},
55 * message = "3U CubeSats can only cross-link using UHF.")
56 * pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) {
57 * CommunicatingElement.commSubsystem(Sat, SourceComm);
58 * neg find commSubsystemBandUhf(SourceComm);
59 * CommSubsystem.target(SourceComm, TargetComm);
60 * CommunicatingElement.commSubsystem(Target, TargetComm);
61 * neg find groundStationNetwork(Target);
62 * }
63 * </pre></code>
64 *
65 * @see Matcher
66 * @see Match
67 *
68 */
69@SuppressWarnings("all")
70public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuerySpecification<ThreeUCubeSatWithNonUhfCrossLink.Matcher> {
71 /**
72 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.threeUCubeSatWithNonUhfCrossLink pattern,
73 * to be used in conjunction with {@link Matcher}.
74 *
75 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
76 * Each instance is a (possibly partial) substitution of pattern parameters,
77 * usable to represent a match of the pattern in the result of a query,
78 * or to specify the bound (fixed) input parameters when issuing a query.
79 *
80 * @see Matcher
81 *
82 */
83 public static abstract class Match extends BasePatternMatch {
84 private CubeSat3U fSat;
85
86 private static List<String> parameterNames = makeImmutableList("Sat");
87
88 private Match(final CubeSat3U pSat) {
89 this.fSat = pSat;
90 }
91
92 @Override
93 public Object get(final String parameterName) {
94 if ("Sat".equals(parameterName)) return this.fSat;
95 return null;
96 }
97
98 public CubeSat3U getSat() {
99 return this.fSat;
100 }
101
102 @Override
103 public boolean set(final String parameterName, final Object newValue) {
104 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
105 if ("Sat".equals(parameterName) ) {
106 this.fSat = (CubeSat3U) newValue;
107 return true;
108 }
109 return false;
110 }
111
112 public void setSat(final CubeSat3U pSat) {
113 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
114 this.fSat = pSat;
115 }
116
117 @Override
118 public String patternName() {
119 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.threeUCubeSatWithNonUhfCrossLink";
120 }
121
122 @Override
123 public List<String> parameterNames() {
124 return ThreeUCubeSatWithNonUhfCrossLink.Match.parameterNames;
125 }
126
127 @Override
128 public Object[] toArray() {
129 return new Object[]{fSat};
130 }
131
132 @Override
133 public ThreeUCubeSatWithNonUhfCrossLink.Match toImmutable() {
134 return isMutable() ? newMatch(fSat) : this;
135 }
136
137 @Override
138 public String prettyPrint() {
139 StringBuilder result = new StringBuilder();
140 result.append("\"Sat\"=" + prettyPrintValue(fSat));
141 return result.toString();
142 }
143
144 @Override
145 public int hashCode() {
146 return Objects.hash(fSat);
147 }
148
149 @Override
150 public boolean equals(final Object obj) {
151 if (this == obj)
152 return true;
153 if (obj == null) {
154 return false;
155 }
156 if ((obj instanceof ThreeUCubeSatWithNonUhfCrossLink.Match)) {
157 ThreeUCubeSatWithNonUhfCrossLink.Match other = (ThreeUCubeSatWithNonUhfCrossLink.Match) obj;
158 return Objects.equals(fSat, other.fSat);
159 } else {
160 // this should be infrequent
161 if (!(obj instanceof IPatternMatch)) {
162 return false;
163 }
164 IPatternMatch otherSig = (IPatternMatch) obj;
165 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
166 }
167 }
168
169 @Override
170 public ThreeUCubeSatWithNonUhfCrossLink specification() {
171 return ThreeUCubeSatWithNonUhfCrossLink.instance();
172 }
173
174 /**
175 * Returns an empty, mutable match.
176 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
177 *
178 * @return the empty match.
179 *
180 */
181 public static ThreeUCubeSatWithNonUhfCrossLink.Match newEmptyMatch() {
182 return new Mutable(null);
183 }
184
185 /**
186 * Returns a mutable (partial) match.
187 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
188 *
189 * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
190 * @return the new, mutable (partial) match object.
191 *
192 */
193 public static ThreeUCubeSatWithNonUhfCrossLink.Match newMutableMatch(final CubeSat3U pSat) {
194 return new Mutable(pSat);
195 }
196
197 /**
198 * Returns a new (partial) match.
199 * This can be used e.g. to call the matcher with a partial match.
200 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
201 * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
202 * @return the (partial) match object.
203 *
204 */
205 public static ThreeUCubeSatWithNonUhfCrossLink.Match newMatch(final CubeSat3U pSat) {
206 return new Immutable(pSat);
207 }
208
209 private static final class Mutable extends ThreeUCubeSatWithNonUhfCrossLink.Match {
210 Mutable(final CubeSat3U pSat) {
211 super(pSat);
212 }
213
214 @Override
215 public boolean isMutable() {
216 return true;
217 }
218 }
219
220 private static final class Immutable extends ThreeUCubeSatWithNonUhfCrossLink.Match {
221 Immutable(final CubeSat3U pSat) {
222 super(pSat);
223 }
224
225 @Override
226 public boolean isMutable() {
227 return false;
228 }
229 }
230 }
231
232 /**
233 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.threeUCubeSatWithNonUhfCrossLink pattern,
234 * providing pattern-specific query methods.
235 *
236 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
237 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
238 *
239 * <p>Matches of the pattern will be represented as {@link Match}.
240 *
241 * <p>Original source:
242 * <code><pre>
243 * // 3U CubeSats are assumed to only be able to downlink to Earth using an X-band trasmitter,
244 * // but cross-link using UHF
245 *
246 * {@literal @}Constraint(severity = "error", key = {Sat},
247 * message = "3U CubeSats can only cross-link using UHF.")
248 * pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) {
249 * CommunicatingElement.commSubsystem(Sat, SourceComm);
250 * neg find commSubsystemBandUhf(SourceComm);
251 * CommSubsystem.target(SourceComm, TargetComm);
252 * CommunicatingElement.commSubsystem(Target, TargetComm);
253 * neg find groundStationNetwork(Target);
254 * }
255 * </pre></code>
256 *
257 * @see Match
258 * @see ThreeUCubeSatWithNonUhfCrossLink
259 *
260 */
261 public static class Matcher extends BaseMatcher<ThreeUCubeSatWithNonUhfCrossLink.Match> {
262 /**
263 * Initializes the pattern matcher within an existing VIATRA Query engine.
264 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
265 *
266 * @param engine the existing VIATRA Query engine in which this matcher will be created.
267 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
268 *
269 */
270 public static ThreeUCubeSatWithNonUhfCrossLink.Matcher on(final ViatraQueryEngine engine) {
271 // check if matcher already exists
272 Matcher matcher = engine.getExistingMatcher(querySpecification());
273 if (matcher == null) {
274 matcher = (Matcher)engine.getMatcher(querySpecification());
275 }
276 return matcher;
277 }
278
279 /**
280 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
281 * @return an initialized matcher
282 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
283 *
284 */
285 public static ThreeUCubeSatWithNonUhfCrossLink.Matcher create() {
286 return new Matcher();
287 }
288
289 private static final int POSITION_SAT = 0;
290
291 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(ThreeUCubeSatWithNonUhfCrossLink.Matcher.class);
292
293 /**
294 * Initializes the pattern matcher within an existing VIATRA Query engine.
295 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
296 *
297 * @param engine the existing VIATRA Query engine in which this matcher will be created.
298 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
299 *
300 */
301 private Matcher() {
302 super(querySpecification());
303 }
304
305 /**
306 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
307 * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
308 * @return matches represented as a Match object.
309 *
310 */
311 public Collection<ThreeUCubeSatWithNonUhfCrossLink.Match> getAllMatches(final CubeSat3U pSat) {
312 return rawStreamAllMatches(new Object[]{pSat}).collect(Collectors.toSet());
313 }
314
315 /**
316 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
317 * </p>
318 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
319 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
320 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
321 * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
322 * @return a stream of matches represented as a Match object.
323 *
324 */
325 public Stream<ThreeUCubeSatWithNonUhfCrossLink.Match> streamAllMatches(final CubeSat3U pSat) {
326 return rawStreamAllMatches(new Object[]{pSat});
327 }
328
329 /**
330 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
331 * Neither determinism nor randomness of selection is guaranteed.
332 * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
333 * @return a match represented as a Match object, or null if no match is found.
334 *
335 */
336 public Optional<ThreeUCubeSatWithNonUhfCrossLink.Match> getOneArbitraryMatch(final CubeSat3U pSat) {
337 return rawGetOneArbitraryMatch(new Object[]{pSat});
338 }
339
340 /**
341 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
342 * under any possible substitution of the unspecified parameters (if any).
343 * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
344 * @return true if the input is a valid (partial) match of the pattern.
345 *
346 */
347 public boolean hasMatch(final CubeSat3U pSat) {
348 return rawHasMatch(new Object[]{pSat});
349 }
350
351 /**
352 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
353 * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
354 * @return the number of pattern matches found.
355 *
356 */
357 public int countMatches(final CubeSat3U pSat) {
358 return rawCountMatches(new Object[]{pSat});
359 }
360
361 /**
362 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
363 * Neither determinism nor randomness of selection is guaranteed.
364 * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
365 * @param processor the action that will process the selected match.
366 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
367 *
368 */
369 public boolean forOneArbitraryMatch(final CubeSat3U pSat, final Consumer<? super ThreeUCubeSatWithNonUhfCrossLink.Match> processor) {
370 return rawForOneArbitraryMatch(new Object[]{pSat}, processor);
371 }
372
373 /**
374 * Returns a new (partial) match.
375 * This can be used e.g. to call the matcher with a partial match.
376 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
377 * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
378 * @return the (partial) match object.
379 *
380 */
381 public ThreeUCubeSatWithNonUhfCrossLink.Match newMatch(final CubeSat3U pSat) {
382 return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch(pSat);
383 }
384
385 /**
386 * Retrieve the set of values that occur in matches for Sat.
387 * @return the Set of all values or empty set if there are no matches
388 *
389 */
390 protected Stream<CubeSat3U> rawStreamAllValuesOfSat(final Object[] parameters) {
391 return rawStreamAllValues(POSITION_SAT, parameters).map(CubeSat3U.class::cast);
392 }
393
394 /**
395 * Retrieve the set of values that occur in matches for Sat.
396 * @return the Set of all values or empty set if there are no matches
397 *
398 */
399 public Set<CubeSat3U> getAllValuesOfSat() {
400 return rawStreamAllValuesOfSat(emptyArray()).collect(Collectors.toSet());
401 }
402
403 /**
404 * Retrieve the set of values that occur in matches for Sat.
405 * @return the Set of all values or empty set if there are no matches
406 *
407 */
408 public Stream<CubeSat3U> streamAllValuesOfSat() {
409 return rawStreamAllValuesOfSat(emptyArray());
410 }
411
412 @Override
413 protected ThreeUCubeSatWithNonUhfCrossLink.Match tupleToMatch(final Tuple t) {
414 try {
415 return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((CubeSat3U) t.get(POSITION_SAT));
416 } catch(ClassCastException e) {
417 LOGGER.error("Element(s) in tuple not properly typed!",e);
418 return null;
419 }
420 }
421
422 @Override
423 protected ThreeUCubeSatWithNonUhfCrossLink.Match arrayToMatch(final Object[] match) {
424 try {
425 return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((CubeSat3U) match[POSITION_SAT]);
426 } catch(ClassCastException e) {
427 LOGGER.error("Element(s) in array not properly typed!",e);
428 return null;
429 }
430 }
431
432 @Override
433 protected ThreeUCubeSatWithNonUhfCrossLink.Match arrayToMatchMutable(final Object[] match) {
434 try {
435 return ThreeUCubeSatWithNonUhfCrossLink.Match.newMutableMatch((CubeSat3U) match[POSITION_SAT]);
436 } catch(ClassCastException e) {
437 LOGGER.error("Element(s) in array not properly typed!",e);
438 return null;
439 }
440 }
441
442 /**
443 * @return the singleton instance of the query specification of this pattern
444 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
445 *
446 */
447 public static IQuerySpecification<ThreeUCubeSatWithNonUhfCrossLink.Matcher> querySpecification() {
448 return ThreeUCubeSatWithNonUhfCrossLink.instance();
449 }
450 }
451
452 private ThreeUCubeSatWithNonUhfCrossLink() {
453 super(GeneratedPQuery.INSTANCE);
454 }
455
456 /**
457 * @return the singleton instance of the query specification
458 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
459 *
460 */
461 public static ThreeUCubeSatWithNonUhfCrossLink instance() {
462 try{
463 return LazyHolder.INSTANCE;
464 } catch (ExceptionInInitializerError err) {
465 throw processInitializerError(err);
466 }
467 }
468
469 @Override
470 protected ThreeUCubeSatWithNonUhfCrossLink.Matcher instantiate(final ViatraQueryEngine engine) {
471 return ThreeUCubeSatWithNonUhfCrossLink.Matcher.on(engine);
472 }
473
474 @Override
475 public ThreeUCubeSatWithNonUhfCrossLink.Matcher instantiate() {
476 return ThreeUCubeSatWithNonUhfCrossLink.Matcher.create();
477 }
478
479 @Override
480 public ThreeUCubeSatWithNonUhfCrossLink.Match newEmptyMatch() {
481 return ThreeUCubeSatWithNonUhfCrossLink.Match.newEmptyMatch();
482 }
483
484 @Override
485 public ThreeUCubeSatWithNonUhfCrossLink.Match newMatch(final Object... parameters) {
486 return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((satellite.CubeSat3U) parameters[0]);
487 }
488
489 /**
490 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink (visibility: PUBLIC, simpleName: ThreeUCubeSatWithNonUhfCrossLink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
491 * <b>not</b> at the class load time of the outer class,
492 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink (visibility: PUBLIC, simpleName: ThreeUCubeSatWithNonUhfCrossLink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
493 *
494 * <p> This workaround is required e.g. to support recursion.
495 *
496 */
497 private static class LazyHolder {
498 private static final ThreeUCubeSatWithNonUhfCrossLink INSTANCE = new ThreeUCubeSatWithNonUhfCrossLink();
499
500 /**
501 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
502 * This initialization order is required to support indirect recursion.
503 *
504 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
505 *
506 */
507 private static final Object STATIC_INITIALIZER = ensureInitialized();
508
509 public static Object ensureInitialized() {
510 INSTANCE.ensureInitializedInternal();
511 return null;
512 }
513 }
514
515 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
516 private static final ThreeUCubeSatWithNonUhfCrossLink.GeneratedPQuery INSTANCE = new GeneratedPQuery();
517
518 private final PParameter parameter_Sat = new PParameter("Sat", "satellite.CubeSat3U", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CubeSat3U")), PParameterDirection.INOUT);
519
520 private final List<PParameter> parameters = Arrays.asList(parameter_Sat);
521
522 private GeneratedPQuery() {
523 super(PVisibility.PUBLIC);
524 }
525
526 @Override
527 public String getFullyQualifiedName() {
528 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.threeUCubeSatWithNonUhfCrossLink";
529 }
530
531 @Override
532 public List<String> getParameterNames() {
533 return Arrays.asList("Sat");
534 }
535
536 @Override
537 public List<PParameter> getParameters() {
538 return parameters;
539 }
540
541 @Override
542 public Set<PBody> doGetContainedBodies() {
543 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
544 Set<PBody> bodies = new LinkedHashSet<>();
545 {
546 PBody body = new PBody(this);
547 PVariable var_Sat = body.getOrCreateVariableByName("Sat");
548 PVariable var_SourceComm = body.getOrCreateVariableByName("SourceComm");
549 PVariable var_TargetComm = body.getOrCreateVariableByName("TargetComm");
550 PVariable var_Target = body.getOrCreateVariableByName("Target");
551 new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat3U")));
552 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
553 new ExportedParameter(body, var_Sat, parameter_Sat)
554 ));
555 // CommunicatingElement.commSubsystem(Sat, SourceComm)
556 new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement")));
557 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
558 new TypeConstraint(body, Tuples.flatTupleOf(var_Sat, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem")));
559 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
560 new Equality(body, var__virtual_0_, var_SourceComm);
561 // neg find commSubsystemBandUhf(SourceComm)
562 new NegativePatternCall(body, Tuples.flatTupleOf(var_SourceComm), CommSubsystemBandUhf.instance().getInternalQueryRepresentation());
563 // CommSubsystem.target(SourceComm, TargetComm)
564 new TypeConstraint(body, Tuples.flatTupleOf(var_SourceComm), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
565 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
566 new TypeConstraint(body, Tuples.flatTupleOf(var_SourceComm, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "target")));
567 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
568 new Equality(body, var__virtual_1_, var_TargetComm);
569 // CommunicatingElement.commSubsystem(Target, TargetComm)
570 new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement")));
571 PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
572 new TypeConstraint(body, Tuples.flatTupleOf(var_Target, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem")));
573 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
574 new Equality(body, var__virtual_2_, var_TargetComm);
575 // neg find groundStationNetwork(Target)
576 new NegativePatternCall(body, Tuples.flatTupleOf(var_Target), GroundStationNetwork.instance().getInternalQueryRepresentation());
577 bodies.add(body);
578 }
579 {
580 PAnnotation annotation = new PAnnotation("Constraint");
581 annotation.addAttribute("severity", "error");
582 annotation.addAttribute("key", Arrays.asList(new Object[] {
583 new ParameterReference("Sat")
584 }));
585 annotation.addAttribute("message", "3U CubeSats can only cross-link using UHF.");
586 addAnnotation(annotation);
587 }
588 return bodies;
589 }
590 }
591}