SLAM
Species Life-Cycle Analysis Modules
Paul McElhany (project manager, scientist) Miroslav Kos (design & development) Anne Mullan (scientist) Howard Coleman (development) 2005-2012, NWFSC/NOAA
Species Life Cycle Analysis Modules (SLAM) was developed as a tool to investigate factors limiting recovery of listed salmonids, but can be applied to any species for modeling population survival over stages. [more]
The most recent version of SLAM, along with examples and more information, can be found at
http://ecologybox.org/user/SLAM/SLAM Table of Contents Acknowledgements...... 1
Introduction to SLAM...... 3 Opening a sample life cycle model...... 4 Adding a scenario to the sample life cycle...... 6 Running a simulation...... 7 Browsing results...... 8 The SLAM interface...... 9 Interface features:...... 9
Theory...... 11 Biological perspective...... 12 Life cycle, season, generation...... 12 Simulation scenario...... 12 Biological and mathematical definitions for salmon...... 13
Life cycles...... 14 Creating and editing life cycles...... 14 Saving life cycles...... 14 Loading existing life cycles...... 15 Deleting life cycles...... 16 Read-only life cycles...... 17 Creating and editing life stages...... 18 Defining stages...... 19 Transitions...... 21 Self-influencing stages...... 24 Split influences...... 25 Self-influencing splits...... 27 Creating and editing environment variables...... 28 Creating environment variables...... 28 Creating environment variable influences...... 29 Creating and editing dynamic drivers...... 30 Creating dynamic drivers...... 30 Connecting dynamic drivers...... 30 Managing life cycle layout...... 32
SLAM Scenarios...... 33 Creating scenarios...... 33 Loading scenarios...... 33 Saving scenarios...... 34 Deleting scenarios...... 34 Scenario editor...... 35 Configuring elements in the scenario editor...... 37 Element types...... 37 Configuring life cycle stages in the scenario editor...... 38 Configuring environment variables in the scenario editor...... 43 Configuring dynamic drivers in the scenario editor...... 44 Configuring transitions in the scenario editor...... 46
i Table of Contents SLAM Scenarios Transition influences...... 47 Transition functions...... 48 Configuring transition functions...... 50 Types of transition functions...... 54 Previewing transition functions...... 56 SLAM parameters...... 59 Parameter types...... 59 Constant...... 60 Generated values...... 61 Using existing data points...... 63 SLAM scripts...... 65 How SLAM scripts work...... 66 The SLAM script editor...... 70 Batch substitution...... 86 Creating a batch substitution template...... 87 Selecting scenarios to copy...... 89
Simulations in SLAM...... 91 Running a simulation in SLAM...... 92 Simulation length...... 92 Running One-At-a-Time (OAT) simulations in SLAM...... 95 How OAT works...... 95 Configuring OAT...... 96 OAT Simulations in the Results Viewer...... 104 Batch Simulations...... 105 Simulation results viewer...... 107 Examining simulation data...... 109 Results viewer chart types...... 111 Simulation results chart legends...... 128 Exporting simulation data...... 130
SLAM data...... 132 The SLAM Database...... 133 How SLAM uses its database...... 133 Changing Databases...... 134 Automatic Database Backups...... 136 Old Databases in New SLAMS...... 138 Exporting and Importing Models...... 139 Exporting Life Cycle Models...... 140 Importing life cycle models...... 142 Exporting Scenarios...... 143 Importing scenarios...... 146 More about Exports and Imports...... 151 Export file formats...... 152
ii Table of Contents Notes...... 153 SLAM directories...... 154 SLAM directory contents...... 154 SLAM garbage collection...... 156
Examples...... 157 Creating the sample 1 life cycle model...... 158 Creating the River stage...... 159 Creating Spawners Region 1...... 160 Creating Spawners Region 2...... 161 Creating remaining stages...... 162 Creating the sample 1 sc_1 scenario...... 164 Stage initialization...... 165 Simple transition...... 166 Complex transitions...... 167
Terms...... 170
iii Acknowledgements
SLAM makes use of the software libraries listed below. Licenses for these libraries are included in the “licenses” subdirectory of your SLAM installation.
Apache cglib, commons-collections, commons-logging : SLAM uses the Code Generation library (cglib) (Copyright 2001-2004 The Apache Software Foundation), Apache Commons Collections (Copyright 2001-2008 The Apache Software Foundation) , Apache Commons Logging (Copyright 2003-2007 The Apache Software Foundation ), For more information about the Code Generation Library, see http://cglib.sourceforge.net/ For more information about the Commons Collections, see http://commons.apache.org/collections/ For more information about Commons Logging, see http://commons.apache.org/logging/
Colt Open Source Libraries for High Performance Scientific and Technical Computing in Java : For evaluation of various mathematical functions, SLAM uses Java libraries created and maintained by the CERN Colt project – Copyright (c) 1999 CERN - European Organization for Nuclear Research. For more information about the Colt project, see http://acs.lbl.gov/software/colt/ dom4j library : SLAM uses the dom4j library, Copyright 2001-2010 (C) MetaStuff, Ltd. All Rights Reserved. For more information about dom4j, see http://dom4j.sourceforge.net
Groovy : For internal, user-defined scripting, SLAM uses Groovy, sustained and led by SpringSource (http://www.springsource.com/) and the Groovy Community. Groovy is licensed under the Apache 2 license. For more about Groovy, see http://groovy.codehaus.org/.
Hibernate : For persistence and retrieval of Java objects, SLAM uses Hibernate, produced by the JBoss Community – Copyright (C) 2004-2012 Red Hat Inc. and the various authors. For more information about Hibernate, see http://hibernate.org/hibernate
HyperSQL HSQLDB : For data storage and retrieval, SLAM uses HSQLDB, produced by the hsql Development Group – Copyright (c) 2001-2010, The HSQL Development Group. For more information about HSQLDB, see http://hsqldb.org/
Acknowledgements 1 JFreeChart : For data display, SLAM uses JFreeChart, produced by JFree.org – (C)opyright 2000-2011, by Object Refinery Limited and Contributors. For more information about JFreeChart, see http://www.jfree.org/jfreechart/
JGoodies FormLayout : For user interface layout, SLAM uses the FormLayout library produced by JGoodies – Copyright (c) 2002-2012 JGoodies Karsten Lentzsch For more information about the FormLayout library, see http://www.jgoodies.com/freeware/libraries/forms/
Parallel Java Library : To support parallel processing, SLAM uses the Parallel Java Library, developed by Prof. Alan Kaminsky in the Department of Computer Science, Rochester Institute of Technology. – Copyright © 2005-2012 by Alan Kaminsky. For more information about the Java Parallel Library, see http://www.cs.rit.edu/~ark/pj.shtml
Stochastic Simulation in Java (SSJ) : For generating values of variables drawn from random distributions and other tasks, SLAM makes use of SSJ, a Java library for stochastic simulation developed under the direction of Pierre L'Ecuyer in the Département d'Informatique et de Recherche Opérationelle (DIRO), at the Université de Montréal – Copyright (C) 2008 Pierre L'Ecuyer and Université de Montréal For more information about SSJ, see http://www.iro.umontreal.ca/~simardr/ssj/indexe.html
XStream : For XML serialization support, SLAM uses the XStream library – Copyright (c) 2003-2006, Joe Walnes; Copyright (c) 2006-2009, 2011 XStream Committers For more information about XStream, see http://xstream.codehaus.org/index.html
Acknowledgements 2 Introduction to SLAM
In SLAM, you can create, modify, and run very complex life cycle models, but the basic steps involved are simple. In this quick introduction, you go through the basic steps involved in running a SLAM model and examining the output:
1. Opening a life cycle model 2. Adding a scenario 3. Running a simulation 4. Examining the results
You can also take a look at SLAM's interface.
Introduction to SLAM 3 Opening a sample life cycle model
There are three ways to open the sample life cycle model in SLAM:
Load the sample from the database : If the sample database is included in your default SLAM/db directory, switch to it and load the sample_1 life cycle model.
Import the sample from an export file : If you have a copy of the sample_1_l.xml file, import it and save it in your current database as sample_1 . (If you're using the sample database, there's probably already a sample_1 database in it, so you have to change databases or save the life cycle under a different name.)
Create the life cycle : You can create your own sample_1 life cycle model.
When you have the life cycle open, SLAM's graphical display will look like this;
Opening a sample life cycle model 4 Sample 1 life cycle
Try running the model as-is , without editing a scenario:
1. Create a new scenario by typing Ctrl+Alt+N. 2. Save the scenario without editing it, by typing Ctrl+Alt+Shift+S. When prompted, pick a name for the scenario — though you'll be deleting it shortly. 3. Run a simulation based on the sample 1 life cycle and the default scenario by typing Ctrl+R. 4. Examine the outcome of the simulation in the results viewer by selecting the simulation results tab. You'll see that the stage abundances simply oscillate, reflecting the simple, closed-loop structure of the life cycle model and the fact that no real dynamics have been built into the scenario.
Make things a little more interesting by adding a scenario for the life cycle model. (You can delete the default scenario created above, if you like.)
Opening a sample life cycle model 5 Adding a scenario to the sample life cycle
There are three ways to add a scenario to the sample 1 life cycle model:
Load the scenario from the database : If you loaded the sample 1 life cycle from the sample database, a scenario named sc_1 should be associated with the life cycle. Load the scenario from the database.
Import the scenario sc_1 from an export file : If you have a copy of the sample_1_l.xml file, import the sc_1 scenario and save it in your current database as sc_1 . (If you're using the sample database, there's probably already a sc_1 scenario associated with the sample 1 life cycle; you can either change databases or save the scenario under a different name.)
Create the scenario : You can create the sc_1 scenario for the sample 1 life cycle model.
With a scenario in place you can test out the model by running a simulation.
Adding a scenario to the sample life cycle 6 Running a simulation
With a life cycle model and a scenario loaded (for example, the sample 1 life cycle and the sc_1 scenario), run a simulation by typing Ctrl+R. When the simulation configuration dialog appears, enter 100 for years and 100 for trajectories , (though other sets of values will work as well).
While the simulation runs, the simulation status bar at the bottom of the SLAM main window will display the message finished 0 of 1 simulation(s) . On reasonably modern computers, simulating sample 1/sc_1 for 100 years and 100 trajectories should take less than a minute. When the simulation finishes, the … 0 of 1 … message will be replaced by No active simulation and SLAM will automatically open the results in the results viewer, where you can examine them.
Running a simulation 7 Browsing results
After the simulation finishes running, the results viewer is automatically opened in the results tab with the simulation-generated data loaded into it. You'll see a list of simulations on the left side and a list of life stages on the right side. Select your simulation results on the right and one or more life stages on the left to see results in the graph window.
As you select different life stages in the right-hand panel, you'll see the graphical display depict them. By choosing different chart types in the lower right corner of the display, you'll see different ways of looking at the output abundance series.
There's much more to know about the results viewer.
After that quick run-through, it may be helpful to read about the SLAM interface.
Browsing results 8 The SLAM interface
When you first open SLAM, the interface will look like this. Various parts of the interface are labeled and are explained below.
The SLAM interface
Interface features:
• Caption: The application caption contains the identifier of the SLAM version and the location on disk of the current SLAM database. In the example the version is 1.1 Beta 28, 3/14/2012 (the date refers to when SLAM was built — it isn't the day on which you're running SLAM) and the database is stored in these two files:
C:/projects/slam_current/examples/db/script_ed.script C:/projects/slam_current/examples/db/script_ed.properties • Menu bar: There are four top-level menu items:
♦ Life cycle contains options for creating, loading, saving, and deleting life cycles, as well as for specifying the current SLAM database. ♦ Scenario contains options for creating, loading, saving, and deleting scenarios, as well as options for configuring and running simulations. ♦ Import/Export contains options for importing and exporting life cycles and scenarios. ♦ Help contains options for accessing the help system. • Life cycle tab: This tab displays the graphical editor in which you edit the current life cycle.
The SLAM interface 9 • Scenario tab: This tab displays the scenario editor in which you can configure the current scenario. • Simulation results tab: This tab contains SLAM's results viewer for examining the outcome of simulations. • Tool bar: Tool bar buttons allow you to perform actions on the object loaded in the selected tab — if the life cycle tab is selected, then clicking the tool bar buttons will perform operations on the life cycle; if the scenario is open, then the tool bar functions apply to the scenario; if the results tab is displayed, the tool bar functions operate on the simulation results viewer. If you hover the mouse over a tool bar button, a tool tip appears to give you a hint about the current function of the button. • Help button: This provides access to SLAM's help documentation. You can also see the help pages by way of the Help menu item. • Processor count: This field displays the number of processors available on your computer. SLAM attempts to distribute simulation computations across multiple threads when there are processors to support them. • Simulation status bar: Messages displayed in this field report the status of simulations in progress. • Simulation stop button: This button allows you to stop the simulation that is currently running. • Memory use: This field shows the memory being used by SLAM. Memory is displayed in the format nn.n/mm.mMB, where the ns represent the current amount of occupied memory and the ms show the maximum memory SLAM can use. • Garbage collection: Clicking this button will cause the Java garbage collector to schedule a cleanup of allocated memory that is no longer required.
Interface features: 10 Theory
Species Life Cycle Analysis Modules (SLAM) was developed as a tool to investigate factors limiting recovery of Endangered Species Act listed salmonids, but can be applied to any species for modeling populations based on survival rates. SLAM is a population model, built and defined by user input to estimate a stock or population s survivability. The model tracks numbers of individuals, through stages based on rates of survival from one stage to another, and builds in uncertainty and variability. A method to test the sensitivity of the model is also built into the user interface.
Theory 11 Biological perspective
Salmonids (species which migrate from freshwater to saltwater and back in their life cycles) can have complex life histories. This is especially true for Chinook salmon (Onchorhynchus tshawytscha) and steelhead (O. mykiss). Certain runs (populations in a given drainage) of salmon spawn and out-migrate at several times per year (usually denoted by either the season when fry start to emerge from the spawning beds, or when the fish return to spawn, i.e. spring Chinook ). Because of their complex life history strategies, salmonid survival is particularly difficult to parameterize (capture in a mathematical representation) in a model.
Life cycle, season, generation
1. Life stages