metametascape
Welcome, Guest
Please Login or Register.
Lost Password?
Re:Modifying Style (1 viewing)
_GEN_GOTOBOTTOM Post Reply

TOPIC: Re:Modifying Style

#25
ecasotti (User)
Expert Boarder
Posts: 38
graphgraph
Modifying Style 2008/01/08 19:34 Karma: 0  
Hey Miles

I am trying to modify the "Style 2D bugStyle2D" by changing the bug rule. I
wanted to remove the Evaluate for the color yellow (I chose yellow over red
and black over green for contrast reasons). Even deleting the rule
and trying to rebuild it does not remove the use of yellow from being generated.
The file is not regenerated.

I even delete the style, and recreate it, and the old BugStyle2D file remains.
It appears that it is not being regenerated even after deleting the original
style. I create a new one with a new name, and the model still looks for the old style.

Just and FYI.

Evelyn
  The administrator has disabled public write access.
#27
miles (Admin)
Admin
Posts: 59
graphgraph
Re:Modifying Style 2008/01/08 21:08 Karma: 1  
Evelyn,

This isn't mentioned anywhere in the so far limited documentation, but the generated Java files are *not* currently deleted. I wanted to be conservative about deleting user resources silently, so until I figure out a good solution or that you will need to delete any generated Java files manually. But the old file should be ignored in the new model so there is probably something else going wrong here. Can you post the metaABM file and I'll take a look..
  The administrator has disabled public write access.
#33
ecasotti (User)
Expert Boarder
Posts: 38
graphgraph
Re:Modifying Style 2008/01/08 22:36 Karma: 0  
Miles

I am at home right now so I cannot send you my files. However, I wanted to tell you
that I tried deleting the generated files, and then that is when it went downhill.
I could not get the files to regenerate, and I could not get the new files to change.

You could try replicating my problem if you want to do this before tomorrow. What I did
was I created the Style format you specified in the simple example. Then I tried to
remove the Evaluates and then recontruct them without the color. It never regenerated
after that. I tried removing the generated style files, I tried removing the 2D style
and recreating it with a new name, and the newly named style would not generate.

Tomorrow I will send you my metaabm file.

Evelyn
  The administrator has disabled public write access.
#36
ecasotti (User)
Expert Boarder
Posts: 38
graphgraph
Re:Modifying Style 2008/01/09 11:59 Karma: 0  
Hey Miles

I will include the file below. I just tried deleting all my generated files and
the .class files. When I try to run, I get

Exception in thread "main" java.lang.RuntimeException: The class "org.example.ascape.StupidModel1 could not be found.
at org.ascape.model.ModelRoot.open(ModelRoot.java:846)
at org.ascape.model.ModelRoot.open(ModelRoot.java:856)
at org.ascape.model.ModelRoot.main(ModelRoot.java:1072)
at org.ascape.model.Scape.main(Scape.java:2986)

So it is not being re-generated.

Evelyn

---------------------------------------------------------------------------------------------------- --
Code:

  <?xml version="1.0" encoding="UTF-8"?> <metaabm:SContext 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="StupidModel1" ID="stupidModel1" pluralLabel="StupidModel1s">   <attributes label="Bug Count" ID="bugCount" pluralLabel="Bug Counts" description="The number of  bugs to create." sType="INTEGER" defaultValue="100"/>   <attributes label="Habitat Count" ID="habitatCount" pluralLabel="Habitat Counts" description="The  number of habitats to create." sType="INTEGER"/>   <attributes label="Bug Vision" ID="bugVision" pluralLabel="Bug Visions" sType="INTEGER"  defaultValue="4"/>   <attributes label="Attribute" ID="attribute" pluralLabel="Attributes"/>   <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel="Root  Act Groups">     <members xsi:type="act:ABuild" label="Build StupidModel1" ID="buildStupidModel1" targets="// @rootActivity/@members[ID='createBugs'] //@rootActivity/@members[ID='createHabitats'] // @rootActivity/@members[ID='fillGrid'] //@rootActivity/@members[ID='createStupidModel1Contexts']"  selected="//@rootActivity/@members[ID='buildStupidModel1']" agent="/" pluralLabel="Build  StupidModel1s"/>     <members xsi:type="act:ACreateAgents" label="Create Bugs" ID="createBugs" sources="// @rootActivity/@members[ID='buildStupidModel1']" selected="//@rootActivity/@members[ID=' buildStupidModel1']" agent="//@agents[ID='bug']" agentCount="//@attributes[ID='bugCount']"/>     <members xsi:type="act:ACreateAgents" label="Create Habitats" ID="createHabitats" sources="// @rootActivity/@members[ID='buildStupidModel1']" selected="//@rootActivity/@members[ID=' buildStupidModel1']" agent="//@agents[ID='habitat']" agentCount="//@attributes[ID='habitatCount']"/>     <members xsi:type="act:ABuildGrid" label="FillGrid" ID="fillGrid" sources="//@rootActivity/ @members[ID='buildStupidModel1']" selected="//@rootActivity/@members[ID='buildStupidModel1']"  pluralLabel="FillGrids" agents="//@agents[ID='bug']" projection="//@projections[ID='grid2D']"  fillAgent="//@agents[ID='habitat']"/>     <members xsi:type="act:ACreateAgents" label="Create StupidModel1 Contexts" ID=" createStupidModel1Contexts" sources="//@rootActivity/@members[ID='buildStupidModel1']" selected="// @rootActivity/@members[ID='buildStupidModel1']"/>   </rootActivity>   <implementation package="org.example.ascape" className="StupidModel1" basePath=""/>   <agents label="Bug" ID="bug" pluralLabel="Bugs">     <attributes label="Size" ID="size" pluralLabel="Sizes" sType="INTEGER" defaultValue="0"/>     <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=' bug']/@rootActivity/@members[ID='randomHabitat']" selected="//@agents[ID='bug']/@rootActivity/ @members[ID='initialize']" agent="//@agents[ID='bug']" space="//@projections[ID='grid2D']"  pluralLabel="Initializes"/>       <members xsi:type="act:ASelect" label="Random Habitat" ID="randomHabitat" sources="// @agents[ID='bug']/@rootActivity/@members[ID='initialize']" targets="//@agents[ID='bug']/ @rootActivity/@members[ID='randomHabitatAvailableQuery']" selected="//@agents[ID='bug']/ @rootActivity/@members[ID='initialize']" agent="//@agents[ID='habitat']" space="//@projections[ID=' grid2D']"/>       <members xsi:type="act:AQuery" label="Random Habitat: Available() Query" ID=" randomHabitatAvailableQuery" sources="//@agents[ID='bug']/@rootActivity/@members[ID='randomHabitat'] " targets="//@agents[ID='bug']/@rootActivity/@members[ID='movetoHabitatinGrid2D']" selected="// @agents[ID='bug']/@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 to Habitat in Grid2D" ID="movetoHabitatinGrid2D"  sources="//@agents[ID='bug']/@rootActivity/@members[ID='randomHabitatAvailableQuery']" selected="// @agents[ID='bug']/@rootActivity/@members[ID='initialize']" destination="//@agents[ID='bug']/ @rootActivity/@members[ID='randomHabitat']"/>       <members xsi:type="act:ARule" label="Bug Rule" ID="bugRule" targets="//@agents[ID='bug']/ @rootActivity/@members[ID='nearbySpace']" selected="//@agents[ID='bug']/@rootActivity/@members[ID=' bugRule']" agent="//@agents[ID='bug']" space="//@projections[ID='grid2D']" pluralLabel="Bug Rules"/>       <members xsi:type="act:ASelect" label="NearbySpace" ID="nearbySpace" sources="//@agents[ID=' bug']/@rootActivity/@members[ID='bugRule']" targets="//@agents[ID='bug']/@rootActivity/@members[ID=' nearbySpaceAvailableQuery'] //@agents[ID='bug']/@rootActivity/@members[ID=' nearbySpaceWithin_BugVision_Query']" selected="//@agents[ID='bug']/@rootActivity/@members[ID=' bugRule']" agent="//@agents[ID='habitat']" space="//@projections[ID='grid2D']"/>       <members xsi:type="act:AQuery" label="NearbySpace: Available() Query" ID=" nearbySpaceAvailableQuery" sources="//@agents[ID='bug']/@rootActivity/@members[ID='nearbySpace']"  targets="//@agents[ID='bug']/@rootActivity/@members[ID=' nearbySpace_AvailableQueryAndWithin_BugVision_Query_']" selected="//@agents[ID='bug']/@rootActivity/ @members[ID='nearbySpace']">         <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:AQuery" label="NearbySpace: Within(Bug Vision) Query" ID=" nearbySpaceWithin_BugVision_Query" sources="//@agents[ID='bug']/@rootActivity/@members[ID=' nearbySpace']" targets="//@agents[ID='bug']/@rootActivity/@members[ID=' nearbySpace_AvailableQueryAndWithin_BugVision_Query_']" selected="//@agents[ID='bug']/@rootActivity/ @members[ID='nearbySpace']">         <inputs selected="//@agents[ID='bug']/@rootActivity/@members[ID='bugRule']" value="// @attributes[ID='bugVision']"/>         <function xsi:type="function:FGenericLogical" href="http://metaabm.org/ core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='spatial']/@functions[ID='within']"/>       </members>       <members xsi:type="act:AAll" label="NearbySpace (Available() Query & Within(Bug Vision) Query) " ID="nearbySpace_AvailableQueryAndWithin_BugVision_Query_" sources="//@agents[ID='bug']/ @rootActivity/@members[ID='nearbySpaceAvailableQuery'] //@agents[ID='bug']/@rootActivity/ @members[ID='nearbySpaceWithin_BugVision_Query']" targets="//@agents[ID='bug']/@rootActivity/ @members[ID='movetoHabitatinGrid2DCopy']" selected="//@agents[ID='bug']/@rootActivity/@members[ID=' nearbySpace']"/>       <members xsi:type="act:AMove" label="Move to Habitat in Grid2D Copy" ID=" movetoHabitatinGrid2DCopy" sources="//@agents[ID='bug']/@rootActivity/@members[ID=' nearbySpace_AvailableQueryAndWithin_BugVision_Query_']" selected="//@agents[ID='bug']/@rootActivity/ @members[ID='bugRule']" destination="//@agents[ID='bug']/@rootActivity/@members[ID='nearbySpace']"/>       <members xsi:type="act:ARule" label="Growth" ID="growth" targets="//@agents[ID='bug']/ @rootActivity/@members[ID='setSizeToBugCount'] //@agents[ID='bug']/@rootActivity/@members[ID=' method']" selected="//@agents[ID='bug']/@rootActivity/@members[ID='growth']" agent="//@agents[ID=' bug']" space="//@projections[ID='grid2D']" pluralLabel="Growths"/>       <members xsi:type="act:ASet" label="Set Size To Bug Count" ID="setSizeToBugCount" sources="// @agents[ID='bug']/@rootActivity/@members[ID='growth']" selected="//@agents[ID='bug']/@rootActivity/ @members[ID='growth']" attribute="//@agents[ID='bug']/@attributes[ID='size']" parameter="// @attributes[ID='bugCount']"/>       <members xsi:type="act:AMethod" label="Method" ID="method" sources="//@agents[ID='bug']/ @rootActivity/@members[ID='growth']" selected="//@agents[ID='bug']/@rootActivity/@members[ID=' growth']" pluralLabel="Methods" body="Size++; switch(Size) {     case: 1     {     } }"/>     </rootActivity>     <implementation className="Bug"/>     <styles xsi:type="metaabm:SStyle2D" label="New Bug Style 2D" ID="newBugStyle2D" pluralLabel=" New Bug Style 2Ds">       <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel=" Root Act Groups">         <members xsi:type="act:ARule" label="Bug Style Rule" ID="bugStyleRule" targets="// @agents[ID='bug']/@styles[ID='newBugStyle2D']/@rootActivity/@members[ID='bugStyleRuleShapeDiamond']"  selected="//@agents[ID='bug']/@styles[ID='newBugStyle2D']/@rootActivity/@members[ID='bugStyleRule'] " agent="//@agents[ID='bug']" space="//@projections[ID='grid2D']" pluralLabel="Bug Style Rules"/>         <members xsi:type="act:AEvaluate" label="Bug Style Rule: Shape Diamond()" ID=" bugStyleRuleShapeDiamond" sources="//@agents[ID='bug']/@styles[ID='newBugStyle2D']/@rootActivity/ @members[ID='bugStyleRule']" targets="//@agents[ID='bug']/@styles[ID='newBugStyle2D']/@rootActivity/ @members[ID='bugStyleRuleGraphicFill']" selected="//@agents[ID='bug']/@styles[ID='newBugStyle2D']/ @rootActivity/@members[ID='bugStyleRule']">           <function xsi:type="function:FGenericFunction" href="http://metaabm.org/ core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='shapeDiamond' ]"/>         </members>         <members xsi:type="act:AEvaluate" label="Bug Style Rule: Graphic Fill()" ID=" bugStyleRuleGraphicFill" sources="//@agents[ID='bug']/@styles[ID='newBugStyle2D']/@rootActivity/ @members[ID='bugStyleRuleShapeDiamond']" selected="//@agents[ID='bug']/@styles[ID='newBugStyle2D']/ @rootActivity/@members[ID='bugStyleRule']">           <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="NewBugStyle2D"/>     </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='habitatRuleColorBlack']"  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 Black()" ID=" habitatRuleColorBlack" 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='colorBlack']" />         </members>         <members xsi:type="act:AEvaluate" label="Habitat Rule: Shape Rectangle()" ID=" habitatRuleShapeRectangle" sources="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/ @rootActivity/@members[ID='habitatRuleColorBlack']" 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="Grid2D" ID="grid2D" pluralLabel="Grid2Ds"  dimensionality="2" borderRule="PERIODIC" neighborhood="MOORE">     <attributes xsi:type="metaabm:SAttributeArray" label="Dimensions" ID="dimensions" pluralLabel=" Dimensionss" description="The size of each dimension." sType="INTEGER" size="2"/>     <attributes label="Width" ID="width" pluralLabel="Widths" description="The horizontal extent of  the space." sType="INTEGER" defaultValue="100"/>     <attributes label="Height" ID="height" pluralLabel="Heights" description="The vertical extent  of the space." sType="INTEGER" defaultValue="100"/>   </projections> </metaabm:SContext>



Post edited by: ecasotti, at: 2008/01/09 12:02
  The administrator has disabled public write access.
#43
miles (Admin)
Admin
Posts: 59
graphgraph
Re:Modifying Style 2008/01/11 01:14 Karma: 1  
Sorry, I couldn't make that file work because of the line breaks. Can you attach it?

But I do think this may be an issue of as you say of oAW not creating the files properly because of something it couldn't understand. For the short term, I'm going to add better oAW error reporting in the next release (the API for this is a bit opaque so it will take a bit of hacking). For the longer term, as I think I mentioned on the ID post, we need to implement validation (oAW checks) so that Users are alerted when they enter invalid values. (Is this what you meant about Menus in your other post?)

For now you can also see any oAW related issues by examining the console output. I don't know where this ends up on Windows but on Mac you use the Console application.
  The administrator has disabled public write access.
#46
ecasotti (User)
Expert Boarder
Posts: 38
graphgraph
Re:Modifying Style 2008/01/11 19:54 Karma: 0  
Hi Miles

Looking at what I previously sent you there is no way it would have worked so
I removed a "method" segment I had been playing around with. I will include
a new version. Problem I am having is I deleted the generated files, and when
I try to run I get

Exception in thread "main" java.lang.RuntimeException: The class "org.example.ascape.StupidModel1 could not be found.
at org.ascape.model.ModelRoot.open(ModelRoot.java:846)
at org.ascape.model.ModelRoot.open(ModelRoot.java:856)
at org.ascape.model.ModelRoot.main(ModelRoot.java:1072)
at org.ascape.model.Scape.main(Scape.java:2986)
File Attachment:
File name: miles.jar
File size:12805 bytes


Post edited by: ecasotti, at: 2008/01/11 19:57
  The administrator has disabled public write access.
_GEN_GOTOTOP Post Reply
© Copyright 2007 Best of Joomla, Powered by FireBoardget the latest posts directly to your desktop