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