Repast Py User Interface |
The layout of the Repast Py user interface is shown below ![]() Repast Py simulations are organized into projects. Each project is composed of components chosen from the component palette in the toolbar and displayed in the project pane. Components in the project pane are organized heirarchicaly such that the environment component is the root of the heirarchy and components further down the heirarchy are considered children to the parent component above them. These components are composed of properties that are customized by the model builder to create the simulation. The properties for the current selected component are displayed in the property pane. Repast Py then compiles the components in the project pane into java code compatible with the Repast simulation framework. Each component is responsible for producing a piece of the the final compiled simulation. Building a simulation is thus done by adding components from the component palette to the project panel, customizing these components by editing their properties, compiling the project and then running the resulting Repast simulation. A typical Repast Py simulation consists of a model producing component such as GIS Model and an agent producing component such as Vector Agent. The model producer is responsible for for setting up the various pieces of the simulation including the agents and interacting with the user via the Repast UI. The agent producer defines the properties and behavior of an agent, acting as a kind of template for the production of agents. The simulation when compiled and run then creates some number of these agents defined by the agent producer. The user interface is composed of the following pieces.
You can create a new model, open a previously created a model and save the current model using the appropriate menu items in File menu or via the new model, open model and model project buttons on the tool bar. Projects are represented as XML (a markup language like html but more flexible) files. The first time you save your model, a file dialog will appear. With this you can name your file and choose the directory in which to save it. In order to turn your model into a executable RePast simulation, you need to compile it. You can compile it from the model menu, or using the compile button on the tool bar. If there are any errors during compilation, Repast Py will point these out, and provide a description of the error. Your compiled project files will be saved in your output directory. The output directory is specified in the "Compiled Model Output Direct" property of the Environment component. Once you have compiled your project, you can run the resulting simulation via the model menu or the run button on the tool bar. Note the the run button will attempt to compile the model before running it. As mentioned above a model is composed of Repast Py components. A component is added to a model by clicking on the desired component in the component palette (which changes the shape of the mouse cursor) and then clicking on a parent component in the project pane. For example, if you want to add a Vector Agent to a GIS Model component, you click on the Vector Agent button in the component palette and then on the GIS Model in the project pane. The Vector Agent component should then appear as a child of the GIS Model. The change in shape of the mouse cursor means that the cursor is now "carrying" the component. If you wish to "drop" the component without adding it to the project pane, you can click on the default selector, the button labeled with the white arrow icon at the start of the component palette. Once a component has been added to the project pane, you can see that component's properties in the property pane by selecting (clicking on) that component.
|