| <html> |
| <head> |
| <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <title>Example Java Models</title> |
| <link href="book.css" rel="stylesheet" type="text/css"> |
| <meta content="DocBook XSL Stylesheets V1.75.1" name="generator"> |
| <link rel="home" href="index.html" title="Agent Modeling Guide"> |
| <link rel="up" href="Programer_Guide.html" title="Programer Guide"> |
| <link rel="prev" href="Installation.html" title="Installation"> |
| <link rel="next" href="Developing_Models.html" title="Developing Models"> |
| </head> |
| <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| <h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Example Java Models</h1> |
| <div class="section" title="Example Java Models"> |
| <div class="titlepage"> |
| <div> |
| <div> |
| <h2 class="title" style="clear: both"> |
| <a name="Example_Java_Models"></a>Example Java Models</h2> |
| </div> |
| </div> |
| </div> |
| <div class="section" title="Exploring Example ABM Models"> |
| <div class="titlepage"> |
| <div> |
| <div> |
| <h3 class="title"> |
| <a name="Exploring_Example_ABM_Models"></a>Exploring Example ABM Models</h3> |
| </div> |
| </div> |
| </div> |
| <p>The first thing most people will want to do in AMP is to play with the example models. You can explore AMF models as well as some really interesting classic ABM models.</p> |
| <div class="section" title="Installing Models"> |
| <div class="titlepage"> |
| <div> |
| <div> |
| <h4 class="title"> |
| <a name="Installing_Models"></a>Installing Models</h4> |
| </div> |
| </div> |
| </div> |
| <p>See the Installation Guide to find out how to get the example models.</p> |
| <div class="section" title="AMF Models"> |
| <div class="titlepage"> |
| <div> |
| <div> |
| <h5 class="title"> |
| <a name="AMF_Models"></a>AMF Models</h5> |
| </div> |
| </div> |
| </div> |
| <p>All AMF models produce pure Java code so they can be used like any other Escape Java model.</p> |
| <div class="literallayout"> |
| <p>org.eclipse.amp/org.eclipse.amp.amf/examples/org.eclipse.amp.amf.examples.escape<br> |
| |
| </p> |
| </div> |
| <p>To understand the capabilities of AMF in producing other kinds of Java models, you might also want to try out running the same models automatically generated for Ascape or Repast. These are located at dev.eclipse.org in cvsroot/modeling:</p> |
| <div class="literallayout"> |
| <p>org.eclipse.amp/org.eclipse.amp.amf/examples/org.eclipse.amp.amf.examples.ascape<br> |
| org.eclipse.amp/org.eclipse.amp.amf/examples/org.eclipse.amp.amf.examples.repast<br> |
| |
| </p> |
| </div> |
| </div> |
| <div class="section" title="Classic Escape / Ascape Java Models"> |
| <div class="titlepage"> |
| <div> |
| <div> |
| <h5 class="title"> |
| <a name="Classic_Escape_.2F_Ascape_Java_Models"></a>Classic Escape / Ascape Java Models</h5> |
| </div> |
| </div> |
| </div> |
| <p>Many models have been created using Ascape over the years, including all of the classic models created at Brookings and some other cool models such as Craig Reynold's Boids and a pretty cool little traffic model, and they've all been converted to run in Escape. They're in Java but you can execute and explore them in exactly the same way as the Epidemic model above. All of the Ascape example models have been converted (a straightforward process) from their intial Ascape incarnations. For licensing reasons (they're BSD, not EPL) we can't host them directly on the Eclipse site. You can get the projects in two ways:</p> |
| <p>Once you've downloaded the projects, open up the src folder and navigate to the Java files for the actual models. For example, to run Conway's Life, you'll want src/edu.brook.life.ConwayLife. Right-click on the Java file and select "Execute". There are many models to explore! (It's not always obvious which Java files are for models, so you may have to poke around a bit. We need to put together a catalog here. Another nice opportunity for user contributions.)</p> |
| <p>These are SVN projects in the sourceforge SVN. For help, see |
| <a class="ulink" href="/wiki/http://www.eclipse.org/subversive/documentation/teamSupport/find_check_wiz.php_this_page" target="_new">http://www.eclipse.org/subversive/documentation/teamSupport/find_check_wiz.php this page</a>. |
| </p> |
| <div class="literallayout"> |
| <p>http://ascape.svn.sourceforge.net/svnroot/ascape/org.ascape.escape.models.brook<br> |
| http://ascape.svn.sourceforge.net/svnroot/ascape/org.ascape.escape.models.examples<br> |
| |
| </p> |
| </div> |
| </div> |
| </div> |
| <div class="section" title="Generating Models"> |
| <div class="titlepage"> |
| <div> |
| <div> |
| <h4 class="title"> |
| <a name="Generating_Models"></a>Generating Models</h4> |
| </div> |
| </div> |
| </div> |
| <p>And of course, you can always use the AMF tools to generate models and then customize them from there. See the following section on integrating AMF with Java for more on that. There are a number of models developed with AMF that can automatically generate example models to run in Escape. There are two ways to run the example models:</p> |
| <div class="section" title="Creating a New Escape Project"> |
| <div class="titlepage"> |
| <div> |
| <div> |
| <h5 class="title"> |
| <a name="Creating_a_New_Escape_Project"></a>Creating a New Escape Project</h5> |
| </div> |
| </div> |
| </div> |
| <p>The best option is to simply create a new Escape project and drag the models into it!</p> |
| <div class="orderedlist"> |
| <ol class="orderedlist" type="1"> |
| <li class="listitem"> |
| <p>If you're not already there, open the Agent Modeling Perspective. Select Window > Open Perspective > Other.. and then Agent Modeling. (Or you can choose Window > Reset Perspective and the Agent Modeling perspective should appear in the Open Perspective list itself.)</p> |
| </li> |
| <li class="listitem"> |
| <p>Create the project where we'll place our model. Select File > New > Escape AMF Project. Give it a name like "escape.tutorial", then click Finish.</p> |
| </li> |
| <li class="listitem"> |
| <p>Finally grab the Epidemic.metaabm model at |
| <a class="ulink" href="http://download.eclipse.org/amp/models/Epidemic.metaabm" target="_new">http://download.eclipse.org/amp/models/Epidemic.metaabm</a> and drag it into the project. (Depending on your browser the file may load as text directly into your browser, in which case just right-click on the link and save it to a file.) |
| </p> |
| </li> |
| </ol> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| </body> |
| </html> |