Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » AMP » prey-predator
prey-predator [message #537004] Mon, 31 May 2010 20:36 Go to next message
Jean-Paul de Vooght is currently offline Jean-Paul de VooghtFriend
Messages: 20
Registered: April 2010
Junior Member
Hi all! Hi Miles!

I am slowly getting through a basic prey-predator model which is far from completion yet. But it's fun to construct when I compare to other environments.

I am getting an "HostCell not available" error which I believe is due to the logic of searching for free space to move both my Prey and Predator agents. But I'm not certain.
Here's a pastie with the metaabm code
http://pastie.org/986296

One thing I am not sure I fully grasp is the importance of order in the targets. I ask because looking at the StupidModels and eventually thinking of GAS/Sugarscape, there's a certain order to respect - or not?

Thanks in advance for any advice!
JP
Re: prey-predator [message #537018 is a reply to message #537004] Mon, 31 May 2010 23:51 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
Hi Jean-Paul,

Jean-Paul de Vooght wrote on Mon, 31 May 2010 16:36
Hi all! Hi Miles!

I am slowly getting through a basic prey-predator model which is far from completion yet. But it's fun to construct when I compare to other environments.


That's good to know! It sounds silly, but I think if we get that part right then that is one of the important things. After all, there are lot's of ABM frameworks out there that you can get a lot done -- functionality is important but you need to be able to play.

Quote:
I am getting an "HostCell not available" error which I believe is due to the logic of searching for free space to move both my Prey and Predator agents. But I'm not certain.


Thanks for the model. So a few things:

1. Actually, it took me a while to puzzle things out, then I remembered a comment someone else made that they had confused Evaluate actions for Query actions. And indeed you had Evaluate where you needed a Query. So I fixed that.

2. For the selections, you want to be searching for the target of whatever command you are using. So in most cases for moving around on a lattice -- except for the special case of where you're searching for prey -- that will mean that you want to put the habitat cell there. But actually you don't need the habitat cell at all anymore, so you could also get rid of that and leave "agent" blank.

3. There is actually an error in the generated code. For now, please go to the PredatorAgent.java and comment out the following code:

    public void predatorAgentRule() {
...
                // if (getHostScape() != ((Agent) predatorAgent).getScape()) {
                // die();
                // getPreyPredator().getPredatorAgentScape().add(this);
                // }
                moveToward(((org.ascape.model.CellOccupant) predatorAgent)
                           .getHostCell());
...
}


Quote:
One thing I am not sure I fully grasp is the importance of order in the targets. I ask because looking at the StupidModels and eventually thinking of GAS/Sugarscape, there's a certain order to respect - or not?


If I'm understanding what you're saying right, then yes, the order is critical -- it's what defines what selection feeds into the next.

I have to run so I can't post it somewhere else, but hopefully just putting the xml code in a code block here will allow you to copy it.. (And for folks following this thread -- no, you're not supposed to edit this directly!)

<?xml version="1.0" encoding="UTF-8"?>
<metaabm:SContext xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:act="http://metaabm.org/act" xmlns:function="http://metaabm.org/function" xmlns:metaabm="http://metaabm.org/structure" label="PreyPredator" ID="preyPredator" pluralLabel="PreyPredators">
  <attributes label="Prey Agent Count" ID="preyAgentCount" pluralLabel="Prey Agent Counts" description="The number of prey agents to create." gatherData="true" defaultValue="100"/>
  <attributes label="Predator Agent Count" ID="predatorAgentCount" pluralLabel="Predator Agent Counts" description="The number of predator agents to create." gatherData="true" defaultValue="20"/>
  <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel="Root Act Groups">
    <members xsi:type="act:ABuild" label="Build PreyPredator" ID="buildPreyPredator" targets="//@rootActivity/@members[ID='createPreyAgents'] //@rootActivity/@members[ID='createPredatorAgents'] //@rootActivity/@members[ID='buildGrid2D']" selected="//@rootActivity/@members[ID='buildPreyPredator']" agent="/" pluralLabel="Build PreyPredators"/>
    <members xsi:type="act:ACreateAgents" label="Create Prey Agents" ID="createPreyAgents" sources="//@rootActivity/@members[ID='buildPreyPredator']" selected="//@rootActivity/@members[ID='buildPreyPredator']" agent="//@agents[ID='preyAgent']" agentCount="//@attributes[ID='preyAgentCount']"/>
    <members xsi:type="act:ACreateAgents" label="Create Predator Agents" ID="createPredatorAgents" sources="//@rootActivity/@members[ID='buildPreyPredator']" selected="//@rootActivity/@members[ID='buildPreyPredator']" agent="//@agents[ID='predatorAgent']" agentCount="//@attributes[ID='predatorAgentCount']"/>
    <members xsi:type="act:ABuildGrid" label="Build Grid 2D" ID="buildGrid2D" sources="//@rootActivity/@members[ID='buildPreyPredator']" selected="//@rootActivity/@members[ID='buildPreyPredator']" pluralLabel="Build Grid 2Ds" agents="//@agents[ID='predatorAgent'] //@agents[ID='preyAgent']" projection="//@projections[ID='grid2D']" fillAgent="//@agents[ID='habitat']"/>
  </rootActivity>
  <implementation package="preypredator" className="PreyPredator" basePath=""/>
  <agents label="Prey Agent" ID="preyAgent" pluralLabel="Prey Agents">
    <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel="Root Act Groups">
      <members xsi:type="act:AInitialize" label="Initialize" ID="initialize" targets="//@agents[ID='preyAgent']/@rootActivity/@members[ID='randomHabitat']" selected="//@agents[ID='preyAgent']/@rootActivity/@members[ID='initialize']" agent="//@agents[ID='preyAgent']" space="//@projections[ID='grid2D']" pluralLabel="Initializes"/>
      <members xsi:type="act:ASelect" label="Random Habitat" ID="randomHabitat" sources="//@agents[ID='preyAgent']/@rootActivity/@members[ID='initialize']" targets="//@agents[ID='preyAgent']/@rootActivity/@members[ID='randomHabitatAvailable']" selected="//@agents[ID='preyAgent']/@rootActivity/@members[ID='initialize']" agent="//@agents[ID='habitat']" space="//@projections[ID='grid2D']"/>
      <members xsi:type="act:AQuery" label="Random Habitat: Available()" ID="randomHabitatAvailable" sources="//@agents[ID='preyAgent']/@rootActivity/@members[ID='randomHabitat']" targets="//@agents[ID='preyAgent']/@rootActivity/@members[ID='movePreyAgent']" selected="//@agents[ID='preyAgent']/@rootActivity/@members[ID='randomHabitat']">
        <function xsi:type="function:FGenericLogical" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='spatial']/@functions[ID='available']"/>
      </members>
      <members xsi:type="act:AMove" label="Move Prey Agent" ID="movePreyAgent" sources="//@agents[ID='preyAgent']/@rootActivity/@members[ID='randomHabitatAvailable']" selected="//@agents[ID='preyAgent']/@rootActivity/@members[ID='initialize']" destination="//@agents[ID='preyAgent']/@rootActivity/@members[ID='randomHabitat']"/>
    </rootActivity>
    <implementation className="PreyAgent"/>
    <styles xsi:type="metaabm:SStyle2D" label="Prey Agent Style 2D" ID="preyAgentStyle2D" pluralLabel="Prey Agent Style 2Ds">
      <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel="Root Act Groups">
        <members xsi:type="act:ARule" label="Prey Agent Rule" ID="preyAgentRule" targets="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRuleColorBlue']" selected="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRule']" agent="//@agents[ID='preyAgent']" space="//@projections[ID='grid2D']" pluralLabel="Prey Agent Rules"/>
        <members xsi:type="act:AEvaluate" label="Prey Agent Rule: Color Blue()" ID="preyAgentRuleColorBlue" sources="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRule']" targets="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRuleShapeOval']" selected="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='colorBlue']"/>
        </members>
        <members xsi:type="act:AEvaluate" label="Prey Agent Rule: Shape Oval()" ID="preyAgentRuleShapeOval" sources="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRuleColorBlue']" targets="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRuleShapeMarker']" selected="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='shapeOval']"/>
        </members>
        <members xsi:type="act:AEvaluate" label="Prey Agent Rule: Shape Marker()" ID="preyAgentRuleShapeMarker" sources="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRuleShapeOval']" selected="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='graphicFill']"/>
        </members>
      </rootActivity>
      <implementation className="PreyAgentStyle2D"/>
    </styles>
  </agents>
  <agents label="Predator Agent" ID="predatorAgent" pluralLabel="Predator Agents">
    <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel="Root Act Groups">
      <members xsi:type="act:AInitialize" label="Initialize" ID="initialize" targets="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='randomHabitat']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='initialize']" agent="//@agents[ID='predatorAgent']" space="//@projections[ID='grid2D']" pluralLabel="Initializes"/>
      <members xsi:type="act:ASelect" label="Random Habitat" ID="randomHabitat" sources="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='initialize']" targets="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='randomHabitatAvailable']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='initialize']" agent="//@agents[ID='habitat']" space="//@projections[ID='grid2D']"/>
      <members xsi:type="act:AQuery" label="Random Habitat: Available()" ID="randomHabitatAvailable" sources="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='randomHabitat']" targets="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='movePredatorAgent']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='randomHabitat']">
        <function xsi:type="function:FGenericLogical" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='spatial']/@functions[ID='available']"/>
      </members>
      <members xsi:type="act:AMove" label="Move Predator Agent" ID="movePredatorAgent" sources="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='randomHabitatAvailable']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='initialize']" destination="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='randomHabitat']"/>
      <members xsi:type="act:ARule" label="Predator Agent Rule" ID="predatorAgentRule" targets="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='predatorAgent']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='predatorAgentRule']" agent="//@agents[ID='predatorAgent']" space="//@projections[ID='grid2D']" pluralLabel="Predator Agent Rules"/>
      <members xsi:type="act:ASelect" label="Predator Agent" ID="predatorAgent" sources="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='predatorAgentRule']" targets="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='nearestQuery'] //@agents[ID='predatorAgent']/@rootActivity/@members[ID='towardQuery']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='predatorAgentRule']" agent="//@agents[ID='predatorAgent']" space="//@projections[ID='grid2D']"/>
      <members xsi:type="act:AQuery" label="Nearest () Query" ID="nearestQuery" sources="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='predatorAgent']" targets="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='_NearestQueryAndTowardQueryAndAvailableQuery_']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='predatorAgent']">
        <function xsi:type="function:FGenericLogical" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='spatial']/@functions[ID='nearest']"/>
      </members>
      <members xsi:type="act:AQuery" label="Toward() Query" ID="towardQuery" sources="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='predatorAgent']" targets="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='_NearestQueryAndTowardQueryAndAvailableQuery_']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='predatorAgent']">
        <function xsi:type="function:FGenericLogical" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='spatial']/@functions[ID='toward']"/>
      </members>
      <members xsi:type="act:AAll" label="(Nearest () Query &amp; Toward() Query &amp; Available() Query)" ID="_NearestQueryAndTowardQueryAndAvailableQuery_" sources="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='towardQuery'] //@agents[ID='predatorAgent']/@rootActivity/@members[ID='nearestQuery']" targets="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='movePredatorAgentCopy']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='predatorAgent']"/>
      <members xsi:type="act:AMove" label="Move Predator Agent Copy" ID="movePredatorAgentCopy" sources="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='_NearestQueryAndTowardQueryAndAvailableQuery_']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='predatorAgentRule']" destination="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='predatorAgent']"/>
    </rootActivity>
    <implementation className="PredatorAgent"/>
    <styles xsi:type="metaabm:SStyle2D" label="Predator Agent Style 2D" ID="predatorAgentStyle2D" pluralLabel="Predator Agent Style 2Ds">
      <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel="Root Act Groups">
        <members xsi:type="act:ARule" label="Predator Agent Rule" ID="predatorAgentRule" targets="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRuleColorRed']" selected="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRule']" agent="//@agents[ID='predatorAgent']" space="//@projections[ID='grid2D']" pluralLabel="Predator Agent Rules"/>
        <members xsi:type="act:AEvaluate" label="Predator Agent Rule: Color Red()" ID="predatorAgentRuleColorRed" sources="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRule']" targets="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRuleShapeOval']" selected="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='colorRed']"/>
        </members>
        <members xsi:type="act:AEvaluate" label="Predator Agent Rule: Shape Oval()" ID="predatorAgentRuleShapeOval" sources="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRuleColorRed']" targets="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRuleGraphicFill']" selected="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='shapeOval']"/>
        </members>
        <members xsi:type="act:AEvaluate" label="Predator Agent Rule: Graphic Fill()" ID="predatorAgentRuleGraphicFill" sources="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRuleShapeOval']" selected="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='graphicFill']"/>
        </members>
      </rootActivity>
      <implementation className="PredatorAgentStyle2D"/>
    </styles>
  </agents>
  <agents label="Habitat" ID="habitat" pluralLabel="Habitats">
    <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel="Root Act Groups"/>
    <implementation className="Habitat"/>
    <styles xsi:type="metaabm:SStyle2D" label="Habitat Style 2D" ID="habitatStyle2D" pluralLabel="Habitat Style 2Ds">
      <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel="Root Act Groups">
        <members xsi:type="act:ARule" label="Habitat Rule" ID="habitatRule" targets="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRuleColorGreen']" selected="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRule']" agent="//@agents[ID='habitat']" space="//@projections[ID='grid2D']" pluralLabel="Habitat Rules"/>
        <members xsi:type="act:AEvaluate" label="Habitat Rule: Color Green()" ID="habitatRuleColorGreen" sources="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRule']" targets="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRuleShapeRectangle']" selected="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='colorGreen']"/>
        </members>
        <members xsi:type="act:AEvaluate" label="Habitat Rule: Shape Rectangle()" ID="habitatRuleShapeRectangle" sources="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRuleColorGreen']" targets="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRuleGraphicFill']" selected="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='shapeRectangle']"/>
        </members>
        <members xsi:type="act:AEvaluate" label="Habitat Rule: Graphic Fill()" ID="habitatRuleGraphicFill" sources="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRuleShapeRectangle']" selected="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='graphicFill']"/>
        </members>
      </rootActivity>
      <implementation className="HabitatStyle2D"/>
    </styles>
  </agents>
  <projections xsi:type="metaabm:SGrid" label="Grid 2D" ID="grid2D" pluralLabel="Grid 2Ds" dimensionality="2" borderRule="PERIODIC">
    <attributes xsi:type="metaabm:SAttributeArray" label="Dimensions" ID="dimensions" pluralLabel="Dimensionss" description="The size of each dimension." size="2"/>
    <attributes label="Width" ID="width" pluralLabel="Widths" description="The horizontal extent of the space." defaultValue="100"/>
    <attributes label="Height" ID="height" pluralLabel="Heights" description="The vertical extent of the space." defaultValue="100"/>
  </projections>
</metaabm:SContext>

Re: prey-predator [message #537020 is a reply to message #537018] Mon, 31 May 2010 23:58 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
BTW, here's the bug tracking the Query / Evaluate confusion issue..if you see a wa yin the docs to explain it better let me know as well.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=311618
Re: prey-predator [message #537031 is a reply to message #537004] Tue, 01 June 2010 06:12 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
OK, this is fixed. It should how up in next nightly build. BTW, in my changes above I made predators go after each other (nice for the prey!) but I'm sure you'll get the idea.

Note that this is actually an interesting case where you can specify an agent (that is a grid occupant) but the framework will infer that you are actually intending to move to a cell (a member of the grid itself) by the use of the "toward" query. A more verbose way to do this would be to first search for the prey, and then search for the cell that is closest to that prey's target cell, but this way of defining things seems much cleaner and more expressive to me.
Re: prey-predator [message #537055 is a reply to message #537031] Tue, 01 June 2010 08:08 Go to previous messageGo to next message
Jean-Paul de Vooght is currently offline Jean-Paul de VooghtFriend
Messages: 20
Registered: April 2010
Junior Member
Thanks a lot for the help!
I'll try for myself tonight and create a separate project with your code.
Re: prey-predator [message #537276 is a reply to message #537055] Tue, 01 June 2010 18:34 Go to previous messageGo to next message
Jean-Paul de Vooght is currently offline Jean-Paul de VooghtFriend
Messages: 20
Registered: April 2010
Junior Member
Ok things are somewhat clearer. Thanks for this explanation. I indeed mixed up Evals and Query and now I understand better the difference. Not sure there's much to do about this actually.

Unfortunately, I was not able to fully run my own model applying my new skills due to some friggin' eclipse - I kept this in a separate thread about xpand.

JP
Re: prey-predator [message #537298 is a reply to message #537276] Tue, 01 June 2010 20:30 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
One other thing I forgot to mention. You can't use the marker style alone -- you need a regular shape for it to be a member of. I need to add a warning to that effect.
Re: prey-predator [message #538130 is a reply to message #537298] Sat, 05 June 2010 13:26 Go to previous messageGo to next message
Jean-Paul de Vooght is currently offline Jean-Paul de VooghtFriend
Messages: 20
Registered: April 2010
Junior Member
Ok so back to PreyPredator with the new 0.7.0 codebase.

I noticed some changes such as RootGroups disappeared from Styles as well as Dimensions on Grids. I like this because it makes things simpler.

I have tried to re-build it from bottom up and hit this exception

java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.xtend.expression.ExecutionContextImpl
at org.eclipse.xtend.XtendFacade.create(XtendFacade.java:53)
at org.eclipse.amp.amf.gen.ide.ModelMarkerHelper.<init>(ModelMarkerHelper.java:50)
at org.eclipse.amp.amf.gen.ide.AbstractMWEBuilder.generateModel(AbstractMWEBuilder.java:142)
at org.eclipse.amp.amf.gen.ide.AbstractMWEBuilder.handleModifiedResource(AbstractMWEBuilder.java:184)
at org.eclipse.amp.escape.amf.ide.GenerateEscapeHandler.execute(GenerateEscapeHandler.java:26)
at org.eclipse.amp.amf.gen.ide.ResourceHandler.execute(ResourceHandler.java:68)
at org.eclipse.amp.amf.gen.ide.ResourceHandler.executeHandler(ResourceHandler.java:72)
at org.eclipse.amp.amf.gen.ide.ResourceJobHandler.access$0(ResourceJobHandler.java:1)
at org.eclipse.amp.amf.gen.ide.ResourceJobHandler$1.run(ResourceJobHandler.java:40)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


Any ideas on how to fix this one?

I have installed Xtend core, UI, UML2 typesystem, XSD typesystem 1.0.0.v201006010440

I also noticed that the indentation logic changed: evaluations are shown one below the other instead of indendented - is this correct?

TIA

[Updated on: Sat, 05 June 2010 13:59]

Report message to a moderator

Re: prey-predator [message #538145 is a reply to message #538130] Sat, 05 June 2010 17:03 Go to previous message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
Jean-Paul de Vooght wrote on Sat, 05 June 2010 09:26
Ok so back to PreyPredator with the new 0.7.0 codebase.

I noticed some changes such as RootGroups disappeared from Styles as well as Dimensions on Grids. I like this because it makes things simpler.

I also noticed that the indentation logic changed: evaluations are shown one below the other instead of indendented - is this correct?



Yes, feedback welcome. There are a number of usability changes that have been made. I'll try to summarize those as part of the M2 (0.8.0) release announcement.

I have received a lot of feedback form people and found myself that the hierarchical view was just too confusing. After thinking about a lot of options (including advanced graph editing tools that are part of some Metascape tools) I realized that it would be much simpler just to show all of the nodes flat. This is after all how conventional programming languages work -- they're linear even though there might be branching structures.

Quote:

I have tried to re-build it from bottom up and hit this exception

java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.xtend.expression.ExecutionContextImpl
at org.eclipse.xtend.XtendFacade.create(XtendFacade.java:53)
at org.eclipse.amp.amf.gen.ide.ModelMarkerHelper.<init>(ModelMarkerHelper.java:50)
at org.eclipse.amp.amf.gen.ide.AbstractMWEBuilder.generateModel(AbstractMWEBuilder.java:142)
at org.eclipse.amp.amf.gen.ide.AbstractMWEBuilder.handleModifiedResource(AbstractMWEBuilder.java:184)
at org.eclipse.amp.escape.amf.ide.GenerateEscapeHandler.execute(GenerateEscapeHandler.java:26)
at org.eclipse.amp.amf.gen.ide.ResourceHandler.execute(ResourceHandler.java:68)
at org.eclipse.amp.amf.gen.ide.ResourceHandler.executeHandler(ResourceHandler.java:72)
at org.eclipse.amp.amf.gen.ide.ResourceJobHandler.access$0(ResourceJobHandler.java:1)
at org.eclipse.amp.amf.gen.ide.ResourceJobHandler$1.run(ResourceJobHandler.java:40)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


Any ideas on how to fix this one?

I have installed Xtend core, UI, UML2 typesystem, XSD typesystem 1.0.0.v201006010440

TIA


Yeah it looks like some missing dependencies there. Do you have XPand and MWE as well? If yo were coming form a fresh install, simply installing AMP should pull in everything you need. (You do not need any of the UML stuff but that get's mixed in in some of the XPand builds for some reason that I haven't figured out.)
Previous Topic:Modeling: slime mold
Next Topic:dependency on xpand 1.0.0
Goto Forum:
  


Current Time: Thu Mar 28 16:25:11 GMT 2024

Powered by FUDForum. Page generated in 0.04091 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top