commit | 90b54d7ac5bdfc005f4e4821e7f8a98b0a1eb052 | [log] [tgz] |
---|---|---|
author | mparker <mparker> | Sat Sep 19 01:29:18 2009 +0000 |
committer | mparker <mparker> | Sat Sep 19 01:29:18 2009 +0000 |
tree | c8637f9ee1a021bfd525d6e87c0dfeeb2afeb3ad | |
parent | aeec5c893eb2eaaa0773a7a9666eb02f3f355b5b [diff] |
289924: Code generation misses condition case in Ascape https://bugs.eclipse.org/bugs/show_bug.cgi?id=289924
diff --git a/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.gen.ascape/src/metaabm/ascape/tmpl/ScapeAspect.xpt b/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.gen.ascape/src/metaabm/ascape/tmpl/ScapeAspect.xpt index 95b5d71..fd0325d 100644 --- a/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.gen.ascape/src/metaabm/ascape/tmpl/ScapeAspect.xpt +++ b/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.gen.ascape/src/metaabm/ascape/tmpl/ScapeAspect.xpt
@@ -96,10 +96,10 @@ «selector().id()»Cell = «converted(selector().id() + "Cell")»; «ENDIF-» if («selector().id()»Cell instanceof «selector().typeName()») { + «IF conditionForState().size > 0-» «selector().typeName()» «selector().id()» = («selector().typeName()») «selector().id()»Cell; - «IF selector().targets.queries().nonSpatial().intersect(allSources).size > 0-» «EXPAND metaabm::tmpl::Java::InnerEvaluation(path, false)-» - return «selector().targets.queries().nonSpatial().intersect(allSources).toList().expressionSink(path, false)»; + return «conditionForState().toList().expressionSink(path, false)»; «ELSE-» return true; «ENDIF-»
diff --git a/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.gen.ascape/src/metaabm/ascape/tmpl/inferascape.ext b/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.gen.ascape/src/metaabm/ascape/tmpl/inferascape.ext index fd8ba37..0113e65 100644 --- a/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.gen.ascape/src/metaabm/ascape/tmpl/inferascape.ext +++ b/org.eclipse.amp.amf/plugins/org.eclipse.amp.amf.gen.ascape/src/metaabm/ascape/tmpl/inferascape.ext
@@ -113,6 +113,9 @@ cached String graphCall(AReplace act) : "replaceNeighbor(" + act.actMover().expl() + ", " + act.findDest() + ", " + act.directed + ")"; + +cached List[AAct] conditionForState(AAct act) : + act.selector().targets.queries().nonSpatial().intersect(act.allSources.union({act})); cached Boolean conditionForAscape(AControl act) : (act.conditionFor() || act.convertToAgent() || !act.selector().agent.isHost()) && !act.hasControl("here") && !act.selector().isRoot();